@giveitsmaller/sdk 0.14.0 → 0.16.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.
@@ -9,7 +9,7 @@ export const PRESETS = Object.freeze({
9
9
  "metadata": "All",
10
10
  "iccProfile": "Strip",
11
11
  "progressive": true,
12
- "outputFormat": "Smallest",
12
+ "outputFormat": "Original",
13
13
  }),
14
14
  Balanced: Object.freeze({
15
15
  "mode": "Auto",
@@ -17,7 +17,7 @@ export const PRESETS = Object.freeze({
17
17
  "metadata": "Sensitive",
18
18
  "iccProfile": "Preserve",
19
19
  "progressive": true,
20
- "outputFormat": "Auto",
20
+ "outputFormat": "Original",
21
21
  }),
22
22
  Quality: Object.freeze({
23
23
  "mode": "Lossless",
@@ -48,17 +48,14 @@ export const PRESETS = Object.freeze({
48
48
  Size: Object.freeze({
49
49
  "crf": 30,
50
50
  "preset": "Slow",
51
- "audioBitrate": "_96",
52
51
  }),
53
52
  Balanced: Object.freeze({
54
53
  "crf": 23,
55
54
  "preset": "Medium",
56
- "audioBitrate": "_128",
57
55
  }),
58
56
  Quality: Object.freeze({
59
57
  "crf": 18,
60
58
  "preset": "Slow",
61
- "audioBitrate": "_192",
62
59
  }),
63
60
  }),
64
61
  "document_pdf_compress": Object.freeze({
@@ -1,3 +1,3 @@
1
- export declare const SDK_SPEC_VERSION: "1.5.0";
2
- export declare const PRESET_VERSION: "1.0";
3
- export declare const PRESET_CONFIG_HASH: "sha256:3791bd2d0cd474c5029707f6e50480bf49be33899f7fc5c1a4e77edb136f6e95";
1
+ export declare const SDK_SPEC_VERSION: "1.7.0";
2
+ export declare const PRESET_VERSION: "1.2";
3
+ export declare const PRESET_CONFIG_HASH: "sha256:ef4d66a81920cec353633d788061a03f7c8891d622908c1bfca326679725e72b";
@@ -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 = "1.5.0";
5
- export const PRESET_VERSION = "1.0";
6
- export const PRESET_CONFIG_HASH = "sha256:3791bd2d0cd474c5029707f6e50480bf49be33899f7fc5c1a4e77edb136f6e95";
4
+ export const SDK_SPEC_VERSION = "1.7.0";
5
+ export const PRESET_VERSION = "1.2";
6
+ export const PRESET_CONFIG_HASH = "sha256:ef4d66a81920cec353633d788061a03f7c8891d622908c1bfca326679725e72b";
package/dist/handle.js CHANGED
@@ -34,7 +34,7 @@
34
34
  */
35
35
  import { GislConfigError, GislNetworkError, GislResultNotReadyError, GislTimeoutError, SseEndedWithoutTerminal, } from './errors.js';
36
36
  import { _consumeSseToTerminal, _pollToTerminal, _parseMaxWait, } from './builder.js';
37
- import { projectDownloadsToRunResult, projectMultiJobToRunResult, isFanoutStatus, isMergeStatus, isArchiveStatus, } from './file-first.js';
37
+ import { projectDownloadsToRunResult, projectMultiJobToRunResult, isFanoutStatus, isMergeStatus, isArchiveStatus, isWatermarkStatus, } from './file-first.js';
38
38
  import { LazyHttpDownloader } from './lazy-downloader.js';
39
39
  /**
40
40
  * The terminal workflow states. A status response in any of these states
@@ -237,6 +237,14 @@ export class Handle {
237
237
  const archiveDownloads = jobDownloads.filter((d) => d.ref === 'archive');
238
238
  return projectDownloadsToRunResult(this.workflowId, finalStatus, archiveDownloads, null, downloader);
239
239
  }
240
+ // A fluent `file(...).watermark(overlay)` — project ONLY the watermark
241
+ // output, filtering the `src_*` (base/overlay) passthrough plumbing. Matches
242
+ // WatermarkedRecipe.run()'s `ref === 'watermark'` filter so a
243
+ // submitted/reattached watermark handle never surfaces the raw inputs.
244
+ if (isWatermarkStatus(finalStatus)) {
245
+ const watermarkDownloads = jobDownloads.filter((d) => d.ref === 'watermark');
246
+ return projectDownloadsToRunResult(this.workflowId, finalStatus, watermarkDownloads, null, downloader);
247
+ }
240
248
  return projectDownloadsToRunResult(this.workflowId, finalStatus, jobDownloads, this.#key, downloader);
241
249
  }
242
250
  /**
@@ -13,6 +13,8 @@ export { FilesRecipe } from './file-first.js';
13
13
  export { MergedRecipe } from './file-first.js';
14
14
  export { ArchivedRecipe } from './file-first.js';
15
15
  export type { ArchiveRecipeOptions } from './file-first.js';
16
+ export { WatermarkedRecipe } from './file-first.js';
17
+ export type { WatermarkWireOp } from './file-first.js';
16
18
  export { Handle, StatusSnapshot } from './handle.js';
17
19
  export { gisl, create } from './gisl.js';
18
20
  export type { GislCreateOptions, Environment, ErgonomicClient } from './gisl.js';
@@ -48,6 +48,11 @@ export { MergedRecipe } from './file-first.js';
48
48
  // File-first N→1 bundle (FF3b) — `client.files([...]).archive(opts?)` returns a
49
49
  // terminal ArchivedRecipe (zip / tar.gz; no post-bundle chain), then run()/submit().
50
50
  export { ArchivedRecipe } from './file-first.js';
51
+ // File-first multi-input watermark (FF4a / Z7zTr789) — `client.file(base)
52
+ // .watermark(overlay, opts)` returns a single-output WatermarkedRecipe you chain
53
+ // post-watermark ops on, then run()/submit(). Routes image_watermark / video_watermark
54
+ // by base media; gates planned/unsupported bases locally pre-upload.
55
+ export { WatermarkedRecipe } from './file-first.js';
51
56
  // `HttpDownloader` (Node streaming downloader) is re-exported from the Node-only
52
57
  // entry `index.ts`, NOT here — it statically imports node:fs/node:stream.
53
58
  // `projectDownloadsToRunResult` is intentionally NOT re-exported here — it is an
package/dist/types.d.ts CHANGED
@@ -279,6 +279,20 @@ export interface PreflightClipError {
279
279
  fileId: string;
280
280
  error: unknown;
281
281
  }
282
+ /**
283
+ * Read-time options for a single anonymous-readable workflow query.
284
+ *
285
+ * Carries the one-time capability token returned by an anonymous (null-owner)
286
+ * workflow create (`WorkflowCreateResponse.cap`). Pass it on status / downloads
287
+ * / events reads so a session-less caller can read its own workflow; the SDK
288
+ * sends it as the `X-Workflow-Capability` header. Omit it for authenticated
289
+ * reads — the session authorizes those. A wrong or missing token on a
290
+ * null-owner workflow returns 404 (deliberately no existence oracle).
291
+ */
292
+ export interface ReadCapabilityOptions {
293
+ /** Anonymous-workflow capability token (the `cap` from workflow-create). */
294
+ capability?: string;
295
+ }
282
296
  export interface WaitOptions {
283
297
  /** Poll interval in milliseconds (default: 2000) */
284
298
  intervalMs?: number;
@@ -286,6 +300,13 @@ export interface WaitOptions {
286
300
  timeoutMs?: number;
287
301
  /** Called after each poll with current status */
288
302
  onPoll?: (status: string) => void;
303
+ /**
304
+ * Anonymous-workflow capability token (the `cap` from workflow-create),
305
+ * forwarded to each underlying status poll as the `X-Workflow-Capability`
306
+ * header. Required to poll a null-owner workflow without a session; omit
307
+ * for authenticated polling.
308
+ */
309
+ capability?: string;
289
310
  }
290
311
  export interface ProbeWaitOptions {
291
312
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giveitsmaller/sdk",
3
- "version": "0.14.0",
3
+ "version": "0.16.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.18.0"
34
+ "@giveitsmaller/contracts": "^0.21.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22",