@mherod/get-cookie 2.0.0-rc.21 → 2.0.0-rc.23
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/.parcelrc +12 -0
- package/.prettierrc +12 -0
- package/dist/cli.js +299 -247
- package/dist/index.js +263 -247
- package/dist/index.js.map +1 -1
- package/dist/module.js +261 -223
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +5 -4
- package/dist/types.d.ts.map +1 -1
- package/package-lock.json +632 -29
- package/package.json +10 -6
- package/src/cli.ts +23 -22
- package/src/index.ts +0 -4
- package/src/logger.ts +3 -0
- package/.prettierrc.json +0 -1
package/dist/index.js
CHANGED
|
@@ -17,45 +17,33 @@ var $cDXzb$useragents = require("user-agents");
|
|
|
17
17
|
function $parcel$export(e, n, v, s) {
|
|
18
18
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
19
19
|
}
|
|
20
|
-
function $parcel$exportWildcard(dest, source) {
|
|
21
|
-
Object.keys(source).forEach(function(key) {
|
|
22
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
Object.defineProperty(dest, key, {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return source[key];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return dest;
|
|
35
|
-
}
|
|
36
20
|
function $parcel$interopDefault(a) {
|
|
37
21
|
return a && a.__esModule ? a.default : a;
|
|
38
22
|
}
|
|
39
23
|
|
|
40
|
-
$parcel$export(module.exports, "getCookie", () => $
|
|
41
|
-
$parcel$export(module.exports, "getChromeCookie", () => $
|
|
42
|
-
$parcel$export(module.exports, "getFirefoxCookie", () => $
|
|
43
|
-
$parcel$export(module.exports, "getMergedRenderedCookies", () => $
|
|
44
|
-
$parcel$export(module.exports, "getGroupedRenderedCookies", () => $
|
|
45
|
-
$parcel$export(module.exports, "fetchWithCookies", () => $
|
|
24
|
+
$parcel$export(module.exports, "getCookie", () => $d281d3a55494cb83$export$4be65e66cfa2648a);
|
|
25
|
+
$parcel$export(module.exports, "getChromeCookie", () => $52913203ed6cd470$export$e5637297e9eb6f2e);
|
|
26
|
+
$parcel$export(module.exports, "getFirefoxCookie", () => $e815b5ca89da9daf$export$c44c5fdef43f0941);
|
|
27
|
+
$parcel$export(module.exports, "getMergedRenderedCookies", () => $0ac28e04b308724d$export$cfc0723de5712e57);
|
|
28
|
+
$parcel$export(module.exports, "getGroupedRenderedCookies", () => $429525b331c0e3ef$export$4d2e9997e2c23417);
|
|
29
|
+
$parcel$export(module.exports, "fetchWithCookies", () => $9f9fb10cbd238704$export$b24a545a0b39f491);
|
|
46
30
|
|
|
47
31
|
|
|
48
32
|
|
|
49
|
-
const $
|
|
50
|
-
const $
|
|
51
|
-
const $
|
|
33
|
+
const $7157583128e389c3$export$6f4ae1207c703045 = process.argv ?? [];
|
|
34
|
+
const $7157583128e389c3$var$minimistArgs = (0, ($parcel$interopDefault($cDXzb$minimist)))($7157583128e389c3$export$6f4ae1207c703045.slice(2));
|
|
35
|
+
const $7157583128e389c3$var$defaultOptions = {
|
|
52
36
|
verbose: false
|
|
53
37
|
};
|
|
54
|
-
const $
|
|
38
|
+
const $7157583128e389c3$export$c348dfaf65040d9b = (0, $cDXzb$lodash.merge)($7157583128e389c3$var$defaultOptions, $7157583128e389c3$var$minimistArgs);
|
|
55
39
|
|
|
56
40
|
|
|
41
|
+
var $25f0c12ee73e61dc$exports = {};
|
|
57
42
|
|
|
58
|
-
|
|
43
|
+
$parcel$export($25f0c12ee73e61dc$exports, "default", () => $25f0c12ee73e61dc$export$2e2bcd8739ae039, (v) => $25f0c12ee73e61dc$export$2e2bcd8739ae039 = v);
|
|
44
|
+
// noinspection JSUnusedGlobalSymbols
|
|
45
|
+
|
|
46
|
+
async function $b7939aab671e676a$export$8d71c74f97c0202e(command) {
|
|
59
47
|
return new Promise((resolve, reject)=>{
|
|
60
48
|
(0, $cDXzb$child_process.exec)(command, {
|
|
61
49
|
encoding: "binary",
|
|
@@ -76,23 +64,23 @@ async function $564742ddd35242d9$export$8d71c74f97c0202e(command) {
|
|
|
76
64
|
|
|
77
65
|
|
|
78
66
|
|
|
79
|
-
const $
|
|
80
|
-
(0, $cDXzb$lodash.merge)($
|
|
81
|
-
const $
|
|
82
|
-
if (!$
|
|
67
|
+
const $9d2024493eb3a873$export$a7b6bc01c63cdfc3 = {};
|
|
68
|
+
(0, $cDXzb$lodash.merge)($9d2024493eb3a873$export$a7b6bc01c63cdfc3, process.env);
|
|
69
|
+
const $9d2024493eb3a873$export$a7c5707626fc90f = $9d2024493eb3a873$export$a7b6bc01c63cdfc3["HOME"];
|
|
70
|
+
if (!$9d2024493eb3a873$export$a7c5707626fc90f) throw new Error("HOME environment variable is not set");
|
|
83
71
|
|
|
84
72
|
|
|
85
73
|
|
|
86
74
|
|
|
87
75
|
|
|
88
|
-
async function $
|
|
76
|
+
async function $7fc3e7715e6e0e1c$export$2c9faf86071156ae({ path: path , name: name , maxDepth: maxDepth = 2 }) {
|
|
89
77
|
const rootSegments = path.split("/").length;
|
|
90
78
|
const files = [];
|
|
91
79
|
let readdirSync;
|
|
92
80
|
try {
|
|
93
81
|
readdirSync = $cDXzb$fs.readdirSync(path);
|
|
94
82
|
} catch (e) {
|
|
95
|
-
if ((0, $
|
|
83
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log(`Error reading ${path}`, e);
|
|
96
84
|
return [];
|
|
97
85
|
}
|
|
98
86
|
for (const file of readdirSync){
|
|
@@ -101,23 +89,23 @@ async function $80bd1d9d7f29d893$export$2c9faf86071156ae({ path: path , name: na
|
|
|
101
89
|
try {
|
|
102
90
|
stat = $cDXzb$fs.statSync(filePath);
|
|
103
91
|
} catch (e1) {
|
|
104
|
-
if ((0, $
|
|
92
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.error(`Error getting stat for ${filePath}`, e1);
|
|
105
93
|
continue;
|
|
106
94
|
}
|
|
107
95
|
if (stat.isDirectory()) {
|
|
108
96
|
if (filePath.split("/").length < rootSegments + maxDepth) try {
|
|
109
|
-
const subFiles = await $
|
|
97
|
+
const subFiles = await $7fc3e7715e6e0e1c$export$2c9faf86071156ae({
|
|
110
98
|
path: filePath,
|
|
111
99
|
name: name,
|
|
112
100
|
maxDepth: 2
|
|
113
101
|
});
|
|
114
102
|
files.push(...subFiles);
|
|
115
103
|
} catch (e2) {
|
|
116
|
-
if ((0, $
|
|
104
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.error(e2);
|
|
117
105
|
}
|
|
118
106
|
} else if (file === name) files.push(filePath);
|
|
119
107
|
}
|
|
120
|
-
if ((0, $
|
|
108
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) {
|
|
121
109
|
if (files.length > 0) {
|
|
122
110
|
console.log(`Found ${files.length} ${name} files`);
|
|
123
111
|
console.log(files);
|
|
@@ -130,17 +118,17 @@ async function $80bd1d9d7f29d893$export$2c9faf86071156ae({ path: path , name: na
|
|
|
130
118
|
|
|
131
119
|
|
|
132
120
|
|
|
133
|
-
function $
|
|
121
|
+
function $58a2698765abf774$export$bc926c43858bd3cb(obj) {
|
|
134
122
|
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
135
123
|
}
|
|
136
124
|
|
|
137
125
|
|
|
138
|
-
function $
|
|
126
|
+
function $66000764a7232cff$export$963c8d651337e4a4(obj) {
|
|
139
127
|
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
140
128
|
}
|
|
141
129
|
|
|
142
130
|
|
|
143
|
-
function $
|
|
131
|
+
function $9e90da30fe7d2aa3$export$4eadcf0bf35a2ddb(s) {
|
|
144
132
|
const s1 = s.replaceAll(/\./gi, ".");
|
|
145
133
|
const s2 = s1.replace(/%/g, ".*");
|
|
146
134
|
const s3 = s2.replace(/\*/g, ".*");
|
|
@@ -150,60 +138,62 @@ function $0dadf812b76e7b53$export$4eadcf0bf35a2ddb(s) {
|
|
|
150
138
|
|
|
151
139
|
|
|
152
140
|
|
|
153
|
-
class $
|
|
154
|
-
|
|
141
|
+
class $566ff6a7fcff9241$export$2e2bcd8739ae039 {
|
|
142
|
+
constructor(){
|
|
143
|
+
this.browserName = "Chrome";
|
|
144
|
+
}
|
|
155
145
|
async queryCookies(name, domain) {
|
|
156
146
|
if (process.platform !== "darwin") throw new Error("This only works on macOS");
|
|
157
|
-
if ((0, $
|
|
158
|
-
return $
|
|
147
|
+
if ((0, $9d2024493eb3a873$export$a7b6bc01c63cdfc3).FIREFOX_ONLY) return [];
|
|
148
|
+
return $566ff6a7fcff9241$var$getChromeCookies({
|
|
159
149
|
requireJwt: false,
|
|
160
150
|
name: name,
|
|
161
151
|
domain: domain
|
|
162
152
|
});
|
|
163
153
|
}
|
|
164
154
|
}
|
|
165
|
-
async function $
|
|
155
|
+
async function $566ff6a7fcff9241$var$getPromise1(name, domain, file) {
|
|
166
156
|
try {
|
|
167
|
-
return await $
|
|
157
|
+
return await $566ff6a7fcff9241$var$getEncryptedChromeCookie({
|
|
168
158
|
name: name,
|
|
169
159
|
domain: domain,
|
|
170
160
|
file: file
|
|
171
161
|
});
|
|
172
162
|
} catch (e) {
|
|
173
|
-
if ((0, $
|
|
163
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error getting encrypted cookie", e);
|
|
174
164
|
return [];
|
|
175
165
|
}
|
|
176
166
|
}
|
|
177
|
-
async function $
|
|
167
|
+
async function $566ff6a7fcff9241$var$getPromise(name, domain) {
|
|
178
168
|
try {
|
|
179
|
-
const files = await (0, $
|
|
180
|
-
path: $
|
|
169
|
+
const files = await (0, $7fc3e7715e6e0e1c$export$2c9faf86071156ae)({
|
|
170
|
+
path: $566ff6a7fcff9241$var$chromeLocal,
|
|
181
171
|
name: "Cookies"
|
|
182
172
|
});
|
|
183
|
-
const promises = files.map((file)=>$
|
|
173
|
+
const promises = files.map((file)=>$566ff6a7fcff9241$var$getPromise1(name, domain, file));
|
|
184
174
|
const results1 = await Promise.all(promises);
|
|
185
|
-
return results1.flat().filter((0, $
|
|
175
|
+
return results1.flat().filter((0, $58a2698765abf774$export$bc926c43858bd3cb));
|
|
186
176
|
} catch (error) {
|
|
187
|
-
if ((0, $
|
|
177
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("error", error);
|
|
188
178
|
return [];
|
|
189
179
|
}
|
|
190
180
|
}
|
|
191
|
-
async function $
|
|
181
|
+
async function $566ff6a7fcff9241$var$decryptValue(password, encryptedValue) {
|
|
192
182
|
let d;
|
|
193
183
|
try {
|
|
194
|
-
d = await $
|
|
184
|
+
d = await $566ff6a7fcff9241$var$decrypt(password, encryptedValue);
|
|
195
185
|
} catch (e) {
|
|
196
|
-
if ((0, $
|
|
186
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error decrypting cookie", e);
|
|
197
187
|
d = null;
|
|
198
188
|
}
|
|
199
189
|
return d ?? encryptedValue.toString("utf-8");
|
|
200
190
|
}
|
|
201
|
-
async function $
|
|
202
|
-
const encryptedDataItems = await $
|
|
203
|
-
const password = await $
|
|
191
|
+
async function $566ff6a7fcff9241$var$getChromeCookies({ name: name , domain: domain = "%" , requireJwt: requireJwt = false }) {
|
|
192
|
+
const encryptedDataItems = await $566ff6a7fcff9241$var$getPromise(name, domain);
|
|
193
|
+
const password = await $566ff6a7fcff9241$var$getChromePassword();
|
|
204
194
|
const decrypted = encryptedDataItems.filter(({ value: value })=>value != null && value.length > 0).map(async (cookieRow)=>{
|
|
205
195
|
const encryptedValue = cookieRow.value;
|
|
206
|
-
const decryptedValue = await $
|
|
196
|
+
const decryptedValue = await $566ff6a7fcff9241$var$decryptValue(password, encryptedValue);
|
|
207
197
|
const meta = {};
|
|
208
198
|
(0, $cDXzb$lodash.merge)(meta, cookieRow.meta ?? {});
|
|
209
199
|
const exportedCookie = {
|
|
@@ -221,14 +211,14 @@ async function $2863e754fd8bb18c$var$getChromeCookies({ name: name , domain: dom
|
|
|
221
211
|
(0, $cDXzb$lodash.merge)(exportedCookie, mergeExpiry);
|
|
222
212
|
return exportedCookie;
|
|
223
213
|
});
|
|
224
|
-
const results = (await Promise.all(decrypted)).filter((0, $
|
|
225
|
-
if ((0, $
|
|
214
|
+
const results = (await Promise.all(decrypted)).filter((0, $66000764a7232cff$export$963c8d651337e4a4));
|
|
215
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("results", results);
|
|
226
216
|
return results;
|
|
227
217
|
}
|
|
228
|
-
const $
|
|
229
|
-
async function $
|
|
218
|
+
const $566ff6a7fcff9241$var$chromeLocal = $cDXzb$path.join((0, $9d2024493eb3a873$export$a7c5707626fc90f), "Library", "Application Support", "Google", "Chrome");
|
|
219
|
+
async function $566ff6a7fcff9241$var$getEncryptedChromeCookie({ name: name , domain: domain , file: file = $cDXzb$path.join($566ff6a7fcff9241$var$chromeLocal, "Default", "Cookies") }) {
|
|
230
220
|
if (!(0, $cDXzb$fs.existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
231
|
-
if ((0, $
|
|
221
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) {
|
|
232
222
|
const s = file.split("/").slice(-3).join("/");
|
|
233
223
|
console.log(`Trying Chrome (at ${s}) cookie ${name} for domain ${domain}`);
|
|
234
224
|
}
|
|
@@ -254,9 +244,9 @@ async function $2863e754fd8bb18c$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
254
244
|
sql += `host_key LIKE '${sqlEmbedDomain}';`;
|
|
255
245
|
}
|
|
256
246
|
}
|
|
257
|
-
if ((0, $
|
|
258
|
-
const domainRegexp = (0, $
|
|
259
|
-
const sqliteQuery1 = await $
|
|
247
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("sql", sql);
|
|
248
|
+
const domainRegexp = (0, $9e90da30fe7d2aa3$export$4eadcf0bf35a2ddb)(domain);
|
|
249
|
+
const sqliteQuery1 = await $566ff6a7fcff9241$export$bd52b72df8d0d261({
|
|
260
250
|
file: file,
|
|
261
251
|
sql: sql,
|
|
262
252
|
rowFilter: (row)=>{
|
|
@@ -269,7 +259,7 @@ async function $2863e754fd8bb18c$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
269
259
|
name: row["name"],
|
|
270
260
|
value: row["encrypted_value"]
|
|
271
261
|
};
|
|
272
|
-
if ((0, $
|
|
262
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("CookieRow", cookieRow);
|
|
273
263
|
return cookieRow;
|
|
274
264
|
}
|
|
275
265
|
});
|
|
@@ -277,10 +267,10 @@ async function $2863e754fd8bb18c$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
277
267
|
return row.domain.match(domainRegexp) != null;
|
|
278
268
|
});
|
|
279
269
|
}
|
|
280
|
-
async function $
|
|
281
|
-
return (0, $
|
|
270
|
+
async function $566ff6a7fcff9241$var$getChromePassword() {
|
|
271
|
+
return (0, $b7939aab671e676a$export$8d71c74f97c0202e)('security find-generic-password -w -s "Chrome Safe Storage"');
|
|
282
272
|
}
|
|
283
|
-
async function $
|
|
273
|
+
async function $566ff6a7fcff9241$var$decrypt(password, encryptedData) {
|
|
284
274
|
if (typeof password !== "string") throw new Error("password must be a string: " + password);
|
|
285
275
|
let encryptedData1;
|
|
286
276
|
encryptedData1 = encryptedData;
|
|
@@ -288,21 +278,21 @@ async function $2863e754fd8bb18c$var$decrypt(password, encryptedData) {
|
|
|
288
278
|
if (!(encryptedData1 instanceof Buffer)) {
|
|
289
279
|
if (Array.isArray(encryptedData1) && encryptedData1[0] instanceof Buffer) {
|
|
290
280
|
[encryptedData1] = encryptedData1;
|
|
291
|
-
if ((0, $
|
|
281
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log(`encryptedData is an array of buffers, selected first: ${encryptedData1}`);
|
|
292
282
|
} else throw new Error("encryptedData must be a Buffer: " + encryptedData1);
|
|
293
283
|
encryptedData1 = Buffer.from(encryptedData1);
|
|
294
284
|
}
|
|
295
|
-
if ((0, $
|
|
285
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log(`Trying to decrypt with password ${password}`);
|
|
296
286
|
return new Promise((resolve, reject)=>{
|
|
297
287
|
$cDXzb$crypto.pbkdf2(password, "saltysalt", 1003, 16, "sha1", (error, buffer)=>{
|
|
298
288
|
try {
|
|
299
289
|
if (error) {
|
|
300
|
-
if ((0, $
|
|
290
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2", error);
|
|
301
291
|
reject(error);
|
|
302
292
|
return;
|
|
303
293
|
}
|
|
304
294
|
if (buffer.length !== 16) {
|
|
305
|
-
if ((0, $
|
|
295
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, buffer length is not 16", buffer.length);
|
|
306
296
|
reject(new Error("Buffer length is not 16"));
|
|
307
297
|
return;
|
|
308
298
|
}
|
|
@@ -312,7 +302,7 @@ async function $2863e754fd8bb18c$var$decrypt(password, encryptedData) {
|
|
|
312
302
|
decipher.setAutoPadding(false);
|
|
313
303
|
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
314
304
|
if (encryptedData1.length % 16 !== 0) {
|
|
315
|
-
if ((0, $
|
|
305
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
316
306
|
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
317
307
|
return;
|
|
318
308
|
}
|
|
@@ -320,7 +310,7 @@ async function $2863e754fd8bb18c$var$decrypt(password, encryptedData) {
|
|
|
320
310
|
try {
|
|
321
311
|
decipher.final("utf-8");
|
|
322
312
|
} catch (e) {
|
|
323
|
-
if ((0, $
|
|
313
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Error doing decipher.final()", e);
|
|
324
314
|
reject(e);
|
|
325
315
|
return;
|
|
326
316
|
}
|
|
@@ -335,7 +325,7 @@ async function $2863e754fd8bb18c$var$decrypt(password, encryptedData) {
|
|
|
335
325
|
});
|
|
336
326
|
});
|
|
337
327
|
}
|
|
338
|
-
async function $
|
|
328
|
+
async function $566ff6a7fcff9241$export$bd52b72df8d0d261({ file: file , sql: sql , rowFilter: rowFilter = ()=>true , rowTransform: rowTransform }) {
|
|
339
329
|
if (!file || file && !(0, ($parcel$interopDefault($cDXzb$fs))).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
340
330
|
const db = new $cDXzb$sqlite3.Database(file);
|
|
341
331
|
return new Promise((resolve, reject)=>{
|
|
@@ -362,7 +352,7 @@ async function $2863e754fd8bb18c$export$bd52b72df8d0d261({ file: file , sql: sql
|
|
|
362
352
|
resolve(cookieRows);
|
|
363
353
|
return;
|
|
364
354
|
}
|
|
365
|
-
if ((0, $
|
|
355
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
366
356
|
resolve([
|
|
367
357
|
rows1
|
|
368
358
|
]);
|
|
@@ -371,11 +361,15 @@ async function $2863e754fd8bb18c$export$bd52b72df8d0d261({ file: file , sql: sql
|
|
|
371
361
|
}
|
|
372
362
|
|
|
373
363
|
|
|
364
|
+
var $8aa7098b08ded51a$exports = {};
|
|
374
365
|
|
|
366
|
+
$parcel$export($8aa7098b08ded51a$exports, "doSqliteQuery1", () => $8aa7098b08ded51a$export$f19f611d1fa7c6f3, (v) => $8aa7098b08ded51a$export$f19f611d1fa7c6f3 = v);
|
|
367
|
+
$parcel$export($8aa7098b08ded51a$exports, "default", () => $8aa7098b08ded51a$export$2e2bcd8739ae039, (v) => $8aa7098b08ded51a$export$2e2bcd8739ae039 = v);
|
|
375
368
|
|
|
376
369
|
|
|
377
370
|
|
|
378
|
-
|
|
371
|
+
|
|
372
|
+
function $42f062ccbc5d3597$export$da22813e5a2ec500({ name: name , domain: domain }) {
|
|
379
373
|
const wildcardRegexp = /^([*%])$/i;
|
|
380
374
|
return {
|
|
381
375
|
specifiedName: name.match(wildcardRegexp) == null,
|
|
@@ -387,7 +381,13 @@ function $4cf67f382f391bdd$export$da22813e5a2ec500({ name: name , domain: domain
|
|
|
387
381
|
|
|
388
382
|
|
|
389
383
|
|
|
390
|
-
|
|
384
|
+
var $8aa7098b08ded51a$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
385
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
386
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
387
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
388
|
+
};
|
|
389
|
+
var $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_instances, $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_getFirefoxCookie, $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_queryCookiesDb;
|
|
390
|
+
async function $8aa7098b08ded51a$export$f19f611d1fa7c6f3({ file: file , sql: sql , rowTransform: rowTransform }) {
|
|
391
391
|
if (!file || file && !(0, ($parcel$interopDefault($cDXzb$fs))).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
392
392
|
const db = new $cDXzb$sqlite3.Database(file);
|
|
393
393
|
return new Promise((resolve, reject)=>{
|
|
@@ -414,20 +414,23 @@ async function $5df4e8bfccec8ffc$export$f19f611d1fa7c6f3({ file: file , sql: sql
|
|
|
414
414
|
resolve(cookieRows);
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
if ((0, $
|
|
417
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
418
418
|
resolve([
|
|
419
419
|
rows1
|
|
420
420
|
]);
|
|
421
421
|
});
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
-
class $
|
|
425
|
-
|
|
424
|
+
class $8aa7098b08ded51a$export$2e2bcd8739ae039 {
|
|
425
|
+
constructor(){
|
|
426
|
+
$8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_instances.add(this);
|
|
427
|
+
this.browserName = "Firefox";
|
|
428
|
+
}
|
|
426
429
|
async queryCookies(name, domain) {
|
|
427
430
|
if (process.platform !== "darwin") // TODO: implement
|
|
428
431
|
return [];
|
|
429
|
-
if ((0, $
|
|
430
|
-
const cookies = await this
|
|
432
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).browser !== "firefox") return [];
|
|
433
|
+
const cookies = await $8aa7098b08ded51a$var$__classPrivateFieldGet(this, $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_instances, "m", $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_getFirefoxCookie).call(this, {
|
|
431
434
|
name: name,
|
|
432
435
|
domain: domain
|
|
433
436
|
});
|
|
@@ -440,61 +443,62 @@ class $5df4e8bfccec8ffc$export$2e2bcd8739ae039 {
|
|
|
440
443
|
});
|
|
441
444
|
else return [];
|
|
442
445
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
if (specifiedDomain) sql += `host LIKE '${domain1}';`;
|
|
446
|
+
}
|
|
447
|
+
$8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_getFirefoxCookie = async function _FirefoxCookieQueryStrategy_getFirefoxCookie({ name: name , domain: domain } //
|
|
448
|
+
) {
|
|
449
|
+
const files = await (0, $7fc3e7715e6e0e1c$export$2c9faf86071156ae)({
|
|
450
|
+
path: $cDXzb$path.join((0, $9d2024493eb3a873$export$a7c5707626fc90f), "Library", "Application Support", "Firefox", "Profiles"),
|
|
451
|
+
name: "cookies.sqlite"
|
|
452
|
+
});
|
|
453
|
+
const fn = async (file)=>{
|
|
454
|
+
return await $8aa7098b08ded51a$var$__classPrivateFieldGet(this, $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_instances, "m", $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_queryCookiesDb).call(this, file, name, domain);
|
|
455
|
+
};
|
|
456
|
+
const all = await Promise.all(files.map(fn));
|
|
457
|
+
// flatten
|
|
458
|
+
return all.flat();
|
|
459
|
+
}, $8aa7098b08ded51a$var$_FirefoxCookieQueryStrategy_queryCookiesDb = async function _FirefoxCookieQueryStrategy_queryCookiesDb(file, name, domain) {
|
|
460
|
+
if (file && !(0, $cDXzb$fs.existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
461
|
+
let sql;
|
|
462
|
+
//language=SQL
|
|
463
|
+
sql = "SELECT value, name, host FROM moz_cookies";
|
|
464
|
+
const { specifiedName: specifiedName , specifiedDomain: specifiedDomain } = (0, $42f062ccbc5d3597$export$da22813e5a2ec500)({
|
|
465
|
+
name: name,
|
|
466
|
+
domain: domain
|
|
467
|
+
});
|
|
468
|
+
if (specifiedName || specifiedDomain) {
|
|
469
|
+
sql += ` WHERE `;
|
|
470
|
+
if (specifiedName) {
|
|
471
|
+
sql += `name = '${name}'`;
|
|
472
|
+
if (specifiedDomain) sql += ` AND `;
|
|
472
473
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
474
|
+
if (specifiedDomain) sql += `host LIKE '${domain}';`;
|
|
475
|
+
}
|
|
476
|
+
const rowTransform = (row)=>{
|
|
477
|
+
// row is object key by column name
|
|
478
|
+
const value = row.value;
|
|
479
|
+
return {
|
|
480
|
+
domain: row.domain,
|
|
481
|
+
name: row.name,
|
|
482
|
+
value: Buffer.from(value, "utf8")
|
|
481
483
|
};
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
484
|
+
};
|
|
485
|
+
try {
|
|
486
|
+
return await $8aa7098b08ded51a$export$f19f611d1fa7c6f3({
|
|
487
|
+
file: file,
|
|
488
|
+
sql: sql,
|
|
489
|
+
rowTransform: rowTransform
|
|
490
|
+
});
|
|
491
|
+
} catch (e) {
|
|
492
|
+
console.error(`Error querying ${file}`, e);
|
|
493
|
+
return [];
|
|
492
494
|
}
|
|
493
|
-
}
|
|
495
|
+
};
|
|
494
496
|
|
|
495
497
|
|
|
496
|
-
class $
|
|
497
|
-
|
|
498
|
+
class $faff8ec0456ffd67$export$2e2bcd8739ae039 {
|
|
499
|
+
constructor(){
|
|
500
|
+
this.browserName = "Safari";
|
|
501
|
+
}
|
|
498
502
|
async queryCookies(name, domain) {
|
|
499
503
|
// TODO: implement
|
|
500
504
|
return [];
|
|
@@ -503,6 +507,9 @@ class $0ca9bb20e90816f9$export$2e2bcd8739ae039 {
|
|
|
503
507
|
|
|
504
508
|
|
|
505
509
|
|
|
510
|
+
var $7e8eb419ff358e59$exports = {};
|
|
511
|
+
|
|
512
|
+
$parcel$export($7e8eb419ff358e59$exports, "default", () => $7e8eb419ff358e59$export$2e2bcd8739ae039, (v) => $7e8eb419ff358e59$export$2e2bcd8739ae039 = v);
|
|
506
513
|
|
|
507
514
|
|
|
508
515
|
|
|
@@ -510,11 +517,11 @@ class $0ca9bb20e90816f9$export$2e2bcd8739ae039 {
|
|
|
510
517
|
|
|
511
518
|
|
|
512
519
|
|
|
513
|
-
class $
|
|
514
|
-
synchronous = false;
|
|
515
|
-
tasks = [];
|
|
520
|
+
class $271ff8d920f87f7d$export$55374e421ca433de extends (0, $cDXzb$toughcookie.Store) {
|
|
516
521
|
constructor(filePath, internalStore = new (0, $cDXzb$toughcookie.MemoryCookieStore)()){
|
|
517
522
|
super();
|
|
523
|
+
this.synchronous = false;
|
|
524
|
+
this.tasks = [];
|
|
518
525
|
this.filePath = filePath;
|
|
519
526
|
this.internalStore = internalStore ?? new (0, $cDXzb$toughcookie.MemoryCookieStore)();
|
|
520
527
|
console.log("Importing cookies from", filePath, internalStore);
|
|
@@ -615,30 +622,39 @@ class $30e4b5d3291f1a19$export$55374e421ca433de extends (0, $cDXzb$toughcookie.S
|
|
|
615
622
|
}
|
|
616
623
|
|
|
617
624
|
|
|
618
|
-
const $
|
|
619
|
-
async function $
|
|
620
|
-
if ((0, $
|
|
621
|
-
const fileCookieStore = new (0, $
|
|
625
|
+
const $a760d3ef25183bab$var$memoryCookieStore = new (0, $cDXzb$toughcookie.MemoryCookieStore)();
|
|
626
|
+
async function $a760d3ef25183bab$var$getCookieStore() {
|
|
627
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b)["cs"] == "memory") return $a760d3ef25183bab$var$memoryCookieStore;
|
|
628
|
+
const fileCookieStore = new (0, $271ff8d920f87f7d$export$55374e421ca433de)(`${(0, $9d2024493eb3a873$export$a7b6bc01c63cdfc3)["HOME"]}/cookie-star.json`, $a760d3ef25183bab$var$memoryCookieStore);
|
|
622
629
|
await fileCookieStore.waitUntilIdle();
|
|
623
630
|
return fileCookieStore;
|
|
624
631
|
}
|
|
625
|
-
const $
|
|
626
|
-
$
|
|
632
|
+
const $a760d3ef25183bab$export$2c043f03eceff4e8 = new Promise((resolve)=>{
|
|
633
|
+
$a760d3ef25183bab$var$getCookieStore().then(resolve);
|
|
627
634
|
});
|
|
628
|
-
const $
|
|
629
|
-
$
|
|
635
|
+
const $a760d3ef25183bab$export$eced8873dedbb4c0 = new Promise((resolve)=>{
|
|
636
|
+
$a760d3ef25183bab$export$2c043f03eceff4e8.then((store)=>new (0, $cDXzb$toughcookie.CookieJar)(store)).then(resolve);
|
|
630
637
|
});
|
|
631
638
|
|
|
632
639
|
|
|
633
640
|
|
|
634
|
-
|
|
635
|
-
|
|
641
|
+
var $7e8eb419ff358e59$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
642
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
643
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
644
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
645
|
+
};
|
|
646
|
+
var $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_extracted, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getCookies, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getAllCookies;
|
|
647
|
+
class $7e8eb419ff358e59$export$2e2bcd8739ae039 {
|
|
648
|
+
constructor(){
|
|
649
|
+
$7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances.add(this);
|
|
650
|
+
this.browserName = "internal";
|
|
651
|
+
}
|
|
636
652
|
async queryCookies(name, domain) {
|
|
637
653
|
const exportedCookies = [];
|
|
638
654
|
// if (name.match(/[%*]/) || domain.match(/[%*]/)) {
|
|
639
|
-
const cookies = await this
|
|
655
|
+
const cookies = await $7e8eb419ff358e59$var$__classPrivateFieldGet(this, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances, "m", $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getAllCookies).call(this);
|
|
640
656
|
const allExportedCookies = cookies.map((cookie)=>{
|
|
641
|
-
return this
|
|
657
|
+
return $7e8eb419ff358e59$var$__classPrivateFieldGet(this, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances, "m", $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_extracted).call(this, cookie, {
|
|
642
658
|
name: name,
|
|
643
659
|
domain: domain
|
|
644
660
|
});
|
|
@@ -652,9 +668,9 @@ class $7fc5b30fe5c37771$export$2e2bcd8739ae039 {
|
|
|
652
668
|
const domain1 = domain.match(/(\w+.+\w+)/gi)?.pop() ?? domain;
|
|
653
669
|
const url = new URL("https://" + domain1);
|
|
654
670
|
url.pathname = path;
|
|
655
|
-
const cookies1 = await this
|
|
671
|
+
const cookies1 = await $7e8eb419ff358e59$var$__classPrivateFieldGet(this, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances, "m", $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getCookies).call(this, url.href);
|
|
656
672
|
const domainCookies = cookies1.map((cookie)=>{
|
|
657
|
-
return this
|
|
673
|
+
return $7e8eb419ff358e59$var$__classPrivateFieldGet(this, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances, "m", $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_extracted).call(this, cookie, {
|
|
658
674
|
domain: domain,
|
|
659
675
|
name: name
|
|
660
676
|
});
|
|
@@ -662,71 +678,81 @@ class $7fc5b30fe5c37771$export$2e2bcd8739ae039 {
|
|
|
662
678
|
exportedCookies.push(...domainCookies);
|
|
663
679
|
}
|
|
664
680
|
if (name == "%") return exportedCookies.filter((cookie)=>{
|
|
665
|
-
return cookie.domain.match((0, $
|
|
681
|
+
return cookie.domain.match((0, $9e90da30fe7d2aa3$export$4eadcf0bf35a2ddb)(domain));
|
|
666
682
|
});
|
|
667
683
|
return exportedCookies.filter((cookie)=>{
|
|
668
|
-
return cookie.name.match((0, $
|
|
684
|
+
return cookie.name.match((0, $9e90da30fe7d2aa3$export$4eadcf0bf35a2ddb)(name)) && cookie.domain.match((0, $9e90da30fe7d2aa3$export$4eadcf0bf35a2ddb)(domain));
|
|
669
685
|
});
|
|
670
686
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
});
|
|
687
|
+
}
|
|
688
|
+
$7e8eb419ff358e59$var$_CookieStoreQueryStrategy_instances = new WeakSet(), $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_extracted = function _CookieStoreQueryStrategy_extracted(cookie, cookieSpec) {
|
|
689
|
+
return {
|
|
690
|
+
domain: cookie.domain ?? cookieSpec.domain,
|
|
691
|
+
name: cookie.key ?? cookieSpec.name,
|
|
692
|
+
value: cookie.value,
|
|
693
|
+
expiry: cookie.expires ?? "Infinity",
|
|
694
|
+
meta: {
|
|
695
|
+
file: "tough-cookie"
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
}, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getCookies = async function _CookieStoreQueryStrategy_getCookies(url) {
|
|
699
|
+
const cookieJar = await (0, $a760d3ef25183bab$export$eced8873dedbb4c0);
|
|
700
|
+
return new Promise((resolve, reject)=>{
|
|
701
|
+
return cookieJar.getCookies(url, (err, cookies)=>{
|
|
702
|
+
if (err) reject(err);
|
|
703
|
+
else resolve(cookies ?? []);
|
|
689
704
|
});
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
});
|
|
705
|
+
});
|
|
706
|
+
}, $7e8eb419ff358e59$var$_CookieStoreQueryStrategy_getAllCookies = async function _CookieStoreQueryStrategy_getAllCookies() {
|
|
707
|
+
const cookieStore = await (0, $a760d3ef25183bab$export$2c043f03eceff4e8);
|
|
708
|
+
return new Promise((resolve, reject)=>{
|
|
709
|
+
return cookieStore.getAllCookies((err, cookies)=>{
|
|
710
|
+
if (err) reject(err);
|
|
711
|
+
else resolve(cookies ?? []);
|
|
698
712
|
});
|
|
699
|
-
}
|
|
700
|
-
}
|
|
713
|
+
});
|
|
714
|
+
};
|
|
701
715
|
|
|
702
716
|
|
|
703
717
|
|
|
704
718
|
|
|
705
719
|
|
|
706
|
-
|
|
720
|
+
var $25f0c12ee73e61dc$var$__classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
721
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
722
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
723
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
724
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
725
|
+
};
|
|
726
|
+
var $25f0c12ee73e61dc$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
727
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
728
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
729
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
730
|
+
};
|
|
731
|
+
var $25f0c12ee73e61dc$var$_CompositeCookieQueryStrategy_strategies;
|
|
732
|
+
const $25f0c12ee73e61dc$var$cache = new (0, ($parcel$interopDefault($cDXzb$lrucache)))({
|
|
707
733
|
ttl: 2000,
|
|
708
734
|
max: 10
|
|
709
735
|
});
|
|
710
|
-
class $
|
|
711
|
-
browserName = "all";
|
|
712
|
-
#strategies;
|
|
736
|
+
class $25f0c12ee73e61dc$export$2e2bcd8739ae039 {
|
|
713
737
|
constructor(){
|
|
714
|
-
this
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
(0, $
|
|
718
|
-
(0, $
|
|
738
|
+
this.browserName = "all";
|
|
739
|
+
$25f0c12ee73e61dc$var$_CompositeCookieQueryStrategy_strategies.set(this, void 0);
|
|
740
|
+
$25f0c12ee73e61dc$var$__classPrivateFieldSet(this, $25f0c12ee73e61dc$var$_CompositeCookieQueryStrategy_strategies, [
|
|
741
|
+
(0, $7e8eb419ff358e59$exports.default),
|
|
742
|
+
(0, $566ff6a7fcff9241$export$2e2bcd8739ae039),
|
|
743
|
+
(0, $8aa7098b08ded51a$exports.default),
|
|
744
|
+
(0, $faff8ec0456ffd67$export$2e2bcd8739ae039)
|
|
719
745
|
].map((strategy)=>{
|
|
720
746
|
return new strategy();
|
|
721
|
-
});
|
|
747
|
+
}), "f");
|
|
722
748
|
}
|
|
723
749
|
async queryCookies(name, domain) {
|
|
724
750
|
// domain = domain.match(/(\w+.+\w+)/gi)?.pop() ?? domain;
|
|
725
751
|
const key = `${name}:${domain}`;
|
|
726
|
-
const cached = $
|
|
752
|
+
const cached = $25f0c12ee73e61dc$var$cache.get(key);
|
|
727
753
|
if (cached) return cached;
|
|
728
|
-
if ((0, $
|
|
729
|
-
const results = await Promise.all(this
|
|
754
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log("Querying cookies:", name, domain);
|
|
755
|
+
const results = await Promise.all($25f0c12ee73e61dc$var$__classPrivateFieldGet(this, $25f0c12ee73e61dc$var$_CompositeCookieQueryStrategy_strategies, "f").map(async (strategy)=>{
|
|
730
756
|
// @ts-ignore
|
|
731
757
|
return strategy.queryCookies(name, domain).then((cookies)=>{
|
|
732
758
|
return cookies.map((cookie)=>{
|
|
@@ -742,20 +768,21 @@ class $9b213ca499318f10$export$2e2bcd8739ae039 {
|
|
|
742
768
|
});
|
|
743
769
|
}));
|
|
744
770
|
const flat = results.flat();
|
|
745
|
-
$
|
|
771
|
+
$25f0c12ee73e61dc$var$cache.set(`${name}:${domain}`, flat);
|
|
746
772
|
return flat;
|
|
747
773
|
}
|
|
748
774
|
}
|
|
775
|
+
$25f0c12ee73e61dc$var$_CompositeCookieQueryStrategy_strategies = new WeakMap();
|
|
749
776
|
|
|
750
777
|
|
|
751
778
|
|
|
752
779
|
|
|
753
|
-
function $
|
|
780
|
+
function $1436e053d2eaa797$export$2e2bcd8739ae039(token) {
|
|
754
781
|
try {
|
|
755
782
|
const result = (0, ($parcel$interopDefault($cDXzb$jsonwebtoken))).decode(token, {
|
|
756
783
|
complete: true
|
|
757
784
|
});
|
|
758
|
-
if ((0, $
|
|
785
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose && result) console.log(result);
|
|
759
786
|
const payload = result?.payload;
|
|
760
787
|
if (payload) {
|
|
761
788
|
const exp = payload.exp;
|
|
@@ -771,27 +798,27 @@ function $02c6d50814f70012$export$2e2bcd8739ae039(token) {
|
|
|
771
798
|
}
|
|
772
799
|
|
|
773
800
|
|
|
774
|
-
async function $
|
|
801
|
+
async function $8b1cf34eddfb2268$export$e6d428437cf2cacb({ name: name , domain: domain }, strategy = new (0, $25f0c12ee73e61dc$exports.default)()) {
|
|
775
802
|
const results = await strategy.queryCookies(name, domain);
|
|
776
803
|
const allCookies = (0, $cDXzb$lodash.uniqBy)(results, JSON.stringify);
|
|
777
|
-
if ((0, $
|
|
804
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b)["require-jwt"]) {
|
|
778
805
|
const jwtCookies = [];
|
|
779
806
|
for (const result of allCookies){
|
|
780
807
|
const value = result.value;
|
|
781
|
-
if ((0, $
|
|
808
|
+
if ((0, $1436e053d2eaa797$export$2e2bcd8739ae039)(value)) jwtCookies.push(result);
|
|
782
809
|
}
|
|
783
|
-
return (0, $
|
|
810
|
+
return (0, $7157583128e389c3$export$c348dfaf65040d9b)["single"] ? [
|
|
784
811
|
jwtCookies[0]
|
|
785
812
|
] : jwtCookies;
|
|
786
|
-
} else return (0, $
|
|
813
|
+
} else return (0, $7157583128e389c3$export$c348dfaf65040d9b)["single"] ? [
|
|
787
814
|
allCookies[0]
|
|
788
815
|
] : allCookies;
|
|
789
816
|
}
|
|
790
817
|
|
|
791
818
|
|
|
792
819
|
|
|
793
|
-
async function $
|
|
794
|
-
const cookies = await (0, $
|
|
820
|
+
async function $d281d3a55494cb83$export$4be65e66cfa2648a(params) {
|
|
821
|
+
const cookies = await (0, $8b1cf34eddfb2268$export$e6d428437cf2cacb)(params, new (0, $25f0c12ee73e61dc$exports.default)());
|
|
795
822
|
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
796
823
|
else throw new Error("Cookie not found");
|
|
797
824
|
}
|
|
@@ -800,17 +827,17 @@ async function $5059c79c511ef67d$export$4be65e66cfa2648a(params) {
|
|
|
800
827
|
|
|
801
828
|
|
|
802
829
|
|
|
803
|
-
async function $
|
|
804
|
-
const cookies = await (0, $
|
|
830
|
+
async function $52913203ed6cd470$export$e5637297e9eb6f2e(params) {
|
|
831
|
+
const cookies = await (0, $8b1cf34eddfb2268$export$e6d428437cf2cacb)(params, new (0, $566ff6a7fcff9241$export$2e2bcd8739ae039)());
|
|
805
832
|
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
806
|
-
return cookies.find((0, $
|
|
833
|
+
return cookies.find((0, $66000764a7232cff$export$963c8d651337e4a4));
|
|
807
834
|
}
|
|
808
835
|
|
|
809
836
|
|
|
810
837
|
|
|
811
838
|
|
|
812
|
-
async function $
|
|
813
|
-
const cookies = await (0, $
|
|
839
|
+
async function $e815b5ca89da9daf$export$c44c5fdef43f0941(params) {
|
|
840
|
+
const cookies = await (0, $8b1cf34eddfb2268$export$e6d428437cf2cacb)(params, new (0, $8aa7098b08ded51a$exports.default)());
|
|
814
841
|
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
815
842
|
else throw new Error("Cookie not found");
|
|
816
843
|
}
|
|
@@ -818,7 +845,7 @@ async function $2c9cc1b8a57118d9$export$c44c5fdef43f0941(params) {
|
|
|
818
845
|
|
|
819
846
|
|
|
820
847
|
|
|
821
|
-
function $
|
|
848
|
+
function $664bd69618c869a2$export$9abc0a414b0d8b8f(results) {
|
|
822
849
|
// sort by name and expiry descending
|
|
823
850
|
// takes the latest expiry for each name
|
|
824
851
|
const orderedResults = (0, $cDXzb$lodash.orderBy)(results, [
|
|
@@ -834,41 +861,42 @@ function $146fc82c45a46a88$export$9abc0a414b0d8b8f(results) {
|
|
|
834
861
|
|
|
835
862
|
|
|
836
863
|
|
|
837
|
-
async function $
|
|
864
|
+
async function $024af89e32b5c6e2$export$a65902517ae87ba8(cookieSpec) {
|
|
838
865
|
const cookies = [];
|
|
839
866
|
if (Array.isArray(cookieSpec)) {
|
|
840
867
|
const results = await Promise.all(cookieSpec.map((cs)=>{
|
|
841
|
-
return (0, $
|
|
868
|
+
return (0, $8b1cf34eddfb2268$export$e6d428437cf2cacb)(cs);
|
|
842
869
|
}));
|
|
843
870
|
for (const exportedCookie of results.flat())cookies.push(exportedCookie);
|
|
844
871
|
} else {
|
|
845
|
-
const singleQuery = await (0, $
|
|
872
|
+
const singleQuery = await (0, $8b1cf34eddfb2268$export$e6d428437cf2cacb)(cookieSpec);
|
|
846
873
|
cookies.push(...singleQuery);
|
|
847
874
|
}
|
|
848
875
|
return (0, $cDXzb$lodash.uniqBy)(cookies, JSON.stringify);
|
|
849
876
|
}
|
|
850
877
|
|
|
851
878
|
|
|
852
|
-
async function $
|
|
853
|
-
const cookies = await (0, $
|
|
879
|
+
async function $429525b331c0e3ef$export$4d2e9997e2c23417(cookieSpec) {
|
|
880
|
+
const cookies = await (0, $024af89e32b5c6e2$export$a65902517ae87ba8)(cookieSpec);
|
|
854
881
|
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
855
882
|
const groupedByFile = (0, $cDXzb$lodash.groupBy)(cookies, (r)=>r.meta?.file);
|
|
856
883
|
return Object.keys(groupedByFile).map((file)=>{
|
|
857
884
|
const results = groupedByFile[file];
|
|
858
|
-
return (0, $
|
|
885
|
+
return (0, $664bd69618c869a2$export$9abc0a414b0d8b8f)(results);
|
|
859
886
|
});
|
|
860
887
|
}
|
|
861
888
|
|
|
862
889
|
|
|
863
890
|
|
|
864
891
|
|
|
865
|
-
async function $
|
|
866
|
-
const cookies = await (0, $
|
|
867
|
-
if (cookies.length > 0) return (0, $
|
|
892
|
+
async function $0ac28e04b308724d$export$cfc0723de5712e57(cookieSpec) {
|
|
893
|
+
const cookies = await (0, $024af89e32b5c6e2$export$a65902517ae87ba8)(cookieSpec);
|
|
894
|
+
if (cookies.length > 0) return (0, $664bd69618c869a2$export$9abc0a414b0d8b8f)(cookies);
|
|
868
895
|
return "";
|
|
869
896
|
}
|
|
870
897
|
|
|
871
898
|
|
|
899
|
+
// noinspection JSUnusedGlobalSymbols,ExceptionCaughtLocallyJS
|
|
872
900
|
|
|
873
901
|
|
|
874
902
|
|
|
@@ -878,7 +906,7 @@ async function $01a8b57f5e2fbc3a$export$cfc0723de5712e57(cookieSpec) {
|
|
|
878
906
|
|
|
879
907
|
|
|
880
908
|
|
|
881
|
-
function $
|
|
909
|
+
function $ab89e6095fce7dcd$export$f266452a5050185d(url) {
|
|
882
910
|
const url1 = typeof url == "string" ? new URL(url) : url;
|
|
883
911
|
const cookieSpecs = [];
|
|
884
912
|
const splits = url1.hostname.split(".");
|
|
@@ -903,14 +931,14 @@ function $2788377d65b088d2$export$f266452a5050185d(url) {
|
|
|
903
931
|
}
|
|
904
932
|
|
|
905
933
|
|
|
906
|
-
const $
|
|
907
|
-
async function $
|
|
934
|
+
const $9f9fb10cbd238704$var$userAgent = new (0, ($parcel$interopDefault($cDXzb$useragents)))().toString();
|
|
935
|
+
async function $9f9fb10cbd238704$export$b24a545a0b39f491(url, options = {}, fetch = (0, $cDXzb$crossfetch.fetch), originalRequest) {
|
|
908
936
|
const originalRequest1 = originalRequest || {
|
|
909
937
|
url: url,
|
|
910
938
|
options: options
|
|
911
939
|
};
|
|
912
940
|
const headers = {
|
|
913
|
-
"User-Agent": $
|
|
941
|
+
"User-Agent": $9f9fb10cbd238704$var$userAgent
|
|
914
942
|
};
|
|
915
943
|
const defaultOptions = {
|
|
916
944
|
headers: headers,
|
|
@@ -918,9 +946,9 @@ async function $9784c2ab321f9dab$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
918
946
|
};
|
|
919
947
|
const url2 = `${url}`;
|
|
920
948
|
const url1 = new URL(url2);
|
|
921
|
-
const cookieSpecs = (0, $
|
|
922
|
-
headers["Cookie"] = await (0, $
|
|
923
|
-
if ((0, $
|
|
949
|
+
const cookieSpecs = (0, $ab89e6095fce7dcd$export$f266452a5050185d)(url1);
|
|
950
|
+
headers["Cookie"] = await (0, $0ac28e04b308724d$export$cfc0723de5712e57)(cookieSpecs).catch(()=>"");
|
|
951
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b)["dump-request-headers"]) {
|
|
924
952
|
console.log((0, $cDXzb$colorette.redBright)("Request URL:"), url1.href);
|
|
925
953
|
console.log((0, $cDXzb$colorette.blue)("Request headers:"), headers);
|
|
926
954
|
}
|
|
@@ -937,17 +965,17 @@ async function $9784c2ab321f9dab$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
937
965
|
]);
|
|
938
966
|
});
|
|
939
967
|
for (const [key, value] of headers1)if (key === "set-cookie") {
|
|
940
|
-
const cookieJar1 = await (0, $
|
|
968
|
+
const cookieJar1 = await (0, $a760d3ef25183bab$export$eced8873dedbb4c0);
|
|
941
969
|
await cookieJar1.setCookie(value, url2);
|
|
942
|
-
if ((0, $
|
|
970
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log((0, $cDXzb$colorette.blue)(`Set-Cookie:`), (0, $cDXzb$colorette.yellow)(value), (0, $cDXzb$colorette.yellow)(url2));
|
|
943
971
|
}
|
|
944
972
|
const newUrl = res.headers.get("location") ?? res.url;
|
|
945
973
|
// const sameHost = new URL(newUrl).host === url1.host;
|
|
946
974
|
if (res.status == 301 || res.status == 302) // follow the redirect
|
|
947
975
|
{
|
|
948
976
|
if (newUrl && newUrl !== url2) {
|
|
949
|
-
if ((0, $
|
|
950
|
-
return $
|
|
977
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose || (0, $7157583128e389c3$export$c348dfaf65040d9b)["dump-response-headers"]) console.log((0, $cDXzb$colorette.blue)(`Redirected to `), (0, $cDXzb$colorette.yellow)(newUrl));
|
|
978
|
+
return $9f9fb10cbd238704$export$b24a545a0b39f491(//
|
|
951
979
|
newUrl, newOptions1, fetch, originalRequest1);
|
|
952
980
|
}
|
|
953
981
|
}
|
|
@@ -972,8 +1000,8 @@ async function $9784c2ab321f9dab$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
972
1000
|
(0, $cDXzb$lodash.merge)(newOptions2, newOptions1);
|
|
973
1001
|
break;
|
|
974
1002
|
}
|
|
975
|
-
if ((0, $
|
|
976
|
-
return $
|
|
1003
|
+
if ((0, $7157583128e389c3$export$c348dfaf65040d9b).verbose) console.log((0, $cDXzb$colorette.blue)(`Redirected to `), (0, $cDXzb$colorette.yellow)(newUrl));
|
|
1004
|
+
return $9f9fb10cbd238704$export$b24a545a0b39f491(//
|
|
977
1005
|
newUrl, newOptions2, fetch, originalRequest1);
|
|
978
1006
|
}
|
|
979
1007
|
const arrayBuffer1 = res.arrayBuffer();
|
|
@@ -1010,18 +1038,6 @@ async function $9784c2ab321f9dab$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
1010
1038
|
}
|
|
1011
1039
|
|
|
1012
1040
|
|
|
1013
|
-
var $36f7eea49875091b$exports = {};
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
var $80f8b323ce8fd8b7$exports = {};
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
var $bf28d13de48682c5$exports = {};
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
$parcel$exportWildcard(module.exports, $36f7eea49875091b$exports);
|
|
1023
|
-
$parcel$exportWildcard(module.exports, $80f8b323ce8fd8b7$exports);
|
|
1024
|
-
$parcel$exportWildcard(module.exports, $bf28d13de48682c5$exports);
|
|
1025
1041
|
|
|
1026
1042
|
|
|
1027
1043
|
//# sourceMappingURL=index.js.map
|