gologin 2.1.12 → 2.1.13

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 (49) hide show
  1. package/package.json +1 -1
  2. package/src/gologin.js +2 -1
  3. package/.sentry-native/15e25388-76f1-4a90-cea4-9a33e95e5be5.run/af276dd3-14b9-4b32-df19-69cb16a9a85e.envelope +0 -5
  4. package/.sentry-native/15e25388-76f1-4a90-cea4-9a33e95e5be5.run.lock +0 -0
  5. package/.sentry-native/last_crash +0 -1
  6. package/gologin/.eslintrc.json +0 -290
  7. package/gologin/README.md +0 -163
  8. package/gologin/example.js +0 -36
  9. package/gologin/examples/example-amazon-cloud-browser.js +0 -37
  10. package/gologin/examples/example-amazon-headless.js +0 -50
  11. package/gologin/examples/example-amazon.js +0 -47
  12. package/gologin/examples/example-create-custom-profile.js +0 -39
  13. package/gologin/examples/example-create-profile.js +0 -40
  14. package/gologin/examples/example-custom-args.js +0 -34
  15. package/gologin/examples/example-fast-profile-settings.js +0 -69
  16. package/gologin/examples/example-gmail.js +0 -67
  17. package/gologin/examples/example-iphey.js +0 -17
  18. package/gologin/examples/example-local-profile.js +0 -26
  19. package/gologin/examples/example-login-walmart.js +0 -35
  20. package/gologin/examples/example-stopremote.js +0 -20
  21. package/gologin/examples/example-timezone.js +0 -44
  22. package/gologin/fonts.js +0 -4293
  23. package/gologin/fonts_config +0 -104
  24. package/gologin/gologin-browser-ext.zip +0 -0
  25. package/gologin/gologin_zeroprofile.b64 +0 -1
  26. package/gologin/index.d.ts +0 -61
  27. package/gologin/package.json +0 -49
  28. package/gologin/profile_export_example.csv +0 -2
  29. package/gologin/run.sh +0 -1
  30. package/gologin/src/bookmarks/utils.js +0 -15
  31. package/gologin/src/browser/browser-api.js +0 -95
  32. package/gologin/src/browser/browser-checker.js +0 -392
  33. package/gologin/src/browser/browser-user-data-manager.js +0 -335
  34. package/gologin/src/cookies/cookies-manager.js +0 -189
  35. package/gologin/src/extensions/extensions-extractor.js +0 -56
  36. package/gologin/src/extensions/extensions-manager.js +0 -384
  37. package/gologin/src/extensions/user-extensions-manager.js +0 -295
  38. package/gologin/src/gologin-api.js +0 -110
  39. package/gologin/src/gologin.js +0 -1472
  40. package/gologin/src/profile/profile-archiver.js +0 -86
  41. package/gologin/src/profile/profile-directories-to-remove.js +0 -75
  42. package/gologin/src/utils/browser.js +0 -62
  43. package/gologin/src/utils/common.js +0 -76
  44. package/gologin/src/utils/constants.js +0 -1
  45. package/gologin/src/utils/utils.js +0 -49
  46. package/gologin/zero_profile.zip +0 -0
  47. package/gologin-canvas.zip +0 -0
  48. package/gologin.zip +0 -0
  49. package/test.html +0 -1
@@ -1,110 +0,0 @@
1
- import puppeteer from 'puppeteer-core';
2
-
3
- import GoLogin from './gologin.js';
4
-
5
- export function getDefaultParams() {
6
- return {
7
- token: process.env.GOLOGIN_API_TOKEN,
8
- profile_id: process.env.GOLOGIN_PROFILE_ID,
9
- executablePath: process.env.GOLOGIN_EXECUTABLE_PATH,
10
- autoUpdateBrowser: true,
11
- };
12
- }
13
-
14
- const createLegacyGologin = ({ profileId, ...params }) => {
15
- const defaults = getDefaultParams();
16
- const mergedParams = {
17
- ...defaults,
18
- ...params,
19
- };
20
-
21
- mergedParams.profile_id = profileId ?? mergedParams.profile_id;
22
-
23
- console.log({ mergedParams });
24
-
25
- return new GoLogin(mergedParams);
26
- };
27
-
28
- const createdApis = [];
29
-
30
- export const delay = (ms = 250) => new Promise((res) => setTimeout(res, ms));
31
-
32
- export function GologinApi({ token }) {
33
- if (!token) {
34
- throw new Error('GoLogin API token is missing');
35
- }
36
-
37
- const browsers = [];
38
- const legacyGls = [];
39
-
40
- const launchLocal = async (params) => {
41
- const legacyGologin = createLegacyGologin({
42
- ...params,
43
- token,
44
- });
45
-
46
- if (!params.profileId) {
47
- const { id } = await legacyGologin.quickCreateProfile();
48
- await legacyGologin.setProfileId(id);
49
- }
50
-
51
- const started = await legacyGologin.start();
52
- const browser = await puppeteer.connect({
53
- browserWSEndpoint: started.wsUrl,
54
- ignoreHTTPSErrors: true,
55
- });
56
-
57
- browsers.push(browser);
58
- legacyGls.push(legacyGologin);
59
-
60
- return { browser };
61
- };
62
-
63
- const launchCloudProfile = async (params) => {
64
- const profileParam = params.profileId
65
- ? `&profile=${params.profileId}`
66
- : '';
67
-
68
- const geolocationParam = params.geolocation
69
- ? `&geolocation=${params.geolocation}`
70
- : '';
71
-
72
- const browserWSEndpoint = `https://cloud.gologin.com/connect?token=${token}${profileParam}${geolocationParam}`;
73
- const browser = await puppeteer.connect({
74
- browserWSEndpoint,
75
- ignoreHTTPSErrors: true,
76
- });
77
-
78
- browsers.push(browser);
79
-
80
- return { browser };
81
- };
82
-
83
- const api = {
84
- async launch(params = {}) {
85
- if (params.cloud) {
86
- return launchCloudProfile(params);
87
- }
88
-
89
- return launchLocal(params);
90
- },
91
-
92
- async exit(status = 0) {
93
- Promise.allSettled(browsers.map((browser) => browser.close()));
94
- Promise.allSettled(
95
- legacyGls.map((gl) => gl.stopLocal({ posting: false })),
96
- );
97
- process.exit(status);
98
- },
99
-
100
- delay,
101
- };
102
-
103
- createdApis.push(api);
104
-
105
- return api;
106
- }
107
-
108
- export function exitAll() {
109
- Promise.allSettled(createdApis.map((api) => api.exit()));
110
- }