@hot-updater/plugin-core 1.0.0-rc.14 → 1.0.0-rc.15

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 (57) hide show
  1. package/dist/bundleStorageLayout.cjs +7 -0
  2. package/dist/bundleStorageLayout.d.cts +5 -1
  3. package/dist/bundleStorageLayout.d.mts +5 -1
  4. package/dist/bundleStorageLayout.mjs +7 -1
  5. package/dist/contentType.cjs +9 -0
  6. package/dist/contentType.d.cts +4 -0
  7. package/dist/contentType.d.mts +4 -0
  8. package/dist/contentType.mjs +7 -0
  9. package/dist/createDatabasePlugin.cjs +3 -1
  10. package/dist/createDatabasePlugin.mjs +3 -1
  11. package/dist/databaseClientUpdates.cjs +0 -3
  12. package/dist/databaseClientUpdates.mjs +0 -3
  13. package/dist/databasePluginCrudValidationFields.cjs +3 -12
  14. package/dist/databasePluginCrudValidationFields.mjs +3 -12
  15. package/dist/databaseRows.cjs +0 -6
  16. package/dist/databaseRows.mjs +0 -6
  17. package/dist/index.cjs +4 -5
  18. package/dist/index.d.cts +4 -4
  19. package/dist/index.d.mts +4 -4
  20. package/dist/index.mjs +3 -3
  21. package/dist/insightsContract.cjs +46 -0
  22. package/dist/insightsContract.mjs +46 -0
  23. package/dist/insightsDistinctSummary.cjs +72 -0
  24. package/dist/insightsDistinctSummary.d.cts +12 -0
  25. package/dist/insightsDistinctSummary.d.mts +12 -0
  26. package/dist/insightsDistinctSummary.mjs +68 -0
  27. package/dist/insightsOverview.cjs +139 -0
  28. package/dist/insightsOverview.d.cts +40 -0
  29. package/dist/insightsOverview.d.mts +40 -0
  30. package/dist/insightsOverview.mjs +135 -0
  31. package/dist/internal.cjs +12 -0
  32. package/dist/internal.d.cts +4 -2
  33. package/dist/internal.d.mts +4 -2
  34. package/dist/internal.mjs +3 -1
  35. package/dist/types/database.d.cts +2 -2
  36. package/dist/types/database.d.mts +2 -2
  37. package/dist/types/databaseFields.cjs +0 -3
  38. package/dist/types/databaseFields.d.cts +1 -1
  39. package/dist/types/databaseFields.d.mts +1 -1
  40. package/dist/types/databaseFields.mjs +0 -3
  41. package/dist/types/databaseOperations.d.cts +2 -0
  42. package/dist/types/databaseOperations.d.mts +2 -0
  43. package/dist/types/databasePlugin.d.cts +85 -1
  44. package/dist/types/databasePlugin.d.mts +85 -1
  45. package/dist/types/databaseRows.d.cts +3 -6
  46. package/dist/types/databaseRows.d.mts +3 -6
  47. package/dist/types/index.d.cts +3 -15
  48. package/dist/types/index.d.mts +3 -15
  49. package/dist/types/internal.d.cts +2 -2
  50. package/dist/types/internal.d.mts +2 -2
  51. package/dist/types/public.d.cts +2 -2
  52. package/dist/types/public.d.mts +2 -2
  53. package/package.json +2 -2
  54. package/dist/compressionFormat.cjs +0 -62
  55. package/dist/compressionFormat.d.cts +0 -33
  56. package/dist/compressionFormat.d.mts +0 -33
  57. package/dist/compressionFormat.mjs +0 -58
