@mherod/get-cookie 2.1.3 → 4.0.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.
Files changed (109) hide show
  1. package/.husky/commit-msg +2 -0
  2. package/.husky/pre-commit +4 -0
  3. package/.husky/pre-push +4 -0
  4. package/README.md +163 -18
  5. package/commitlint.config.js +12 -0
  6. package/dist/chunk-56Z35D5R.js +2 -0
  7. package/dist/chunk-56Z35D5R.js.map +1 -0
  8. package/dist/chunk-5FUMK7M3.js +4 -0
  9. package/dist/chunk-5FUMK7M3.js.map +1 -0
  10. package/dist/chunk-5ZT2G45S.js +2 -0
  11. package/dist/chunk-5ZT2G45S.js.map +1 -0
  12. package/dist/chunk-FR2MKDHT.js +2 -0
  13. package/dist/chunk-FR2MKDHT.js.map +1 -0
  14. package/dist/chunk-HMKSQBDC.js +2 -0
  15. package/dist/chunk-HMKSQBDC.js.map +1 -0
  16. package/dist/chunk-VMBA4NVU.js +2 -0
  17. package/dist/chunk-VMBA4NVU.js.map +1 -0
  18. package/dist/chunk-W3JALMAX.js +2 -0
  19. package/dist/chunk-W3JALMAX.js.map +1 -0
  20. package/dist/cli.cjs +19 -0
  21. package/dist/cli.cjs.map +1 -0
  22. package/dist/cli.d.cts +1 -0
  23. package/dist/getChromeCookie-4ZWACG6M.js +2 -0
  24. package/dist/getChromeCookie-4ZWACG6M.js.map +1 -0
  25. package/dist/getChromePassword-GTIXL733.js +2 -0
  26. package/dist/getChromePassword-GTIXL733.js.map +1 -0
  27. package/dist/getCookie-43FKMQEZ.js +2 -0
  28. package/dist/getCookie-43FKMQEZ.js.map +1 -0
  29. package/dist/getFirefoxCookie-OJYYZFZP.js +2 -0
  30. package/dist/getFirefoxCookie-OJYYZFZP.js.map +1 -0
  31. package/dist/getGroupedRenderedCookies-P5VZXZUC.js +2 -0
  32. package/dist/getGroupedRenderedCookies-P5VZXZUC.js.map +1 -0
  33. package/dist/getMergedRenderedCookies-C6TXK2I4.js +2 -0
  34. package/dist/getMergedRenderedCookies-C6TXK2I4.js.map +1 -0
  35. package/dist/index.cjs +4 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +252 -0
  38. package/dist/index.d.ts +252 -0
  39. package/dist/index.js +2 -24712
  40. package/dist/index.js.map +1 -0
  41. package/eslint.config.js +243 -0
  42. package/jest.setup.js +11 -0
  43. package/package.json +87 -36
  44. package/tsconfig.build.json +9 -0
  45. package/tsup.cli.ts +27 -0
  46. package/tsup.config.ts +27 -0
  47. package/tsup.lib.ts +27 -0
  48. package/typedoc.json +22 -0
  49. package/.parcelrc +0 -7
  50. package/.prettierignore +0 -5
  51. package/.prettierrc +0 -12
  52. package/.terserrc +0 -26
  53. package/build-indexes.ts +0 -108
  54. package/bun.lockb +0 -0
  55. package/dist/cli.js +0 -18319
  56. package/dist/types.d.ts +0 -361
  57. package/jest.config.ts +0 -14
  58. package/package-lock.json +0 -5608
  59. package/src/CookieRow.ts +0 -43
  60. package/src/CookieSpec.ts +0 -42
  61. package/src/ExportedCookie.ts +0 -19
  62. package/src/FetchResponse.ts +0 -13
  63. package/src/SpecialCases.ts +0 -15
  64. package/src/StringToRegex.ts +0 -16
  65. package/src/argv.ts +0 -30
  66. package/src/browsers/CompositeCookieQueryStrategy.ts +0 -76
  67. package/src/browsers/CookieQueryStrategy.ts +0 -7
  68. package/src/browsers/CookieStoreQueryStrategy.ts +0 -115
  69. package/src/browsers/QuerySqliteThenTransform.ts +0 -48
  70. package/src/browsers/chrome/ChromeApplicationSupport.ts +0 -14
  71. package/src/browsers/chrome/ChromeCookieQueryStrategy.ts +0 -158
  72. package/src/browsers/chrome/decrypt.ts +0 -154
  73. package/src/browsers/chrome/getChromePassword.ts +0 -28
  74. package/src/browsers/firefox/FirefoxCookieQueryStrategy.ts +0 -109
  75. package/src/browsers/getEncryptedChromeCookie.ts +0 -122
  76. package/src/browsers/index.ts +0 -12
  77. package/src/browsers/mock/MockCookieQueryStrategy.ts +0 -22
  78. package/src/browsers/safari/SafariCookieQueryStrategy.ts +0 -42
  79. package/src/cli.ts +0 -94
  80. package/src/cliQueryCookies.ts +0 -65
  81. package/src/comboQueryCookieSpec.test.ts +0 -92
  82. package/src/comboQueryCookieSpec.ts +0 -26
  83. package/src/cookieQueryOptions.ts +0 -27
  84. package/src/cookieSpecsFromUrl.test.ts +0 -65
  85. package/src/cookieSpecsFromUrl.ts +0 -73
  86. package/src/decodeBinaryCookies.ts +0 -72
  87. package/src/execSimple.ts +0 -12
  88. package/src/fetchWithCookies.test.ts +0 -32
  89. package/src/fetchWithCookies.ts +0 -217
  90. package/src/findAllFiles.ts +0 -48
  91. package/src/getChromeCookie.ts +0 -19
  92. package/src/getCookie.ts +0 -22
  93. package/src/getFirefoxCookie.ts +0 -25
  94. package/src/getGroupedRenderedCookies.ts +0 -42
  95. package/src/getMergedRenderedCookies.test.ts +0 -43
  96. package/src/getMergedRenderedCookies.ts +0 -19
  97. package/src/global.ts +0 -8
  98. package/src/index.ts +0 -16
  99. package/src/isValidJwt.ts +0 -26
  100. package/src/listChromeProfiles.ts +0 -53
  101. package/src/logger.ts +0 -12
  102. package/src/processBeforeReturn.ts +0 -29
  103. package/src/queryCookies.ts +0 -41
  104. package/src/resultsRendered.ts +0 -24
  105. package/src/unpackHeaders.ts +0 -18
  106. package/src/util/flatMapAsync.test.ts +0 -55
  107. package/src/util/flatMapAsync.ts +0 -41
  108. package/src/util/index.ts +0 -1
  109. package/tsconfig.json +0 -26
