@mherod/get-cookie 4.3.0 → 4.3.2
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.cjs +2 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -1
- package/.claude/settings.local.json +0 -11
- package/test-exports/package.json +0 -15
- package/test-exports/test-esm.mjs +0 -12
- package/test-exports/test-runtime.js +0 -14
- package/test-exports/test-types.ts +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mherod/get-cookie",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "Node.js module for querying cookies from Chrome, Firefox, and Safari browsers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
"tsconfig-paths": "^4.2.0",
|
|
44
44
|
"zod": "^3.24.1"
|
|
45
45
|
},
|
|
46
|
+
"optionalDependencies": {
|
|
47
|
+
"@primno/dpapi": "^2.0.1"
|
|
48
|
+
},
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"@biomejs/biome": "1.9.4",
|
|
48
51
|
"@commitlint/cli": "19.8.1",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "test-exports",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [],
|
|
10
|
-
"author": "",
|
|
11
|
-
"license": "ISC",
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@mherod/get-cookie": "link:.."
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { getCookie, getChromeCookie } from '@mherod/get-cookie';
|
|
2
|
-
|
|
3
|
-
// Test ESM imports
|
|
4
|
-
console.log('getCookie type:', typeof getCookie);
|
|
5
|
-
console.log('getChromeCookie type:', typeof getChromeCookie);
|
|
6
|
-
|
|
7
|
-
// Test that we can import types in JSDoc
|
|
8
|
-
/** @type {import('@mherod/get-cookie').CookieSpec} */
|
|
9
|
-
const spec = { name: 'test', domain: 'example.com' };
|
|
10
|
-
|
|
11
|
-
console.log('ESM imports successful!');
|
|
12
|
-
console.log('CookieSpec:', spec);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const { getCookie, getChromeCookie } = require('@mherod/get-cookie');
|
|
2
|
-
|
|
3
|
-
// Test CommonJS imports
|
|
4
|
-
console.log('getCookie type:', typeof getCookie);
|
|
5
|
-
console.log('getChromeCookie type:', typeof getChromeCookie);
|
|
6
|
-
|
|
7
|
-
// Test basic usage
|
|
8
|
-
getCookie({ name: 'test', domain: 'example.com' })
|
|
9
|
-
.then(cookies => {
|
|
10
|
-
console.log('getCookie works, returned:', cookies.length, 'cookies');
|
|
11
|
-
})
|
|
12
|
-
.catch(err => {
|
|
13
|
-
console.log('getCookie test complete (error expected if no cookies found)');
|
|
14
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCookie,
|
|
3
|
-
getChromeCookie,
|
|
4
|
-
getFirefoxCookie,
|
|
5
|
-
getGroupedRenderedCookies,
|
|
6
|
-
getMergedRenderedCookies,
|
|
7
|
-
type CookieSpec,
|
|
8
|
-
type ExportedCookie,
|
|
9
|
-
type RenderOptions,
|
|
10
|
-
type BrowserName,
|
|
11
|
-
type CookieQueryStrategy,
|
|
12
|
-
type MultiCookieSpec,
|
|
13
|
-
} from '@mherod/get-cookie';
|
|
14
|
-
|
|
15
|
-
// Test type imports
|
|
16
|
-
const cookieSpec: CookieSpec = {
|
|
17
|
-
name: 'test',
|
|
18
|
-
domain: 'example.com'
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const multiSpec: MultiCookieSpec = [
|
|
22
|
-
{ name: 'test1', domain: 'example.com' },
|
|
23
|
-
{ name: 'test2', domain: 'api.example.com' }
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const renderOptions: RenderOptions = {
|
|
27
|
-
format: 'grouped',
|
|
28
|
-
separator: '; ',
|
|
29
|
-
showFilePaths: true
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const browserName: BrowserName = 'Chrome';
|
|
33
|
-
|
|
34
|
-
// Test function signatures
|
|
35
|
-
async function testFunctions() {
|
|
36
|
-
const cookies: ExportedCookie[] = await getCookie(cookieSpec);
|
|
37
|
-
const chromeCookies: ExportedCookie[] = await getChromeCookie(cookieSpec);
|
|
38
|
-
const firefoxCookies: ExportedCookie[] = await getFirefoxCookie(cookieSpec);
|
|
39
|
-
const groupedCookies: string[] = await getGroupedRenderedCookies(cookieSpec, renderOptions);
|
|
40
|
-
const mergedCookies: string = await getMergedRenderedCookies(cookieSpec, renderOptions);
|
|
41
|
-
|
|
42
|
-
// Test ExportedCookie type
|
|
43
|
-
const exampleCookie: ExportedCookie = {
|
|
44
|
-
name: 'session',
|
|
45
|
-
domain: 'example.com',
|
|
46
|
-
value: 'abc123',
|
|
47
|
-
expiry: new Date(),
|
|
48
|
-
meta: {
|
|
49
|
-
file: '/path/to/cookies',
|
|
50
|
-
browser: 'Chrome',
|
|
51
|
-
secure: true,
|
|
52
|
-
httpOnly: true,
|
|
53
|
-
path: '/'
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
console.log('All type imports successful!');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Test that types are properly exported
|
|
61
|
-
export { CookieSpec, ExportedCookie };
|