@@ -1,33 +0,0 @@
1
- //#region src/compressionFormat.d.ts
2
- /**
3
- * Compression format type definition
4
- */
5
- type CompressionFormat = "zip" | "tar.br" | "tar.gz";
6
- /**
7
- * Compression format metadata
8
- */
9
- interface CompressionFormatInfo {
10
- format: CompressionFormat;
11
- fileExtension: string;
12
- mimeType?: string;
13
- }
14
- /**
15
- * Detects compression format from filename
16
- * @param filename The filename to detect format from
17
- * @returns Compression format information
18
- */
19
- declare function detectCompressionFormat(filename: string): CompressionFormatInfo;
20
- /**
21
- * Gets MIME type for a filename
22
- * @param filename The filename to get MIME type for
23
- * @returns MIME type string, or undefined when the filename is not an archive
24
- */
25
- declare function getCompressionMimeType(filename: string): string | undefined;
26
- /**
27
- * Gets Content-Type for a bundle file with 3-tier fallback
28
- * @param bundlePath The bundle file path
29
- * @returns Content-Type string (never undefined, falls back to application/octet-stream)
30
- */
31
- declare function getContentType(bundlePath: string): string;
32
- //#endregion
33
- export { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType };
@@ -1,33 +0,0 @@
1
- //#region src/compressionFormat.d.ts
2
- /**
3
- * Compression format type definition
4
- */
5
- type CompressionFormat = "zip" | "tar.br" | "tar.gz";
6
- /**
7
- * Compression format metadata
8
- */
9
- interface CompressionFormatInfo {
10
- format: CompressionFormat;
11
- fileExtension: string;
12
- mimeType?: string;
13
- }
14
- /**
15
- * Detects compression format from filename
16
- * @param filename The filename to detect format from
17
- * @returns Compression format information
18
- */
19
- declare function detectCompressionFormat(filename: string): CompressionFormatInfo;
20
- /**
21
- * Gets MIME type for a filename
22
- * @param filename The filename to get MIME type for
23
- * @returns MIME type string, or undefined when the filename is not an archive
24
- */
25
- declare function getCompressionMimeType(filename: string): string | undefined;
26
- /**
27
- * Gets Content-Type for a bundle file with 3-tier fallback
28
- * @param bundlePath The bundle file path
29
- * @returns Content-Type string (never undefined, falls back to application/octet-stream)
30
- */
31
- declare function getContentType(bundlePath: string): string;
32
- //#endregion
33
- export { CompressionFormat, CompressionFormatInfo, detectCompressionFormat, getCompressionMimeType, getContentType };
@@ -1,58 +0,0 @@
1
- import mime from "mime";
2
- //#region src/compressionFormat.ts
3
- /**
4
- * Compression formats registry
5
- * Add new formats here to support additional compression types
6
- */
7
- const COMPRESSION_FORMATS = {
8
- zip: {
9
- format: "zip",
10
- fileExtension: ".zip",
11
- mimeType: "application/zip"
12
- },
13
- "tar.br": {
14
- format: "tar.br",
15
- fileExtension: ".tar.br",
16
- mimeType: "application/x-tar"
17
- },
18
- "tar.gz": {
19
- format: "tar.gz",
20
- fileExtension: ".tar.gz",
21
- mimeType: "application/x-tar"
22
- }
23
- };
24
- /**
25
- * Finds the compression format matching a filename extension
26
- * @param filename The filename to match
27
- * @returns Compression format information, or undefined when nothing matches
28
- */
29
- function findCompressionFormat(filename) {
30
- return Object.values(COMPRESSION_FORMATS).find((info) => filename.endsWith(info.fileExtension));
31
- }
32
- /**
33
- * Detects compression format from filename
34
- * @param filename The filename to detect format from
35
- * @returns Compression format information
36
- */
37
- function detectCompressionFormat(filename) {
38
- return findCompressionFormat(filename) ?? COMPRESSION_FORMATS.zip;
39
- }
40
- /**
41
- * Gets MIME type for a filename
42
- * @param filename The filename to get MIME type for
43
- * @returns MIME type string, or undefined when the filename is not an archive
44
- */
45
- function getCompressionMimeType(filename) {
46
- return findCompressionFormat(filename)?.mimeType;
47
- }
48
- /**
49
- * Gets Content-Type for a bundle file with 3-tier fallback
50
- * @param bundlePath The bundle file path
51
- * @returns Content-Type string (never undefined, falls back to application/octet-stream)
52
- */
53
- function getContentType(bundlePath) {
54
- const filename = bundlePath.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
55
- return mime.getType(bundlePath) ?? getCompressionMimeType(filename ?? "") ?? "application/octet-stream";
56
- }
57
- //#endregion
58
- export { detectCompressionFormat, getCompressionMimeType, getContentType };