@giveitsmaller/sdk 0.6.0 → 0.7.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 (48) hide show
  1. package/dist/_audit.js +60 -0
  2. package/dist/builder.d.ts +406 -0
  3. package/dist/builder.js +706 -0
  4. package/dist/client.d.ts +10 -0
  5. package/dist/client.js +28 -2
  6. package/dist/credentials.d.ts +61 -0
  7. package/dist/credentials.js +200 -0
  8. package/dist/ergonomic/preset_resolver.d.ts +75 -0
  9. package/dist/ergonomic/preset_resolver.js +568 -0
  10. package/dist/ergonomic/presets/_translate.d.ts +11 -0
  11. package/dist/ergonomic/presets/_translate.js +35 -0
  12. package/dist/ergonomic/presets/audio_compress.d.ts +16 -0
  13. package/dist/ergonomic/presets/audio_compress.js +45 -0
  14. package/dist/ergonomic/presets/document_epub_compress.d.ts +14 -0
  15. package/dist/ergonomic/presets/document_epub_compress.js +34 -0
  16. package/dist/ergonomic/presets/document_odf_compress.d.ts +14 -0
  17. package/dist/ergonomic/presets/document_odf_compress.js +34 -0
  18. package/dist/ergonomic/presets/document_office_compress.d.ts +16 -0
  19. package/dist/ergonomic/presets/document_office_compress.js +40 -0
  20. package/dist/ergonomic/presets/document_pdf_compress.d.ts +14 -0
  21. package/dist/ergonomic/presets/document_pdf_compress.js +35 -0
  22. package/dist/ergonomic/presets/image_compress.d.ts +43 -0
  23. package/dist/ergonomic/presets/image_compress.js +95 -0
  24. package/dist/ergonomic/presets/index.d.ts +77 -0
  25. package/dist/ergonomic/presets/index.js +216 -0
  26. package/dist/ergonomic/presets/video_compress.d.ts +30 -0
  27. package/dist/ergonomic/presets/video_compress.js +83 -0
  28. package/dist/errors.d.ts +147 -1
  29. package/dist/errors.js +161 -0
  30. package/dist/generated/sdk_spec/enums.d.ts +195 -0
  31. package/dist/generated/sdk_spec/enums.js +127 -0
  32. package/dist/generated/sdk_spec/errors.d.ts +16 -0
  33. package/dist/generated/sdk_spec/errors.js +473 -0
  34. package/dist/generated/sdk_spec/index.d.ts +4 -0
  35. package/dist/generated/sdk_spec/index.js +7 -0
  36. package/dist/generated/sdk_spec/presets.d.ts +6 -0
  37. package/dist/generated/sdk_spec/presets.js +157 -0
  38. package/dist/generated/sdk_spec/version.d.ts +3 -0
  39. package/dist/generated/sdk_spec/version.js +6 -0
  40. package/dist/gisl.d.ts +112 -0
  41. package/dist/gisl.js +266 -0
  42. package/dist/index.d.ts +15 -5
  43. package/dist/index.js +32 -4
  44. package/dist/merge.d.ts +142 -0
  45. package/dist/merge.js +411 -0
  46. package/dist/types.d.ts +12 -14
  47. package/dist/types.js +18 -0
  48. package/package.json +2 -2
