@mherod/get-cookie 2.0.0-rc.23 → 2.0.0-rc.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/types.d.ts +25 -248
  2. package/package.json +4 -6
package/dist/types.d.ts CHANGED
@@ -1,248 +1,25 @@
1
- #!/usr/bin/env ts-node
2
- /// <reference types="node" />
3
- declare module "CookieRow" {
4
- export default interface CookieRow {
5
- expiry?: number;
6
- domain: string;
7
- name: string;
8
- value: Buffer;
9
- meta?: any;
10
- }
11
- }
12
- declare module "CookieSpec" {
13
- export default interface CookieSpec {
14
- domain: string;
15
- name: string;
16
- }
17
- export type MultiCookieSpec = CookieSpec | CookieSpec[];
18
- }
19
- declare module "global" {
20
- export const env: any;
21
- export const HOME: string;
22
- }
23
- declare module "argv" {
24
- import minimist from "minimist";
25
- export interface MyParsedArgs extends minimist.ParsedArgs {
26
- verbose: boolean;
27
- render?: string;
28
- fetch?: string;
29
- cs?: string;
30
- dump?: string;
31
- "dump-request-headers"?: string;
32
- "dump-response-headers"?: string;
33
- "dump-response-body"?: string;
34
- }
35
- export const argv: string[];
36
- export const parsedArgs: MyParsedArgs;
37
- }
38
- declare module "FileCookieStore" {
39
- import { Cookie, Store } from "tough-cookie";
40
- export class FileCookieStore extends Store {
41
- private readonly internalStore;
42
- synchronous: boolean;
43
- filePath: string;
44
- private tasks;
45
- constructor(filePath: string, internalStore?: Store);
46
- private importSaved;
47
- findCookie(domain: string, path: string, key: string, cb: (err: Error | null, cookie: Cookie | null) => void): void;
48
- findCookies(domain: string, path: string, allowSpecialUseDomain: boolean, cb: (err: Error | null, cookie: Cookie[]) => void): void;
49
- putCookie(cookie: Cookie, cb: (err: Error | null) => void): void;
50
- updateCookie(oldCookie: Cookie, newCookie: Cookie, cb: (err: Error | null) => void): void;
51
- removeCookie(domain: string, path: string, key: string, cb: (err: Error | null) => void): void;
52
- removeCookies(domain: string, path: string, cb: (err: Error | null) => void): void;
53
- getAllCookies(cb: (err: Error | null, cookie: Cookie[]) => void): void;
54
- waitUntilIdle(): Promise<void | PromiseSettledResult<any>[]>;
55
- private putCookieInternal;
56
- private serializeCallback;
57
- }
58
- }
59
- declare module "CookieStore" {
60
- import { CookieJar, Store } from "tough-cookie";
61
- export const cookieStorePromise: Promise<Store>;
62
- export const cookieJarPromise: Promise<CookieJar>;
63
- }
64
- declare module "ExportedCookie" {
65
- export default interface ExportedCookie {
66
- domain: string;
67
- name: string;
68
- value: string;
69
- expiry?: Date | "Infinity";
70
- meta?: any;
71
- }
72
- }
73
- declare module "FetchResponse" {
74
- export default interface FetchResponse extends Response {
75
- status: number;
76
- statusText: string;
77
- headers: Headers;
78
- url: string;
79
- text: () => Promise<string>;
80
- json: () => Promise<any>;
81
- formData: () => Promise<URLSearchParams>;
82
- arrayBuffer: () => Promise<ArrayBuffer>;
83
- buffer: () => Promise<Buffer>;
84
- }
85
- }
86
- declare module "IsCookieRow" {
87
- import CookieRow from "CookieRow";
88
- export function isCookieRow(obj: any): obj is CookieRow;
89
- }
90
- declare module "IsExportedCookie" {
91
- import ExportedCookie from "ExportedCookie";
92
- export function isExportedCookie(obj: any): obj is ExportedCookie;
93
- }
94
- declare module "SpecialCases" {
95
- import CookieSpec from "CookieSpec";
96
- export function specialCases({ name, domain }: CookieSpec): {
97
- specifiedName: boolean;
98
- specifiedDomain: boolean;
99
- };
100
- }
101
- declare module "StringToRegex" {
102
- export function stringToRegex(s: string): RegExp;
103
- }
104
- declare module "resultsRendered" {
105
- import ExportedCookie from "ExportedCookie";
106
- export function resultsRendered(results: ExportedCookie[]): string;
107
- }
108
- declare module "browsers/CookieQueryStrategy" {
109
- import ExportedCookie from "ExportedCookie";
110
- export default interface CookieQueryStrategy {
111
- browserName: string;
112
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
113
- }
114
- }
115
- declare module "utils" {
116
- export function execSimple(command: string): Promise<string>;
117
- }
118
- declare module "findAllFiles" {
119
- export function findAllFiles({ path, name, maxDepth, }: {
120
- path: string;
121
- name: string;
122
- maxDepth?: number;
123
- }): Promise<string[]>;
124
- }
125
- declare module "doSqliteQuery1Params" {
126
- import CookieRow from "CookieRow";
127
- export interface DoSqliteQuery1Params {
128
- file: string;
129
- sql: string;
130
- rowFilter?: (row: any) => boolean;
131
- rowTransform: (row: any) => CookieRow;
132
- }
133
- }
134
- declare module "browsers/ChromeCookieQueryStrategy" {
135
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
136
- import CookieRow from "CookieRow";
137
- import ExportedCookie from "ExportedCookie";
138
- import { DoSqliteQuery1Params } from "doSqliteQuery1Params";
139
- export default class ChromeCookieQueryStrategy implements CookieQueryStrategy {
140
- browserName: string;
141
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
142
- }
143
- export function doChromeSqliteQuery1({ file, sql, rowFilter, rowTransform, }: DoSqliteQuery1Params): Promise<CookieRow[]>;
144
- }
145
- declare module "browsers/FirefoxCookieQueryStrategy" {
146
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
147
- import ExportedCookie from "ExportedCookie";
148
- import CookieRow from "CookieRow";
149
- import { DoSqliteQuery1Params } from "doSqliteQuery1Params";
150
- export function doSqliteQuery1({ file, sql, rowTransform, }: DoSqliteQuery1Params): Promise<CookieRow[]>;
151
- export default class FirefoxCookieQueryStrategy implements CookieQueryStrategy {
152
- #private;
153
- browserName: string;
154
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
155
- }
156
- }
157
- declare module "browsers/SafariCookieQueryStrategy" {
158
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
159
- import ExportedCookie from "ExportedCookie";
160
- export default class SafariCookieQueryStrategy implements CookieQueryStrategy {
161
- browserName: string;
162
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
163
- }
164
- }
165
- declare module "browsers/CookieStoreQueryStrategy" {
166
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
167
- import ExportedCookie from "ExportedCookie";
168
- export default class CookieStoreQueryStrategy implements CookieQueryStrategy {
169
- #private;
170
- browserName: string;
171
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
172
- }
173
- }
174
- declare module "browsers/CompositeCookieQueryStrategy" {
175
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
176
- import ExportedCookie from "ExportedCookie";
177
- export default class CompositeCookieQueryStrategy implements CookieQueryStrategy {
178
- #private;
179
- browserName: string;
180
- constructor();
181
- queryCookies(name: string, domain: string): Promise<ExportedCookie[]>;
182
- }
183
- }
184
- declare module "isValidJwt" {
185
- export default function isValidJwt(token: any): boolean;
186
- }
187
- declare module "queryCookies" {
188
- import CookieQueryStrategy from "browsers/CookieQueryStrategy";
189
- import CookieSpec from "CookieSpec";
190
- import ExportedCookie from "ExportedCookie";
191
- export function queryCookies({ name, domain }: CookieSpec, strategy?: CookieQueryStrategy): Promise<ExportedCookie[]>;
192
- }
193
- declare module "comboQueryCookieSpec" {
194
- import { MultiCookieSpec } from "CookieSpec";
195
- import ExportedCookie from "ExportedCookie";
196
- export function comboQueryCookieSpec(cookieSpec: MultiCookieSpec): Promise<ExportedCookie[]>;
197
- }
198
- declare module "getMergedRenderedCookies" {
199
- import { MultiCookieSpec } from "CookieSpec";
200
- export function getMergedRenderedCookies(cookieSpec: MultiCookieSpec): Promise<string>;
201
- }
202
- declare module "cookieSpecsFromUrl" {
203
- import CookieSpec from "CookieSpec";
204
- export function cookieSpecsFromUrl(url: URL | string): CookieSpec[];
205
- }
206
- declare module "fetchWithCookies" {
207
- interface FetchRequestInit {
208
- url: RequestInfo | URL | string;
209
- options?: RequestInit;
210
- }
211
- export function fetchWithCookies(url: RequestInfo | URL | string, options?: RequestInit | undefined, fetch?: Function, originalRequest?: FetchRequestInit | undefined): Promise<Response>;
212
- }
213
- declare module "unpackHeaders" {
214
- export function unpackHeaders(headerArgs: string[] | string | null): any;
215
- }
216
- declare module "logger" {
217
- import consola from "consola";
218
- export default consola;
219
- }
220
- declare module "cli" { }
221
- declare module "getChromeCookie" {
222
- import CookieSpec from "CookieSpec";
223
- import ExportedCookie from "ExportedCookie";
224
- export function getChromeCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
225
- }
226
- declare module "getCookie" {
227
- import CookieSpec from "CookieSpec";
228
- import ExportedCookie from "ExportedCookie";
229
- export function getCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
230
- }
231
- declare module "getFirefoxCookie" {
232
- import CookieSpec from "CookieSpec";
233
- import ExportedCookie from "ExportedCookie";
234
- export function getFirefoxCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
235
- }
236
- declare module "getGroupedRenderedCookies" {
237
- import { MultiCookieSpec } from "CookieSpec";
238
- export function getGroupedRenderedCookies(cookieSpec: MultiCookieSpec): Promise<string[]>;
239
- }
240
- declare module "index" {
241
- import { getCookie } from "getCookie";
242
- import { getChromeCookie } from "getChromeCookie";
243
- import { getFirefoxCookie } from "getFirefoxCookie";
244
- import { getGroupedRenderedCookies } from "getGroupedRenderedCookies";
245
- import { getMergedRenderedCookies } from "getMergedRenderedCookies";
246
- import { fetchWithCookies } from "fetchWithCookies";
247
- export { getCookie, getChromeCookie, getFirefoxCookie, getMergedRenderedCookies, getGroupedRenderedCookies, fetchWithCookies, };
248
- }
1
+ #!/usr/bin/env node
2
+ interface CookieSpec {
3
+ domain: string;
4
+ name: string;
5
+ }
6
+ type MultiCookieSpec = CookieSpec | CookieSpec[];
7
+ interface ExportedCookie {
8
+ domain: string;
9
+ name: string;
10
+ value: string;
11
+ expiry?: Date | "Infinity";
12
+ meta?: any;
13
+ }
14
+ export function getCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
15
+ export function getChromeCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
16
+ export function getFirefoxCookie(params: CookieSpec): Promise<ExportedCookie | undefined>;
17
+ export function getGroupedRenderedCookies(cookieSpec: MultiCookieSpec): Promise<string[]>;
18
+ export function getMergedRenderedCookies(cookieSpec: MultiCookieSpec): Promise<string>;
19
+ interface FetchRequestInit {
20
+ url: RequestInfo | URL | string;
21
+ options?: RequestInit;
22
+ }
23
+ export function fetchWithCookies(url: RequestInfo | URL | string, options?: RequestInit | undefined, fetch?: Function, originalRequest?: FetchRequestInit | undefined): Promise<Response>;
24
+
25
+ //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mherod/get-cookie",
3
- "version": "2.0.0-rc.23",
3
+ "version": "2.0.0-rc.24",
4
4
  "description": "Node.js module for querying a local user's Chrome cookie",
