@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/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env ts-node
|
|
2
2
|
var $cMsgG$lodash = require("lodash");
|
|
3
3
|
var $cMsgG$minimist = require("minimist");
|
|
4
4
|
var $cMsgG$tty = require("tty");
|
|
@@ -13,23 +13,27 @@ var $cMsgG$path = require("path");
|
|
|
13
13
|
var $cMsgG$sqlite3 = require("sqlite3");
|
|
14
14
|
var $cMsgG$child_process = require("child_process");
|
|
15
15
|
var $cMsgG$jsonwebtoken = require("jsonwebtoken");
|
|
16
|
+
var $cMsgG$consola = require("consola");
|
|
16
17
|
|
|
17
18
|
function $parcel$interopDefault(a) {
|
|
18
19
|
return a && a.__esModule ? a.default : a;
|
|
19
20
|
}
|
|
21
|
+
function $parcel$export(e, n, v, s) {
|
|
22
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
23
|
+
}
|
|
20
24
|
|
|
21
25
|
|
|
22
|
-
const $
|
|
23
|
-
const $
|
|
24
|
-
const $
|
|
26
|
+
const $c731a22a41036768$export$6f4ae1207c703045 = process.argv ?? [];
|
|
27
|
+
const $c731a22a41036768$var$minimistArgs = (0, ($parcel$interopDefault($cMsgG$minimist)))($c731a22a41036768$export$6f4ae1207c703045.slice(2));
|
|
28
|
+
const $c731a22a41036768$var$defaultOptions = {
|
|
25
29
|
verbose: false
|
|
26
30
|
};
|
|
27
|
-
const $
|
|
31
|
+
const $c731a22a41036768$export$c348dfaf65040d9b = (0, $cMsgG$lodash.merge)($c731a22a41036768$var$defaultOptions, $c731a22a41036768$var$minimistArgs);
|
|
28
32
|
|
|
29
33
|
|
|
30
34
|
|
|
31
35
|
|
|
32
|
-
const { env: $14c38dc11beadfaf$var$env = {} , argv: $14c38dc11beadfaf$var$argv = [] , platform: $14c38dc11beadfaf$var$platform = ""
|
|
36
|
+
const { env: $14c38dc11beadfaf$var$env = {} , argv: $14c38dc11beadfaf$var$argv = [] , platform: $14c38dc11beadfaf$var$platform = "" } = typeof process === "undefined" ? {} : process;
|
|
33
37
|
const $14c38dc11beadfaf$var$isDisabled = "NO_COLOR" in $14c38dc11beadfaf$var$env || $14c38dc11beadfaf$var$argv.includes("--no-color");
|
|
34
38
|
const $14c38dc11beadfaf$var$isForced = "FORCE_COLOR" in $14c38dc11beadfaf$var$env || $14c38dc11beadfaf$var$argv.includes("--color");
|
|
35
39
|
const $14c38dc11beadfaf$var$isWindows = $14c38dc11beadfaf$var$platform === "win32";
|
|
@@ -88,11 +92,11 @@ const $14c38dc11beadfaf$export$fc3cc093e161d064 = ({ useColor: useColor = $14c38
|
|
|
88
92
|
...colors,
|
|
89
93
|
[key]: String
|
|
90
94
|
}), {});
|
|
91
|
-
const { reset: $14c38dc11beadfaf$export$aad8462122ac592b , bold: $14c38dc11beadfaf$export$73ba5813cda80a49 , dim: $14c38dc11beadfaf$export$c96e90b4bcb7d4ca , italic: $14c38dc11beadfaf$export$5540da1282cbf565 , underline: $14c38dc11beadfaf$export$425327af25286e5e , inverse: $14c38dc11beadfaf$export$70ae2c07e401031b , hidden: $14c38dc11beadfaf$export$73920f18ca706874 , strikethrough: $14c38dc11beadfaf$export$19426ff118fe8be , black: $14c38dc11beadfaf$export$c073df10e766abfa , red: $14c38dc11beadfaf$export$a90204d1394caf30 , green: $14c38dc11beadfaf$export$955a2ebd2fb142ae , yellow: $14c38dc11beadfaf$export$594c5a8758200c32 , blue: $14c38dc11beadfaf$export$2aa0182783e7e9de , magenta: $14c38dc11beadfaf$export$2a9ca2e383622e18 , cyan: $14c38dc11beadfaf$export$7474046f446842ee , white: $14c38dc11beadfaf$export$8fa4e5556fd77a60 , gray: $14c38dc11beadfaf$export$3e2c219d3ab79d01 , bgBlack: $14c38dc11beadfaf$export$a91ca5b79f5fb26c , bgRed: $14c38dc11beadfaf$export$74a89e4512e7c91 , bgGreen: $14c38dc11beadfaf$export$8137d14243d019b3 , bgYellow: $14c38dc11beadfaf$export$3d3dcf8beff00fe1 , bgBlue: $14c38dc11beadfaf$export$ec69fb4048854b4 , bgMagenta: $14c38dc11beadfaf$export$76507b7995de3038 , bgCyan: $14c38dc11beadfaf$export$1b1236a85ae1b824 , bgWhite: $14c38dc11beadfaf$export$2fbae6ef3123e0b0 , blackBright: $14c38dc11beadfaf$export$c442bbc3ef058f3e , redBright: $14c38dc11beadfaf$export$6f940151fac4d6e4 , greenBright: $14c38dc11beadfaf$export$9e103086f7204459 , yellowBright: $14c38dc11beadfaf$export$106f17ac3545b17c , blueBright: $14c38dc11beadfaf$export$7aa4c9ef25eb1086 , magentaBright: $14c38dc11beadfaf$export$76b6abffe88e3179 , cyanBright: $14c38dc11beadfaf$export$c609d1d25ac1cc71 , whiteBright: $14c38dc11beadfaf$export$38b81c3a7de495d7 , bgBlackBright: $14c38dc11beadfaf$export$5c9c56f63b47e15b , bgRedBright: $14c38dc11beadfaf$export$26735259ab854b4f , bgGreenBright: $14c38dc11beadfaf$export$d5483c19744b2fc2 , bgYellowBright: $14c38dc11beadfaf$export$f8c17ad4aac14a99 , bgBlueBright: $14c38dc11beadfaf$export$6038eb5fdc315c12 , bgMagentaBright: $14c38dc11beadfaf$export$41148066f4812842 , bgCyanBright: $14c38dc11beadfaf$export$eb0dc7973d30eea7 , bgWhiteBright: $14c38dc11beadfaf$export$fde769fa8262c0d6
|
|
95
|
+
const { reset: $14c38dc11beadfaf$export$aad8462122ac592b , bold: $14c38dc11beadfaf$export$73ba5813cda80a49 , dim: $14c38dc11beadfaf$export$c96e90b4bcb7d4ca , italic: $14c38dc11beadfaf$export$5540da1282cbf565 , underline: $14c38dc11beadfaf$export$425327af25286e5e , inverse: $14c38dc11beadfaf$export$70ae2c07e401031b , hidden: $14c38dc11beadfaf$export$73920f18ca706874 , strikethrough: $14c38dc11beadfaf$export$19426ff118fe8be , black: $14c38dc11beadfaf$export$c073df10e766abfa , red: $14c38dc11beadfaf$export$a90204d1394caf30 , green: $14c38dc11beadfaf$export$955a2ebd2fb142ae , yellow: $14c38dc11beadfaf$export$594c5a8758200c32 , blue: $14c38dc11beadfaf$export$2aa0182783e7e9de , magenta: $14c38dc11beadfaf$export$2a9ca2e383622e18 , cyan: $14c38dc11beadfaf$export$7474046f446842ee , white: $14c38dc11beadfaf$export$8fa4e5556fd77a60 , gray: $14c38dc11beadfaf$export$3e2c219d3ab79d01 , bgBlack: $14c38dc11beadfaf$export$a91ca5b79f5fb26c , bgRed: $14c38dc11beadfaf$export$74a89e4512e7c91 , bgGreen: $14c38dc11beadfaf$export$8137d14243d019b3 , bgYellow: $14c38dc11beadfaf$export$3d3dcf8beff00fe1 , bgBlue: $14c38dc11beadfaf$export$ec69fb4048854b4 , bgMagenta: $14c38dc11beadfaf$export$76507b7995de3038 , bgCyan: $14c38dc11beadfaf$export$1b1236a85ae1b824 , bgWhite: $14c38dc11beadfaf$export$2fbae6ef3123e0b0 , blackBright: $14c38dc11beadfaf$export$c442bbc3ef058f3e , redBright: $14c38dc11beadfaf$export$6f940151fac4d6e4 , greenBright: $14c38dc11beadfaf$export$9e103086f7204459 , yellowBright: $14c38dc11beadfaf$export$106f17ac3545b17c , blueBright: $14c38dc11beadfaf$export$7aa4c9ef25eb1086 , magentaBright: $14c38dc11beadfaf$export$76b6abffe88e3179 , cyanBright: $14c38dc11beadfaf$export$c609d1d25ac1cc71 , whiteBright: $14c38dc11beadfaf$export$38b81c3a7de495d7 , bgBlackBright: $14c38dc11beadfaf$export$5c9c56f63b47e15b , bgRedBright: $14c38dc11beadfaf$export$26735259ab854b4f , bgGreenBright: $14c38dc11beadfaf$export$d5483c19744b2fc2 , bgYellowBright: $14c38dc11beadfaf$export$f8c17ad4aac14a99 , bgBlueBright: $14c38dc11beadfaf$export$6038eb5fdc315c12 , bgMagentaBright: $14c38dc11beadfaf$export$41148066f4812842 , bgCyanBright: $14c38dc11beadfaf$export$eb0dc7973d30eea7 , bgWhiteBright: $14c38dc11beadfaf$export$fde769fa8262c0d6 } = $14c38dc11beadfaf$export$fc3cc093e161d064();
|
|
92
96
|
|
|
93
97
|
|
|
94
98
|
|
|
95
|
-
function $
|
|
99
|
+
function $a57bcf3215d80b8c$export$9abc0a414b0d8b8f(results) {
|
|
96
100
|
// sort by name and expiry descending
|
|
97
101
|
// takes the latest expiry for each name
|
|
98
102
|
const orderedResults = (0, $cMsgG$lodash.orderBy)(results, [
|
|
@@ -106,14 +110,15 @@ function $499e45cddca8ee5f$export$9abc0a414b0d8b8f(results) {
|
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
|
|
113
|
+
// noinspection JSUnusedGlobalSymbols,ExceptionCaughtLocallyJS
|
|
109
114
|
|
|
110
115
|
|
|
111
116
|
|
|
112
117
|
|
|
113
|
-
const $
|
|
114
|
-
(0, $cMsgG$lodash.merge)($
|
|
115
|
-
const $
|
|
116
|
-
if (!$
|
|
118
|
+
const $d8860887c4b79ebb$export$a7b6bc01c63cdfc3 = {};
|
|
119
|
+
(0, $cMsgG$lodash.merge)($d8860887c4b79ebb$export$a7b6bc01c63cdfc3, process.env);
|
|
120
|
+
const $d8860887c4b79ebb$export$a7c5707626fc90f = $d8860887c4b79ebb$export$a7b6bc01c63cdfc3["HOME"];
|
|
121
|
+
if (!$d8860887c4b79ebb$export$a7c5707626fc90f) throw new Error("HOME environment variable is not set");
|
|
117
122
|
|
|
118
123
|
|
|
119
124
|
|
|
@@ -122,11 +127,11 @@ if (!$ab6a835953d78a50$export$a7c5707626fc90f) throw new Error("HOME environment
|
|
|
122
127
|
|
|
123
128
|
|
|
124
129
|
|
|
125
|
-
class $
|
|
126
|
-
synchronous = false;
|
|
127
|
-
tasks = [];
|
|
130
|
+
class $3312c5017f34fb86$export$55374e421ca433de extends (0, $cMsgG$toughcookie.Store) {
|
|
128
131
|
constructor(filePath, internalStore = new (0, $cMsgG$toughcookie.MemoryCookieStore)()){
|
|
129
132
|
super();
|
|
133
|
+
this.synchronous = false;
|
|
134
|
+
this.tasks = [];
|
|
130
135
|
this.filePath = filePath;
|
|
131
136
|
this.internalStore = internalStore ?? new (0, $cMsgG$toughcookie.MemoryCookieStore)();
|
|
132
137
|
console.log("Importing cookies from", filePath, internalStore);
|
|
@@ -227,18 +232,18 @@ class $d6ba105dc47b157f$export$55374e421ca433de extends (0, $cMsgG$toughcookie.S
|
|
|
227
232
|
}
|
|
228
233
|
|
|
229
234
|
|
|
230
|
-
const $
|
|
231
|
-
async function $
|
|
232
|
-
if ((0, $
|
|
233
|
-
const fileCookieStore = new (0, $
|
|
235
|
+
const $4a4ed1244fb0a877$var$memoryCookieStore = new (0, $cMsgG$toughcookie.MemoryCookieStore)();
|
|
236
|
+
async function $4a4ed1244fb0a877$var$getCookieStore() {
|
|
237
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["cs"] == "memory") return $4a4ed1244fb0a877$var$memoryCookieStore;
|
|
238
|
+
const fileCookieStore = new (0, $3312c5017f34fb86$export$55374e421ca433de)(`${(0, $d8860887c4b79ebb$export$a7b6bc01c63cdfc3)["HOME"]}/cookie-star.json`, $4a4ed1244fb0a877$var$memoryCookieStore);
|
|
234
239
|
await fileCookieStore.waitUntilIdle();
|
|
235
240
|
return fileCookieStore;
|
|
236
241
|
}
|
|
237
|
-
const $
|
|
238
|
-
$
|
|
242
|
+
const $4a4ed1244fb0a877$export$2c043f03eceff4e8 = new Promise((resolve)=>{
|
|
243
|
+
$4a4ed1244fb0a877$var$getCookieStore().then(resolve);
|
|
239
244
|
});
|
|
240
|
-
const $
|
|
241
|
-
$
|
|
245
|
+
const $4a4ed1244fb0a877$export$eced8873dedbb4c0 = new Promise((resolve)=>{
|
|
246
|
+
$4a4ed1244fb0a877$export$2c043f03eceff4e8.then((store)=>new (0, $cMsgG$toughcookie.CookieJar)(store)).then(resolve);
|
|
242
247
|
});
|
|
243
248
|
|
|
244
249
|
|
|
@@ -248,8 +253,12 @@ const $fad025d072e806d0$export$eced8873dedbb4c0 = new Promise((resolve)=>{
|
|
|
248
253
|
|
|
249
254
|
|
|
250
255
|
|
|
256
|
+
var $547132cdf5a36f3b$exports = {};
|
|
257
|
+
|
|
258
|
+
$parcel$export($547132cdf5a36f3b$exports, "default", () => $547132cdf5a36f3b$export$2e2bcd8739ae039, (v) => $547132cdf5a36f3b$export$2e2bcd8739ae039 = v);
|
|
259
|
+
// noinspection JSUnusedGlobalSymbols
|
|
251
260
|
|
|
252
|
-
async function $
|
|
261
|
+
async function $3ea13562a360dc5d$export$8d71c74f97c0202e(command) {
|
|
253
262
|
return new Promise((resolve, reject)=>{
|
|
254
263
|
(0, $cMsgG$child_process.exec)(command, {
|
|
255
264
|
encoding: "binary",
|
|
@@ -273,14 +282,14 @@ async function $85bf79029ec33db0$export$8d71c74f97c0202e(command) {
|
|
|
273
282
|
|
|
274
283
|
|
|
275
284
|
|
|
276
|
-
async function $
|
|
285
|
+
async function $70cef682534b8984$export$2c9faf86071156ae({ path: path , name: name , maxDepth: maxDepth = 2 }) {
|
|
277
286
|
const rootSegments = path.split("/").length;
|
|
278
287
|
const files = [];
|
|
279
288
|
let readdirSync;
|
|
280
289
|
try {
|
|
281
290
|
readdirSync = $cMsgG$fs.readdirSync(path);
|
|
282
291
|
} catch (e) {
|
|
283
|
-
if ((0, $
|
|
292
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log(`Error reading ${path}`, e);
|
|
284
293
|
return [];
|
|
285
294
|
}
|
|
286
295
|
for (const file of readdirSync){
|
|
@@ -289,23 +298,23 @@ async function $0f9e65bbe95be4b5$export$2c9faf86071156ae({ path: path , name: na
|
|
|
289
298
|
try {
|
|
290
299
|
stat = $cMsgG$fs.statSync(filePath);
|
|
291
300
|
} catch (e1) {
|
|
292
|
-
if ((0, $
|
|
301
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.error(`Error getting stat for ${filePath}`, e1);
|
|
293
302
|
continue;
|
|
294
303
|
}
|
|
295
304
|
if (stat.isDirectory()) {
|
|
296
305
|
if (filePath.split("/").length < rootSegments + maxDepth) try {
|
|
297
|
-
const subFiles = await $
|
|
306
|
+
const subFiles = await $70cef682534b8984$export$2c9faf86071156ae({
|
|
298
307
|
path: filePath,
|
|
299
308
|
name: name,
|
|
300
309
|
maxDepth: 2
|
|
301
310
|
});
|
|
302
311
|
files.push(...subFiles);
|
|
303
312
|
} catch (e2) {
|
|
304
|
-
if ((0, $
|
|
313
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.error(e2);
|
|
305
314
|
}
|
|
306
315
|
} else if (file === name) files.push(filePath);
|
|
307
316
|
}
|
|
308
|
-
if ((0, $
|
|
317
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) {
|
|
309
318
|
if (files.length > 0) {
|
|
310
319
|
console.log(`Found ${files.length} ${name} files`);
|
|
311
320
|
console.log(files);
|
|
@@ -318,17 +327,17 @@ async function $0f9e65bbe95be4b5$export$2c9faf86071156ae({ path: path , name: na
|
|
|
318
327
|
|
|
319
328
|
|
|
320
329
|
|
|
321
|
-
function $
|
|
330
|
+
function $3686eff364e16b6b$export$bc926c43858bd3cb(obj) {
|
|
322
331
|
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
323
332
|
}
|
|
324
333
|
|
|
325
334
|
|
|
326
|
-
function $
|
|
335
|
+
function $27d2b99e5da1d835$export$963c8d651337e4a4(obj) {
|
|
327
336
|
return obj.domain !== undefined && obj.name !== undefined && obj.value !== undefined;
|
|
328
337
|
}
|
|
329
338
|
|
|
330
339
|
|
|
331
|
-
function $
|
|
340
|
+
function $b26065d185f035db$export$4eadcf0bf35a2ddb(s) {
|
|
332
341
|
const s1 = s.replaceAll(/\./gi, ".");
|
|
333
342
|
const s2 = s1.replace(/%/g, ".*");
|
|
334
343
|
const s3 = s2.replace(/\*/g, ".*");
|
|
@@ -338,60 +347,62 @@ function $804e67849976ffdb$export$4eadcf0bf35a2ddb(s) {
|
|
|
338
347
|
|
|
339
348
|
|
|
340
349
|
|
|
341
|
-
class $
|
|
342
|
-
|
|
350
|
+
class $27703e9333c4cb99$export$2e2bcd8739ae039 {
|
|
351
|
+
constructor(){
|
|
352
|
+
this.browserName = "Chrome";
|
|
353
|
+
}
|
|
343
354
|
async queryCookies(name, domain) {
|
|
344
355
|
if (process.platform !== "darwin") throw new Error("This only works on macOS");
|
|
345
|
-
if ((0, $
|
|
346
|
-
return $
|
|
356
|
+
if ((0, $d8860887c4b79ebb$export$a7b6bc01c63cdfc3).FIREFOX_ONLY) return [];
|
|
357
|
+
return $27703e9333c4cb99$var$getChromeCookies({
|
|
347
358
|
requireJwt: false,
|
|
348
359
|
name: name,
|
|
349
360
|
domain: domain
|
|
350
361
|
});
|
|
351
362
|
}
|
|
352
363
|
}
|
|
353
|
-
async function $
|
|
364
|
+
async function $27703e9333c4cb99$var$getPromise1(name, domain, file) {
|
|
354
365
|
try {
|
|
355
|
-
return await $
|
|
366
|
+
return await $27703e9333c4cb99$var$getEncryptedChromeCookie({
|
|
356
367
|
name: name,
|
|
357
368
|
domain: domain,
|
|
358
369
|
file: file
|
|
359
370
|
});
|
|
360
371
|
} catch (e) {
|
|
361
|
-
if ((0, $
|
|
372
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error getting encrypted cookie", e);
|
|
362
373
|
return [];
|
|
363
374
|
}
|
|
364
375
|
}
|
|
365
|
-
async function $
|
|
376
|
+
async function $27703e9333c4cb99$var$getPromise(name, domain) {
|
|
366
377
|
try {
|
|
367
|
-
const files = await (0, $
|
|
368
|
-
path: $
|
|
378
|
+
const files = await (0, $70cef682534b8984$export$2c9faf86071156ae)({
|
|
379
|
+
path: $27703e9333c4cb99$var$chromeLocal,
|
|
369
380
|
name: "Cookies"
|
|
370
381
|
});
|
|
371
|
-
const promises = files.map((file)=>$
|
|
382
|
+
const promises = files.map((file)=>$27703e9333c4cb99$var$getPromise1(name, domain, file));
|
|
372
383
|
const results1 = await Promise.all(promises);
|
|
373
|
-
return results1.flat().filter((0, $
|
|
384
|
+
return results1.flat().filter((0, $3686eff364e16b6b$export$bc926c43858bd3cb));
|
|
374
385
|
} catch (error) {
|
|
375
|
-
if ((0, $
|
|
386
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("error", error);
|
|
376
387
|
return [];
|
|
377
388
|
}
|
|
378
389
|
}
|
|
379
|
-
async function $
|
|
390
|
+
async function $27703e9333c4cb99$var$decryptValue(password, encryptedValue) {
|
|
380
391
|
let d;
|
|
381
392
|
try {
|
|
382
|
-
d = await $
|
|
393
|
+
d = await $27703e9333c4cb99$var$decrypt(password, encryptedValue);
|
|
383
394
|
} catch (e) {
|
|
384
|
-
if ((0, $
|
|
395
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error decrypting cookie", e);
|
|
385
396
|
d = null;
|
|
386
397
|
}
|
|
387
398
|
return d ?? encryptedValue.toString("utf-8");
|
|
388
399
|
}
|
|
389
|
-
async function $
|
|
390
|
-
const encryptedDataItems = await $
|
|
391
|
-
const password = await $
|
|
400
|
+
async function $27703e9333c4cb99$var$getChromeCookies({ name: name , domain: domain = "%" , requireJwt: requireJwt = false }) {
|
|
401
|
+
const encryptedDataItems = await $27703e9333c4cb99$var$getPromise(name, domain);
|
|
402
|
+
const password = await $27703e9333c4cb99$var$getChromePassword();
|
|
392
403
|
const decrypted = encryptedDataItems.filter(({ value: value })=>value != null && value.length > 0).map(async (cookieRow)=>{
|
|
393
404
|
const encryptedValue = cookieRow.value;
|
|
394
|
-
const decryptedValue = await $
|
|
405
|
+
const decryptedValue = await $27703e9333c4cb99$var$decryptValue(password, encryptedValue);
|
|
395
406
|
const meta = {};
|
|
396
407
|
(0, $cMsgG$lodash.merge)(meta, cookieRow.meta ?? {});
|
|
397
408
|
const exportedCookie = {
|
|
@@ -409,14 +420,14 @@ async function $50e0b48eb429d6c2$var$getChromeCookies({ name: name , domain: dom
|
|
|
409
420
|
(0, $cMsgG$lodash.merge)(exportedCookie, mergeExpiry);
|
|
410
421
|
return exportedCookie;
|
|
411
422
|
});
|
|
412
|
-
const results = (await Promise.all(decrypted)).filter((0, $
|
|
413
|
-
if ((0, $
|
|
423
|
+
const results = (await Promise.all(decrypted)).filter((0, $27d2b99e5da1d835$export$963c8d651337e4a4));
|
|
424
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("results", results);
|
|
414
425
|
return results;
|
|
415
426
|
}
|
|
416
|
-
const $
|
|
417
|
-
async function $
|
|
427
|
+
const $27703e9333c4cb99$var$chromeLocal = $cMsgG$path.join((0, $d8860887c4b79ebb$export$a7c5707626fc90f), "Library", "Application Support", "Google", "Chrome");
|
|
428
|
+
async function $27703e9333c4cb99$var$getEncryptedChromeCookie({ name: name , domain: domain , file: file = $cMsgG$path.join($27703e9333c4cb99$var$chromeLocal, "Default", "Cookies") }) {
|
|
418
429
|
if (!(0, $cMsgG$fs.existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
419
|
-
if ((0, $
|
|
430
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) {
|
|
420
431
|
const s = file.split("/").slice(-3).join("/");
|
|
421
432
|
console.log(`Trying Chrome (at ${s}) cookie ${name} for domain ${domain}`);
|
|
422
433
|
}
|
|
@@ -442,9 +453,9 @@ async function $50e0b48eb429d6c2$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
442
453
|
sql += `host_key LIKE '${sqlEmbedDomain}';`;
|
|
443
454
|
}
|
|
444
455
|
}
|
|
445
|
-
if ((0, $
|
|
446
|
-
const domainRegexp = (0, $
|
|
447
|
-
const sqliteQuery1 = await $
|
|
456
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("sql", sql);
|
|
457
|
+
const domainRegexp = (0, $b26065d185f035db$export$4eadcf0bf35a2ddb)(domain);
|
|
458
|
+
const sqliteQuery1 = await $27703e9333c4cb99$export$bd52b72df8d0d261({
|
|
448
459
|
file: file,
|
|
449
460
|
sql: sql,
|
|
450
461
|
rowFilter: (row)=>{
|
|
@@ -457,7 +468,7 @@ async function $50e0b48eb429d6c2$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
457
468
|
name: row["name"],
|
|
458
469
|
value: row["encrypted_value"]
|
|
459
470
|
};
|
|
460
|
-
if ((0, $
|
|
471
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("CookieRow", cookieRow);
|
|
461
472
|
return cookieRow;
|
|
462
473
|
}
|
|
463
474
|
});
|
|
@@ -465,10 +476,10 @@ async function $50e0b48eb429d6c2$var$getEncryptedChromeCookie({ name: name , dom
|
|
|
465
476
|
return row.domain.match(domainRegexp) != null;
|
|
466
477
|
});
|
|
467
478
|
}
|
|
468
|
-
async function $
|
|
469
|
-
return (0, $
|
|
479
|
+
async function $27703e9333c4cb99$var$getChromePassword() {
|
|
480
|
+
return (0, $3ea13562a360dc5d$export$8d71c74f97c0202e)('security find-generic-password -w -s "Chrome Safe Storage"');
|
|
470
481
|
}
|
|
471
|
-
async function $
|
|
482
|
+
async function $27703e9333c4cb99$var$decrypt(password, encryptedData) {
|
|
472
483
|
if (typeof password !== "string") throw new Error("password must be a string: " + password);
|
|
473
484
|
let encryptedData1;
|
|
474
485
|
encryptedData1 = encryptedData;
|
|
@@ -476,21 +487,21 @@ async function $50e0b48eb429d6c2$var$decrypt(password, encryptedData) {
|
|
|
476
487
|
if (!(encryptedData1 instanceof Buffer)) {
|
|
477
488
|
if (Array.isArray(encryptedData1) && encryptedData1[0] instanceof Buffer) {
|
|
478
489
|
[encryptedData1] = encryptedData1;
|
|
479
|
-
if ((0, $
|
|
490
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log(`encryptedData is an array of buffers, selected first: ${encryptedData1}`);
|
|
480
491
|
} else throw new Error("encryptedData must be a Buffer: " + encryptedData1);
|
|
481
492
|
encryptedData1 = Buffer.from(encryptedData1);
|
|
482
493
|
}
|
|
483
|
-
if ((0, $
|
|
494
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log(`Trying to decrypt with password ${password}`);
|
|
484
495
|
return new Promise((resolve, reject)=>{
|
|
485
496
|
$cMsgG$crypto.pbkdf2(password, "saltysalt", 1003, 16, "sha1", (error, buffer)=>{
|
|
486
497
|
try {
|
|
487
498
|
if (error) {
|
|
488
|
-
if ((0, $
|
|
499
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2", error);
|
|
489
500
|
reject(error);
|
|
490
501
|
return;
|
|
491
502
|
}
|
|
492
503
|
if (buffer.length !== 16) {
|
|
493
|
-
if ((0, $
|
|
504
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, buffer length is not 16", buffer.length);
|
|
494
505
|
reject(new Error("Buffer length is not 16"));
|
|
495
506
|
return;
|
|
496
507
|
}
|
|
@@ -500,7 +511,7 @@ async function $50e0b48eb429d6c2$var$decrypt(password, encryptedData) {
|
|
|
500
511
|
decipher.setAutoPadding(false);
|
|
501
512
|
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
502
513
|
if (encryptedData1.length % 16 !== 0) {
|
|
503
|
-
if ((0, $
|
|
514
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
504
515
|
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
505
516
|
return;
|
|
506
517
|
}
|
|
@@ -508,7 +519,7 @@ async function $50e0b48eb429d6c2$var$decrypt(password, encryptedData) {
|
|
|
508
519
|
try {
|
|
509
520
|
decipher.final("utf-8");
|
|
510
521
|
} catch (e) {
|
|
511
|
-
if ((0, $
|
|
522
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Error doing decipher.final()", e);
|
|
512
523
|
reject(e);
|
|
513
524
|
return;
|
|
514
525
|
}
|
|
@@ -523,7 +534,7 @@ async function $50e0b48eb429d6c2$var$decrypt(password, encryptedData) {
|
|
|
523
534
|
});
|
|
524
535
|
});
|
|
525
536
|
}
|
|
526
|
-
async function $
|
|
537
|
+
async function $27703e9333c4cb99$export$bd52b72df8d0d261({ file: file , sql: sql , rowFilter: rowFilter = ()=>true , rowTransform: rowTransform }) {
|
|
527
538
|
if (!file || file && !(0, ($parcel$interopDefault($cMsgG$fs))).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
528
539
|
const db = new $cMsgG$sqlite3.Database(file);
|
|
529
540
|
return new Promise((resolve, reject)=>{
|
|
@@ -550,7 +561,7 @@ async function $50e0b48eb429d6c2$export$bd52b72df8d0d261({ file: file , sql: sql
|
|
|
550
561
|
resolve(cookieRows);
|
|
551
562
|
return;
|
|
552
563
|
}
|
|
553
|
-
if ((0, $
|
|
564
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
554
565
|
resolve([
|
|
555
566
|
rows1
|
|
556
567
|
]);
|
|
@@ -559,11 +570,15 @@ async function $50e0b48eb429d6c2$export$bd52b72df8d0d261({ file: file , sql: sql
|
|
|
559
570
|
}
|
|
560
571
|
|
|
561
572
|
|
|
573
|
+
var $eb613f19bc55afc6$exports = {};
|
|
574
|
+
|
|
575
|
+
$parcel$export($eb613f19bc55afc6$exports, "doSqliteQuery1", () => $eb613f19bc55afc6$export$f19f611d1fa7c6f3, (v) => $eb613f19bc55afc6$export$f19f611d1fa7c6f3 = v);
|
|
576
|
+
$parcel$export($eb613f19bc55afc6$exports, "default", () => $eb613f19bc55afc6$export$2e2bcd8739ae039, (v) => $eb613f19bc55afc6$export$2e2bcd8739ae039 = v);
|
|
562
577
|
|
|
563
578
|
|
|
564
579
|
|
|
565
580
|
|
|
566
|
-
function $
|
|
581
|
+
function $6d7948d166b6561e$export$da22813e5a2ec500({ name: name , domain: domain }) {
|
|
567
582
|
const wildcardRegexp = /^([*%])$/i;
|
|
568
583
|
return {
|
|
569
584
|
specifiedName: name.match(wildcardRegexp) == null,
|
|
@@ -575,7 +590,13 @@ function $21b9a65cfb44c163$export$da22813e5a2ec500({ name: name , domain: domain
|
|
|
575
590
|
|
|
576
591
|
|
|
577
592
|
|
|
578
|
-
|
|
593
|
+
var $eb613f19bc55afc6$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
594
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
595
|
+
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");
|
|
596
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
597
|
+
};
|
|
598
|
+
var $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_instances, $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_getFirefoxCookie, $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_queryCookiesDb;
|
|
599
|
+
async function $eb613f19bc55afc6$export$f19f611d1fa7c6f3({ file: file , sql: sql , rowTransform: rowTransform }) {
|
|
579
600
|
if (!file || file && !(0, ($parcel$interopDefault($cMsgG$fs))).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
580
601
|
const db = new $cMsgG$sqlite3.Database(file);
|
|
581
602
|
return new Promise((resolve, reject)=>{
|
|
@@ -602,20 +623,23 @@ async function $31b10c081e582091$export$f19f611d1fa7c6f3({ file: file , sql: sql
|
|
|
602
623
|
resolve(cookieRows);
|
|
603
624
|
return;
|
|
604
625
|
}
|
|
605
|
-
if ((0, $
|
|
626
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
606
627
|
resolve([
|
|
607
628
|
rows1
|
|
608
629
|
]);
|
|
609
630
|
});
|
|
610
631
|
});
|
|
611
632
|
}
|
|
612
|
-
class $
|
|
613
|
-
|
|
633
|
+
class $eb613f19bc55afc6$export$2e2bcd8739ae039 {
|
|
634
|
+
constructor(){
|
|
635
|
+
$eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_instances.add(this);
|
|
636
|
+
this.browserName = "Firefox";
|
|
637
|
+
}
|
|
614
638
|
async queryCookies(name, domain) {
|
|
615
639
|
if (process.platform !== "darwin") // TODO: implement
|
|
616
640
|
return [];
|
|
617
|
-
if ((0, $
|
|
618
|
-
const cookies = await this
|
|
641
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).browser !== "firefox") return [];
|
|
642
|
+
const cookies = await $eb613f19bc55afc6$var$__classPrivateFieldGet(this, $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_instances, "m", $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_getFirefoxCookie).call(this, {
|
|
619
643
|
name: name,
|
|
620
644
|
domain: domain
|
|
621
645
|
});
|
|
@@ -628,61 +652,62 @@ class $31b10c081e582091$export$2e2bcd8739ae039 {
|
|
|
628
652
|
});
|
|
629
653
|
else return [];
|
|
630
654
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
}
|
|
659
|
-
if (specifiedDomain) sql += `host LIKE '${domain1}';`;
|
|
655
|
+
}
|
|
656
|
+
$eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_getFirefoxCookie = async function _FirefoxCookieQueryStrategy_getFirefoxCookie({ name: name , domain: domain } //
|
|
657
|
+
) {
|
|
658
|
+
const files = await (0, $70cef682534b8984$export$2c9faf86071156ae)({
|
|
659
|
+
path: $cMsgG$path.join((0, $d8860887c4b79ebb$export$a7c5707626fc90f), "Library", "Application Support", "Firefox", "Profiles"),
|
|
660
|
+
name: "cookies.sqlite"
|
|
661
|
+
});
|
|
662
|
+
const fn = async (file)=>{
|
|
663
|
+
return await $eb613f19bc55afc6$var$__classPrivateFieldGet(this, $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_instances, "m", $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_queryCookiesDb).call(this, file, name, domain);
|
|
664
|
+
};
|
|
665
|
+
const all = await Promise.all(files.map(fn));
|
|
666
|
+
// flatten
|
|
667
|
+
return all.flat();
|
|
668
|
+
}, $eb613f19bc55afc6$var$_FirefoxCookieQueryStrategy_queryCookiesDb = async function _FirefoxCookieQueryStrategy_queryCookiesDb(file, name, domain) {
|
|
669
|
+
if (file && !(0, $cMsgG$fs.existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
670
|
+
let sql;
|
|
671
|
+
//language=SQL
|
|
672
|
+
sql = "SELECT value, name, host FROM moz_cookies";
|
|
673
|
+
const { specifiedName: specifiedName , specifiedDomain: specifiedDomain } = (0, $6d7948d166b6561e$export$da22813e5a2ec500)({
|
|
674
|
+
name: name,
|
|
675
|
+
domain: domain
|
|
676
|
+
});
|
|
677
|
+
if (specifiedName || specifiedDomain) {
|
|
678
|
+
sql += ` WHERE `;
|
|
679
|
+
if (specifiedName) {
|
|
680
|
+
sql += `name = '${name}'`;
|
|
681
|
+
if (specifiedDomain) sql += ` AND `;
|
|
660
682
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
683
|
+
if (specifiedDomain) sql += `host LIKE '${domain}';`;
|
|
684
|
+
}
|
|
685
|
+
const rowTransform = (row)=>{
|
|
686
|
+
// row is object key by column name
|
|
687
|
+
const value = row.value;
|
|
688
|
+
return {
|
|
689
|
+
domain: row.domain,
|
|
690
|
+
name: row.name,
|
|
691
|
+
value: Buffer.from(value, "utf8")
|
|
669
692
|
};
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
693
|
+
};
|
|
694
|
+
try {
|
|
695
|
+
return await $eb613f19bc55afc6$export$f19f611d1fa7c6f3({
|
|
696
|
+
file: file,
|
|
697
|
+
sql: sql,
|
|
698
|
+
rowTransform: rowTransform
|
|
699
|
+
});
|
|
700
|
+
} catch (e) {
|
|
701
|
+
console.error(`Error querying ${file}`, e);
|
|
702
|
+
return [];
|
|
680
703
|
}
|
|
681
|
-
}
|
|
704
|
+
};
|
|
682
705
|
|
|
683
706
|
|
|
684
|
-
class $
|
|
685
|
-
|
|
707
|
+
class $6f25a9a3d85541ea$export$2e2bcd8739ae039 {
|
|
708
|
+
constructor(){
|
|
709
|
+
this.browserName = "Safari";
|
|
710
|
+
}
|
|
686
711
|
async queryCookies(name, domain) {
|
|
687
712
|
// TODO: implement
|
|
688
713
|
return [];
|
|
@@ -691,16 +716,28 @@ class $6f1d09c5ec49fdc6$export$2e2bcd8739ae039 {
|
|
|
691
716
|
|
|
692
717
|
|
|
693
718
|
|
|
719
|
+
var $427ad5d0e206acf0$exports = {};
|
|
720
|
+
|
|
721
|
+
$parcel$export($427ad5d0e206acf0$exports, "default", () => $427ad5d0e206acf0$export$2e2bcd8739ae039, (v) => $427ad5d0e206acf0$export$2e2bcd8739ae039 = v);
|
|
694
722
|
|
|
695
723
|
|
|
696
|
-
|
|
697
|
-
|
|
724
|
+
var $427ad5d0e206acf0$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
725
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
726
|
+
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");
|
|
727
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
728
|
+
};
|
|
729
|
+
var $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_extracted, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getCookies, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getAllCookies;
|
|
730
|
+
class $427ad5d0e206acf0$export$2e2bcd8739ae039 {
|
|
731
|
+
constructor(){
|
|
732
|
+
$427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances.add(this);
|
|
733
|
+
this.browserName = "internal";
|
|
734
|
+
}
|
|
698
735
|
async queryCookies(name, domain) {
|
|
699
736
|
const exportedCookies = [];
|
|
700
737
|
// if (name.match(/[%*]/) || domain.match(/[%*]/)) {
|
|
701
|
-
const cookies = await this
|
|
738
|
+
const cookies = await $427ad5d0e206acf0$var$__classPrivateFieldGet(this, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances, "m", $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getAllCookies).call(this);
|
|
702
739
|
const allExportedCookies = cookies.map((cookie)=>{
|
|
703
|
-
return this
|
|
740
|
+
return $427ad5d0e206acf0$var$__classPrivateFieldGet(this, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances, "m", $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_extracted).call(this, cookie, {
|
|
704
741
|
name: name,
|
|
705
742
|
domain: domain
|
|
706
743
|
});
|
|
@@ -714,9 +751,9 @@ class $6f131982bdd0218c$export$2e2bcd8739ae039 {
|
|
|
714
751
|
const domain1 = domain.match(/(\w+.+\w+)/gi)?.pop() ?? domain;
|
|
715
752
|
const url = new URL("https://" + domain1);
|
|
716
753
|
url.pathname = path;
|
|
717
|
-
const cookies1 = await this
|
|
754
|
+
const cookies1 = await $427ad5d0e206acf0$var$__classPrivateFieldGet(this, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances, "m", $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getCookies).call(this, url.href);
|
|
718
755
|
const domainCookies = cookies1.map((cookie)=>{
|
|
719
|
-
return this
|
|
756
|
+
return $427ad5d0e206acf0$var$__classPrivateFieldGet(this, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances, "m", $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_extracted).call(this, cookie, {
|
|
720
757
|
domain: domain,
|
|
721
758
|
name: name
|
|
722
759
|
});
|
|
@@ -724,71 +761,81 @@ class $6f131982bdd0218c$export$2e2bcd8739ae039 {
|
|
|
724
761
|
exportedCookies.push(...domainCookies);
|
|
725
762
|
}
|
|
726
763
|
if (name == "%") return exportedCookies.filter((cookie)=>{
|
|
727
|
-
return cookie.domain.match((0, $
|
|
764
|
+
return cookie.domain.match((0, $b26065d185f035db$export$4eadcf0bf35a2ddb)(domain));
|
|
728
765
|
});
|
|
729
766
|
return exportedCookies.filter((cookie)=>{
|
|
730
|
-
return cookie.name.match((0, $
|
|
767
|
+
return cookie.name.match((0, $b26065d185f035db$export$4eadcf0bf35a2ddb)(name)) && cookie.domain.match((0, $b26065d185f035db$export$4eadcf0bf35a2ddb)(domain));
|
|
731
768
|
});
|
|
732
769
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
});
|
|
770
|
+
}
|
|
771
|
+
$427ad5d0e206acf0$var$_CookieStoreQueryStrategy_instances = new WeakSet(), $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_extracted = function _CookieStoreQueryStrategy_extracted(cookie, cookieSpec) {
|
|
772
|
+
return {
|
|
773
|
+
domain: cookie.domain ?? cookieSpec.domain,
|
|
774
|
+
name: cookie.key ?? cookieSpec.name,
|
|
775
|
+
value: cookie.value,
|
|
776
|
+
expiry: cookie.expires ?? "Infinity",
|
|
777
|
+
meta: {
|
|
778
|
+
file: "tough-cookie"
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
}, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getCookies = async function _CookieStoreQueryStrategy_getCookies(url) {
|
|
782
|
+
const cookieJar = await (0, $4a4ed1244fb0a877$export$eced8873dedbb4c0);
|
|
783
|
+
return new Promise((resolve, reject)=>{
|
|
784
|
+
return cookieJar.getCookies(url, (err, cookies)=>{
|
|
785
|
+
if (err) reject(err);
|
|
786
|
+
else resolve(cookies ?? []);
|
|
751
787
|
});
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
});
|
|
788
|
+
});
|
|
789
|
+
}, $427ad5d0e206acf0$var$_CookieStoreQueryStrategy_getAllCookies = async function _CookieStoreQueryStrategy_getAllCookies() {
|
|
790
|
+
const cookieStore = await (0, $4a4ed1244fb0a877$export$2c043f03eceff4e8);
|
|
791
|
+
return new Promise((resolve, reject)=>{
|
|
792
|
+
return cookieStore.getAllCookies((err, cookies)=>{
|
|
793
|
+
if (err) reject(err);
|
|
794
|
+
else resolve(cookies ?? []);
|
|
760
795
|
});
|
|
761
|
-
}
|
|
762
|
-
}
|
|
796
|
+
});
|
|
797
|
+
};
|
|
763
798
|
|
|
764
799
|
|
|
765
800
|
|
|
766
801
|
|
|
767
802
|
|
|
768
|
-
|
|
803
|
+
var $547132cdf5a36f3b$var$__classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
804
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
805
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
806
|
+
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");
|
|
807
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
808
|
+
};
|
|
809
|
+
var $547132cdf5a36f3b$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
810
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
811
|
+
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");
|
|
812
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
813
|
+
};
|
|
814
|
+
var $547132cdf5a36f3b$var$_CompositeCookieQueryStrategy_strategies;
|
|
815
|
+
const $547132cdf5a36f3b$var$cache = new (0, ($parcel$interopDefault($cMsgG$lrucache)))({
|
|
769
816
|
ttl: 2000,
|
|
770
817
|
max: 10
|
|
771
818
|
});
|
|
772
|
-
class $
|
|
773
|
-
browserName = "all";
|
|
774
|
-
#strategies;
|
|
819
|
+
class $547132cdf5a36f3b$export$2e2bcd8739ae039 {
|
|
775
820
|
constructor(){
|
|
776
|
-
this
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
(0, $
|
|
780
|
-
(0, $
|
|
821
|
+
this.browserName = "all";
|
|
822
|
+
$547132cdf5a36f3b$var$_CompositeCookieQueryStrategy_strategies.set(this, void 0);
|
|
823
|
+
$547132cdf5a36f3b$var$__classPrivateFieldSet(this, $547132cdf5a36f3b$var$_CompositeCookieQueryStrategy_strategies, [
|
|
824
|
+
(0, $427ad5d0e206acf0$exports.default),
|
|
825
|
+
(0, $27703e9333c4cb99$export$2e2bcd8739ae039),
|
|
826
|
+
(0, $eb613f19bc55afc6$exports.default),
|
|
827
|
+
(0, $6f25a9a3d85541ea$export$2e2bcd8739ae039)
|
|
781
828
|
].map((strategy)=>{
|
|
782
829
|
return new strategy();
|
|
783
|
-
});
|
|
830
|
+
}), "f");
|
|
784
831
|
}
|
|
785
832
|
async queryCookies(name, domain) {
|
|
786
833
|
// domain = domain.match(/(\w+.+\w+)/gi)?.pop() ?? domain;
|
|
787
834
|
const key = `${name}:${domain}`;
|
|
788
|
-
const cached = $
|
|
835
|
+
const cached = $547132cdf5a36f3b$var$cache.get(key);
|
|
789
836
|
if (cached) return cached;
|
|
790
|
-
if ((0, $
|
|
791
|
-
const results = await Promise.all(this
|
|
837
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log("Querying cookies:", name, domain);
|
|
838
|
+
const results = await Promise.all($547132cdf5a36f3b$var$__classPrivateFieldGet(this, $547132cdf5a36f3b$var$_CompositeCookieQueryStrategy_strategies, "f").map(async (strategy)=>{
|
|
792
839
|
// @ts-ignore
|
|
793
840
|
return strategy.queryCookies(name, domain).then((cookies)=>{
|
|
794
841
|
return cookies.map((cookie)=>{
|
|
@@ -804,20 +851,21 @@ class $27eb81da92769162$export$2e2bcd8739ae039 {
|
|
|
804
851
|
});
|
|
805
852
|
}));
|
|
806
853
|
const flat = results.flat();
|
|
807
|
-
$
|
|
854
|
+
$547132cdf5a36f3b$var$cache.set(`${name}:${domain}`, flat);
|
|
808
855
|
return flat;
|
|
809
856
|
}
|
|
810
857
|
}
|
|
858
|
+
$547132cdf5a36f3b$var$_CompositeCookieQueryStrategy_strategies = new WeakMap();
|
|
811
859
|
|
|
812
860
|
|
|
813
861
|
|
|
814
862
|
|
|
815
|
-
function $
|
|
863
|
+
function $5bc8a08cd694e3c6$export$2e2bcd8739ae039(token) {
|
|
816
864
|
try {
|
|
817
865
|
const result = (0, ($parcel$interopDefault($cMsgG$jsonwebtoken))).decode(token, {
|
|
818
866
|
complete: true
|
|
819
867
|
});
|
|
820
|
-
if ((0, $
|
|
868
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose && result) console.log(result);
|
|
821
869
|
const payload = result?.payload;
|
|
822
870
|
if (payload) {
|
|
823
871
|
const exp = payload.exp;
|
|
@@ -833,49 +881,49 @@ function $57733ace45e3aeb7$export$2e2bcd8739ae039(token) {
|
|
|
833
881
|
}
|
|
834
882
|
|
|
835
883
|
|
|
836
|
-
async function $
|
|
884
|
+
async function $9918bcee81edf497$export$e6d428437cf2cacb({ name: name , domain: domain }, strategy = new (0, $547132cdf5a36f3b$exports.default)()) {
|
|
837
885
|
const results = await strategy.queryCookies(name, domain);
|
|
838
886
|
const allCookies = (0, $cMsgG$lodash.uniqBy)(results, JSON.stringify);
|
|
839
|
-
if ((0, $
|
|
887
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["require-jwt"]) {
|
|
840
888
|
const jwtCookies = [];
|
|
841
889
|
for (const result of allCookies){
|
|
842
890
|
const value = result.value;
|
|
843
|
-
if ((0, $
|
|
891
|
+
if ((0, $5bc8a08cd694e3c6$export$2e2bcd8739ae039)(value)) jwtCookies.push(result);
|
|
844
892
|
}
|
|
845
|
-
return (0, $
|
|
893
|
+
return (0, $c731a22a41036768$export$c348dfaf65040d9b)["single"] ? [
|
|
846
894
|
jwtCookies[0]
|
|
847
895
|
] : jwtCookies;
|
|
848
|
-
} else return (0, $
|
|
896
|
+
} else return (0, $c731a22a41036768$export$c348dfaf65040d9b)["single"] ? [
|
|
849
897
|
allCookies[0]
|
|
850
898
|
] : allCookies;
|
|
851
899
|
}
|
|
852
900
|
|
|
853
901
|
|
|
854
902
|
|
|
855
|
-
async function $
|
|
903
|
+
async function $7042dc654ce897dd$export$a65902517ae87ba8(cookieSpec) {
|
|
856
904
|
const cookies = [];
|
|
857
905
|
if (Array.isArray(cookieSpec)) {
|
|
858
906
|
const results = await Promise.all(cookieSpec.map((cs)=>{
|
|
859
|
-
return (0, $
|
|
907
|
+
return (0, $9918bcee81edf497$export$e6d428437cf2cacb)(cs);
|
|
860
908
|
}));
|
|
861
909
|
for (const exportedCookie of results.flat())cookies.push(exportedCookie);
|
|
862
910
|
} else {
|
|
863
|
-
const singleQuery = await (0, $
|
|
911
|
+
const singleQuery = await (0, $9918bcee81edf497$export$e6d428437cf2cacb)(cookieSpec);
|
|
864
912
|
cookies.push(...singleQuery);
|
|
865
913
|
}
|
|
866
914
|
return (0, $cMsgG$lodash.uniqBy)(cookies, JSON.stringify);
|
|
867
915
|
}
|
|
868
916
|
|
|
869
917
|
|
|
870
|
-
async function $
|
|
871
|
-
const cookies = await (0, $
|
|
872
|
-
if (cookies.length > 0) return (0, $
|
|
918
|
+
async function $d00aaae904784e28$export$cfc0723de5712e57(cookieSpec) {
|
|
919
|
+
const cookies = await (0, $7042dc654ce897dd$export$a65902517ae87ba8)(cookieSpec);
|
|
920
|
+
if (cookies.length > 0) return (0, $a57bcf3215d80b8c$export$9abc0a414b0d8b8f)(cookies);
|
|
873
921
|
return "";
|
|
874
922
|
}
|
|
875
923
|
|
|
876
924
|
|
|
877
925
|
|
|
878
|
-
function $
|
|
926
|
+
function $2febaded2716e6a6$export$f266452a5050185d(url) {
|
|
879
927
|
const url1 = typeof url == "string" ? new URL(url) : url;
|
|
880
928
|
const cookieSpecs = [];
|
|
881
929
|
const splits = url1.hostname.split(".");
|
|
@@ -900,14 +948,14 @@ function $b32860efe238f1f1$export$f266452a5050185d(url) {
|
|
|
900
948
|
}
|
|
901
949
|
|
|
902
950
|
|
|
903
|
-
const $
|
|
904
|
-
async function $
|
|
951
|
+
const $9a28c00d1ec5ecc2$var$userAgent = new (0, ($parcel$interopDefault($cMsgG$useragents)))().toString();
|
|
952
|
+
async function $9a28c00d1ec5ecc2$export$b24a545a0b39f491(url, options = {}, fetch = (0, $cMsgG$crossfetch.fetch), originalRequest) {
|
|
905
953
|
const originalRequest1 = originalRequest || {
|
|
906
954
|
url: url,
|
|
907
955
|
options: options
|
|
908
956
|
};
|
|
909
957
|
const headers = {
|
|
910
|
-
"User-Agent": $
|
|
958
|
+
"User-Agent": $9a28c00d1ec5ecc2$var$userAgent
|
|
911
959
|
};
|
|
912
960
|
const defaultOptions = {
|
|
913
961
|
headers: headers,
|
|
@@ -915,9 +963,9 @@ async function $72b72bc713ce1262$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
915
963
|
};
|
|
916
964
|
const url2 = `${url}`;
|
|
917
965
|
const url1 = new URL(url2);
|
|
918
|
-
const cookieSpecs = (0, $
|
|
919
|
-
headers["Cookie"] = await (0, $
|
|
920
|
-
if ((0, $
|
|
966
|
+
const cookieSpecs = (0, $2febaded2716e6a6$export$f266452a5050185d)(url1);
|
|
967
|
+
headers["Cookie"] = await (0, $d00aaae904784e28$export$cfc0723de5712e57)(cookieSpecs).catch(()=>"");
|
|
968
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["dump-request-headers"]) {
|
|
921
969
|
console.log((0, $14c38dc11beadfaf$export$6f940151fac4d6e4)("Request URL:"), url1.href);
|
|
922
970
|
console.log((0, $14c38dc11beadfaf$export$2aa0182783e7e9de)("Request headers:"), headers);
|
|
923
971
|
}
|
|
@@ -934,17 +982,17 @@ async function $72b72bc713ce1262$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
934
982
|
]);
|
|
935
983
|
});
|
|
936
984
|
for (const [key, value] of headers1)if (key === "set-cookie") {
|
|
937
|
-
const cookieJar1 = await (0, $
|
|
985
|
+
const cookieJar1 = await (0, $4a4ed1244fb0a877$export$eced8873dedbb4c0);
|
|
938
986
|
await cookieJar1.setCookie(value, url2);
|
|
939
|
-
if ((0, $
|
|
987
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log((0, $14c38dc11beadfaf$export$2aa0182783e7e9de)(`Set-Cookie:`), (0, $14c38dc11beadfaf$export$594c5a8758200c32)(value), (0, $14c38dc11beadfaf$export$594c5a8758200c32)(url2));
|
|
940
988
|
}
|
|
941
989
|
const newUrl = res.headers.get("location") ?? res.url;
|
|
942
990
|
// const sameHost = new URL(newUrl).host === url1.host;
|
|
943
991
|
if (res.status == 301 || res.status == 302) // follow the redirect
|
|
944
992
|
{
|
|
945
993
|
if (newUrl && newUrl !== url2) {
|
|
946
|
-
if ((0, $
|
|
947
|
-
return $
|
|
994
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose || (0, $c731a22a41036768$export$c348dfaf65040d9b)["dump-response-headers"]) console.log((0, $14c38dc11beadfaf$export$2aa0182783e7e9de)(`Redirected to `), (0, $14c38dc11beadfaf$export$594c5a8758200c32)(newUrl));
|
|
995
|
+
return $9a28c00d1ec5ecc2$export$b24a545a0b39f491(//
|
|
948
996
|
newUrl, newOptions1, fetch, originalRequest1);
|
|
949
997
|
}
|
|
950
998
|
}
|
|
@@ -969,8 +1017,8 @@ async function $72b72bc713ce1262$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
969
1017
|
(0, $cMsgG$lodash.merge)(newOptions2, newOptions1);
|
|
970
1018
|
break;
|
|
971
1019
|
}
|
|
972
|
-
if ((0, $
|
|
973
|
-
return $
|
|
1020
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) console.log((0, $14c38dc11beadfaf$export$2aa0182783e7e9de)(`Redirected to `), (0, $14c38dc11beadfaf$export$594c5a8758200c32)(newUrl));
|
|
1021
|
+
return $9a28c00d1ec5ecc2$export$b24a545a0b39f491(//
|
|
974
1022
|
newUrl, newOptions2, fetch, originalRequest1);
|
|
975
1023
|
}
|
|
976
1024
|
const arrayBuffer1 = res.arrayBuffer();
|
|
@@ -1007,7 +1055,7 @@ async function $72b72bc713ce1262$export$b24a545a0b39f491(url, options = {}, fetc
|
|
|
1007
1055
|
}
|
|
1008
1056
|
|
|
1009
1057
|
|
|
1010
|
-
function $
|
|
1058
|
+
function $67b8f97a626b0219$export$e7dabf85f0a9f9c(headerArgs) {
|
|
1011
1059
|
const headers = {};
|
|
1012
1060
|
if (headerArgs == null) return headers;
|
|
1013
1061
|
if (Array.isArray(headerArgs)) {
|
|
@@ -1025,87 +1073,91 @@ function $b221da94e3dc8880$export$e7dabf85f0a9f9c(headerArgs) {
|
|
|
1025
1073
|
|
|
1026
1074
|
|
|
1027
1075
|
|
|
1028
|
-
|
|
1076
|
+
|
|
1077
|
+
var $f5ffc29454da9157$export$2e2bcd8739ae039 = (0, ($parcel$interopDefault($cMsgG$consola)));
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
async function $07358f6c1dbf57c3$var$cliQueryCookies(cookieSpec) {
|
|
1029
1081
|
try {
|
|
1030
|
-
const results = await (0, $
|
|
1082
|
+
const results = await (0, $7042dc654ce897dd$export$a65902517ae87ba8)(cookieSpec);
|
|
1031
1083
|
if (results == null || results.length == 0) {
|
|
1032
|
-
|
|
1084
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).error((0, $14c38dc11beadfaf$export$a90204d1394caf30)("No results"));
|
|
1033
1085
|
return;
|
|
1034
1086
|
}
|
|
1035
|
-
if ((0, $
|
|
1036
|
-
|
|
1087
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["dump"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["d"]) {
|
|
1088
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(results);
|
|
1037
1089
|
return;
|
|
1038
1090
|
}
|
|
1039
|
-
if ((0, $
|
|
1091
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["dump-grouped"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["D"]) {
|
|
1040
1092
|
const groupedByFile = (0, $cMsgG$lodash.groupBy)(results, (r)=>r.meta?.file);
|
|
1041
|
-
|
|
1093
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log((0, $14c38dc11beadfaf$export$955a2ebd2fb142ae)(JSON.stringify(groupedByFile, null, 2)));
|
|
1042
1094
|
return;
|
|
1043
1095
|
}
|
|
1044
|
-
if ((0, $
|
|
1045
|
-
|
|
1096
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["render"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["render-merged"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["r"]) {
|
|
1097
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log((0, $14c38dc11beadfaf$export$594c5a8758200c32)((0, $a57bcf3215d80b8c$export$9abc0a414b0d8b8f)(results)));
|
|
1046
1098
|
return;
|
|
1047
1099
|
}
|
|
1048
|
-
if ((0, $
|
|
1100
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["render-grouped"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["R"]) {
|
|
1049
1101
|
const groupedByFile1 = (0, $cMsgG$lodash.groupBy)(results, (r)=>r.meta?.file);
|
|
1050
1102
|
for (const file of Object.keys(groupedByFile1)){
|
|
1051
1103
|
let results1 = groupedByFile1[file];
|
|
1052
|
-
|
|
1104
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log((0, $14c38dc11beadfaf$export$955a2ebd2fb142ae)(file) + ": ", (0, $14c38dc11beadfaf$export$594c5a8758200c32)((0, $a57bcf3215d80b8c$export$9abc0a414b0d8b8f)(results1)));
|
|
1053
1105
|
}
|
|
1054
1106
|
return;
|
|
1055
1107
|
}
|
|
1056
|
-
for (const result of results)
|
|
1108
|
+
for (const result of results)(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(result.value);
|
|
1057
1109
|
} catch (e) {
|
|
1058
|
-
|
|
1110
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).error(e);
|
|
1059
1111
|
}
|
|
1060
1112
|
}
|
|
1061
|
-
async function $
|
|
1062
|
-
if ((0, $
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1113
|
+
async function $07358f6c1dbf57c3$var$main() {
|
|
1114
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["help"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["h"]) {
|
|
1115
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(`Usage: ${(0, $c731a22a41036768$export$6f4ae1207c703045)[1]} [name] [domain] [options] `);
|
|
1116
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(`Options:`);
|
|
1117
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(` -h, --help: Show this help`);
|
|
1118
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(` -v, --verbose: Show verbose output`);
|
|
1119
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(` -d, --dump: Dump all results`);
|
|
1120
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(` -D, --dump-grouped: Dump all results, grouped by profile`);
|
|
1121
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(` -r, --render: Render all results`);
|
|
1070
1122
|
return;
|
|
1071
1123
|
}
|
|
1072
|
-
(0, $
|
|
1073
|
-
const fetchUrl = (0, $
|
|
1124
|
+
(0, $c731a22a41036768$export$c348dfaf65040d9b)["verbose"] = (0, $c731a22a41036768$export$c348dfaf65040d9b)["verbose"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["v"];
|
|
1125
|
+
const fetchUrl = (0, $c731a22a41036768$export$c348dfaf65040d9b)["fetch"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["F"];
|
|
1074
1126
|
if (fetchUrl) {
|
|
1075
1127
|
let url;
|
|
1076
1128
|
try {
|
|
1077
1129
|
url = new URL(fetchUrl);
|
|
1078
1130
|
} catch (e) {
|
|
1079
|
-
|
|
1131
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).error("Invalid URL", fetchUrl);
|
|
1080
1132
|
return;
|
|
1081
1133
|
}
|
|
1082
|
-
const headerArgs = (0, $
|
|
1083
|
-
const headers = (0, $
|
|
1134
|
+
const headerArgs = (0, $c731a22a41036768$export$c348dfaf65040d9b)["H"];
|
|
1135
|
+
const headers = (0, $67b8f97a626b0219$export$e7dabf85f0a9f9c)(headerArgs);
|
|
1084
1136
|
const onfulfilled = (res)=>{
|
|
1085
|
-
if ((0, $
|
|
1086
|
-
|
|
1137
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["dump-response-headers"]) res.headers.forEach((value, key)=>{
|
|
1138
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(`${key}: ${value}`);
|
|
1087
1139
|
});
|
|
1088
|
-
if ((0, $
|
|
1089
|
-
|
|
1140
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b)["dump-response-body"]) res.text().then((r)=>{
|
|
1141
|
+
(0, $f5ffc29454da9157$export$2e2bcd8739ae039).log(r);
|
|
1090
1142
|
});
|
|
1091
1143
|
return;
|
|
1092
1144
|
};
|
|
1093
|
-
(0, $
|
|
1145
|
+
(0, $9a28c00d1ec5ecc2$export$b24a545a0b39f491)(url, {
|
|
1094
1146
|
headers: //
|
|
1095
1147
|
headers
|
|
1096
|
-
}).then(onfulfilled,
|
|
1148
|
+
}).then(onfulfilled, (0, $f5ffc29454da9157$export$2e2bcd8739ae039).error);
|
|
1097
1149
|
return;
|
|
1098
1150
|
}
|
|
1099
1151
|
const cookieSpecs = [];
|
|
1100
|
-
const argUrl = (0, $
|
|
1101
|
-
if (argUrl) for (const cookieSpec of (0, $
|
|
1152
|
+
const argUrl = (0, $c731a22a41036768$export$c348dfaf65040d9b)["url"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["u"];
|
|
1153
|
+
if (argUrl) for (const cookieSpec of (0, $2febaded2716e6a6$export$f266452a5050185d)(argUrl))cookieSpecs.push(cookieSpec);
|
|
1102
1154
|
else cookieSpecs.push({
|
|
1103
|
-
name: (0, $
|
|
1104
|
-
domain: (0, $
|
|
1155
|
+
name: (0, $c731a22a41036768$export$c348dfaf65040d9b)["name"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["_"][0] || "%",
|
|
1156
|
+
domain: (0, $c731a22a41036768$export$c348dfaf65040d9b)["domain"] || (0, $c731a22a41036768$export$c348dfaf65040d9b)["_"][1] || "%"
|
|
1105
1157
|
});
|
|
1106
|
-
if ((0, $
|
|
1107
|
-
await $
|
|
1158
|
+
if ((0, $c731a22a41036768$export$c348dfaf65040d9b).verbose) (0, $f5ffc29454da9157$export$2e2bcd8739ae039).log("cookieSpecs", cookieSpecs);
|
|
1159
|
+
await $07358f6c1dbf57c3$var$cliQueryCookies(cookieSpecs).catch((0, $f5ffc29454da9157$export$2e2bcd8739ae039).error);
|
|
1108
1160
|
}
|
|
1109
|
-
$
|
|
1161
|
+
$07358f6c1dbf57c3$var$main().then((r)=>r, (0, $f5ffc29454da9157$export$2e2bcd8739ae039).error);
|
|
1110
1162
|
|
|
1111
1163
|
|