package/build-indexes.ts DELETED
@@ -1,108 +0,0 @@
1
- //#!/usr/bin/env bun run
2
-
3
- import consola from "consola";
4
- import { groupBy, orderBy } from "lodash";
5
- import path from "path";
6
- import { existsSync, readFileSync, writeFileSync } from "fs";
7
- import { sync } from "fast-glob";
8
- import prettier from "prettier";
9
-
10
- async function main() {
11
- // find all ts files in src and build indexes
12
-
13
- const files = sync("src/**/*.ts", {
14
- dot: true,
15
- onlyFiles: true,
16
- ignore: [
17
- "**/index.ts",
18
- "**/*.d.ts",
19
- "**/*.test.{ts,tsx}",
20
- "**/*.spec.{ts,tsx}",
21
- "**/*.stories.tsx",
22
- ],
23
- //
24
- });
25
-
26
- // group files by directory
27
- const groups = groupBy(files, (file: string) => {
28
- const parts = file.split("/");
29
- parts.pop();
30
- return parts.join("/");
31
- });
32
- // order by depth, so that we build indexes for subdirectories first
33
- const dirs = orderBy(
34
- Object.keys(groups),
35
- (dir) => dir.split("/").length,
36
- //
37
- );
38
-
39
- // build index for each directory
40
- for (const dir of dirs) {
41
- consola.info(`building index for ${dir}`);
42
- const files = groups[dir].filter((file: string) => file.match(/\.ts$/));
43
- const indexes = files
44
- .map((file: string) => {
45
- const content = readFileSync(file, "utf-8").split("\n");
46
- if (!content.some((line) => line.trim().startsWith("export"))) {
47
- // if none of the lines in the file start with an export, then we should not include it in the index
48
- return "";
49
- }
50
- const name = path
51
- .relative(dir, file) //
52
- .replace(/\.ts$/, ""); //
53
- return `export * from './${name}';`;
54
- })
55
- .filter(Boolean)
56
- .sort() as string[];
57
-
58
- // then find subdirectories and build index for them
59
-
60
- const subIndex = sync(`${dir}/*/index.ts`, {
61
- dot: true,
62
- onlyFiles: true,
63
- //
64
- });
65
-
66
- if (subIndex.length > 0) {
67
- indexes.push(
68
- ...subIndex.map((file: string) => {
69
- const name = path
70
- .relative(dir, file) //
71
- .replace(/\/index\.ts$/, ""); //
72
- return `export * from './${name}';`;
73
- }),
74
- );
75
- }
76
-
77
- const index = indexes.join("\n");
78
-
79
- // const indexFile = `${dir}/index.ts`
80
- const indexFile = path.join(dir, "index.ts");
81
-
82
- const output = await prettier.format(index, { parser: "babel" });
83
-
84
- if (existsSync(indexFile)) {
85
- const existingContent = readFileSync(indexFile, "utf8");
86
- if (existingContent === output) {
87
- continue;
88
- }
89
- const lines = existingContent.split("\n");
90
- if (lines.every((line) => line.startsWith("export * from")) == false) {
91
- // if the existing index file is not an export index, then we should not overwrite it
92
- continue;
93
- }
94
- }
95
-
96
- if (output.length > 0) {
97
- console.log(`writing ${dir}/index.ts`, output.length);
98
-
99
- writeFileSync(
100
- indexFile,
101
- output,
102
- //
103
- );
104
- }
105
- }
106
- }
107
-
108
- main().catch(consola.error);
package/bun.lockb DELETED
Binary file