@mherod/get-cookie 2.0.0-rc.29 → 2.0.0-rc.30
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.
- package/dist/cli.js +1 -974
- package/dist/index.js +2 -1024
- package/dist/module.js +289 -296
- package/dist/module.js.map +1 -1
- package/dist/prompt.2b8c61c0.js +40 -0
- package/dist/prompt.536a2c51.js +40 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/jest.config.ts +14 -0
- package/package-lock.json +67 -150
- package/package.json +22 -16
- package/src/ExportedCookie.ts +12 -0
- package/src/FetchResponse.ts +1 -2
- package/src/FileCookieStore.ts +1 -0
- package/src/StringToRegex.ts +10 -0
- package/src/argv.ts +10 -0
- package/src/browsers/ChromeApplicationSupport.ts +10 -0
- package/src/browsers/ChromeCookieQueryStrategy.ts +29 -171
- package/src/browsers/DoSqliteQueryWithTransform.ts +85 -0
- package/src/browsers/FirefoxCookieQueryStrategy.ts +4 -47
- package/src/browsers/decrypt.ts +118 -0
- package/src/browsers/getChromePassword.ts +9 -0
- package/src/execSimple.ts +13 -0
- package/src/findAllFiles.ts +24 -51
- package/src/getChromeCookie.ts +1 -1
- package/src/global.ts +1 -1
- package/src/index.ts +1 -2
- package/src/listChromeProfiles.ts +45 -0
- package/src/util/flatMapAsync.test.ts +55 -0
- package/src/util/flatMapAsync.ts +37 -0
- package/src/IsExportedCookie.ts +0 -9
- package/src/doSqliteQuery1Params.ts +0 -8
- package/src/utils.ts +0 -25
package/dist/module.js
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun run
|
|
2
2
|
import {uniqBy as $6B8p2$uniqBy, merge as $6B8p2$merge, groupBy as $6B8p2$groupBy, orderBy as $6B8p2$orderBy} from "lodash";
|
|
3
3
|
import $6B8p2$minimist from "minimist";
|
|
4
4
|
import $6B8p2$lrucache from "lru-cache";
|
|
5
5
|
import {red as $6B8p2$red, redBright as $6B8p2$redBright, blue as $6B8p2$blue, yellow as $6B8p2$yellow} from "colorette";
|
|
6
|
-
import $6B8p2$fs, {existsSync as $6B8p2$existsSync
|
|
7
|
-
import {pbkdf2 as $6B8p2$pbkdf2, createDecipheriv as $6B8p2$createDecipheriv} from "crypto";
|
|
6
|
+
import $6B8p2$fs, {existsSync as $6B8p2$existsSync} from "fs";
|
|
8
7
|
import {join as $6B8p2$join} from "path";
|
|
9
|
-
import {Database as $6B8p2$Database} from "sqlite3";
|
|
10
|
-
import {exec as $6B8p2$exec} from "child_process";
|
|
11
|
-
import {readdir as $6B8p2$readdir} from "fs/promises";
|
|
12
8
|
import $6B8p2$consola from "consola";
|
|
9
|
+
import {sync as $6B8p2$sync} from "fast-glob";
|
|
10
|
+
import {execSync as $6B8p2$execSync} from "child_process";
|
|
11
|
+
import {pbkdf2 as $6B8p2$pbkdf2, createDecipheriv as $6B8p2$createDecipheriv} from "crypto";
|
|
12
|
+
import {Database as $6B8p2$Database} from "sqlite3";
|
|
13
13
|
import $6B8p2$jsonwebtoken from "jsonwebtoken";
|
|
14
14
|
import {fetch as $6B8p2$fetch} from "cross-fetch";
|
|
15
15
|
import $6B8p2$destr from "destr";
|
|
16
16
|
import $6B8p2$useragents from "user-agents";
|
|
17
17
|
|
|
18
|
-
function $parcel$export(e, n, v, s) {
|
|
19
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
20
|
-
}
|
|
21
|
-
var $3a892f71b64103f5$exports = {};
|
|
22
|
-
|
|
23
|
-
$parcel$export($3a892f71b64103f5$exports, "getCookie", () => $3a892f71b64103f5$export$4be65e66cfa2648a, (v) => $3a892f71b64103f5$export$4be65e66cfa2648a = v);
|
|
24
|
-
var $f382029733f65752$exports = {};
|
|
25
|
-
|
|
26
|
-
$parcel$export($f382029733f65752$exports, "queryCookies", () => $f382029733f65752$export$e6d428437cf2cacb, (v) => $f382029733f65752$export$e6d428437cf2cacb = v);
|
|
27
18
|
|
|
28
19
|
|
|
29
20
|
|
|
@@ -36,19 +27,69 @@ const $01f4cf98d50740c6$var$defaultOptions = {
|
|
|
36
27
|
const $01f4cf98d50740c6$export$c348dfaf65040d9b = (0, $6B8p2$merge)($01f4cf98d50740c6$var$defaultOptions, $01f4cf98d50740c6$var$minimistArgs);
|
|
37
28
|
|
|
38
29
|
|
|
39
|
-
var $49168e685ea38e19$exports = {};
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
var $ebc8f9a71f429261$var$_a;
|
|
32
|
+
const $ebc8f9a71f429261$export$a7b6bc01c63cdfc3 = {};
|
|
33
|
+
(0, $6B8p2$merge)($ebc8f9a71f429261$export$a7b6bc01c63cdfc3, ($ebc8f9a71f429261$var$_a = process === null || process === void 0 ? void 0 : process.env) !== null && $ebc8f9a71f429261$var$_a !== void 0 ? $ebc8f9a71f429261$var$_a : {});
|
|
34
|
+
const $ebc8f9a71f429261$export$a7c5707626fc90f = $ebc8f9a71f429261$export$a7b6bc01c63cdfc3["HOME"];
|
|
35
|
+
if (!$ebc8f9a71f429261$export$a7c5707626fc90f) throw new Error("HOME environment variable is not set");
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
function $a6c1a5673fde1c2b$export$2c9faf86071156ae(//
|
|
44
|
+
{ path: path, name: name, maxDepth: maxDepth = 2 }) {
|
|
45
|
+
if (!(0, $6B8p2$existsSync)(path)) throw new Error(`Path ${path} does not exist`);
|
|
46
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).start(`Searching for ${name} files in ${path}`);
|
|
47
|
+
const files = (0, $6B8p2$sync)(`${path}/**/${name}`, {
|
|
48
|
+
onlyFiles: true,
|
|
49
|
+
deep: maxDepth
|
|
50
|
+
});
|
|
51
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) {
|
|
52
|
+
if (files.length > 0) {
|
|
53
|
+
(0, $6B8p2$consola).success(`Found ${files.length} ${name} files`);
|
|
54
|
+
(0, $6B8p2$consola).info(files);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return files;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
function $63d6ce571e62efc6$export$bc926c43858bd3cb(obj) {
|
|
64
|
+
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
function $cf39947f238e32e1$export$963c8d651337e4a4(obj) {
|
|
69
|
+
return typeof obj.domain === "string" && typeof obj.name === "string" && typeof obj.value === "string" && (obj.expiry === undefined || obj.expiry instanceof Date || obj.expiry === "Infinity") && (obj.meta === undefined || typeof obj.meta === "object");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// This function converts a string into a regular expression
|
|
74
|
+
function $78efb18fcf7b6c2c$export$4eadcf0bf35a2ddb(s) {
|
|
75
|
+
// Replace all occurrences of '.' with a literal '.'
|
|
76
|
+
const s1 = s.replaceAll(/\./gi, ".");
|
|
77
|
+
// Replace all occurrences of '%' with '.*' to match any number of any characters
|
|
78
|
+
const s2 = s1.replace(/%/g, ".*");
|
|
79
|
+
// Replace all occurrences of '*' with '.*' to match any number of any characters
|
|
80
|
+
const s3 = s2.replace(/\*/g, ".*");
|
|
81
|
+
// Return the new string as a RegExp object
|
|
82
|
+
return new RegExp(s3);
|
|
83
|
+
} /*
|
|
84
|
+
%.example.com -> .*\.example\.com
|
|
85
|
+
example.com -> example\.com
|
|
86
|
+
*/
|
|
87
|
+
|
|
43
88
|
|
|
44
|
-
$parcel$export($a6f61760d01c3afd$exports, "default", () => $a6f61760d01c3afd$export$2e2bcd8739ae039, (v) => $a6f61760d01c3afd$export$2e2bcd8739ae039 = v);
|
|
45
|
-
$parcel$export($a6f61760d01c3afd$exports, "doChromeSqliteQuery1", () => $a6f61760d01c3afd$export$bd52b72df8d0d261, (v) => $a6f61760d01c3afd$export$bd52b72df8d0d261 = v);
|
|
46
|
-
var $7a8c6b6f0e26a266$exports = {};
|
|
47
89
|
|
|
48
|
-
$parcel$export($7a8c6b6f0e26a266$exports, "execSimple", () => $7a8c6b6f0e26a266$export$8d71c74f97c0202e, (v) => $7a8c6b6f0e26a266$export$8d71c74f97c0202e = v);
|
|
49
|
-
// noinspection JSUnusedGlobalSymbols
|
|
50
90
|
|
|
51
|
-
|
|
91
|
+
|
|
92
|
+
var $9854e148a157cf4f$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
52
93
|
function adopt(value) {
|
|
53
94
|
return value instanceof P ? value : new P(function(resolve) {
|
|
54
95
|
resolve(value);
|
|
@@ -75,44 +116,65 @@ var $7a8c6b6f0e26a266$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
75
116
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
76
117
|
});
|
|
77
118
|
};
|
|
78
|
-
function $
|
|
79
|
-
return $
|
|
80
|
-
|
|
81
|
-
(0, $6B8p2$
|
|
119
|
+
function $9854e148a157cf4f$export$8d71c74f97c0202e(command) {
|
|
120
|
+
return $9854e148a157cf4f$var$__awaiter(this, void 0, void 0, function*() {
|
|
121
|
+
try {
|
|
122
|
+
const stdout = (0, $6B8p2$execSync)(command, {
|
|
82
123
|
encoding: "binary",
|
|
83
124
|
maxBuffer: 5120
|
|
84
|
-
}, (error, stdout, stderr)=>{
|
|
85
|
-
if (error) {
|
|
86
|
-
reject(error);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (stderr) {
|
|
90
|
-
reject(error);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (stdout) resolve(stdout.trim());
|
|
94
125
|
});
|
|
95
|
-
|
|
126
|
+
return stdout.trim();
|
|
127
|
+
} catch (error) {
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
96
130
|
});
|
|
97
131
|
}
|
|
98
132
|
|
|
99
133
|
|
|
134
|
+
var $b40272b017401e2b$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
135
|
+
function adopt(value) {
|
|
136
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
137
|
+
resolve(value);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
141
|
+
function fulfilled(value) {
|
|
142
|
+
try {
|
|
143
|
+
step(generator.next(value));
|
|
144
|
+
} catch (e) {
|
|
145
|
+
reject(e);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function rejected(value) {
|
|
149
|
+
try {
|
|
150
|
+
step(generator["throw"](value));
|
|
151
|
+
} catch (e) {
|
|
152
|
+
reject(e);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function step(result) {
|
|
156
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
157
|
+
}
|
|
158
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
const $b40272b017401e2b$var$chromePassword = (0, $9854e148a157cf4f$export$8d71c74f97c0202e)('security find-generic-password -w -s "Chrome Safe Storage"');
|
|
162
|
+
function $b40272b017401e2b$export$91552cff7edf316() {
|
|
163
|
+
return $b40272b017401e2b$var$__awaiter(this, void 0, void 0, function*() {
|
|
164
|
+
return yield $b40272b017401e2b$var$chromePassword;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
100
167
|
|
|
101
|
-
const $ebc8f9a71f429261$export$a7b6bc01c63cdfc3 = {};
|
|
102
|
-
(0, $6B8p2$merge)($ebc8f9a71f429261$export$a7b6bc01c63cdfc3, process.env);
|
|
103
|
-
const $ebc8f9a71f429261$export$a7c5707626fc90f = $ebc8f9a71f429261$export$a7b6bc01c63cdfc3["HOME"];
|
|
104
|
-
if (!$ebc8f9a71f429261$export$a7c5707626fc90f) throw new Error("HOME environment variable is not set");
|
|
105
168
|
|
|
106
169
|
|
|
107
170
|
|
|
108
|
-
|
|
171
|
+
const $89c1e78462503bf7$export$6c123efa52771cfa = (0, $6B8p2$join)((0, $ebc8f9a71f429261$export$a7c5707626fc90f), "Library", "Application Support", "Google", "Chrome");
|
|
109
172
|
|
|
110
|
-
$parcel$export($a6c1a5673fde1c2b$exports, "findAllFiles", () => $a6c1a5673fde1c2b$export$2c9faf86071156ae, (v) => $a6c1a5673fde1c2b$export$2c9faf86071156ae = v);
|
|
111
173
|
|
|
112
174
|
|
|
113
175
|
|
|
114
176
|
|
|
115
|
-
var $
|
|
177
|
+
var $1776b4cc4877131a$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
116
178
|
function adopt(value) {
|
|
117
179
|
return value instanceof P ? value : new P(function(resolve) {
|
|
118
180
|
resolve(value);
|
|
@@ -139,46 +201,81 @@ var $a6c1a5673fde1c2b$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
139
201
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
140
202
|
});
|
|
141
203
|
};
|
|
142
|
-
function $
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
204
|
+
function $1776b4cc4877131a$export$e85a0c9a1067c5d3(password, encryptedData // The data to decrypt
|
|
205
|
+
) {
|
|
206
|
+
return $1776b4cc4877131a$var$__awaiter(this, void 0, void 0, function*() {
|
|
207
|
+
// Returns a promise that resolves with the decrypted string
|
|
208
|
+
// Check if password is a string
|
|
209
|
+
if (typeof password !== "string") throw new Error("password must be a string: " + password);
|
|
210
|
+
let encryptedData1;
|
|
211
|
+
encryptedData1 = encryptedData;
|
|
212
|
+
// Check if encryptedData is an object
|
|
213
|
+
if (encryptedData1 == null || typeof encryptedData1 !== "object") throw new Error("encryptedData must be a object: " + encryptedData1);
|
|
214
|
+
// Check if encryptedData is a Buffer or an array of Buffers
|
|
215
|
+
if (!(encryptedData1 instanceof Buffer)) {
|
|
216
|
+
if (Array.isArray(encryptedData1) && encryptedData1[0] instanceof Buffer) {
|
|
217
|
+
[encryptedData1] = encryptedData1;
|
|
218
|
+
// Log if encryptedData is an array of buffers
|
|
219
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`encryptedData is an array of buffers, selected first: ${encryptedData1}`);
|
|
220
|
+
} else throw new Error("encryptedData must be a Buffer: " + encryptedData1);
|
|
221
|
+
encryptedData1 = Buffer.from(encryptedData1);
|
|
152
222
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
223
|
+
// Log the password being used for decryption
|
|
224
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).start(`Trying to decrypt with password: ${password}`);
|
|
225
|
+
// Return a promise that resolves with the decrypted string
|
|
226
|
+
return new Promise((resolve, reject)=>{
|
|
227
|
+
// Use pbkdf2 to derive a key from the password
|
|
228
|
+
(0, $6B8p2$pbkdf2)(password, "saltysalt", 1003, 16, "sha1", (error, buffer)=>{
|
|
229
|
+
try {
|
|
230
|
+
// Handle any errors from pbkdf2
|
|
231
|
+
if (error) {
|
|
232
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2", error);
|
|
233
|
+
reject(error);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
// Check if the buffer length is 16
|
|
237
|
+
if (buffer.length !== 16) {
|
|
238
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, buffer length is not 16", buffer.length);
|
|
239
|
+
reject(new Error("Buffer length is not 16"));
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
// Create an initialization vector
|
|
243
|
+
const str = new Array(17).join(" ");
|
|
244
|
+
const iv = Buffer.from(str, "binary");
|
|
245
|
+
// Create a decipher using the derived key and initialization vector
|
|
246
|
+
const decipher = (0, $6B8p2$createDecipheriv)("aes-128-cbc", buffer, iv);
|
|
247
|
+
decipher.setAutoPadding(false);
|
|
248
|
+
// Remove the first 3 bytes from the encrypted data
|
|
249
|
+
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
250
|
+
// Check if the encrypted data length is a multiple of 16
|
|
251
|
+
if (encryptedData1.length % 16 !== 0) {
|
|
252
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
253
|
+
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
// Update the decipher with the encrypted data
|
|
257
|
+
let decoded = decipher.update(encryptedData1);
|
|
258
|
+
try {
|
|
259
|
+
// Finalize the decipher
|
|
260
|
+
decipher.final("utf-8");
|
|
261
|
+
} catch (e) {
|
|
262
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing decipher.final()", e);
|
|
263
|
+
reject(e);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
// Remove padding from the decoded data
|
|
267
|
+
const padding = decoded[decoded.length - 1];
|
|
268
|
+
if (padding) decoded = decoded.slice(0, 0 - padding);
|
|
269
|
+
// Convert the decoded data to a string
|
|
270
|
+
const decodedString = decoded.toString("utf8");
|
|
271
|
+
// Resolve the promise with the decrypted string
|
|
272
|
+
resolve(decodedString);
|
|
273
|
+
} catch (e) {
|
|
274
|
+
// Reject the promise if there is an error
|
|
275
|
+
reject(e);
|
|
172
276
|
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) {
|
|
176
|
-
if (files.length > 0) {
|
|
177
|
-
(0, $6B8p2$consola).log(`Found ${files.length} ${name} files`);
|
|
178
|
-
(0, $6B8p2$consola).log(files);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return files;
|
|
277
|
+
});
|
|
278
|
+
});
|
|
182
279
|
});
|
|
183
280
|
}
|
|
184
281
|
|
|
@@ -186,24 +283,70 @@ function $a6c1a5673fde1c2b$export$2c9faf86071156ae({ path: path , name: name , m
|
|
|
186
283
|
|
|
187
284
|
|
|
188
285
|
|
|
189
|
-
function $63d6ce571e62efc6$export$bc926c43858bd3cb(obj) {
|
|
190
|
-
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
191
|
-
}
|
|
192
286
|
|
|
193
287
|
|
|
194
|
-
|
|
195
|
-
|
|
288
|
+
var $314d38a8021f1e34$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
289
|
+
function adopt(value) {
|
|
290
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
291
|
+
resolve(value);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
295
|
+
function fulfilled(value) {
|
|
296
|
+
try {
|
|
297
|
+
step(generator.next(value));
|
|
298
|
+
} catch (e) {
|
|
299
|
+
reject(e);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function rejected(value) {
|
|
303
|
+
try {
|
|
304
|
+
step(generator["throw"](value));
|
|
305
|
+
} catch (e) {
|
|
306
|
+
reject(e);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function step(result) {
|
|
310
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
311
|
+
}
|
|
312
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
function $314d38a8021f1e34$var$checkFileExistence(file) {
|
|
316
|
+
if (!file || !(0, $6B8p2$fs).existsSync(file)) throw new Error(`File ${file} does not exist`);
|
|
196
317
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
318
|
+
function $314d38a8021f1e34$var$createDatabase(file) {
|
|
319
|
+
return new (0, $6B8p2$Database)(file);
|
|
320
|
+
}
|
|
321
|
+
function $314d38a8021f1e34$var$transformRows(//
|
|
322
|
+
rows, rowFilter, rowTransform, file) {
|
|
323
|
+
return rows.filter(rowFilter).map((row)=>{
|
|
324
|
+
const metaData = {
|
|
325
|
+
meta: {
|
|
326
|
+
file: file
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
const cookieRow = rowTransform(row);
|
|
330
|
+
return (0, $6B8p2$merge)(metaData, cookieRow);
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
function $314d38a8021f1e34$export$a24b988c49ded60e(//
|
|
334
|
+
{ file: //
|
|
335
|
+
file, sql: sql, rowFilter: rowFilter = ()=>true, rowTransform: rowTransform }) {
|
|
336
|
+
return $314d38a8021f1e34$var$__awaiter(this, void 0, void 0, function*() {
|
|
337
|
+
$314d38a8021f1e34$var$checkFileExistence(file);
|
|
338
|
+
const db = $314d38a8021f1e34$var$createDatabase(file);
|
|
339
|
+
return new Promise((resolve, reject)=>{
|
|
340
|
+
db.all(sql, (err, rows)=>{
|
|
341
|
+
if (err) return reject(err);
|
|
342
|
+
if (!rows || rows.length === 0) return resolve([]);
|
|
343
|
+
const cookieRows = $314d38a8021f1e34$var$transformRows(rows, rowFilter, rowTransform, file);
|
|
344
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).log(`Rows: ${JSON.stringify(rows)}`);
|
|
345
|
+
return resolve(cookieRows);
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
});
|
|
204
349
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
350
|
|
|
208
351
|
|
|
209
352
|
var $a6f61760d01c3afd$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
@@ -266,8 +409,8 @@ function $a6f61760d01c3afd$var$getPromise1(name, domain, file) {
|
|
|
266
409
|
function $a6f61760d01c3afd$var$getPromise(name, domain) {
|
|
267
410
|
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
268
411
|
try {
|
|
269
|
-
const files = yield (0, $a6c1a5673fde1c2b$
|
|
270
|
-
path: $
|
|
412
|
+
const files = yield (0, $a6c1a5673fde1c2b$export$2c9faf86071156ae)({
|
|
413
|
+
path: (0, $89c1e78462503bf7$export$6c123efa52771cfa),
|
|
271
414
|
name: "Cookies"
|
|
272
415
|
});
|
|
273
416
|
const promises = files.map((file)=>$a6f61760d01c3afd$var$getPromise1(name, domain, file));
|
|
@@ -283,7 +426,7 @@ function $a6f61760d01c3afd$var$decryptValue(password, encryptedValue) {
|
|
|
283
426
|
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
284
427
|
let d;
|
|
285
428
|
try {
|
|
286
|
-
d = yield $
|
|
429
|
+
d = yield (0, $1776b4cc4877131a$export$e85a0c9a1067c5d3)(password, encryptedValue);
|
|
287
430
|
} catch (e) {
|
|
288
431
|
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error decrypting cookie", e);
|
|
289
432
|
d = null;
|
|
@@ -291,11 +434,11 @@ function $a6f61760d01c3afd$var$decryptValue(password, encryptedValue) {
|
|
|
291
434
|
return d !== null && d !== void 0 ? d : encryptedValue.toString("utf-8");
|
|
292
435
|
});
|
|
293
436
|
}
|
|
294
|
-
function $a6f61760d01c3afd$var$getChromeCookies({ name: name
|
|
437
|
+
function $a6f61760d01c3afd$var$getChromeCookies({ name: name, domain: domain = "%", requireJwt: requireJwt = false }) {
|
|
295
438
|
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
296
439
|
const encryptedDataItems = yield $a6f61760d01c3afd$var$getPromise(name, domain);
|
|
297
|
-
const password = yield $
|
|
298
|
-
const decrypted = encryptedDataItems.filter(({ value: value
|
|
440
|
+
const password = yield (0, $b40272b017401e2b$export$91552cff7edf316)();
|
|
441
|
+
const decrypted = encryptedDataItems.filter(({ value: value })=>value != null && value.length > 0).map((cookieRow)=>$a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
299
442
|
var _a;
|
|
300
443
|
const encryptedValue = cookieRow.value;
|
|
301
444
|
const decryptedValue = yield $a6f61760d01c3afd$var$decryptValue(password, encryptedValue);
|
|
@@ -316,44 +459,51 @@ function $a6f61760d01c3afd$var$getChromeCookies({ name: name , domain: domain =
|
|
|
316
459
|
(0, $6B8p2$merge)(exportedCookie, mergeExpiry);
|
|
317
460
|
return exportedCookie;
|
|
318
461
|
}));
|
|
319
|
-
const results = (yield Promise.all(decrypted)).filter((0, $
|
|
462
|
+
const results = (yield Promise.all(decrypted)).filter((0, $cf39947f238e32e1$export$963c8d651337e4a4));
|
|
320
463
|
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("results", results);
|
|
321
464
|
return results;
|
|
322
465
|
});
|
|
323
466
|
}
|
|
324
|
-
|
|
325
|
-
function $a6f61760d01c3afd$var$getEncryptedChromeCookie({ name: name , domain: domain , file: file = $6B8p2$join($a6f61760d01c3afd$var$chromeLocal, "Default", "Cookies") }) {
|
|
467
|
+
function $a6f61760d01c3afd$var$getEncryptedChromeCookie({ name: name, domain: domain, file: file = (0, $6B8p2$join)((0, $89c1e78462503bf7$export$6c123efa52771cfa), "Default", "Cookies") }) {
|
|
326
468
|
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
327
469
|
if (!(0, $6B8p2$existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
328
470
|
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) {
|
|
329
471
|
const s = file.split("/").slice(-3).join("/");
|
|
330
|
-
|
|
472
|
+
(0, $6B8p2$consola).start(`Trying Chrome (at ${s}) cookie ${name} for domain ${domain}`);
|
|
331
473
|
}
|
|
332
474
|
let sql;
|
|
333
475
|
//language=SQL
|
|
334
|
-
sql = "SELECT
|
|
335
|
-
//
|
|
476
|
+
sql = "SELECT encrypted_value, name, host_key, expires_utc FROM cookies";
|
|
477
|
+
// Define a regular expression to match wildcard characters
|
|
336
478
|
const wildcardRegexp = /^([*%])$/i;
|
|
479
|
+
// Check if the name does not contain wildcard characters
|
|
337
480
|
const specifiedName = name.match(wildcardRegexp) == null;
|
|
481
|
+
// Check if the domain does not contain wildcard characters
|
|
338
482
|
const specifiedDomain = domain.match(wildcardRegexp) == null;
|
|
483
|
+
// Check if the domain contains wildcard characters
|
|
339
484
|
const wildcardDomain = domain.match(/[%*]/) != null;
|
|
485
|
+
// Determine if we should query the domain based on the previous checks
|
|
340
486
|
const queryDomain = specifiedDomain && !wildcardDomain;
|
|
341
487
|
// if we have a wildcard domain, we need to use a regexp
|
|
488
|
+
// If the name is specified or we need to query the domain, we add a WHERE clause to the SQL query
|
|
342
489
|
if (specifiedName || queryDomain) {
|
|
343
490
|
sql += ` WHERE `;
|
|
491
|
+
// If the name is specified, we add a condition to the SQL query to match the name
|
|
344
492
|
if (specifiedName) {
|
|
345
493
|
sql += `name = '${name}'`;
|
|
494
|
+
// If we also need to query the domain, we add an AND operator to the SQL query
|
|
346
495
|
if (queryDomain) sql += ` AND `;
|
|
347
496
|
}
|
|
497
|
+
// If we need to query the domain, we add a condition to the SQL query to match the domain
|
|
348
498
|
if (queryDomain) {
|
|
349
|
-
// leading dot replaced with % to match subdomains
|
|
499
|
+
// The leading dot is replaced with % to match subdomains
|
|
350
500
|
const sqlEmbedDomain = domain.replace(/^[.%]?/, "%");
|
|
351
501
|
sql += `host_key LIKE '${sqlEmbedDomain}';`;
|
|
352
502
|
}
|
|
353
503
|
}
|
|
354
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose)
|
|
504
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).info("Querying:", sql);
|
|
355
505
|
const domainRegexp = (0, $78efb18fcf7b6c2c$export$4eadcf0bf35a2ddb)(domain);
|
|
356
|
-
const sqliteQuery1 = yield $
|
|
506
|
+
const sqliteQuery1 = yield (0, $314d38a8021f1e34$export$a24b988c49ded60e)({
|
|
357
507
|
file: file,
|
|
358
508
|
sql: sql,
|
|
359
509
|
rowFilter: (row)=>{
|
|
@@ -366,124 +516,23 @@ function $a6f61760d01c3afd$var$getEncryptedChromeCookie({ name: name , domain: d
|
|
|
366
516
|
name: row["name"],
|
|
367
517
|
value: row["encrypted_value"]
|
|
368
518
|
};
|
|
369
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose)
|
|
519
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).info("Found", cookieRow);
|
|
370
520
|
return cookieRow;
|
|
371
521
|
}
|
|
372
522
|
});
|
|
373
523
|
return sqliteQuery1.filter((row)=>{
|
|
524
|
+
// TODO: is this needed?
|
|
374
525
|
return row.domain.match(domainRegexp) != null;
|
|
375
526
|
});
|
|
376
527
|
});
|
|
377
528
|
}
|
|
378
|
-
function $a6f61760d01c3afd$var$getChromePassword() {
|
|
379
|
-
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
380
|
-
return (0, $7a8c6b6f0e26a266$exports.execSimple)('security find-generic-password -w -s "Chrome Safe Storage"');
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
function $a6f61760d01c3afd$var$decrypt(password, encryptedData) {
|
|
384
|
-
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
385
|
-
if (typeof password !== "string") throw new Error("password must be a string: " + password);
|
|
386
|
-
let encryptedData1;
|
|
387
|
-
encryptedData1 = encryptedData;
|
|
388
|
-
if (encryptedData1 == null || typeof encryptedData1 !== "object") throw new Error("encryptedData must be a object: " + encryptedData1);
|
|
389
|
-
if (!(encryptedData1 instanceof Buffer)) {
|
|
390
|
-
if (Array.isArray(encryptedData1) && encryptedData1[0] instanceof Buffer) {
|
|
391
|
-
[encryptedData1] = encryptedData1;
|
|
392
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`encryptedData is an array of buffers, selected first: ${encryptedData1}`);
|
|
393
|
-
} else throw new Error("encryptedData must be a Buffer: " + encryptedData1);
|
|
394
|
-
encryptedData1 = Buffer.from(encryptedData1);
|
|
395
|
-
}
|
|
396
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`Trying to decrypt with password ${password}`);
|
|
397
|
-
return new Promise((resolve, reject)=>{
|
|
398
|
-
$6B8p2$pbkdf2(password, "saltysalt", 1003, 16, "sha1", (error, buffer)=>{
|
|
399
|
-
try {
|
|
400
|
-
if (error) {
|
|
401
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2", error);
|
|
402
|
-
reject(error);
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
if (buffer.length !== 16) {
|
|
406
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, buffer length is not 16", buffer.length);
|
|
407
|
-
reject(new Error("Buffer length is not 16"));
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
const str = new Array(17).join(" ");
|
|
411
|
-
const iv = Buffer.from(str, "binary");
|
|
412
|
-
const decipher = $6B8p2$createDecipheriv("aes-128-cbc", buffer, iv);
|
|
413
|
-
decipher.setAutoPadding(false);
|
|
414
|
-
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
415
|
-
if (encryptedData1.length % 16 !== 0) {
|
|
416
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
417
|
-
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
let decoded = decipher.update(encryptedData1);
|
|
421
|
-
try {
|
|
422
|
-
decipher.final("utf-8");
|
|
423
|
-
} catch (e) {
|
|
424
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing decipher.final()", e);
|
|
425
|
-
reject(e);
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
const padding = decoded[decoded.length - 1];
|
|
429
|
-
if (padding) decoded = decoded.slice(0, 0 - padding);
|
|
430
|
-
// noinspection JSCheckFunctionSignatures
|
|
431
|
-
const decodedString = decoded.toString("utf8");
|
|
432
|
-
resolve(decodedString);
|
|
433
|
-
} catch (e1) {
|
|
434
|
-
reject(e1);
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
function $a6f61760d01c3afd$export$bd52b72df8d0d261({ file: file , sql: sql , rowFilter: rowFilter = ()=>true , rowTransform: rowTransform }) {
|
|
441
|
-
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
442
|
-
if (!file || file && !(0, $6B8p2$fs).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
443
|
-
const db = new $6B8p2$Database(file);
|
|
444
|
-
return new Promise((resolve, reject)=>{
|
|
445
|
-
db.all(sql, (err, rows)=>{
|
|
446
|
-
if (err) {
|
|
447
|
-
reject(err);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
const rows1 = rows;
|
|
451
|
-
if (rows1 == null || rows1.length === 0) {
|
|
452
|
-
resolve([]);
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
if (Array.isArray(rows1)) {
|
|
456
|
-
const cookieRows = rows1.filter(rowFilter).map((row)=>{
|
|
457
|
-
const newVar = {
|
|
458
|
-
meta: {
|
|
459
|
-
file: file
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
const cookieRow = rowTransform(row);
|
|
463
|
-
return (0, $6B8p2$merge)(newVar, cookieRow);
|
|
464
|
-
});
|
|
465
|
-
resolve(cookieRows);
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
469
|
-
resolve([
|
|
470
|
-
rows1
|
|
471
|
-
]);
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
|
|
477
529
|
|
|
478
|
-
var $62dcb7ce199205be$exports = {};
|
|
479
530
|
|
|
480
|
-
$parcel$export($62dcb7ce199205be$exports, "doSqliteQuery1", () => $62dcb7ce199205be$export$f19f611d1fa7c6f3, (v) => $62dcb7ce199205be$export$f19f611d1fa7c6f3 = v);
|
|
481
|
-
$parcel$export($62dcb7ce199205be$exports, "default", () => $62dcb7ce199205be$export$2e2bcd8739ae039, (v) => $62dcb7ce199205be$export$2e2bcd8739ae039 = v);
|
|
482
531
|
|
|
483
532
|
|
|
484
533
|
|
|
485
534
|
|
|
486
|
-
function $81d2f9cb974d13de$export$da22813e5a2ec500({ name: name
|
|
535
|
+
function $81d2f9cb974d13de$export$da22813e5a2ec500({ name: name, domain: domain }) {
|
|
487
536
|
const wildcardRegexp = /^([*%])$/i;
|
|
488
537
|
return {
|
|
489
538
|
specifiedName: name.match(wildcardRegexp) == null,
|
|
@@ -494,7 +543,6 @@ function $81d2f9cb974d13de$export$da22813e5a2ec500({ name: name , domain: domain
|
|
|
494
543
|
|
|
495
544
|
|
|
496
545
|
|
|
497
|
-
|
|
498
546
|
var $62dcb7ce199205be$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
499
547
|
function adopt(value) {
|
|
500
548
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -528,43 +576,7 @@ var $62dcb7ce199205be$var$__classPrivateFieldGet = undefined && undefined.__clas
|
|
|
528
576
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
529
577
|
};
|
|
530
578
|
var $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_queryCookiesDb;
|
|
531
|
-
|
|
532
|
-
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
533
|
-
if (!file || file && !(0, $6B8p2$fs).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
534
|
-
const db = new $6B8p2$Database(file);
|
|
535
|
-
return new Promise((resolve, reject)=>{
|
|
536
|
-
db.all(sql, (err, rows)=>{
|
|
537
|
-
if (err) {
|
|
538
|
-
reject(err);
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
const rows1 = rows;
|
|
542
|
-
if (rows1 == null || rows1.length === 0) {
|
|
543
|
-
resolve([]);
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
if (Array.isArray(rows1)) {
|
|
547
|
-
const cookieRows = rows1.map((row)=>{
|
|
548
|
-
const newVar = {
|
|
549
|
-
meta: {
|
|
550
|
-
file: file
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
const cookieRow = rowTransform(row);
|
|
554
|
-
return (0, $6B8p2$merge)(newVar, cookieRow);
|
|
555
|
-
});
|
|
556
|
-
resolve(cookieRows);
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
560
|
-
resolve([
|
|
561
|
-
rows1
|
|
562
|
-
]);
|
|
563
|
-
});
|
|
564
|
-
});
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
class $62dcb7ce199205be$export$2e2bcd8739ae039 {
|
|
579
|
+
class $62dcb7ce199205be$var$FirefoxCookieQueryStrategy {
|
|
568
580
|
constructor(){
|
|
569
581
|
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances.add(this);
|
|
570
582
|
this.browserName = "Firefox";
|
|
@@ -589,10 +601,10 @@ class $62dcb7ce199205be$export$2e2bcd8739ae039 {
|
|
|
589
601
|
});
|
|
590
602
|
}
|
|
591
603
|
}
|
|
592
|
-
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie = function _FirefoxCookieQueryStrategy_getFirefoxCookie({ name: name
|
|
604
|
+
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie = function _FirefoxCookieQueryStrategy_getFirefoxCookie({ name: name, domain: domain } //
|
|
593
605
|
) {
|
|
594
606
|
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
595
|
-
const files =
|
|
607
|
+
const files = (0, $a6c1a5673fde1c2b$export$2c9faf86071156ae)({
|
|
596
608
|
path: $6B8p2$join((0, $ebc8f9a71f429261$export$a7c5707626fc90f), "Library", "Application Support", "Firefox", "Profiles"),
|
|
597
609
|
name: "cookies.sqlite"
|
|
598
610
|
});
|
|
@@ -609,7 +621,7 @@ $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62
|
|
|
609
621
|
let sql;
|
|
610
622
|
//language=SQL
|
|
611
623
|
sql = "SELECT value, name, host FROM moz_cookies";
|
|
612
|
-
const { specifiedName: specifiedName
|
|
624
|
+
const { specifiedName: specifiedName, specifiedDomain: specifiedDomain } = (0, $81d2f9cb974d13de$export$da22813e5a2ec500)({
|
|
613
625
|
name: name,
|
|
614
626
|
domain: domain
|
|
615
627
|
});
|
|
@@ -631,7 +643,7 @@ $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62
|
|
|
631
643
|
};
|
|
632
644
|
};
|
|
633
645
|
try {
|
|
634
|
-
return yield $
|
|
646
|
+
return yield (0, $314d38a8021f1e34$export$a24b988c49ded60e)({
|
|
635
647
|
file: file,
|
|
636
648
|
sql: sql,
|
|
637
649
|
rowTransform: rowTransform
|
|
@@ -642,11 +654,9 @@ $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62
|
|
|
642
654
|
}
|
|
643
655
|
});
|
|
644
656
|
};
|
|
657
|
+
var $62dcb7ce199205be$export$2e2bcd8739ae039 = $62dcb7ce199205be$var$FirefoxCookieQueryStrategy;
|
|
645
658
|
|
|
646
659
|
|
|
647
|
-
var $b470ee3b0b06a25e$exports = {};
|
|
648
|
-
|
|
649
|
-
$parcel$export($b470ee3b0b06a25e$exports, "default", () => $b470ee3b0b06a25e$export$2e2bcd8739ae039, (v) => $b470ee3b0b06a25e$export$2e2bcd8739ae039 = v);
|
|
650
660
|
var $b470ee3b0b06a25e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
651
661
|
function adopt(value) {
|
|
652
662
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -734,15 +744,15 @@ const $49168e685ea38e19$var$cache = new (0, $6B8p2$lrucache)({
|
|
|
734
744
|
ttl: 10000,
|
|
735
745
|
max: 10
|
|
736
746
|
});
|
|
737
|
-
class $49168e685ea38e19$
|
|
747
|
+
class $49168e685ea38e19$var$CompositeCookieQueryStrategy {
|
|
738
748
|
constructor(){
|
|
739
749
|
this.browserName = "all";
|
|
740
750
|
$49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies.set(this, void 0);
|
|
741
751
|
$49168e685ea38e19$var$__classPrivateFieldSet(this, $49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies, [
|
|
742
752
|
// CookieStoreQueryStrategy,
|
|
743
|
-
(0, $a6f61760d01c3afd$
|
|
744
|
-
(0, $62dcb7ce199205be$
|
|
745
|
-
(0, $b470ee3b0b06a25e$
|
|
753
|
+
(0, $a6f61760d01c3afd$export$2e2bcd8739ae039),
|
|
754
|
+
(0, $62dcb7ce199205be$export$2e2bcd8739ae039),
|
|
755
|
+
(0, $b470ee3b0b06a25e$export$2e2bcd8739ae039)
|
|
746
756
|
].map((strategy)=>{
|
|
747
757
|
return new strategy();
|
|
748
758
|
}), "f");
|
|
@@ -776,6 +786,7 @@ class $49168e685ea38e19$export$2e2bcd8739ae039 {
|
|
|
776
786
|
}
|
|
777
787
|
}
|
|
778
788
|
$49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies = new WeakMap();
|
|
789
|
+
var $49168e685ea38e19$export$2e2bcd8739ae039 = $49168e685ea38e19$var$CompositeCookieQueryStrategy;
|
|
779
790
|
|
|
780
791
|
|
|
781
792
|
|
|
@@ -828,7 +839,7 @@ var $f382029733f65752$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
828
839
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
829
840
|
});
|
|
830
841
|
};
|
|
831
|
-
function $f382029733f65752$export$e6d428437cf2cacb({ name: name
|
|
842
|
+
function $f382029733f65752$export$e6d428437cf2cacb({ name: name, domain: domain }, strategy = new (0, $49168e685ea38e19$export$2e2bcd8739ae039)()) {
|
|
832
843
|
return $f382029733f65752$var$__awaiter(this, void 0, void 0, function*() {
|
|
833
844
|
//
|
|
834
845
|
const results = yield strategy.queryCookies(name, domain);
|
|
@@ -880,16 +891,13 @@ var $3a892f71b64103f5$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
880
891
|
function $3a892f71b64103f5$export$4be65e66cfa2648a(params) {
|
|
881
892
|
return $3a892f71b64103f5$var$__awaiter(this, void 0, void 0, function*() {
|
|
882
893
|
//
|
|
883
|
-
const cookies = yield (0, $f382029733f65752$
|
|
894
|
+
const cookies = yield (0, $f382029733f65752$export$e6d428437cf2cacb)(params, new (0, $49168e685ea38e19$export$2e2bcd8739ae039)());
|
|
884
895
|
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
885
896
|
else throw new Error("Cookie not found");
|
|
886
897
|
});
|
|
887
898
|
}
|
|
888
899
|
|
|
889
900
|
|
|
890
|
-
var $c23eafaef8340cc3$exports = {};
|
|
891
|
-
|
|
892
|
-
$parcel$export($c23eafaef8340cc3$exports, "getChromeCookie", () => $c23eafaef8340cc3$export$e5637297e9eb6f2e, (v) => $c23eafaef8340cc3$export$e5637297e9eb6f2e = v);
|
|
893
901
|
|
|
894
902
|
|
|
895
903
|
|
|
@@ -922,16 +930,13 @@ var $c23eafaef8340cc3$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
922
930
|
};
|
|
923
931
|
function $c23eafaef8340cc3$export$e5637297e9eb6f2e(params) {
|
|
924
932
|
return $c23eafaef8340cc3$var$__awaiter(this, void 0, void 0, function*() {
|
|
925
|
-
const cookies = yield (0, $f382029733f65752$
|
|
933
|
+
const cookies = yield (0, $f382029733f65752$export$e6d428437cf2cacb)(params, new (0, $a6f61760d01c3afd$export$2e2bcd8739ae039)());
|
|
926
934
|
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
927
|
-
return cookies.find((0, $
|
|
935
|
+
return cookies.find((0, $cf39947f238e32e1$export$963c8d651337e4a4));
|
|
928
936
|
});
|
|
929
937
|
}
|
|
930
938
|
|
|
931
939
|
|
|
932
|
-
var $bea34252b8e17f8d$exports = {};
|
|
933
|
-
|
|
934
|
-
$parcel$export($bea34252b8e17f8d$exports, "getFirefoxCookie", () => $bea34252b8e17f8d$export$c44c5fdef43f0941, (v) => $bea34252b8e17f8d$export$c44c5fdef43f0941 = v);
|
|
935
940
|
|
|
936
941
|
|
|
937
942
|
var $bea34252b8e17f8d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
@@ -963,16 +968,13 @@ var $bea34252b8e17f8d$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
963
968
|
};
|
|
964
969
|
function $bea34252b8e17f8d$export$c44c5fdef43f0941(params) {
|
|
965
970
|
return $bea34252b8e17f8d$var$__awaiter(this, void 0, void 0, function*() {
|
|
966
|
-
const cookies = yield (0, $f382029733f65752$
|
|
971
|
+
const cookies = yield (0, $f382029733f65752$export$e6d428437cf2cacb)(params, new (0, $62dcb7ce199205be$export$2e2bcd8739ae039)());
|
|
967
972
|
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
968
973
|
else throw new Error("Cookie not found");
|
|
969
974
|
});
|
|
970
975
|
}
|
|
971
976
|
|
|
972
977
|
|
|
973
|
-
var $9bb85405e96c1fbc$exports = {};
|
|
974
|
-
|
|
975
|
-
$parcel$export($9bb85405e96c1fbc$exports, "getGroupedRenderedCookies", () => $9bb85405e96c1fbc$export$4d2e9997e2c23417, (v) => $9bb85405e96c1fbc$export$4d2e9997e2c23417 = v);
|
|
976
978
|
|
|
977
979
|
|
|
978
980
|
function $8227023f453bcf31$export$9abc0a414b0d8b8f(results) {
|
|
@@ -989,9 +991,6 @@ function $8227023f453bcf31$export$9abc0a414b0d8b8f(results) {
|
|
|
989
991
|
}
|
|
990
992
|
|
|
991
993
|
|
|
992
|
-
var $0f113de605a2ef1d$exports = {};
|
|
993
|
-
|
|
994
|
-
$parcel$export($0f113de605a2ef1d$exports, "comboQueryCookieSpec", () => $0f113de605a2ef1d$export$a65902517ae87ba8, (v) => $0f113de605a2ef1d$export$a65902517ae87ba8 = v);
|
|
995
994
|
|
|
996
995
|
|
|
997
996
|
var $0f113de605a2ef1d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
@@ -1026,11 +1025,11 @@ function $0f113de605a2ef1d$export$a65902517ae87ba8(cookieSpec) {
|
|
|
1026
1025
|
const cookies = [];
|
|
1027
1026
|
if (Array.isArray(cookieSpec)) {
|
|
1028
1027
|
const results = yield Promise.all(cookieSpec.map((cs)=>{
|
|
1029
|
-
return (0, $f382029733f65752$
|
|
1028
|
+
return (0, $f382029733f65752$export$e6d428437cf2cacb)(cs);
|
|
1030
1029
|
}));
|
|
1031
1030
|
for (const exportedCookie of results.flat())cookies.push(exportedCookie);
|
|
1032
1031
|
} else {
|
|
1033
|
-
const singleQuery = yield (0, $f382029733f65752$
|
|
1032
|
+
const singleQuery = yield (0, $f382029733f65752$export$e6d428437cf2cacb)(cookieSpec);
|
|
1034
1033
|
cookies.push(...singleQuery);
|
|
1035
1034
|
}
|
|
1036
1035
|
return (0, $6B8p2$uniqBy)(cookies, JSON.stringify);
|
|
@@ -1067,7 +1066,7 @@ var $9bb85405e96c1fbc$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
1067
1066
|
};
|
|
1068
1067
|
function $9bb85405e96c1fbc$export$4d2e9997e2c23417(cookieSpec) {
|
|
1069
1068
|
return $9bb85405e96c1fbc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1070
|
-
const cookies = yield (0, $0f113de605a2ef1d$
|
|
1069
|
+
const cookies = yield (0, $0f113de605a2ef1d$export$a65902517ae87ba8)(cookieSpec);
|
|
1071
1070
|
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
1072
1071
|
const groupedByFile = (0, $6B8p2$groupBy)(cookies, (r)=>{
|
|
1073
1072
|
var _a;
|
|
@@ -1081,9 +1080,6 @@ function $9bb85405e96c1fbc$export$4d2e9997e2c23417(cookieSpec) {
|
|
|
1081
1080
|
}
|
|
1082
1081
|
|
|
1083
1082
|
|
|
1084
|
-
var $0b27779070651c3e$exports = {};
|
|
1085
|
-
|
|
1086
|
-
$parcel$export($0b27779070651c3e$exports, "getMergedRenderedCookies", () => $0b27779070651c3e$export$cfc0723de5712e57, (v) => $0b27779070651c3e$export$cfc0723de5712e57 = v);
|
|
1087
1083
|
|
|
1088
1084
|
|
|
1089
1085
|
var $0b27779070651c3e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
@@ -1115,15 +1111,12 @@ var $0b27779070651c3e$var$__awaiter = undefined && undefined.__awaiter || functi
|
|
|
1115
1111
|
};
|
|
1116
1112
|
function $0b27779070651c3e$export$cfc0723de5712e57(cookieSpec) {
|
|
1117
1113
|
return $0b27779070651c3e$var$__awaiter(this, void 0, void 0, function*() {
|
|
1118
|
-
const cookies = yield (0, $0f113de605a2ef1d$
|
|
1114
|
+
const cookies = yield (0, $0f113de605a2ef1d$export$a65902517ae87ba8)(cookieSpec);
|
|
1119
1115
|
return cookies.length > 0 ? (0, $8227023f453bcf31$export$9abc0a414b0d8b8f)(cookies) : "";
|
|
1120
1116
|
});
|
|
1121
1117
|
}
|
|
1122
1118
|
|
|
1123
1119
|
|
|
1124
|
-
var $7d6c43a28f2485bc$exports = {};
|
|
1125
|
-
|
|
1126
|
-
$parcel$export($7d6c43a28f2485bc$exports, "fetchWithCookies", () => $7d6c43a28f2485bc$export$b24a545a0b39f491, (v) => $7d6c43a28f2485bc$export$b24a545a0b39f491 = v);
|
|
1127
1120
|
// noinspection JSUnusedGlobalSymbols,ExceptionCaughtLocallyJS
|
|
1128
1121
|
|
|
1129
1122
|
|
|
@@ -1214,7 +1207,7 @@ function $7d6c43a28f2485bc$export$b24a545a0b39f491(url, options = {}, fetch = (0
|
|
|
1214
1207
|
const url1 = new URL(url2);
|
|
1215
1208
|
(0, $6B8p2$consola).start("fetchWithCookies", url2);
|
|
1216
1209
|
const cookieSpecs = (0, $bd973abb63c1ed35$export$f266452a5050185d)(url1);
|
|
1217
|
-
headers["Cookie"] = yield (0, $0b27779070651c3e$
|
|
1210
|
+
headers["Cookie"] = yield (0, $0b27779070651c3e$export$cfc0723de5712e57)(cookieSpecs).catch((err)=>{
|
|
1218
1211
|
(0, $6B8p2$consola).error(err);
|
|
1219
1212
|
return "";
|
|
1220
1213
|
});
|
|
@@ -1228,9 +1221,9 @@ function $7d6c43a28f2485bc$export$b24a545a0b39f491(url, options = {}, fetch = (0
|
|
|
1228
1221
|
try {
|
|
1229
1222
|
const res = yield fetch(url1, newOptions1);
|
|
1230
1223
|
// noinspection JSMismatchedCollectionQueryUpdate
|
|
1231
|
-
const
|
|
1224
|
+
const headers = [];
|
|
1232
1225
|
res.headers.forEach((value, key)=>{
|
|
1233
|
-
|
|
1226
|
+
headers.push([
|
|
1234
1227
|
key,
|
|
1235
1228
|
value
|
|
1236
1229
|
]);
|