@ac-kit/cmd-exiftool 0.0.0-stage → 0.1.0

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 (60) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +28 -0
  3. package/README.md +176 -2
  4. package/dist/_argfile.d.ts +41 -0
  5. package/dist/_argfile.d.ts.map +1 -0
  6. package/dist/_argfile.js +99 -0
  7. package/dist/_argfile.js.map +1 -0
  8. package/dist/_inspect-file.d.ts +32 -0
  9. package/dist/_inspect-file.d.ts.map +1 -0
  10. package/dist/_inspect-file.js +103 -0
  11. package/dist/_inspect-file.js.map +1 -0
  12. package/dist/_parse-json-output.d.ts +31 -0
  13. package/dist/_parse-json-output.d.ts.map +1 -0
  14. package/dist/_parse-json-output.js +132 -0
  15. package/dist/_parse-json-output.js.map +1 -0
  16. package/dist/_print-read-arguments.d.ts +42 -0
  17. package/dist/_print-read-arguments.d.ts.map +1 -0
  18. package/dist/_print-read-arguments.js +152 -0
  19. package/dist/_print-read-arguments.js.map +1 -0
  20. package/dist/_process-handle.d.ts +7 -0
  21. package/dist/_process-handle.d.ts.map +1 -0
  22. package/dist/_process-handle.js +2 -0
  23. package/dist/_process-handle.js.map +1 -0
  24. package/dist/_response-reader.d.ts +54 -0
  25. package/dist/_response-reader.d.ts.map +1 -0
  26. package/dist/_response-reader.js +129 -0
  27. package/dist/_response-reader.js.map +1 -0
  28. package/dist/_worker.d.ts +104 -0
  29. package/dist/_worker.d.ts.map +1 -0
  30. package/dist/_worker.js +327 -0
  31. package/dist/_worker.js.map +1 -0
  32. package/dist/date-time.d.ts +28 -0
  33. package/dist/date-time.d.ts.map +1 -0
  34. package/dist/date-time.js +74 -0
  35. package/dist/date-time.js.map +1 -0
  36. package/dist/errors.d.ts +125 -0
  37. package/dist/errors.d.ts.map +1 -0
  38. package/dist/errors.js +151 -0
  39. package/dist/errors.js.map +1 -0
  40. package/dist/exiftool-pool.d.ts +203 -0
  41. package/dist/exiftool-pool.d.ts.map +1 -0
  42. package/dist/exiftool-pool.js +455 -0
  43. package/dist/exiftool-pool.js.map +1 -0
  44. package/dist/index.d.ts +7 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +7 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/metadata.d.ts +46 -0
  49. package/dist/metadata.d.ts.map +1 -0
  50. package/dist/metadata.js +8 -0
  51. package/dist/metadata.js.map +1 -0
  52. package/dist/read-options.d.ts +86 -0
  53. package/dist/read-options.d.ts.map +1 -0
  54. package/dist/read-options.js +2 -0
  55. package/dist/read-options.js.map +1 -0
  56. package/dist/version.d.ts +39 -0
  57. package/dist/version.d.ts.map +1 -0
  58. package/dist/version.js +53 -0
  59. package/dist/version.js.map +1 -0
  60. package/package.json +61 -3
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=read-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-options.js","sourceRoot":"","sources":["../src/read-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ /** An exiftool version number, such as `13.50`. */
2
+ export type ExiftoolVersion = {
3
+ readonly major: number;
4
+ /** The two digits after the point, as an integer: `50` for `13.50`. */
5
+ readonly minor: number;
6
+ /** The version as exiftool printed it, trimmed. */
7
+ readonly text: string;
8
+ };
9
+ /**
10
+ * The oldest exiftool the pool accepts, checked when a process starts.
11
+ *
12
+ * 12.38 fixed CVE-2022-23935 (code execution through a crafted file name);
13
+ * 12.40 is what Ubuntu 22.04 ships. Every protocol feature used here
14
+ * (`-stay_open`, `-echo4` with `${status}`, `#[CSTR]` argument lines, `-charset
15
+ * filename=`) is older.
16
+ */
17
+ export declare const EXIFTOOL_MINIMUM_VERSION: ExiftoolVersion;
18
+ /**
19
+ * The oldest exiftool that reads with `scalars: "text"`: 13.00 is the first
20
+ * release whose `-api StructFormat=JSONQ` quotes every value, inside structures
21
+ * too, so the text is exactly what exiftool printed.
22
+ */
23
+ export declare const EXIFTOOL_TEXT_SCALARS_VERSION: ExiftoolVersion;
24
+ /**
25
+ * Parses what `exiftool -ver` prints.
26
+ *
27
+ * @param text The output, surrounding whitespace allowed. A suffix after the
28
+ * number (a development build marker) is ignored.
29
+ * @returns The version, or `null` when the text does not start with
30
+ * `<digits>.<digits>`. O(length).
31
+ */
32
+ export declare function parseExiftoolVersion(text: string): ExiftoolVersion | null;
33
+ /**
34
+ * Orders two versions.
35
+ *
36
+ * @returns Negative when `left` is older, positive when newer, 0 when equal.
37
+ */
38
+ export declare function compareExiftoolVersions(left: ExiftoolVersion, right: ExiftoolVersion): number;
39
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAIrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,eAI1C,CAAC;AAIH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAazE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,eAAe,GACpB,MAAM,CAER"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The oldest exiftool the pool accepts, checked when a process starts.
3
+ *
4
+ * 12.38 fixed CVE-2022-23935 (code execution through a crafted file name);
5
+ * 12.40 is what Ubuntu 22.04 ships. Every protocol feature used here
6
+ * (`-stay_open`, `-echo4` with `${status}`, `#[CSTR]` argument lines, `-charset
7
+ * filename=`) is older.
8
+ */
9
+ export const EXIFTOOL_MINIMUM_VERSION = Object.freeze({
10
+ major: 12,
11
+ minor: 40,
12
+ text: "12.40",
13
+ });
14
+ /**
15
+ * The oldest exiftool that reads with `scalars: "text"`: 13.00 is the first
16
+ * release whose `-api StructFormat=JSONQ` quotes every value, inside structures
17
+ * too, so the text is exactly what exiftool printed.
18
+ */
19
+ export const EXIFTOOL_TEXT_SCALARS_VERSION = Object.freeze({
20
+ major: 13,
21
+ minor: 0,
22
+ text: "13.00",
23
+ });
24
+ const VERSION_PATTERN_ = /^(\d{1,6})\.(\d{1,6})(?:\D.*)?$/s;
25
+ /**
26
+ * Parses what `exiftool -ver` prints.
27
+ *
28
+ * @param text The output, surrounding whitespace allowed. A suffix after the
29
+ * number (a development build marker) is ignored.
30
+ * @returns The version, or `null` when the text does not start with
31
+ * `<digits>.<digits>`. O(length).
32
+ */
33
+ export function parseExiftoolVersion(text) {
34
+ const trimmed = text.trim();
35
+ const match = VERSION_PATTERN_.exec(trimmed);
36
+ if (match === null) {
37
+ return null;
38
+ }
39
+ return {
40
+ major: Number(match[1]),
41
+ minor: Number(match[2]),
42
+ text: trimmed,
43
+ };
44
+ }
45
+ /**
46
+ * Orders two versions.
47
+ *
48
+ * @returns Negative when `left` is older, positive when newer, 0 when equal.
49
+ */
50
+ export function compareExiftoolVersions(left, right) {
51
+ return left.major - right.major || left.minor - right.minor;
52
+ }
53
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAoB,MAAM,CAAC,MAAM,CAAC;IACtE,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,OAAO;CACb,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAoB,MAAM,CAAC,MAAM,CAAC;IAC3E,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,OAAO;CACb,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE7C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO;QACN,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,OAAO;KACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACtC,IAAqB,EACrB,KAAsB;IAEtB,OAAO,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;AAC7D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@ac-kit/cmd-exiftool",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Typed exiftool reads through a pool of -stay_open processes: safe argument encoding, request matching, cancellation and restart.",
5
+ "keywords": [
6
+ "cli",
7
+ "exif",
8
+ "exiftool",
9
+ "metadata",
10
+ "wrapper",
11
+ "xmp"
12
+ ],
13
+ "homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/cmd-exiftool/",
14
+ "bugs": {
15
+ "url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
16
+ },
17
+ "license": "BSD-3-Clause",
18
+ "author": "Anthony Champagne <dev@anthonychampagne.fr>",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
22
+ "directory": "packages/cmd-exiftool"
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "type": "module",
28
+ "sideEffects": false,
29
+ "main": "./dist/index.js",
30
+ "publishConfig": {
31
+ "main": "./dist/index.js",
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "compile": "tsc -p ./tsconfig.build.json -outDir dist",
36
+ "compile:check": "tsc -noEmit -p ./tsconfig.json",
37
+ "clean": "rimraf dist",
38
+ "build": "yarn clean && yarn compile",
39
+ "test": "yarn run -T vitest run",
40
+ "prepack": "yarn build"
41
+ },
42
+ "dependencies": {
43
+ "@ac-kit/core": "^0.10.0",
44
+ "@ac-kit/data": "^0.3.2",
45
+ "@ac-kit/node": "^0.9.0"
46
+ },
47
+ "devDependencies": {
48
+ "@ac-kit/algo": "0.4.0",
49
+ "@ac-kit/app-system": "0.5.0",
50
+ "@ac-kit/math-random": "0.2.0",
51
+ "@ac-kit/tsconfig": "0.1.0",
52
+ "@ac-kit/typedoc-config": "0.1.0",
53
+ "@ac-kit/vitest-config": "0.1.1",
54
+ "@types/node": "26.6.6",
55
+ "@typescript/native": "typescript@7.0.2",
56
+ "rimraf": "6.1.4",
57
+ "tsx": "4.23.15",
58
+ "typedoc": "0.28.20",
59
+ "typescript": "@typescript/typescript6@6.0.2"
60
+ },
61
+ "engines": {
62
+ "node": ">=24"
63
+ }
6
64
  }