@@ -0,0 +1,473 @@
1
+ // CODE GENERATED — DO NOT EDIT.
2
+ // Source: compression_contracts/sdk-spec/ (see sdk-spec/README.md).
3
+ // Regenerate with: scripts/generate.py.
4
+ export const ERROR_CODES = Object.freeze({
5
+ "missing_credentials": Object.freeze({
6
+ code: "missing_credentials",
7
+ category: "config",
8
+ source: "SDK_local",
9
+ status: "wired",
10
+ httpStatus: null,
11
+ retryable: false,
12
+ sdkClass: "GislMissingCredentialsError",
13
+ description: "gisl.create() failed the credential chain (explicit → GISL_API_KEY env → ~/.gisl/credentials profile → fail-early).",
14
+ metadataSchema: Object.freeze({
15
+ "sourcesTried": "array",
16
+ }),
17
+ }),
18
+ "feature_requires_auth": Object.freeze({
19
+ code: "feature_requires_auth",
20
+ category: "config",
21
+ source: "SDK_local",
22
+ status: "wired",
23
+ httpStatus: null,
24
+ retryable: false,
25
+ sdkClass: "GislFeatureRequiresAuthError",
26
+ description: "SDK rejected an anonymous-mode call to a feature that requires authentication. Pre-flight gate; never reaches the API.",
27
+ metadataSchema: Object.freeze({
28
+ "feature": "string",
29
+ }),
30
+ }),
31
+ "undeclared_asset": Object.freeze({
32
+ code: "undeclared_asset",
33
+ category: "chain",
34
+ source: "SDK_local",
35
+ status: "wired",
36
+ httpStatus: null,
37
+ retryable: false,
38
+ sdkClass: "GislUndeclaredAssetError",
39
+ description: "Merge / archive / mapEach referenced an asset handle that was not declared upstream in the chain.",
40
+ metadataSchema: Object.freeze({
41
+ "ref": "string",
42
+ }),
43
+ }),
44
+ "unused_asset": Object.freeze({
45
+ code: "unused_asset",
46
+ category: "chain",
47
+ source: "SDK_local",
48
+ status: "wired",
49
+ httpStatus: null,
50
+ retryable: false,
51
+ sdkClass: "GislUnusedAssetError",
52
+ description: "A declared asset was never referenced in the chain (caller likely forgot to use it; escape via allowUnusedAssets).",
53
+ metadataSchema: Object.freeze({
54
+ "ref": "string",
55
+ }),
56
+ }),
57
+ "per_input_options_not_supported": Object.freeze({
58
+ code: "per_input_options_not_supported",
59
+ category: "chain",
60
+ source: "SDK_local",
61
+ status: "wired",
62
+ httpStatus: null,
63
+ retryable: false,
64
+ sdkClass: "GislPerInputOptionsNotSupportedError",
65
+ description: "per_input_options provided on a multi-input op role that doesn't accept it (e.g. role-less branch).",
66
+ metadataSchema: Object.freeze({
67
+ "op": "string",
68
+ "role": "string",
69
+ }),
70
+ }),
71
+ "chain_cardinality_mismatch": Object.freeze({
72
+ code: "chain_cardinality_mismatch",
73
+ category: "chain",
74
+ source: "SDK_local",
75
+ status: "wired",
76
+ httpStatus: null,
77
+ retryable: false,
78
+ sdkClass: "GislChainCardinalityMismatchError",
79
+ description: "Chain step expects a single artifact but the upstream step produces N (e.g.\n.compress() chained after convert(pdf, pages: \"1-20\")). Recovery: branch\nto a single artifact OR use .mapEach() to fan out.\n",
80
+ metadataSchema: Object.freeze({
81
+ "upstreamArtifactCount": "integer",
82
+ "operation": "string",
83
+ }),
84
+ }),
85
+ "multipart_part_invalid": Object.freeze({
86
+ code: "multipart_part_invalid",
87
+ category: "validation",
88
+ source: "SDK_local",
89
+ status: "wired",
90
+ httpStatus: null,
91
+ retryable: false,
92
+ sdkClass: "GislMultipartPartError",
93
+ description: "SDK rejected a part configuration before upload (e.g. out-of-range part number, duplicate, missing).",
94
+ metadataSchema: Object.freeze({
95
+ "partNumber": "integer",
96
+ "reason": "string",
97
+ }),
98
+ }),
99
+ "multipart_part_count_exceeded": Object.freeze({
100
+ code: "multipart_part_count_exceeded",
101
+ category: "validation",
102
+ source: "SDK_local",
103
+ status: "wired",
104
+ httpStatus: null,
105
+ retryable: false,
106
+ sdkClass: "GislMultipartPartCountError",
107
+ description: "Multipart presign batch / total parts exceeds S3 ceilings (10 000 total, 100 per presign request).",
108
+ metadataSchema: Object.freeze({
109
+ "partCount": "integer",
110
+ "ceiling": "integer",
111
+ }),
112
+ }),
113
+ "timeout": Object.freeze({
114
+ code: "timeout",
115
+ category: "network",
116
+ source: "SDK_local",
117
+ status: "wired",
118
+ httpStatus: null,
119
+ retryable: true,
120
+ sdkClass: "GislTimeoutError",
121
+ description: "SDK-set deadline exceeded (run({maxWait}), waitForCompletion, multipart attempt timeout).",
122
+ metadataSchema: Object.freeze({
123
+ "timeoutMs": "integer",
124
+ "phase": "string",
125
+ }),
126
+ }),
127
+ "aborted": Object.freeze({
128
+ code: "aborted",
129
+ category: "network",
130
+ source: "SDK_local",
131
+ status: "wired",
132
+ httpStatus: null,
133
+ retryable: false,
134
+ sdkClass: "GislAbortError",
135
+ description: "Caller-supplied AbortSignal triggered cancellation.",
136
+ metadataSchema: Object.freeze({
137
+ "reason": "string",
138
+ }),
139
+ }),
140
+ "validation_failed": Object.freeze({
141
+ code: "validation_failed",
142
+ category: "validation",
143
+ source: "ErrorEnvelope.error",
144
+ status: "wired",
145
+ httpStatus: 422,
146
+ retryable: false,
147
+ sdkClass: "GislValidationError",
148
+ description: "422 — request validation failure; emitted on the wire as `VALIDATION_FAILED` (e.g. invalid limit/offset on GET /api/v2/credits/usage). Carries `details[]`.",
149
+ metadataSchema: Object.freeze({
150
+ "details": "array",
151
+ }),
152
+ }),
153
+ "auth_failed": Object.freeze({
154
+ code: "auth_failed",
155
+ category: "auth",
156
+ source: "ErrorEnvelope.error",
157
+ status: "wired",
158
+ httpStatus: 401,
159
+ retryable: false,
160
+ sdkClass: "GislAuthError",
161
+ description: "401 — invalid / expired / missing API key.",
162
+ metadataSchema: Object.freeze({
163
+ "authErrorType": "string",
164
+ }),
165
+ }),
166
+ "feature_tier_restricted": Object.freeze({
167
+ code: "feature_tier_restricted",
168
+ category: "api",
169
+ source: "error_type",
170
+ status: "wired",
171
+ httpStatus: 403,
172
+ retryable: false,
173
+ sdkClass: "GislFeatureTierRestrictedError",
174
+ description: "403 — feature requires a higher subscription tier than the caller's.",
175
+ metadataSchema: Object.freeze({
176
+ "feature": "string",
177
+ "requiredTier": "string",
178
+ "currentTier": "string",
179
+ }),
180
+ }),
181
+ "tier_restriction": Object.freeze({
182
+ code: "tier_restriction",
183
+ category: "api",
184
+ source: "error_type",
185
+ status: "wired",
186
+ httpStatus: 403,
187
+ retryable: false,
188
+ sdkClass: "GislTierRestrictedError",
189
+ description: "403 — general tier restriction (not feature-specific). Wire emits `error_type: \"tier_restriction\"`; the SDK class name keeps the `TierRestricted` adjective form per packages/typescript/src/errors.ts.",
190
+ metadataSchema: Object.freeze({
191
+ "requiredTier": "string",
192
+ "currentTier": "string",
193
+ }),
194
+ }),
195
+ "multipart_session_ownership": Object.freeze({
196
+ code: "multipart_session_ownership",
197
+ category: "auth",
198
+ source: "ErrorEnvelope.error",
199
+ status: "wired",
200
+ httpStatus: 403,
201
+ retryable: false,
202
+ sdkClass: "GislMultipartSessionOwnershipError",
203
+ description: "403 on multipart resume — session exists but belongs to a different caller.",
204
+ metadataSchema: Object.freeze({
205
+ "uploadId": "string",
206
+ }),
207
+ }),
208
+ "multipart_session_auth_required": Object.freeze({
209
+ code: "multipart_session_auth_required",
210
+ category: "auth",
211
+ source: "ErrorEnvelope.error",
212
+ status: "wired",
213
+ httpStatus: 403,
214
+ retryable: false,
215
+ sdkClass: "GislMultipartSessionAuthRequiredError",
216
+ description: "403 on multipart resume — session was initiated anonymously; resume requires auth (future-flip per upstream 8LABloaz).",
217
+ metadataSchema: Object.freeze({
218
+ "uploadId": "string",
219
+ }),
220
+ }),
221
+ "multipart_session_not_found": Object.freeze({
222
+ code: "multipart_session_not_found",
223
+ category: "api",
224
+ source: "ErrorEnvelope.error",
225
+ status: "wired",
226
+ httpStatus: 404,
227
+ retryable: false,
228
+ sdkClass: "GislMultipartSessionNotFoundError",
229
+ description: "404 on multipart resume — upload_id unknown or expired past 48h TTL.",
230
+ metadataSchema: Object.freeze({
231
+ "uploadId": "string",
232
+ }),
233
+ }),
234
+ "workflow_expired": Object.freeze({
235
+ code: "workflow_expired",
236
+ category: "api",
237
+ source: "error_type",
238
+ status: "wired",
239
+ httpStatus: 410,
240
+ retryable: false,
241
+ sdkClass: "GislWorkflowExpiredError",
242
+ description: "410 — workflow result TTL expired; outputs no longer downloadable.",
243
+ metadataSchema: Object.freeze({
244
+ "workflowId": "string",
245
+ }),
246
+ }),
247
+ "balance_exhausted": Object.freeze({
248
+ code: "balance_exhausted",
249
+ category: "api",
250
+ source: "error_type",
251
+ status: "wired",
252
+ httpStatus: 402,
253
+ retryable: false,
254
+ sdkClass: "GislBalanceExhaustedError",
255
+ description: "402 — workflow create rejected because cost estimate exceeds available credits (monthly + purchased + overdraft).",
256
+ metadataSchema: Object.freeze({
257
+ "requiredCredits": "integer",
258
+ "availableCredits": "integer",
259
+ "links": "object",
260
+ }),
261
+ }),
262
+ "feature_not_available": Object.freeze({
263
+ code: "feature_not_available",
264
+ category: "api",
265
+ source: "error_type",
266
+ status: "wired",
267
+ httpStatus: 422,
268
+ retryable: false,
269
+ sdkClass: "GislFeatureNotAvailableError",
270
+ description: "422 — operation type is planned but not yet implemented server-side (e.g. custom_luma before Lambda support ships).",
271
+ metadataSchema: Object.freeze({
272
+ "feature": "string",
273
+ }),
274
+ }),
275
+ "upload_size_exceeds_tier": Object.freeze({
276
+ code: "upload_size_exceeds_tier",
277
+ category: "api",
278
+ source: "error_type",
279
+ status: "wired",
280
+ httpStatus: 422,
281
+ retryable: false,
282
+ sdkClass: "GislUploadCapExceededError",
283
+ description: "422 — uploaded file size exceeds the per-tier cap. Wire `error_type: \"upload_size_exceeds_tier\"`. SDK class GislUploadCapExceededError covers this + upload_duration_exceeds_tier (sibling code below).",
284
+ metadataSchema: Object.freeze({
285
+ "size": "integer",
286
+ "ceiling": "integer",
287
+ }),
288
+ }),
289
+ "upload_duration_exceeds_tier": Object.freeze({
290
+ code: "upload_duration_exceeds_tier",
291
+ category: "api",
292
+ source: "error_type",
293
+ status: "wired",
294
+ httpStatus: 422,
295
+ retryable: false,
296
+ sdkClass: "GislUploadCapExceededError",
297
+ description: "422 — uploaded media duration exceeds the per-tier cap. Wire `error_type: \"upload_duration_exceeds_tier\"`. Shares SDK class GislUploadCapExceededError with upload_size_exceeds_tier; consumers branch on the metadata.",
298
+ metadataSchema: Object.freeze({
299
+ "duration": "integer",
300
+ "ceiling": "integer",
301
+ }),
302
+ }),
303
+ "probe_pending": Object.freeze({
304
+ code: "probe_pending",
305
+ category: "api",
306
+ source: "error_type",
307
+ status: "wired",
308
+ httpStatus: 422,
309
+ retryable: true,
310
+ sdkClass: "GislApiError",
311
+ description: "422 on workflow create — upload probing not yet complete; retry after the upload finishes probing. Wire `error_type: \"probe_pending\"`.",
312
+ metadataSchema: Object.freeze({
313
+ "jobRef": "string",
314
+ }),
315
+ }),
316
+ "requires_reencode": Object.freeze({
317
+ code: "requires_reencode",
318
+ category: "api",
319
+ source: "ErrorEnvelope.error",
320
+ status: "wired",
321
+ httpStatus: 422,
322
+ retryable: false,
323
+ sdkClass: "GislApiError",
324
+ description: "422 on merge — inputs are byte-stream-incompatible (different codec / resolution / etc.); merge requires re-encode rather than concat.",
325
+ metadataSchema: Object.freeze({
326
+ "reason": "string",
327
+ }),
328
+ }),
329
+ "invalid_options": Object.freeze({
330
+ code: "invalid_options",
331
+ category: "validation",
332
+ source: "ErrorEnvelope.error",
333
+ status: "wired",
334
+ httpStatus: 422,
335
+ retryable: false,
336
+ sdkClass: "GislValidationError",
337
+ description: "422 — operation option failed server-side validation (range, depends_on, mutex). Often surfaces preflight rejections (e.g. split.cut_points len exceeds 200-output cap).",
338
+ metadataSchema: Object.freeze({
339
+ "field": "string",
340
+ "reason": "string",
341
+ }),
342
+ }),
343
+ "invalid_combination": Object.freeze({
344
+ code: "invalid_combination",
345
+ category: "validation",
346
+ source: "SDK_local",
347
+ status: "wired",
348
+ httpStatus: null,
349
+ retryable: false,
350
+ sdkClass: "GislValidationError",
351
+ description: "Two or more options that are mutually exclusive per contract `depends_on` / mutex were both provided.",
352
+ metadataSchema: Object.freeze({
353
+ "fields": "array",
354
+ }),
355
+ }),
356
+ "missing_dependency": Object.freeze({
357
+ code: "missing_dependency",
358
+ category: "validation",
359
+ source: "SDK_local",
360
+ status: "wired",
361
+ httpStatus: null,
362
+ retryable: false,
363
+ sdkClass: "GislValidationError",
364
+ description: "An option was set but its contract `depends_on` predicate was not satisfied (e.g. quality set but mode is not lossy).",
365
+ metadataSchema: Object.freeze({
366
+ "field": "string",
367
+ "requires": "array",
368
+ }),
369
+ }),
370
+ "unsupported_value": Object.freeze({
371
+ code: "unsupported_value",
372
+ category: "validation",
373
+ source: "SDK_local",
374
+ status: "wired",
375
+ httpStatus: null,
376
+ retryable: false,
377
+ sdkClass: "GislValidationError",
378
+ description: "A value was outside the allowed enum / range for an option.",
379
+ metadataSchema: Object.freeze({
380
+ "field": "string",
381
+ "value": "string",
382
+ "allowed": "array",
383
+ }),
384
+ }),
385
+ "type_mismatch": Object.freeze({
386
+ code: "type_mismatch",
387
+ category: "validation",
388
+ source: "SDK_local",
389
+ status: "wired",
390
+ httpStatus: null,
391
+ retryable: false,
392
+ sdkClass: "GislValidationError",
393
+ description: "A value's type didn't match the schema (e.g. string where integer expected).",
394
+ metadataSchema: Object.freeze({
395
+ "field": "string",
396
+ "expected": "string",
397
+ "actual": "string",
398
+ }),
399
+ }),
400
+ "upload_failed": Object.freeze({
401
+ code: "upload_failed",
402
+ category: "network",
403
+ source: "SDK_local",
404
+ status: "wired",
405
+ httpStatus: null,
406
+ retryable: true,
407
+ sdkClass: "GislError",
408
+ description: "Single-shot or multipart upload failed after retry exhaustion. Distinct from auth/balance/cap errors (those are typed above).",
409
+ metadataSchema: Object.freeze({
410
+ "reason": "string",
411
+ "attempt": "integer",
412
+ }),
413
+ }),
414
+ "workflow_failed": Object.freeze({
415
+ code: "workflow_failed",
416
+ category: "api",
417
+ source: "OperationResponse.error_code",
418
+ status: "wired",
419
+ httpStatus: null,
420
+ retryable: false,
421
+ sdkClass: "GislApiError",
422
+ description: "Workflow reached terminal failure status. Per-job error codes live on jobErrors[].errorCode.",
423
+ metadataSchema: Object.freeze({
424
+ "workflowId": "string",
425
+ "jobErrors": "array",
426
+ }),
427
+ }),
428
+ });
429
+ export const ERROR_CATEGORIES = Object.freeze({
430
+ api: Object.freeze([
431
+ "feature_tier_restricted",
432
+ "tier_restriction",
433
+ "multipart_session_not_found",
434
+ "workflow_expired",
435
+ "balance_exhausted",
436
+ "feature_not_available",
437
+ "upload_size_exceeds_tier",
438
+ "upload_duration_exceeds_tier",
439
+ "probe_pending",
440
+ "requires_reencode",
441
+ "workflow_failed",
442
+ ]),
443
+ config: Object.freeze([
444
+ "missing_credentials",
445
+ "feature_requires_auth",
446
+ ]),
447
+ network: Object.freeze([
448
+ "timeout",
449
+ "aborted",
450
+ "upload_failed",
451
+ ]),
452
+ auth: Object.freeze([
453
+ "auth_failed",
454
+ "multipart_session_ownership",
455
+ "multipart_session_auth_required",
456
+ ]),
457
+ validation: Object.freeze([
458
+ "multipart_part_invalid",
459
+ "multipart_part_count_exceeded",
460
+ "validation_failed",
461
+ "invalid_options",
462
+ "invalid_combination",
463
+ "missing_dependency",
464
+ "unsupported_value",
465
+ "type_mismatch",
466
+ ]),
467
+ chain: Object.freeze([
468
+ "undeclared_asset",
469
+ "unused_asset",
470
+ "per_input_options_not_supported",
471
+ "chain_cardinality_mismatch",
472
+ ]),
473
+ });
@@ -0,0 +1,4 @@
1
+ export * from './presets.js';
2
+ export * from './enums.js';
3
+ export * from './errors.js';
4
+ export * from './version.js';
@@ -0,0 +1,7 @@
1
+ // CODE GENERATED — DO NOT EDIT.
2
+ // Source: compression_contracts/sdk-spec/ (see sdk-spec/README.md).
3
+ // Regenerate with: scripts/generate.py.
4
+ export * from './presets.js';
5
+ export * from './enums.js';
6
+ export * from './errors.js';
7
+ export * from './version.js';
@@ -0,0 +1,6 @@
1
+ export type PresetLevel = 'Size' | 'Balanced' | 'Quality';
2
+ export type PresetCell = Readonly<Record<string, string | number | boolean>>;
3
+ export type PresetMatrix = Readonly<Record<string, Readonly<Record<PresetLevel, PresetCell>>>>;
4
+ export declare const PRESETS: PresetMatrix;
5
+ /** Lookup the shipped preset cell for (mediaOp, level). Throws on unknown keys. */
6
+ export declare function shippedDefaultsFor(mediaOp: string, level: PresetLevel): PresetCell;
@@ -0,0 +1,157 @@
1
+ // CODE GENERATED — DO NOT EDIT.
2
+ // Source: compression_contracts/sdk-spec/ (see sdk-spec/README.md).
3
+ // Regenerate with: scripts/generate.py.
4
+ export const PRESETS = Object.freeze({
5
+ "image_compress": Object.freeze({
6
+ Size: Object.freeze({
7
+ "mode": "Lossy",
8
+ "quality": 65,
9
+ "metadata": "All",
10
+ "iccProfile": "Strip",
11
+ "autoOrient": true,
12
+ "progressive": true,
13
+ "outputFormat": "Smallest",
14
+ }),
15
+ Balanced: Object.freeze({
16
+ "mode": "Auto",
17
+ "quality": 80,
18
+ "metadata": "Sensitive",
19
+ "iccProfile": "Preserve",
20
+ "autoOrient": true,
21
+ "progressive": true,
22
+ "outputFormat": "Auto",
23
+ }),
24
+ Quality: Object.freeze({
25
+ "mode": "Lossless",
26
+ "metadata": "None",
27
+ "iccProfile": "Preserve",
28
+ "autoOrient": true,
29
+ "progressive": true,
30
+ "outputFormat": "Original",
31
+ }),
32
+ }),
33
+ "audio_compress": Object.freeze({
34
+ Size: Object.freeze({
35
+ "bitrate": "_96",
36
+ "sampleRate": "_44100",
37
+ "normalize": true,
38
+ }),
39
+ Balanced: Object.freeze({
40
+ "bitrate": "_192",
41
+ "sampleRate": "_44100",
42
+ "normalize": true,
43
+ }),
44
+ Quality: Object.freeze({
45
+ "bitrate": "_320",
46
+ "sampleRate": "_48000",
47
+ "normalize": false,
48
+ }),
49
+ }),
50
+ "video_compress": Object.freeze({
51
+ Size: Object.freeze({
52
+ "codec": "H265",
53
+ "crf": 30,
54
+ "preset": "Slow",
55
+ "faststart": true,
56
+ "audioCodec": "Aac",
57
+ "audioBitrate": "_96",
58
+ }),
59
+ Balanced: Object.freeze({
60
+ "codec": "H264",
61
+ "crf": 23,
62
+ "preset": "Medium",
63
+ "faststart": true,
64
+ "audioCodec": "Aac",
65
+ "audioBitrate": "_128",
66
+ }),
67
+ Quality: Object.freeze({
68
+ "codec": "H264",
69
+ "crf": 18,
70
+ "preset": "Slow",
71
+ "faststart": true,
72
+ "audioCodec": "Aac",
73
+ "audioBitrate": "_192",
74
+ }),
75
+ }),
76
+ "document_pdf_compress": Object.freeze({
77
+ Size: Object.freeze({
78
+ "profile": "Max",
79
+ "colorspace": "Grayscale",
80
+ "flattenForms": false,
81
+ }),
82
+ Balanced: Object.freeze({
83
+ "profile": "Web",
84
+ "colorspace": "Unchanged",
85
+ "flattenForms": false,
86
+ }),
87
+ Quality: Object.freeze({
88
+ "profile": "Archive",
89
+ "colorspace": "Unchanged",
90
+ "flattenForms": false,
91
+ }),
92
+ }),
93
+ "document_office_compress": Object.freeze({
94
+ Size: Object.freeze({
95
+ "imageQuality": 60,
96
+ "stripMacros": true,
97
+ "stripHiddenData": true,
98
+ "stripUnusedFonts": true,
99
+ }),
100
+ Balanced: Object.freeze({
101
+ "imageQuality": 80,
102
+ "stripMacros": true,
103
+ "stripHiddenData": false,
104
+ "stripUnusedFonts": false,
105
+ }),
106
+ Quality: Object.freeze({
107
+ "imageQuality": 92,
108
+ "stripMacros": false,
109
+ "stripHiddenData": false,
110
+ "stripUnusedFonts": false,
111
+ }),
112
+ }),
113
+ "document_odf_compress": Object.freeze({
114
+ Size: Object.freeze({
115
+ "imageQuality": 60,
116
+ "stripMetadata": true,
117
+ "stripUnusedStyles": true,
118
+ }),
119
+ Balanced: Object.freeze({
120
+ "imageQuality": 80,
121
+ "stripMetadata": true,
122
+ "stripUnusedStyles": false,
123
+ }),
124
+ Quality: Object.freeze({
125
+ "imageQuality": 92,
126
+ "stripMetadata": false,
127
+ "stripUnusedStyles": false,
128
+ }),
129
+ }),
130
+ "document_epub_compress": Object.freeze({
131
+ Size: Object.freeze({
132
+ "imageQuality": 60,
133
+ "fontSubsetting": true,
134
+ "stripUnusedCss": true,
135
+ }),
136
+ Balanced: Object.freeze({
137
+ "imageQuality": 80,
138
+ "fontSubsetting": true,
139
+ "stripUnusedCss": false,
140
+ }),
141
+ Quality: Object.freeze({
142
+ "imageQuality": 92,
143
+ "fontSubsetting": false,
144
+ "stripUnusedCss": false,
145
+ }),
146
+ }),
147
+ });
148
+ /** Lookup the shipped preset cell for (mediaOp, level). Throws on unknown keys. */
149
+ export function shippedDefaultsFor(mediaOp, level) {
150
+ const group = PRESETS[mediaOp];
151
+ if (!group)
152
+ throw new Error(`Unknown preset mediaOp: ${mediaOp}`);
153
+ const cell = group[level];
154
+ if (!cell)
155
+ throw new Error(`Unknown preset level for ${mediaOp}: ${level}`);
156
+ return cell;
157
+ }
@@ -0,0 +1,3 @@
1
+ export declare const SDK_SPEC_VERSION: "1.1.0";
2
+ export declare const PRESET_VERSION: "1.0";
3
+ export declare const PRESET_CONFIG_HASH: "sha256:35aeb0b6b86edd9814ace5b75cfeef8a7b1432ecb8e4d5ee8b38d9187a0b45eb";
@@ -0,0 +1,6 @@
1
+ // CODE GENERATED — DO NOT EDIT.
2
+ // Source: compression_contracts/sdk-spec/ (see sdk-spec/README.md).
3
+ // Regenerate with: scripts/generate.py.
4
+ export const SDK_SPEC_VERSION = "1.1.0";
5
+ export const PRESET_VERSION = "1.0";
6
+ export const PRESET_CONFIG_HASH = "sha256:35aeb0b6b86edd9814ace5b75cfeef8a7b1432ecb8e4d5ee8b38d9187a0b45eb";