5
5
  "source": "src/index.ts",
6
6
  "bin": "dist/cli.js",
@@ -13,9 +13,8 @@
13
13
  "scripts": {
14
14
  "clean": "git clean -fdX && rm -rf node_modules dist && yarn install",
15
15
  "lintfix": "prettier --write \"src/**/*.ts\"",
16
- "typescript": "tsc",
17
16
  "prebuild": "npm run lintfix",
18
- "build": "tsc && parcel build",
17
+ "build": "parcel build",
19
18
  "prepare": "npm run build && npm run prettier",
20
19
  "test": "jest",
21
20
  "prepublish": "npm run build",
@@ -24,8 +23,7 @@
24
23
  },
25
24
  "targets": {
26
25
  "types": {},
27
- "main": {},
28
- "library": {
26
+ "main": {
29
27
  "source": "src/index.ts",
30
28
  "distDir": "dist",
31
29
  "isLibrary": true,
@@ -64,7 +62,7 @@
64
62
  "consola": "^3.1.0",
65
63
  "cross-fetch": "^3.1.5",
66
64
  "destr": "^1.2.0",
67
- "jsonwebtoken": "^8.5.1",
65
+ "jsonwebtoken": "9.0.0",
68
66
  "lodash": "^4.17.21",
69
67
  "lodash-es": "^4.17.21",
70
68
  "lru-cache": "^7.14.0",