@mherod/get-cookie 2.0.0-rc.28 → 2.0.0-rc.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +848 -10187
- package/dist/index.js +883 -10132
- package/dist/module.js +1009 -652
- package/dist/module.js.map +1 -1
- package/package.json +3 -13
- package/src/browsers/CompositeCookieQueryStrategy.ts +0 -1
- package/src/fetchWithCookies.ts +15 -10
- package/tsconfig.json +1 -1
- package/dist/prompt.2dcd57a4.js +0 -736
- package/dist/prompt.ad369937.js +0 -736
- package/dist/prompt.ebd83909.js +0 -736
- package/dist/prompt.fb2c7dad.js +0 -1002
package/dist/module.js
CHANGED
|
@@ -3,26 +3,32 @@ import {uniqBy as $6B8p2$uniqBy, merge as $6B8p2$merge, groupBy as $6B8p2$groupB
|
|
|
3
3
|
import $6B8p2$minimist from "minimist";
|
|
4
4
|
import $6B8p2$lrucache from "lru-cache";
|
|
5
5
|
import {red as $6B8p2$red, redBright as $6B8p2$redBright, blue as $6B8p2$blue, yellow as $6B8p2$yellow} from "colorette";
|
|
6
|
-
import $6B8p2$fs, {existsSync as $6B8p2$existsSync, statSync as $6B8p2$statSync
|
|
6
|
+
import $6B8p2$fs, {existsSync as $6B8p2$existsSync, statSync as $6B8p2$statSync} from "fs";
|
|
7
7
|
import {pbkdf2 as $6B8p2$pbkdf2, createDecipheriv as $6B8p2$createDecipheriv} from "crypto";
|
|
8
8
|
import {join as $6B8p2$join} from "path";
|
|
9
9
|
import {Database as $6B8p2$Database} from "sqlite3";
|
|
10
10
|
import {exec as $6B8p2$exec} from "child_process";
|
|
11
|
-
import {readdir as $6B8p2$readdir
|
|
11
|
+
import {readdir as $6B8p2$readdir} from "fs/promises";
|
|
12
12
|
import $6B8p2$consola from "consola";
|
|
13
13
|
import $6B8p2$jsonwebtoken from "jsonwebtoken";
|
|
14
14
|
import {fetch as $6B8p2$fetch} from "cross-fetch";
|
|
15
15
|
import $6B8p2$destr from "destr";
|
|
16
16
|
import $6B8p2$useragents from "user-agents";
|
|
17
|
-
import {MemoryCookieStore as $6B8p2$MemoryCookieStore, CookieJar as $6B8p2$CookieJar, Cookie as $6B8p2$Cookie, Store as $6B8p2$Store} from "tough-cookie";
|
|
18
17
|
|
|
19
18
|
function $parcel$export(e, n, v, s) {
|
|
20
19
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
20
|
}
|
|
21
|
+
var $3a892f71b64103f5$exports = {};
|
|
22
22
|
|
|
23
|
+
$parcel$export($3a892f71b64103f5$exports, "getCookie", () => $3a892f71b64103f5$export$4be65e66cfa2648a, (v) => $3a892f71b64103f5$export$4be65e66cfa2648a = v);
|
|
24
|
+
var $f382029733f65752$exports = {};
|
|
23
25
|
|
|
26
|
+
$parcel$export($f382029733f65752$exports, "queryCookies", () => $f382029733f65752$export$e6d428437cf2cacb, (v) => $f382029733f65752$export$e6d428437cf2cacb = v);
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var $01f4cf98d50740c6$var$_a;
|
|
31
|
+
const $01f4cf98d50740c6$export$6f4ae1207c703045 = ($01f4cf98d50740c6$var$_a = process.argv) !== null && $01f4cf98d50740c6$var$_a !== void 0 ? $01f4cf98d50740c6$var$_a : [];
|
|
26
32
|
const $01f4cf98d50740c6$var$minimistArgs = (0, $6B8p2$minimist)($01f4cf98d50740c6$export$6f4ae1207c703045.slice(2));
|
|
27
33
|
const $01f4cf98d50740c6$var$defaultOptions = {
|
|
28
34
|
verbose: false
|
|
@@ -33,23 +39,59 @@ const $01f4cf98d50740c6$export$c348dfaf65040d9b = (0, $6B8p2$merge)($01f4cf98d50
|
|
|
33
39
|
var $49168e685ea38e19$exports = {};
|
|
34
40
|
|
|
35
41
|
$parcel$export($49168e685ea38e19$exports, "default", () => $49168e685ea38e19$export$2e2bcd8739ae039, (v) => $49168e685ea38e19$export$2e2bcd8739ae039 = v);
|
|
42
|
+
var $a6f61760d01c3afd$exports = {};
|
|
43
|
+
|
|
44
|
+
$parcel$export($a6f61760d01c3afd$exports, "default", () => $a6f61760d01c3afd$export$2e2bcd8739ae039, (v) => $a6f61760d01c3afd$export$2e2bcd8739ae039 = v);
|
|
45
|
+
$parcel$export($a6f61760d01c3afd$exports, "doChromeSqliteQuery1", () => $a6f61760d01c3afd$export$bd52b72df8d0d261, (v) => $a6f61760d01c3afd$export$bd52b72df8d0d261 = v);
|
|
46
|
+
var $7a8c6b6f0e26a266$exports = {};
|
|
47
|
+
|
|
48
|
+
$parcel$export($7a8c6b6f0e26a266$exports, "execSimple", () => $7a8c6b6f0e26a266$export$8d71c74f97c0202e, (v) => $7a8c6b6f0e26a266$export$8d71c74f97c0202e = v);
|
|
36
49
|
// noinspection JSUnusedGlobalSymbols
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
reject(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
var $7a8c6b6f0e26a266$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
52
|
+
function adopt(value) {
|
|
53
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
54
|
+
resolve(value);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
58
|
+
function fulfilled(value) {
|
|
59
|
+
try {
|
|
60
|
+
step(generator.next(value));
|
|
61
|
+
} catch (e) {
|
|
62
|
+
reject(e);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function rejected(value) {
|
|
66
|
+
try {
|
|
67
|
+
step(generator["throw"](value));
|
|
68
|
+
} catch (e) {
|
|
69
|
+
reject(e);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function step(result) {
|
|
73
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
74
|
+
}
|
|
75
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
function $7a8c6b6f0e26a266$export$8d71c74f97c0202e(command) {
|
|
79
|
+
return $7a8c6b6f0e26a266$var$__awaiter(this, void 0, void 0, function*() {
|
|
80
|
+
return new Promise((resolve, reject)=>{
|
|
81
|
+
(0, $6B8p2$exec)(command, {
|
|
82
|
+
encoding: "binary",
|
|
83
|
+
maxBuffer: 5120
|
|
84
|
+
}, (error, stdout, stderr)=>{
|
|
85
|
+
if (error) {
|
|
86
|
+
reject(error);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (stderr) {
|
|
90
|
+
reject(error);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (stdout) resolve(stdout.trim());
|
|
94
|
+
});
|
|
53
95
|
});
|
|
54
96
|
});
|
|
55
97
|
}
|
|
@@ -63,49 +105,81 @@ if (!$ebc8f9a71f429261$export$a7c5707626fc90f) throw new Error("HOME environment
|
|
|
63
105
|
|
|
64
106
|
|
|
65
107
|
|
|
108
|
+
var $a6c1a5673fde1c2b$exports = {};
|
|
66
109
|
|
|
110
|
+
$parcel$export($a6c1a5673fde1c2b$exports, "findAllFiles", () => $a6c1a5673fde1c2b$export$2c9faf86071156ae, (v) => $a6c1a5673fde1c2b$export$2c9faf86071156ae = v);
|
|
67
111
|
|
|
68
112
|
|
|
69
113
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} catch (e) {
|
|
77
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(`Error reading ${path}`, e);
|
|
78
|
-
return [];
|
|
114
|
+
|
|
115
|
+
var $a6c1a5673fde1c2b$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
116
|
+
function adopt(value) {
|
|
117
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
118
|
+
resolve(value);
|
|
119
|
+
});
|
|
79
120
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
121
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
122
|
+
function fulfilled(value) {
|
|
123
|
+
try {
|
|
124
|
+
step(generator.next(value));
|
|
125
|
+
} catch (e) {
|
|
126
|
+
reject(e);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function rejected(value) {
|
|
130
|
+
try {
|
|
131
|
+
step(generator["throw"](value));
|
|
132
|
+
} catch (e) {
|
|
133
|
+
reject(e);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function step(result) {
|
|
137
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
138
|
+
}
|
|
139
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
function $a6c1a5673fde1c2b$export$2c9faf86071156ae({ path: path , name: name , maxDepth: maxDepth = 2 }) {
|
|
143
|
+
return $a6c1a5673fde1c2b$var$__awaiter(this, void 0, void 0, function*() {
|
|
144
|
+
const rootSegments = path.split("/").length;
|
|
145
|
+
const files = [];
|
|
146
|
+
let readdirSync;
|
|
83
147
|
try {
|
|
84
|
-
|
|
85
|
-
} catch (
|
|
86
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(`Error
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
} catch (e2) {
|
|
98
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(e2);
|
|
148
|
+
readdirSync = yield (0, $6B8p2$readdir)(path);
|
|
149
|
+
} catch (e) {
|
|
150
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(`Error reading ${path}`, e);
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
for (const file of readdirSync){
|
|
154
|
+
const filePath = path + "/" + file;
|
|
155
|
+
let stat;
|
|
156
|
+
try {
|
|
157
|
+
stat = $6B8p2$statSync(filePath);
|
|
158
|
+
} catch (e1) {
|
|
159
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(`Error getting stat for ${filePath}`, e1);
|
|
160
|
+
continue;
|
|
99
161
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
162
|
+
if (stat.isDirectory()) {
|
|
163
|
+
if (filePath.split("/").length < rootSegments + maxDepth) try {
|
|
164
|
+
const subFiles = yield $a6c1a5673fde1c2b$export$2c9faf86071156ae({
|
|
165
|
+
path: filePath,
|
|
166
|
+
name: name,
|
|
167
|
+
maxDepth: 2
|
|
168
|
+
});
|
|
169
|
+
files.push(...subFiles);
|
|
170
|
+
} catch (e2) {
|
|
171
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) (0, $6B8p2$consola).error(e2);
|
|
172
|
+
}
|
|
173
|
+
} else if (file === name) files.push(filePath);
|
|
106
174
|
}
|
|
107
|
-
|
|
108
|
-
|
|
175
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) {
|
|
176
|
+
if (files.length > 0) {
|
|
177
|
+
(0, $6B8p2$consola).log(`Found ${files.length} ${name} files`);
|
|
178
|
+
(0, $6B8p2$consola).log(files);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return files;
|
|
182
|
+
});
|
|
109
183
|
}
|
|
110
184
|
|
|
111
185
|
|
|
@@ -132,224 +206,270 @@ function $78efb18fcf7b6c2c$export$4eadcf0bf35a2ddb(s) {
|
|
|
132
206
|
|
|
133
207
|
|
|
134
208
|
|
|
209
|
+
var $a6f61760d01c3afd$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
210
|
+
function adopt(value) {
|
|
211
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
212
|
+
resolve(value);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
216
|
+
function fulfilled(value) {
|
|
217
|
+
try {
|
|
218
|
+
step(generator.next(value));
|
|
219
|
+
} catch (e) {
|
|
220
|
+
reject(e);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function rejected(value) {
|
|
224
|
+
try {
|
|
225
|
+
step(generator["throw"](value));
|
|
226
|
+
} catch (e) {
|
|
227
|
+
reject(e);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function step(result) {
|
|
231
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
232
|
+
}
|
|
233
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
234
|
+
});
|
|
235
|
+
};
|
|
135
236
|
class $a6f61760d01c3afd$export$2e2bcd8739ae039 {
|
|
136
237
|
constructor(){
|
|
137
238
|
this.browserName = "Chrome";
|
|
138
239
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
240
|
+
queryCookies(name, domain) {
|
|
241
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
242
|
+
if (process.platform !== "darwin") throw new Error("This only works on macOS");
|
|
243
|
+
if ((0, $ebc8f9a71f429261$export$a7b6bc01c63cdfc3).FIREFOX_ONLY) return [];
|
|
244
|
+
return $a6f61760d01c3afd$var$getChromeCookies({
|
|
245
|
+
requireJwt: false,
|
|
246
|
+
name: name,
|
|
247
|
+
domain: domain
|
|
248
|
+
});
|
|
146
249
|
});
|
|
147
250
|
}
|
|
148
251
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
252
|
+
function $a6f61760d01c3afd$var$getPromise1(name, domain, file) {
|
|
253
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
254
|
+
try {
|
|
255
|
+
return yield $a6f61760d01c3afd$var$getEncryptedChromeCookie({
|
|
256
|
+
name: name,
|
|
257
|
+
domain: domain,
|
|
258
|
+
file: file
|
|
259
|
+
});
|
|
260
|
+
} catch (e) {
|
|
261
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error getting encrypted cookie", e);
|
|
262
|
+
return [];
|
|
263
|
+
}
|
|
264
|
+
});
|
|
160
265
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
266
|
+
function $a6f61760d01c3afd$var$getPromise(name, domain) {
|
|
267
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
268
|
+
try {
|
|
269
|
+
const files = yield (0, $a6c1a5673fde1c2b$exports.findAllFiles)({
|
|
270
|
+
path: $a6f61760d01c3afd$var$chromeLocal,
|
|
271
|
+
name: "Cookies"
|
|
272
|
+
});
|
|
273
|
+
const promises = files.map((file)=>$a6f61760d01c3afd$var$getPromise1(name, domain, file));
|
|
274
|
+
const results1 = yield Promise.all(promises);
|
|
275
|
+
return results1.flat().filter((0, $63d6ce571e62efc6$export$bc926c43858bd3cb));
|
|
276
|
+
} catch (error) {
|
|
277
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("error", error);
|
|
278
|
+
return [];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
174
281
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
282
|
+
function $a6f61760d01c3afd$var$decryptValue(password, encryptedValue) {
|
|
283
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
284
|
+
let d;
|
|
285
|
+
try {
|
|
286
|
+
d = yield $a6f61760d01c3afd$var$decrypt(password, encryptedValue);
|
|
287
|
+
} catch (e) {
|
|
288
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error decrypting cookie", e);
|
|
289
|
+
d = null;
|
|
290
|
+
}
|
|
291
|
+
return d !== null && d !== void 0 ? d : encryptedValue.toString("utf-8");
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function $a6f61760d01c3afd$var$getChromeCookies({ name: name , domain: domain = "%" , requireJwt: requireJwt = false }) {
|
|
295
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
296
|
+
const encryptedDataItems = yield $a6f61760d01c3afd$var$getPromise(name, domain);
|
|
297
|
+
const password = yield $a6f61760d01c3afd$var$getChromePassword();
|
|
298
|
+
const decrypted = encryptedDataItems.filter(({ value: value })=>value != null && value.length > 0).map((cookieRow)=>$a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
299
|
+
var _a;
|
|
300
|
+
const encryptedValue = cookieRow.value;
|
|
301
|
+
const decryptedValue = yield $a6f61760d01c3afd$var$decryptValue(password, encryptedValue);
|
|
302
|
+
const meta = {};
|
|
303
|
+
(0, $6B8p2$merge)(meta, (_a = cookieRow.meta) !== null && _a !== void 0 ? _a : {});
|
|
304
|
+
const exportedCookie = {
|
|
305
|
+
domain: cookieRow.domain,
|
|
306
|
+
name: cookieRow.name,
|
|
307
|
+
value: decryptedValue,
|
|
308
|
+
meta: meta
|
|
309
|
+
};
|
|
310
|
+
const expiry = cookieRow.expiry;
|
|
311
|
+
const mergeExpiry = expiry != null && expiry > 0 ? {
|
|
312
|
+
expiry: new Date(expiry)
|
|
313
|
+
} : {
|
|
314
|
+
expiry: "Infinity"
|
|
315
|
+
};
|
|
316
|
+
(0, $6B8p2$merge)(exportedCookie, mergeExpiry);
|
|
317
|
+
return exportedCookie;
|
|
318
|
+
}));
|
|
319
|
+
const results = (yield Promise.all(decrypted)).filter((0, $2c20f7c9c363469f$export$963c8d651337e4a4));
|
|
320
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("results", results);
|
|
321
|
+
return results;
|
|
207
322
|
});
|
|
208
|
-
const results = (await Promise.all(decrypted)).filter((0, $2c20f7c9c363469f$export$963c8d651337e4a4));
|
|
209
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("results", results);
|
|
210
|
-
return results;
|
|
211
323
|
}
|
|
212
324
|
const $a6f61760d01c3afd$var$chromeLocal = $6B8p2$join((0, $ebc8f9a71f429261$export$a7c5707626fc90f), "Library", "Application Support", "Google", "Chrome");
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
let sql;
|
|
220
|
-
//language=SQL
|
|
221
|
-
sql = "SELECT * FROM cookies";
|
|
222
|
-
// sql = "SELECT encrypted_value, name, host_key FROM cookies";
|
|
223
|
-
const wildcardRegexp = /^([*%])$/i;
|
|
224
|
-
const specifiedName = name.match(wildcardRegexp) == null;
|
|
225
|
-
const specifiedDomain = domain.match(wildcardRegexp) == null;
|
|
226
|
-
const wildcardDomain = domain.match(/[%*]/) != null;
|
|
227
|
-
const queryDomain = specifiedDomain && !wildcardDomain;
|
|
228
|
-
// if we have a wildcard domain, we need to use a regexp
|
|
229
|
-
if (specifiedName || queryDomain) {
|
|
230
|
-
sql += ` WHERE `;
|
|
231
|
-
if (specifiedName) {
|
|
232
|
-
sql += `name = '${name}'`;
|
|
233
|
-
if (queryDomain) sql += ` AND `;
|
|
234
|
-
}
|
|
235
|
-
if (queryDomain) {
|
|
236
|
-
// leading dot replaced with % to match subdomains
|
|
237
|
-
const sqlEmbedDomain = domain.replace(/^[.%]?/, "%");
|
|
238
|
-
sql += `host_key LIKE '${sqlEmbedDomain}';`;
|
|
325
|
+
function $a6f61760d01c3afd$var$getEncryptedChromeCookie({ name: name , domain: domain , file: file = $6B8p2$join($a6f61760d01c3afd$var$chromeLocal, "Default", "Cookies") }) {
|
|
326
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
327
|
+
if (!(0, $6B8p2$existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
328
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) {
|
|
329
|
+
const s = file.split("/").slice(-3).join("/");
|
|
330
|
+
console.log(`Trying Chrome (at ${s}) cookie ${name} for domain ${domain}`);
|
|
239
331
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
name
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
if (
|
|
257
|
-
|
|
332
|
+
let sql;
|
|
333
|
+
//language=SQL
|
|
334
|
+
sql = "SELECT * FROM cookies";
|
|
335
|
+
// sql = "SELECT encrypted_value, name, host_key FROM cookies";
|
|
336
|
+
const wildcardRegexp = /^([*%])$/i;
|
|
337
|
+
const specifiedName = name.match(wildcardRegexp) == null;
|
|
338
|
+
const specifiedDomain = domain.match(wildcardRegexp) == null;
|
|
339
|
+
const wildcardDomain = domain.match(/[%*]/) != null;
|
|
340
|
+
const queryDomain = specifiedDomain && !wildcardDomain;
|
|
341
|
+
// if we have a wildcard domain, we need to use a regexp
|
|
342
|
+
if (specifiedName || queryDomain) {
|
|
343
|
+
sql += ` WHERE `;
|
|
344
|
+
if (specifiedName) {
|
|
345
|
+
sql += `name = '${name}'`;
|
|
346
|
+
if (queryDomain) sql += ` AND `;
|
|
347
|
+
}
|
|
348
|
+
if (queryDomain) {
|
|
349
|
+
// leading dot replaced with % to match subdomains
|
|
350
|
+
const sqlEmbedDomain = domain.replace(/^[.%]?/, "%");
|
|
351
|
+
sql += `host_key LIKE '${sqlEmbedDomain}';`;
|
|
352
|
+
}
|
|
258
353
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
354
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("sql", sql);
|
|
355
|
+
const domainRegexp = (0, $78efb18fcf7b6c2c$export$4eadcf0bf35a2ddb)(domain);
|
|
356
|
+
const sqliteQuery1 = yield $a6f61760d01c3afd$export$bd52b72df8d0d261({
|
|
357
|
+
file: file,
|
|
358
|
+
sql: sql,
|
|
359
|
+
rowFilter: (row)=>{
|
|
360
|
+
return row["host_key"].match(domainRegexp) != null;
|
|
361
|
+
},
|
|
362
|
+
rowTransform: (row)=>{
|
|
363
|
+
const cookieRow = {
|
|
364
|
+
expiry: (row["expires_utc"] / 1000000 - 11644473600) * 1000,
|
|
365
|
+
domain: row["host_key"],
|
|
366
|
+
name: row["name"],
|
|
367
|
+
value: row["encrypted_value"]
|
|
368
|
+
};
|
|
369
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("CookieRow", cookieRow);
|
|
370
|
+
return cookieRow;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
return sqliteQuery1.filter((row)=>{
|
|
374
|
+
return row.domain.match(domainRegexp) != null;
|
|
375
|
+
});
|
|
262
376
|
});
|
|
263
377
|
}
|
|
264
|
-
|
|
265
|
-
return
|
|
378
|
+
function $a6f61760d01c3afd$var$getChromePassword() {
|
|
379
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
380
|
+
return (0, $7a8c6b6f0e26a266$exports.execSimple)('security find-generic-password -w -s "Chrome Safe Storage"');
|
|
381
|
+
});
|
|
266
382
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
[
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
|
|
383
|
+
function $a6f61760d01c3afd$var$decrypt(password, encryptedData) {
|
|
384
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
385
|
+
if (typeof password !== "string") throw new Error("password must be a string: " + password);
|
|
386
|
+
let encryptedData1;
|
|
387
|
+
encryptedData1 = encryptedData;
|
|
388
|
+
if (encryptedData1 == null || typeof encryptedData1 !== "object") throw new Error("encryptedData must be a object: " + encryptedData1);
|
|
389
|
+
if (!(encryptedData1 instanceof Buffer)) {
|
|
390
|
+
if (Array.isArray(encryptedData1) && encryptedData1[0] instanceof Buffer) {
|
|
391
|
+
[encryptedData1] = encryptedData1;
|
|
392
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`encryptedData is an array of buffers, selected first: ${encryptedData1}`);
|
|
393
|
+
} else throw new Error("encryptedData must be a Buffer: " + encryptedData1);
|
|
394
|
+
encryptedData1 = Buffer.from(encryptedData1);
|
|
395
|
+
}
|
|
396
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`Trying to decrypt with password ${password}`);
|
|
397
|
+
return new Promise((resolve, reject)=>{
|
|
398
|
+
$6B8p2$pbkdf2(password, "saltysalt", 1003, 16, "sha1", (error, buffer)=>{
|
|
399
|
+
try {
|
|
400
|
+
if (error) {
|
|
401
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2", error);
|
|
402
|
+
reject(error);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (buffer.length !== 16) {
|
|
406
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, buffer length is not 16", buffer.length);
|
|
407
|
+
reject(new Error("Buffer length is not 16"));
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
const str = new Array(17).join(" ");
|
|
411
|
+
const iv = Buffer.from(str, "binary");
|
|
412
|
+
const decipher = $6B8p2$createDecipheriv("aes-128-cbc", buffer, iv);
|
|
413
|
+
decipher.setAutoPadding(false);
|
|
414
|
+
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
415
|
+
if (encryptedData1.length % 16 !== 0) {
|
|
416
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
417
|
+
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
let decoded = decipher.update(encryptedData1);
|
|
421
|
+
try {
|
|
422
|
+
decipher.final("utf-8");
|
|
423
|
+
} catch (e) {
|
|
424
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing decipher.final()", e);
|
|
425
|
+
reject(e);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const padding = decoded[decoded.length - 1];
|
|
429
|
+
if (padding) decoded = decoded.slice(0, 0 - padding);
|
|
430
|
+
// noinspection JSCheckFunctionSignatures
|
|
431
|
+
const decodedString = decoded.toString("utf8");
|
|
432
|
+
resolve(decodedString);
|
|
433
|
+
} catch (e1) {
|
|
434
|
+
reject(e1);
|
|
287
435
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function $a6f61760d01c3afd$export$bd52b72df8d0d261({ file: file , sql: sql , rowFilter: rowFilter = ()=>true , rowTransform: rowTransform }) {
|
|
441
|
+
return $a6f61760d01c3afd$var$__awaiter(this, void 0, void 0, function*() {
|
|
442
|
+
if (!file || file && !(0, $6B8p2$fs).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
443
|
+
const db = new $6B8p2$Database(file);
|
|
444
|
+
return new Promise((resolve, reject)=>{
|
|
445
|
+
db.all(sql, (err, rows)=>{
|
|
446
|
+
if (err) {
|
|
447
|
+
reject(err);
|
|
291
448
|
return;
|
|
292
449
|
}
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
decipher.setAutoPadding(false);
|
|
297
|
-
if (encryptedData1 && encryptedData1.slice) encryptedData1 = encryptedData1.slice(3);
|
|
298
|
-
if (encryptedData1.length % 16 !== 0) {
|
|
299
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Error doing pbkdf2, encryptedData length is not a multiple of 16", encryptedData1.length);
|
|
300
|
-
reject(new Error("encryptedData length is not a multiple of 16"));
|
|
450
|
+
const rows1 = rows;
|
|
451
|
+
if (rows1 == null || rows1.length === 0) {
|
|
452
|
+
resolve([]);
|
|
301
453
|
return;
|
|
302
454
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
455
|
+
if (Array.isArray(rows1)) {
|
|
456
|
+
const cookieRows = rows1.filter(rowFilter).map((row)=>{
|
|
457
|
+
const newVar = {
|
|
458
|
+
meta: {
|
|
459
|
+
file: file
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
const cookieRow = rowTransform(row);
|
|
463
|
+
return (0, $6B8p2$merge)(newVar, cookieRow);
|
|
464
|
+
});
|
|
465
|
+
resolve(cookieRows);
|
|
309
466
|
return;
|
|
310
467
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
} catch (e1) {
|
|
317
|
-
reject(e1);
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
async function $a6f61760d01c3afd$export$bd52b72df8d0d261({ file: file , sql: sql , rowFilter: rowFilter = ()=>true , rowTransform: rowTransform }) {
|
|
323
|
-
if (!file || file && !(0, $6B8p2$fs).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
324
|
-
const db = new $6B8p2$Database(file);
|
|
325
|
-
return new Promise((resolve, reject)=>{
|
|
326
|
-
db.all(sql, (err, rows)=>{
|
|
327
|
-
if (err) {
|
|
328
|
-
reject(err);
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
const rows1 = rows;
|
|
332
|
-
if (rows1 == null || rows1.length === 0) {
|
|
333
|
-
resolve([]);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (Array.isArray(rows1)) {
|
|
337
|
-
const cookieRows = rows1.filter(rowFilter).map((row)=>{
|
|
338
|
-
const newVar = {
|
|
339
|
-
meta: {
|
|
340
|
-
file: file
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
const cookieRow = rowTransform(row);
|
|
344
|
-
return (0, $6B8p2$merge)(newVar, cookieRow);
|
|
345
|
-
});
|
|
346
|
-
resolve(cookieRows);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
350
|
-
resolve([
|
|
351
|
-
rows1
|
|
352
|
-
]);
|
|
468
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
469
|
+
resolve([
|
|
470
|
+
rows1
|
|
471
|
+
]);
|
|
472
|
+
});
|
|
353
473
|
});
|
|
354
474
|
});
|
|
355
475
|
}
|
|
@@ -375,43 +495,72 @@ function $81d2f9cb974d13de$export$da22813e5a2ec500({ name: name , domain: domain
|
|
|
375
495
|
|
|
376
496
|
|
|
377
497
|
|
|
498
|
+
var $62dcb7ce199205be$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
499
|
+
function adopt(value) {
|
|
500
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
501
|
+
resolve(value);
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
505
|
+
function fulfilled(value) {
|
|
506
|
+
try {
|
|
507
|
+
step(generator.next(value));
|
|
508
|
+
} catch (e) {
|
|
509
|
+
reject(e);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
function rejected(value) {
|
|
513
|
+
try {
|
|
514
|
+
step(generator["throw"](value));
|
|
515
|
+
} catch (e) {
|
|
516
|
+
reject(e);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function step(result) {
|
|
520
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
521
|
+
}
|
|
522
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
523
|
+
});
|
|
524
|
+
};
|
|
378
525
|
var $62dcb7ce199205be$var$__classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
|
|
379
526
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
380
527
|
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");
|
|
381
528
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
382
529
|
};
|
|
383
530
|
var $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_queryCookiesDb;
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
531
|
+
function $62dcb7ce199205be$export$f19f611d1fa7c6f3({ file: file , sql: sql , rowTransform: rowTransform }) {
|
|
532
|
+
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
533
|
+
if (!file || file && !(0, $6B8p2$fs).existsSync(file)) throw new Error(`doSqliteQuery1: file ${file} does not exist`);
|
|
534
|
+
const db = new $6B8p2$Database(file);
|
|
535
|
+
return new Promise((resolve, reject)=>{
|
|
536
|
+
db.all(sql, (err, rows)=>{
|
|
537
|
+
if (err) {
|
|
538
|
+
reject(err);
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
const rows1 = rows;
|
|
542
|
+
if (rows1 == null || rows1.length === 0) {
|
|
543
|
+
resolve([]);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (Array.isArray(rows1)) {
|
|
547
|
+
const cookieRows = rows1.map((row)=>{
|
|
548
|
+
const newVar = {
|
|
549
|
+
meta: {
|
|
550
|
+
file: file
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
const cookieRow = rowTransform(row);
|
|
554
|
+
return (0, $6B8p2$merge)(newVar, cookieRow);
|
|
555
|
+
});
|
|
556
|
+
resolve(cookieRows);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log(`doSqliteQuery1: rows ${JSON.stringify(rows1)}`);
|
|
560
|
+
resolve([
|
|
561
|
+
rows1
|
|
562
|
+
]);
|
|
563
|
+
});
|
|
415
564
|
});
|
|
416
565
|
});
|
|
417
566
|
}
|
|
@@ -420,82 +569,120 @@ class $62dcb7ce199205be$export$2e2bcd8739ae039 {
|
|
|
420
569
|
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances.add(this);
|
|
421
570
|
this.browserName = "Firefox";
|
|
422
571
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
return {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
572
|
+
queryCookies(name, domain) {
|
|
573
|
+
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
574
|
+
if (process.platform !== "darwin") // TODO: implement
|
|
575
|
+
return [];
|
|
576
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).browser !== "firefox") return [];
|
|
577
|
+
const cookies = yield $62dcb7ce199205be$var$__classPrivateFieldGet(this, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances, "m", $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie).call(this, {
|
|
578
|
+
name: name,
|
|
579
|
+
domain: domain
|
|
580
|
+
});
|
|
581
|
+
if (Array.isArray(cookies)) return cookies.map((cookie)=>{
|
|
582
|
+
return {
|
|
583
|
+
domain: cookie.domain,
|
|
584
|
+
name: cookie.name,
|
|
585
|
+
value: cookie.value.toString("utf8")
|
|
586
|
+
};
|
|
587
|
+
});
|
|
588
|
+
else return [];
|
|
437
589
|
});
|
|
438
|
-
else return [];
|
|
439
590
|
}
|
|
440
591
|
}
|
|
441
|
-
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie =
|
|
592
|
+
$62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances = new WeakSet(), $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_getFirefoxCookie = function _FirefoxCookieQueryStrategy_getFirefoxCookie({ name: name , domain: domain } //
|
|
442
593
|
) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
594
|
+
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
595
|
+
const files = yield (0, $a6c1a5673fde1c2b$exports.findAllFiles)({
|
|
596
|
+
path: $6B8p2$join((0, $ebc8f9a71f429261$export$a7c5707626fc90f), "Library", "Application Support", "Firefox", "Profiles"),
|
|
597
|
+
name: "cookies.sqlite"
|
|
598
|
+
});
|
|
599
|
+
const fn = (file)=>$62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
600
|
+
return yield $62dcb7ce199205be$var$__classPrivateFieldGet(this, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_instances, "m", $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_queryCookiesDb).call(this, file, name, domain);
|
|
601
|
+
});
|
|
602
|
+
const all = yield Promise.all(files.map(fn));
|
|
603
|
+
// flatten
|
|
604
|
+
return all.flat();
|
|
446
605
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
//language=SQL
|
|
457
|
-
sql = "SELECT value, name, host FROM moz_cookies";
|
|
458
|
-
const { specifiedName: specifiedName , specifiedDomain: specifiedDomain } = (0, $81d2f9cb974d13de$export$da22813e5a2ec500)({
|
|
459
|
-
name: name,
|
|
460
|
-
domain: domain
|
|
461
|
-
});
|
|
462
|
-
if (specifiedName || specifiedDomain) {
|
|
463
|
-
sql += ` WHERE `;
|
|
464
|
-
if (specifiedName) {
|
|
465
|
-
sql += `name = '${name}'`;
|
|
466
|
-
if (specifiedDomain) sql += ` AND `;
|
|
467
|
-
}
|
|
468
|
-
if (specifiedDomain) sql += `host LIKE '${domain}';`;
|
|
469
|
-
}
|
|
470
|
-
const rowTransform = (row)=>{
|
|
471
|
-
// row is object key by column name
|
|
472
|
-
const value = row.value;
|
|
473
|
-
return {
|
|
474
|
-
domain: row.domain,
|
|
475
|
-
name: row.name,
|
|
476
|
-
value: Buffer.from(value, "utf8")
|
|
477
|
-
};
|
|
478
|
-
};
|
|
479
|
-
try {
|
|
480
|
-
return await $62dcb7ce199205be$export$f19f611d1fa7c6f3({
|
|
481
|
-
file: file,
|
|
482
|
-
sql: sql,
|
|
483
|
-
rowTransform: rowTransform
|
|
606
|
+
}, $62dcb7ce199205be$var$_FirefoxCookieQueryStrategy_queryCookiesDb = function _FirefoxCookieQueryStrategy_queryCookiesDb(file, name, domain) {
|
|
607
|
+
return $62dcb7ce199205be$var$__awaiter(this, void 0, void 0, function*() {
|
|
608
|
+
if (file && !(0, $6B8p2$existsSync)(file)) throw new Error(`File ${file} does not exist`);
|
|
609
|
+
let sql;
|
|
610
|
+
//language=SQL
|
|
611
|
+
sql = "SELECT value, name, host FROM moz_cookies";
|
|
612
|
+
const { specifiedName: specifiedName , specifiedDomain: specifiedDomain } = (0, $81d2f9cb974d13de$export$da22813e5a2ec500)({
|
|
613
|
+
name: name,
|
|
614
|
+
domain: domain
|
|
484
615
|
});
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
616
|
+
if (specifiedName || specifiedDomain) {
|
|
617
|
+
sql += ` WHERE `;
|
|
618
|
+
if (specifiedName) {
|
|
619
|
+
sql += `name = '${name}'`;
|
|
620
|
+
if (specifiedDomain) sql += ` AND `;
|
|
621
|
+
}
|
|
622
|
+
if (specifiedDomain) sql += `host LIKE '${domain}';`;
|
|
623
|
+
}
|
|
624
|
+
const rowTransform = (row)=>{
|
|
625
|
+
// row is object key by column name
|
|
626
|
+
const value = row.value;
|
|
627
|
+
return {
|
|
628
|
+
domain: row.domain,
|
|
629
|
+
name: row.name,
|
|
630
|
+
value: Buffer.from(value, "utf8")
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
try {
|
|
634
|
+
return yield $62dcb7ce199205be$export$f19f611d1fa7c6f3({
|
|
635
|
+
file: file,
|
|
636
|
+
sql: sql,
|
|
637
|
+
rowTransform: rowTransform
|
|
638
|
+
});
|
|
639
|
+
} catch (e) {
|
|
640
|
+
console.error(`Error querying ${file}`, e);
|
|
641
|
+
return [];
|
|
642
|
+
}
|
|
643
|
+
});
|
|
489
644
|
};
|
|
490
645
|
|
|
491
646
|
|
|
647
|
+
var $b470ee3b0b06a25e$exports = {};
|
|
648
|
+
|
|
649
|
+
$parcel$export($b470ee3b0b06a25e$exports, "default", () => $b470ee3b0b06a25e$export$2e2bcd8739ae039, (v) => $b470ee3b0b06a25e$export$2e2bcd8739ae039 = v);
|
|
650
|
+
var $b470ee3b0b06a25e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
651
|
+
function adopt(value) {
|
|
652
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
653
|
+
resolve(value);
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
657
|
+
function fulfilled(value) {
|
|
658
|
+
try {
|
|
659
|
+
step(generator.next(value));
|
|
660
|
+
} catch (e) {
|
|
661
|
+
reject(e);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function rejected(value) {
|
|
665
|
+
try {
|
|
666
|
+
step(generator["throw"](value));
|
|
667
|
+
} catch (e) {
|
|
668
|
+
reject(e);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function step(result) {
|
|
672
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
673
|
+
}
|
|
674
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
675
|
+
});
|
|
676
|
+
};
|
|
492
677
|
class $b470ee3b0b06a25e$export$2e2bcd8739ae039 {
|
|
493
678
|
constructor(){
|
|
494
679
|
this.browserName = "Safari";
|
|
495
680
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
681
|
+
queryCookies(name, domain) {
|
|
682
|
+
return $b470ee3b0b06a25e$var$__awaiter(this, void 0, void 0, function*() {
|
|
683
|
+
// TODO: implement
|
|
684
|
+
return [];
|
|
685
|
+
});
|
|
499
686
|
}
|
|
500
687
|
}
|
|
501
688
|
|
|
@@ -504,6 +691,33 @@ class $b470ee3b0b06a25e$export$2e2bcd8739ae039 {
|
|
|
504
691
|
|
|
505
692
|
|
|
506
693
|
|
|
694
|
+
var $49168e685ea38e19$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
695
|
+
function adopt(value) {
|
|
696
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
697
|
+
resolve(value);
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
701
|
+
function fulfilled(value) {
|
|
702
|
+
try {
|
|
703
|
+
step(generator.next(value));
|
|
704
|
+
} catch (e) {
|
|
705
|
+
reject(e);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
function rejected(value) {
|
|
709
|
+
try {
|
|
710
|
+
step(generator["throw"](value));
|
|
711
|
+
} catch (e) {
|
|
712
|
+
reject(e);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
function step(result) {
|
|
716
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
717
|
+
}
|
|
718
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
719
|
+
});
|
|
720
|
+
};
|
|
507
721
|
var $49168e685ea38e19$var$__classPrivateFieldSet = undefined && undefined.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
|
|
508
722
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
509
723
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -526,37 +740,39 @@ class $49168e685ea38e19$export$2e2bcd8739ae039 {
|
|
|
526
740
|
$49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies.set(this, void 0);
|
|
527
741
|
$49168e685ea38e19$var$__classPrivateFieldSet(this, $49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies, [
|
|
528
742
|
// CookieStoreQueryStrategy,
|
|
529
|
-
(0, $a6f61760d01c3afd$
|
|
743
|
+
(0, $a6f61760d01c3afd$exports.default),
|
|
530
744
|
(0, $62dcb7ce199205be$exports.default),
|
|
531
|
-
(0, $b470ee3b0b06a25e$
|
|
745
|
+
(0, $b470ee3b0b06a25e$exports.default)
|
|
532
746
|
].map((strategy)=>{
|
|
533
747
|
return new strategy();
|
|
534
748
|
}), "f");
|
|
535
749
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
750
|
+
queryCookies(name, domain) {
|
|
751
|
+
return $49168e685ea38e19$var$__awaiter(this, void 0, void 0, function*() {
|
|
752
|
+
// domain = domain.match(/(\w+.+\w+)/gi)?.pop() ?? domain;
|
|
753
|
+
const key = `${name}:${domain}`;
|
|
754
|
+
const cached = $49168e685ea38e19$var$cache.get(key);
|
|
755
|
+
if (cached) return cached;
|
|
756
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log("Querying cookies:", name, domain);
|
|
757
|
+
const results = yield Promise.all($49168e685ea38e19$var$__classPrivateFieldGet(this, $49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies, "f").map((strategy)=>$49168e685ea38e19$var$__awaiter(this, void 0, void 0, function*() {
|
|
758
|
+
// @ts-ignore
|
|
759
|
+
return strategy.queryCookies(name, domain).then((cookies)=>{
|
|
760
|
+
return cookies.map((cookie)=>{
|
|
761
|
+
return (0, $6B8p2$merge)(cookie, {
|
|
762
|
+
meta: {
|
|
763
|
+
browser: strategy.browserName
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
});
|
|
767
|
+
}).catch((e)=>{
|
|
768
|
+
console.log((0, $6B8p2$red)(`Error querying ${strategy.browserName} cookies`), e);
|
|
769
|
+
return [];
|
|
550
770
|
});
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}));
|
|
557
|
-
const flat = results.flat();
|
|
558
|
-
$49168e685ea38e19$var$cache.set(`${name}:${domain}`, flat);
|
|
559
|
-
return flat;
|
|
771
|
+
})));
|
|
772
|
+
const flat = results.flat();
|
|
773
|
+
$49168e685ea38e19$var$cache.set(`${name}:${domain}`, flat);
|
|
774
|
+
return flat;
|
|
775
|
+
});
|
|
560
776
|
}
|
|
561
777
|
}
|
|
562
778
|
$49168e685ea38e19$var$_CompositeCookieQueryStrategy_strategies = new WeakMap();
|
|
@@ -570,7 +786,7 @@ function $459cd094c935086e$export$2e2bcd8739ae039(token) {
|
|
|
570
786
|
complete: true
|
|
571
787
|
});
|
|
572
788
|
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose && result) console.debug(result);
|
|
573
|
-
const payload = result
|
|
789
|
+
const payload = result === null || result === void 0 ? void 0 : result.payload;
|
|
574
790
|
if (payload) {
|
|
575
791
|
const exp = payload.exp;
|
|
576
792
|
if (exp) {
|
|
@@ -585,53 +801,178 @@ function $459cd094c935086e$export$2e2bcd8739ae039(token) {
|
|
|
585
801
|
}
|
|
586
802
|
|
|
587
803
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
804
|
+
var $f382029733f65752$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
805
|
+
function adopt(value) {
|
|
806
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
807
|
+
resolve(value);
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
811
|
+
function fulfilled(value) {
|
|
812
|
+
try {
|
|
813
|
+
step(generator.next(value));
|
|
814
|
+
} catch (e) {
|
|
815
|
+
reject(e);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
function rejected(value) {
|
|
819
|
+
try {
|
|
820
|
+
step(generator["throw"](value));
|
|
821
|
+
} catch (e) {
|
|
822
|
+
reject(e);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
function step(result) {
|
|
826
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
597
827
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
828
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
829
|
+
});
|
|
830
|
+
};
|
|
831
|
+
function $f382029733f65752$export$e6d428437cf2cacb({ name: name , domain: domain }, strategy = new (0, $49168e685ea38e19$exports.default)()) {
|
|
832
|
+
return $f382029733f65752$var$__awaiter(this, void 0, void 0, function*() {
|
|
833
|
+
//
|
|
834
|
+
const results = yield strategy.queryCookies(name, domain);
|
|
835
|
+
const allCookies = (0, $6B8p2$uniqBy)(results, JSON.stringify);
|
|
836
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b)["require-jwt"]) {
|
|
837
|
+
const jwtCookies = [];
|
|
838
|
+
for (const result of allCookies){
|
|
839
|
+
const value = result.value;
|
|
840
|
+
if ((0, $459cd094c935086e$export$2e2bcd8739ae039)(value)) jwtCookies.push(result);
|
|
841
|
+
}
|
|
842
|
+
return (0, $01f4cf98d50740c6$export$c348dfaf65040d9b)["single"] ? [
|
|
843
|
+
jwtCookies[0]
|
|
844
|
+
] : jwtCookies;
|
|
845
|
+
} else return (0, $01f4cf98d50740c6$export$c348dfaf65040d9b)["single"] ? [
|
|
846
|
+
allCookies[0]
|
|
847
|
+
] : allCookies;
|
|
848
|
+
});
|
|
604
849
|
}
|
|
605
850
|
|
|
606
851
|
|
|
607
852
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
853
|
+
var $3a892f71b64103f5$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
854
|
+
function adopt(value) {
|
|
855
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
856
|
+
resolve(value);
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
860
|
+
function fulfilled(value) {
|
|
861
|
+
try {
|
|
862
|
+
step(generator.next(value));
|
|
863
|
+
} catch (e) {
|
|
864
|
+
reject(e);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function rejected(value) {
|
|
868
|
+
try {
|
|
869
|
+
step(generator["throw"](value));
|
|
870
|
+
} catch (e) {
|
|
871
|
+
reject(e);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
function step(result) {
|
|
875
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
876
|
+
}
|
|
877
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
878
|
+
});
|
|
879
|
+
};
|
|
880
|
+
function $3a892f71b64103f5$export$4be65e66cfa2648a(params) {
|
|
881
|
+
return $3a892f71b64103f5$var$__awaiter(this, void 0, void 0, function*() {
|
|
882
|
+
//
|
|
883
|
+
const cookies = yield (0, $f382029733f65752$exports.queryCookies)(params, new (0, $49168e685ea38e19$exports.default)());
|
|
884
|
+
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
885
|
+
else throw new Error("Cookie not found");
|
|
886
|
+
});
|
|
613
887
|
}
|
|
614
888
|
|
|
615
889
|
|
|
890
|
+
var $c23eafaef8340cc3$exports = {};
|
|
616
891
|
|
|
892
|
+
$parcel$export($c23eafaef8340cc3$exports, "getChromeCookie", () => $c23eafaef8340cc3$export$e5637297e9eb6f2e, (v) => $c23eafaef8340cc3$export$e5637297e9eb6f2e = v);
|
|
617
893
|
|
|
618
894
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
895
|
+
|
|
896
|
+
var $c23eafaef8340cc3$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
897
|
+
function adopt(value) {
|
|
898
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
899
|
+
resolve(value);
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
903
|
+
function fulfilled(value) {
|
|
904
|
+
try {
|
|
905
|
+
step(generator.next(value));
|
|
906
|
+
} catch (e) {
|
|
907
|
+
reject(e);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
function rejected(value) {
|
|
911
|
+
try {
|
|
912
|
+
step(generator["throw"](value));
|
|
913
|
+
} catch (e) {
|
|
914
|
+
reject(e);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function step(result) {
|
|
918
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
919
|
+
}
|
|
920
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
921
|
+
});
|
|
922
|
+
};
|
|
923
|
+
function $c23eafaef8340cc3$export$e5637297e9eb6f2e(params) {
|
|
924
|
+
return $c23eafaef8340cc3$var$__awaiter(this, void 0, void 0, function*() {
|
|
925
|
+
const cookies = yield (0, $f382029733f65752$exports.queryCookies)(params, new (0, $a6f61760d01c3afd$exports.default)());
|
|
926
|
+
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
927
|
+
return cookies.find((0, $2c20f7c9c363469f$export$963c8d651337e4a4));
|
|
928
|
+
});
|
|
623
929
|
}
|
|
624
930
|
|
|
625
931
|
|
|
932
|
+
var $bea34252b8e17f8d$exports = {};
|
|
933
|
+
|
|
934
|
+
$parcel$export($bea34252b8e17f8d$exports, "getFirefoxCookie", () => $bea34252b8e17f8d$export$c44c5fdef43f0941, (v) => $bea34252b8e17f8d$export$c44c5fdef43f0941 = v);
|
|
626
935
|
|
|
627
936
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
937
|
+
var $bea34252b8e17f8d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
938
|
+
function adopt(value) {
|
|
939
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
940
|
+
resolve(value);
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
944
|
+
function fulfilled(value) {
|
|
945
|
+
try {
|
|
946
|
+
step(generator.next(value));
|
|
947
|
+
} catch (e) {
|
|
948
|
+
reject(e);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
function rejected(value) {
|
|
952
|
+
try {
|
|
953
|
+
step(generator["throw"](value));
|
|
954
|
+
} catch (e) {
|
|
955
|
+
reject(e);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
function step(result) {
|
|
959
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
960
|
+
}
|
|
961
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
962
|
+
});
|
|
963
|
+
};
|
|
964
|
+
function $bea34252b8e17f8d$export$c44c5fdef43f0941(params) {
|
|
965
|
+
return $bea34252b8e17f8d$var$__awaiter(this, void 0, void 0, function*() {
|
|
966
|
+
const cookies = yield (0, $f382029733f65752$exports.queryCookies)(params, new (0, $62dcb7ce199205be$exports.default)());
|
|
967
|
+
if (Array.isArray(cookies) && cookies.length > 0) return cookies.find((cookie)=>cookie != null);
|
|
968
|
+
else throw new Error("Cookie not found");
|
|
969
|
+
});
|
|
632
970
|
}
|
|
633
971
|
|
|
634
972
|
|
|
973
|
+
var $9bb85405e96c1fbc$exports = {};
|
|
974
|
+
|
|
975
|
+
$parcel$export($9bb85405e96c1fbc$exports, "getGroupedRenderedCookies", () => $9bb85405e96c1fbc$export$4d2e9997e2c23417, (v) => $9bb85405e96c1fbc$export$4d2e9997e2c23417 = v);
|
|
635
976
|
|
|
636
977
|
|
|
637
978
|
function $8227023f453bcf31$export$9abc0a414b0d8b8f(results) {
|
|
@@ -648,176 +989,143 @@ function $8227023f453bcf31$export$9abc0a414b0d8b8f(results) {
|
|
|
648
989
|
}
|
|
649
990
|
|
|
650
991
|
|
|
992
|
+
var $0f113de605a2ef1d$exports = {};
|
|
651
993
|
|
|
652
|
-
|
|
653
|
-
async function $0f113de605a2ef1d$export$a65902517ae87ba8(cookieSpec) {
|
|
654
|
-
const cookies = [];
|
|
655
|
-
if (Array.isArray(cookieSpec)) {
|
|
656
|
-
const results = await Promise.all(cookieSpec.map((cs)=>{
|
|
657
|
-
return (0, $f382029733f65752$export$e6d428437cf2cacb)(cs);
|
|
658
|
-
}));
|
|
659
|
-
for (const exportedCookie of results.flat())cookies.push(exportedCookie);
|
|
660
|
-
} else {
|
|
661
|
-
const singleQuery = await (0, $f382029733f65752$export$e6d428437cf2cacb)(cookieSpec);
|
|
662
|
-
cookies.push(...singleQuery);
|
|
663
|
-
}
|
|
664
|
-
return (0, $6B8p2$uniqBy)(cookies, JSON.stringify);
|
|
665
|
-
}
|
|
994
|
+
$parcel$export($0f113de605a2ef1d$exports, "comboQueryCookieSpec", () => $0f113de605a2ef1d$export$a65902517ae87ba8, (v) => $0f113de605a2ef1d$export$a65902517ae87ba8 = v);
|
|
666
995
|
|
|
667
996
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
997
|
+
var $0f113de605a2ef1d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
998
|
+
function adopt(value) {
|
|
999
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1000
|
+
resolve(value);
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1004
|
+
function fulfilled(value) {
|
|
1005
|
+
try {
|
|
1006
|
+
step(generator.next(value));
|
|
1007
|
+
} catch (e) {
|
|
1008
|
+
reject(e);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
function rejected(value) {
|
|
1012
|
+
try {
|
|
1013
|
+
step(generator["throw"](value));
|
|
1014
|
+
} catch (e) {
|
|
1015
|
+
reject(e);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function step(result) {
|
|
1019
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1020
|
+
}
|
|
1021
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
function $0f113de605a2ef1d$export$a65902517ae87ba8(cookieSpec) {
|
|
1025
|
+
return $0f113de605a2ef1d$var$__awaiter(this, void 0, void 0, function*() {
|
|
1026
|
+
const cookies = [];
|
|
1027
|
+
if (Array.isArray(cookieSpec)) {
|
|
1028
|
+
const results = yield Promise.all(cookieSpec.map((cs)=>{
|
|
1029
|
+
return (0, $f382029733f65752$exports.queryCookies)(cs);
|
|
1030
|
+
}));
|
|
1031
|
+
for (const exportedCookie of results.flat())cookies.push(exportedCookie);
|
|
1032
|
+
} else {
|
|
1033
|
+
const singleQuery = yield (0, $f382029733f65752$exports.queryCookies)(cookieSpec);
|
|
1034
|
+
cookies.push(...singleQuery);
|
|
1035
|
+
}
|
|
1036
|
+
return (0, $6B8p2$uniqBy)(cookies, JSON.stringify);
|
|
675
1037
|
});
|
|
676
1038
|
}
|
|
677
1039
|
|
|
678
1040
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1041
|
+
var $9bb85405e96c1fbc$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1042
|
+
function adopt(value) {
|
|
1043
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1044
|
+
resolve(value);
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1048
|
+
function fulfilled(value) {
|
|
1049
|
+
try {
|
|
1050
|
+
step(generator.next(value));
|
|
1051
|
+
} catch (e) {
|
|
1052
|
+
reject(e);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
function rejected(value) {
|
|
1056
|
+
try {
|
|
1057
|
+
step(generator["throw"](value));
|
|
1058
|
+
} catch (e) {
|
|
1059
|
+
reject(e);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
function step(result) {
|
|
1063
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1064
|
+
}
|
|
1065
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1066
|
+
});
|
|
1067
|
+
};
|
|
1068
|
+
function $9bb85405e96c1fbc$export$4d2e9997e2c23417(cookieSpec) {
|
|
1069
|
+
return $9bb85405e96c1fbc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1070
|
+
const cookies = yield (0, $0f113de605a2ef1d$exports.comboQueryCookieSpec)(cookieSpec);
|
|
1071
|
+
if (cookies.length == 0) throw new Error("Cookie not found");
|
|
1072
|
+
const groupedByFile = (0, $6B8p2$groupBy)(cookies, (r)=>{
|
|
1073
|
+
var _a;
|
|
1074
|
+
return (_a = r.meta) === null || _a === void 0 ? void 0 : _a.file;
|
|
1075
|
+
});
|
|
1076
|
+
return Object.keys(groupedByFile).map((file)=>{
|
|
1077
|
+
const results = groupedByFile[file];
|
|
1078
|
+
return (0, $8227023f453bcf31$export$9abc0a414b0d8b8f)(results);
|
|
1079
|
+
});
|
|
1080
|
+
});
|
|
684
1081
|
}
|
|
685
1082
|
|
|
686
1083
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
1084
|
+
var $0b27779070651c3e$exports = {};
|
|
694
1085
|
|
|
1086
|
+
$parcel$export($0b27779070651c3e$exports, "getMergedRenderedCookies", () => $0b27779070651c3e$export$cfc0723de5712e57, (v) => $0b27779070651c3e$export$cfc0723de5712e57 = v);
|
|
695
1087
|
|
|
696
1088
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
class $9992049ed060fd67$export$55374e421ca433de extends (0, $6B8p2$Store) {
|
|
704
|
-
constructor(filePath, internalStore = new (0, $6B8p2$MemoryCookieStore)()){
|
|
705
|
-
super();
|
|
706
|
-
this.synchronous = false;
|
|
707
|
-
this.tasks = [];
|
|
708
|
-
this.filePath = filePath;
|
|
709
|
-
this.internalStore = internalStore ?? new (0, $6B8p2$MemoryCookieStore)();
|
|
710
|
-
(0, $848ef80fb85ef266$export$2e2bcd8739ae039).debug("Importing cookies from", filePath, internalStore);
|
|
711
|
-
this.tasks.push(this.importSaved(filePath, internalStore).then(console.log, console.error));
|
|
712
|
-
}
|
|
713
|
-
async importSaved(filePath, store) {
|
|
714
|
-
const cookies = [];
|
|
715
|
-
if ((0, $6B8p2$existsSync)(filePath)) {
|
|
716
|
-
const data = await (0, $6B8p2$readFile)(filePath, "utf8");
|
|
717
|
-
const cookies1 = Object.values((0, $6B8p2$destr)(data)).flatMap((domainCookies)=>Object.values(domainCookies)).flatMap((domainCookies)=>Object.values(domainCookies));
|
|
718
|
-
if (process.env["DEBUG"]) (0, $848ef80fb85ef266$export$2e2bcd8739ae039).start("Importing", cookies1.length, "cookies");
|
|
719
|
-
const array = Array.isArray(cookies1) ? cookies1 : Object.values(cookies1);
|
|
720
|
-
const put = await Promise.all(array.map((cookie)=>{
|
|
721
|
-
const fromJSON = (0, $6B8p2$Cookie).fromJSON(cookie);
|
|
722
|
-
if (fromJSON) return this.putCookieInternal(fromJSON, store);
|
|
723
|
-
}));
|
|
724
|
-
cookies1.push(...put);
|
|
725
|
-
}
|
|
726
|
-
return cookies;
|
|
727
|
-
}
|
|
728
|
-
findCookie(domain, path, key, cb) {
|
|
729
|
-
this.waitUntilIdle().finally(()=>{
|
|
730
|
-
this.internalStore.findCookie(domain, path, key, cb);
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
findCookies(domain, path, allowSpecialUseDomain, cb) {
|
|
734
|
-
this.waitUntilIdle().finally(()=>{
|
|
735
|
-
this.internalStore.findCookies(domain, path, allowSpecialUseDomain, cb);
|
|
736
|
-
});
|
|
737
|
-
}
|
|
738
|
-
putCookie(cookie, cb) {
|
|
739
|
-
this.internalStore.putCookie(cookie, cb);
|
|
740
|
-
this.internalStore.getAllCookies((err, cookies)=>{
|
|
741
|
-
this.serializeCallback(err, cookies);
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
updateCookie(oldCookie, newCookie, cb) {
|
|
745
|
-
this.internalStore.updateCookie(oldCookie, newCookie, cb);
|
|
746
|
-
this.internalStore.getAllCookies((err, cookies)=>{
|
|
747
|
-
this.serializeCallback(err, cookies);
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
removeCookie(domain, path, key, cb) {
|
|
751
|
-
this.internalStore.removeCookie(domain, path, key, cb);
|
|
752
|
-
this.internalStore.getAllCookies((err, cookies)=>{
|
|
753
|
-
this.serializeCallback(err, cookies);
|
|
1089
|
+
var $0b27779070651c3e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1090
|
+
function adopt(value) {
|
|
1091
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1092
|
+
resolve(value);
|
|
754
1093
|
});
|
|
755
1094
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
getAllCookies(cb) {
|
|
763
|
-
this.waitUntilIdle().finally(()=>{
|
|
764
|
-
this.internalStore.getAllCookies(cb);
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
waitUntilIdle() {
|
|
768
|
-
return Promise.allSettled(this.tasks).catch((0, $848ef80fb85ef266$export$2e2bcd8739ae039).error);
|
|
769
|
-
}
|
|
770
|
-
async putCookieInternal(cookie, store) {
|
|
771
|
-
await this.waitUntilIdle();
|
|
772
|
-
return await new Promise((resolve, reject)=>{
|
|
773
|
-
store.putCookie(cookie, (err)=>{
|
|
774
|
-
if (err) reject(err);
|
|
775
|
-
else resolve(cookie);
|
|
776
|
-
});
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
serializeCallback(err, cookies) {
|
|
780
|
-
if (err) {
|
|
781
|
-
console.error(err);
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
const cookieObjs = cookies.map((cookie)=>cookie);
|
|
785
|
-
const idx = {};
|
|
786
|
-
for (const cookie of cookieObjs){
|
|
787
|
-
const domain = cookie.domain;
|
|
788
|
-
if (typeof domain === "string") {
|
|
789
|
-
const path = cookie.path ?? "/";
|
|
790
|
-
const key = cookie.key;
|
|
791
|
-
(0, $6B8p2$merge)(idx, {
|
|
792
|
-
[domain]: {
|
|
793
|
-
[path]: {
|
|
794
|
-
[key]: cookie.toJSON()
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
});
|
|
1095
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1096
|
+
function fulfilled(value) {
|
|
1097
|
+
try {
|
|
1098
|
+
step(generator.next(value));
|
|
1099
|
+
} catch (e) {
|
|
1100
|
+
reject(e);
|
|
798
1101
|
}
|
|
799
1102
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1103
|
+
function rejected(value) {
|
|
1104
|
+
try {
|
|
1105
|
+
step(generator["throw"](value));
|
|
1106
|
+
} catch (e) {
|
|
1107
|
+
reject(e);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
function step(result) {
|
|
1111
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1112
|
+
}
|
|
1113
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1114
|
+
});
|
|
1115
|
+
};
|
|
1116
|
+
function $0b27779070651c3e$export$cfc0723de5712e57(cookieSpec) {
|
|
1117
|
+
return $0b27779070651c3e$var$__awaiter(this, void 0, void 0, function*() {
|
|
1118
|
+
const cookies = yield (0, $0f113de605a2ef1d$exports.comboQueryCookieSpec)(cookieSpec);
|
|
1119
|
+
return cookies.length > 0 ? (0, $8227023f453bcf31$export$9abc0a414b0d8b8f)(cookies) : "";
|
|
1120
|
+
});
|
|
805
1121
|
}
|
|
806
1122
|
|
|
807
1123
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
return fileCookieStore;
|
|
814
|
-
}
|
|
815
|
-
const $77099c72165ec5ea$export$2c043f03eceff4e8 = new Promise((resolve)=>{
|
|
816
|
-
$77099c72165ec5ea$var$getCookieStore().then(resolve);
|
|
817
|
-
});
|
|
818
|
-
const $77099c72165ec5ea$export$eced8873dedbb4c0 = new Promise((resolve)=>{
|
|
819
|
-
$77099c72165ec5ea$export$2c043f03eceff4e8.then((store)=>new (0, $6B8p2$CookieJar)(store)).then(resolve);
|
|
820
|
-
});
|
|
1124
|
+
var $7d6c43a28f2485bc$exports = {};
|
|
1125
|
+
|
|
1126
|
+
$parcel$export($7d6c43a28f2485bc$exports, "fetchWithCookies", () => $7d6c43a28f2485bc$export$b24a545a0b39f491, (v) => $7d6c43a28f2485bc$export$b24a545a0b39f491 = v);
|
|
1127
|
+
// noinspection JSUnusedGlobalSymbols,ExceptionCaughtLocallyJS
|
|
1128
|
+
|
|
821
1129
|
|
|
822
1130
|
|
|
823
1131
|
|
|
@@ -851,119 +1159,168 @@ function $bd973abb63c1ed35$export$f266452a5050185d(url) {
|
|
|
851
1159
|
|
|
852
1160
|
|
|
853
1161
|
|
|
1162
|
+
var $7d6c43a28f2485bc$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
1163
|
+
function adopt(value) {
|
|
1164
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1165
|
+
resolve(value);
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1169
|
+
function fulfilled(value) {
|
|
1170
|
+
try {
|
|
1171
|
+
step(generator.next(value));
|
|
1172
|
+
} catch (e) {
|
|
1173
|
+
reject(e);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
function rejected(value) {
|
|
1177
|
+
try {
|
|
1178
|
+
step(generator["throw"](value));
|
|
1179
|
+
} catch (e) {
|
|
1180
|
+
reject(e);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
function step(result) {
|
|
1184
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1185
|
+
}
|
|
1186
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1187
|
+
});
|
|
1188
|
+
};
|
|
854
1189
|
if (typeof (0, $6B8p2$fetch) !== "function") {
|
|
855
1190
|
(0, $6B8p2$consola).error("fetch is not a function");
|
|
856
1191
|
throw new Error("fetch is not a function");
|
|
857
1192
|
}
|
|
858
1193
|
const $7d6c43a28f2485bc$var$userAgent = new (0, $6B8p2$useragents)().toString();
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
(
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
(0, $
|
|
882
|
-
(0, $
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
headers: headers
|
|
886
|
-
}, options);
|
|
887
|
-
try {
|
|
888
|
-
const res = await fetch(url1, newOptions1);
|
|
889
|
-
const headers1 = [];
|
|
890
|
-
res.headers.forEach((value, key)=>{
|
|
891
|
-
headers1.push([
|
|
892
|
-
key,
|
|
893
|
-
value
|
|
894
|
-
]);
|
|
1194
|
+
function $7d6c43a28f2485bc$export$b24a545a0b39f491(url, options = {}, fetch = (0, $6B8p2$fetch), originalRequest) {
|
|
1195
|
+
var _a;
|
|
1196
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1197
|
+
if (typeof fetch !== "function") {
|
|
1198
|
+
const message = "fetch is not a function";
|
|
1199
|
+
(0, $6B8p2$consola).error(message);
|
|
1200
|
+
throw new Error(message);
|
|
1201
|
+
}
|
|
1202
|
+
const originalRequest1 = originalRequest || {
|
|
1203
|
+
url: url,
|
|
1204
|
+
options: options
|
|
1205
|
+
};
|
|
1206
|
+
const headers = {
|
|
1207
|
+
"User-Agent": $7d6c43a28f2485bc$var$userAgent
|
|
1208
|
+
};
|
|
1209
|
+
const defaultOptions = {
|
|
1210
|
+
headers: headers,
|
|
1211
|
+
redirect: "manual"
|
|
1212
|
+
};
|
|
1213
|
+
const url2 = `${url}`;
|
|
1214
|
+
const url1 = new URL(url2);
|
|
1215
|
+
(0, $6B8p2$consola).start("fetchWithCookies", url2);
|
|
1216
|
+
const cookieSpecs = (0, $bd973abb63c1ed35$export$f266452a5050185d)(url1);
|
|
1217
|
+
headers["Cookie"] = yield (0, $0b27779070651c3e$exports.getMergedRenderedCookies)(cookieSpecs).catch((err)=>{
|
|
1218
|
+
(0, $6B8p2$consola).error(err);
|
|
1219
|
+
return "";
|
|
895
1220
|
});
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1221
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b)["dump-request-headers"]) {
|
|
1222
|
+
(0, $6B8p2$consola).info((0, $6B8p2$redBright)("Request URL:"), url1.href);
|
|
1223
|
+
(0, $6B8p2$consola).info((0, $6B8p2$blue)("Request headers:"), headers);
|
|
1224
|
+
}
|
|
1225
|
+
const newOptions1 = (0, $6B8p2$merge)(defaultOptions, {
|
|
1226
|
+
headers: headers
|
|
1227
|
+
}, options);
|
|
1228
|
+
try {
|
|
1229
|
+
const res = yield fetch(url1, newOptions1);
|
|
1230
|
+
// noinspection JSMismatchedCollectionQueryUpdate
|
|
1231
|
+
const headers1 = [];
|
|
1232
|
+
res.headers.forEach((value, key)=>{
|
|
1233
|
+
headers1.push([
|
|
1234
|
+
key,
|
|
1235
|
+
value
|
|
1236
|
+
]);
|
|
1237
|
+
});
|
|
1238
|
+
// for (const [key, value] of headers) {
|
|
1239
|
+
// if (key === "set-cookie") {
|
|
1240
|
+
// const cookieJar1 = await cookieJarPromise;
|
|
1241
|
+
// await cookieJar1.setCookie(value, url2);
|
|
1242
|
+
// if (parsedArgs.verbose) {
|
|
1243
|
+
// console.log(blue(`Set-Cookie:`), yellow(value), yellow(url2));
|
|
1244
|
+
// }
|
|
1245
|
+
// }
|
|
1246
|
+
// }
|
|
1247
|
+
const newUrl = (_a = res.headers.get("location")) !== null && _a !== void 0 ? _a : res.url;
|
|
1248
|
+
// const sameHost = new URL(newUrl).host === url1.host;
|
|
1249
|
+
if (res.status == 301 || res.status == 302) // follow the redirect
|
|
1250
|
+
{
|
|
1251
|
+
if (newUrl && newUrl !== url2) {
|
|
1252
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose || (0, $01f4cf98d50740c6$export$c348dfaf65040d9b)["dump-response-headers"]) console.log((0, $6B8p2$blue)(`Redirected to `), (0, $6B8p2$yellow)(newUrl));
|
|
1253
|
+
return $7d6c43a28f2485bc$export$b24a545a0b39f491(//
|
|
1254
|
+
newUrl, newOptions1, fetch, originalRequest1);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
if (res.status == 303 && newUrl && newUrl !== url2) {
|
|
1258
|
+
// follow the redirect with GET
|
|
1259
|
+
let newOptions2 = {};
|
|
1260
|
+
switch(newOptions1.method){
|
|
1261
|
+
case "POST":
|
|
1262
|
+
case "PUT":
|
|
1263
|
+
case "DELETE":
|
|
1264
|
+
(0, $6B8p2$merge)(newOptions2, newOptions1, {
|
|
1265
|
+
method: "GET"
|
|
1266
|
+
});
|
|
1267
|
+
newOptions2.body = undefined; // TODO: is this needed?
|
|
1268
|
+
break;
|
|
1269
|
+
case "HEAD":
|
|
1270
|
+
case "GET":
|
|
1271
|
+
(0, $6B8p2$merge)(newOptions2, newOptions1);
|
|
1272
|
+
newOptions2.body = undefined; // TODO: is this needed?
|
|
1273
|
+
break;
|
|
1274
|
+
default:
|
|
1275
|
+
(0, $6B8p2$merge)(newOptions2, newOptions1);
|
|
1276
|
+
break;
|
|
1277
|
+
}
|
|
1278
|
+
if ((0, $01f4cf98d50740c6$export$c348dfaf65040d9b).verbose) console.log((0, $6B8p2$blue)(`Redirected to `), (0, $6B8p2$yellow)(newUrl));
|
|
907
1279
|
return $7d6c43a28f2485bc$export$b24a545a0b39f491(//
|
|
908
|
-
newUrl,
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
(
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
return
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
for (const [key, value] of urlSearchParams.entries())formData.append(key, value);
|
|
953
|
-
return formData;
|
|
954
|
-
}
|
|
955
|
-
const res1 = res;
|
|
956
|
-
const source2 = {
|
|
957
|
-
arrayBuffer: arrayBuffer,
|
|
958
|
-
text: text,
|
|
959
|
-
json: json,
|
|
960
|
-
buffer: buffer,
|
|
961
|
-
formData: formData
|
|
962
|
-
};
|
|
963
|
-
return (0, $6B8p2$merge)(res1, source2);
|
|
964
|
-
} catch (e) {
|
|
965
|
-
throw e;
|
|
966
|
-
}
|
|
1280
|
+
newUrl, newOptions2, fetch, originalRequest1);
|
|
1281
|
+
}
|
|
1282
|
+
const arrayBuffer1 = res.arrayBuffer();
|
|
1283
|
+
function arrayBuffer() {
|
|
1284
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1285
|
+
return arrayBuffer1;
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
function buffer() {
|
|
1289
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1290
|
+
return arrayBuffer().then(Buffer.from);
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
function text() {
|
|
1294
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1295
|
+
return buffer().then((buffer)=>buffer.toString("utf8"));
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
function json() {
|
|
1299
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1300
|
+
return text().then((text)=>(0, $6B8p2$destr)(text));
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
function formData() {
|
|
1304
|
+
return $7d6c43a28f2485bc$var$__awaiter(this, void 0, void 0, function*() {
|
|
1305
|
+
const urlSearchParams = yield text().then((text)=>new URLSearchParams(text));
|
|
1306
|
+
const formData = new FormData();
|
|
1307
|
+
for (const [key, value] of urlSearchParams.entries())formData.append(key, value);
|
|
1308
|
+
return formData;
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
const res1 = res;
|
|
1312
|
+
const source2 = {
|
|
1313
|
+
arrayBuffer: arrayBuffer,
|
|
1314
|
+
text: text,
|
|
1315
|
+
json: json,
|
|
1316
|
+
buffer: buffer,
|
|
1317
|
+
formData: formData
|
|
1318
|
+
};
|
|
1319
|
+
return (0, $6B8p2$merge)(res1, source2);
|
|
1320
|
+
} catch (e) {
|
|
1321
|
+
throw e;
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
967
1324
|
}
|
|
968
1325
|
|
|
969
1326
|
|