@giveitsmaller/sdk 0.17.0 → 0.18.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.
@@ -63,11 +63,11 @@ export const IMAGE_OUTPUT_ROUTES = {
63
63
  same_format: {
64
64
  avif: { honored: ['avif_speed', 'fit', 'height', 'metadata', 'output_format', 'quality', 'width'], planned: [] },
65
65
  gif: { honored: ['fit', 'height', 'metadata', 'output_format', 'quality', 'width'], planned: [] },
66
- jpeg: { honored: ['fit', 'height', 'metadata', 'output_format', 'progressive', 'quality', 'width'], planned: ['lossless'] },
66
+ jpeg: { honored: ['fit', 'height', 'lossless', 'metadata', 'output_format', 'progressive', 'quality', 'width'], planned: [] },
67
67
  png: { honored: ['fit', 'height', 'metadata', 'optimization_level', 'output_format', 'quality', 'width'], planned: ['lossy'] },
68
68
  svg: { honored: ['metadata', 'output_format', 'quality'], planned: [] },
69
69
  tiff: { honored: ['fit', 'height', 'metadata', 'output_format', 'quality', 'width'], planned: [] },
70
- webp: { honored: ['fit', 'height', 'metadata', 'output_format', 'quality', 'width'], planned: ['lossless'] },
70
+ webp: { honored: ['fit', 'height', 'lossless', 'metadata', 'output_format', 'quality', 'width'], planned: [] },
71
71
  },
72
72
  format_change: {
73
73
  avif: { honored: ['output_format', 'quality'], planned: [] },
@@ -98,7 +98,7 @@ export interface WatermarkOptions {
98
98
  }
99
99
  /** Resize mode (contract `fit` enum, v2.97.0). */
100
100
  export type OutputFit = 'max' | 'crop' | 'scale';
101
- /** Metadata policy (contract `metadata` enum, v2.97.0). `keep` is `availability:planned`. */
101
+ /** Metadata policy (contract `metadata` enum). Both values stable since v2.102.0 (keep/strip un-parked). */
102
102
  export type OutputMetadata = 'all' | 'keep';
103
103
  /**
104
104
  * Options for the file-first `output()` image transform. The KEY SET is the
@@ -126,9 +126,9 @@ export interface OutputOptions {
126
126
  optimization_level?: number;
127
127
  /** AVIF encode speed. Honored: same_format avif only. */
128
128
  avif_speed?: number;
129
- /** Metadata policy. Honored: same_format routes. (`keep` value is planned.) */
129
+ /** Metadata policy. Honored: same_format routes (both `all` and `keep` since v2.102.0). */
130
130
  metadata?: OutputMetadata;
131
- /** JPEG/WebP lossless. PLANNED (gated unavailable). */
131
+ /** JPEG/WebP lossless. Honored: same_format jpeg/webp (stable since v2.101.0). */
132
132
  lossless?: boolean;
133
133
  /** Lossy PNG quantization. PLANNED (gated unavailable; licence-gated). */
134
134
  lossy?: boolean;
@@ -11,6 +11,7 @@ export declare const ImageFormat: {
11
11
  export type ImageFormat = typeof ImageFormat[keyof typeof ImageFormat];
12
12
  export declare const ImageMetadataPolicy: {
13
13
  readonly All: "all";
14
+ readonly Keep: "keep";
14
15
  };
15
16
  export type ImageMetadataPolicy = typeof ImageMetadataPolicy[keyof typeof ImageMetadataPolicy];
16
17
  export declare const VideoCodec: {
@@ -88,6 +89,7 @@ export declare const ERGONOMIC_ENUMS: {
88
89
  };
89
90
  readonly ImageMetadataPolicy: {
90
91
  readonly All: "all";
92
+ readonly Keep: "keep";
91
93
  };
92
94
  readonly VideoCodec: {
93
95
  readonly H264: "h264";
@@ -12,14 +12,16 @@ export const ImageFormat = {
12
12
  Original: "original",
13
13
  Webp: "webp",
14
14
  };
15
- // Image metadata handling. Single value today (Option B, 2026-06-20):
16
- // All = strip all EXIF/IPTC/XMP (smallest file)
17
- // The compress worker always strips metadata; None/Copyright/Sensitive were
18
- // removed they never reached the worker (it hardcodes strip-everything), so
19
- // advertising metadata preservation was an over-claim. Preservation is a
20
- // possible future feature (would need worker support).
15
+ // Image metadata handling (compress.image, optimiser/same_format route):
16
+ // All = strip all EXIF/IPTC/XMP (default, smallest file)
17
+ // Keep = preserve EXIF/ICC/XMP — worker-proven on the libcaesium formats
18
+ // (JPEG/PNG/WebP/GIF/TIFF; lambdas PR #260, un-parked 2026-06-23).
19
+ // Keep is NOT available for AVIF (ravif) / SVG (SVGO) — those re-encode from
20
+ // pixels and cannot preserve metadata, so the worker rejects it there (the
21
+ // `metadata` enum is narrowed to [all] on those groups).
21
22
  export const ImageMetadataPolicy = {
22
23
  All: "all",
24
+ Keep: "keep",
23
25
  };
24
26
  // Video codec. H264 = widest compatibility; H265/Av1 = better compression but slower.
25
27
  export const VideoCodec = {
@@ -1,3 +1,3 @@
1
- export declare const SDK_SPEC_VERSION: "2.0.0";
1
+ export declare const SDK_SPEC_VERSION: "2.1.0";
2
2
  export declare const PRESET_VERSION: "1.4";
3
3
  export declare const PRESET_CONFIG_HASH: "sha256:62fbada24e33f983dacb0f717b0c9bb80824a208c3dc7f9af8523026e783543a";
@@ -1,6 +1,6 @@
1
1
  // CODE GENERATED — DO NOT EDIT.
2
2
  // Source: compression_contracts/sdk-spec/ (see sdk-spec/README.md).
3
3
  // Regenerate with: scripts/generate.py.
4
- export const SDK_SPEC_VERSION = "2.0.0";
4
+ export const SDK_SPEC_VERSION = "2.1.0";
5
5
  export const PRESET_VERSION = "1.4";
6
6
  export const PRESET_CONFIG_HASH = "sha256:62fbada24e33f983dacb0f717b0c9bb80824a208c3dc7f9af8523026e783543a";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giveitsmaller/sdk",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Node.js SDK for the GISL (Give It Smaller) file compression and processing API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "dependencies": {
34
- "@giveitsmaller/contracts": "^0.34.0"
34
+ "@giveitsmaller/contracts": "^0.35.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22",