@giveitsmaller/sdk 0.15.0 → 0.17.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.
- package/README.md +21 -0
- package/dist/_audit.js +15 -2
- package/dist/client.d.ts +27 -4
- package/dist/client.js +46 -4
- package/dist/ergonomic/image_output_routes.d.ts +89 -0
- package/dist/ergonomic/image_output_routes.js +155 -0
- package/dist/ergonomic/option_types.d.ts +147 -0
- package/dist/ergonomic/option_types.js +57 -0
- package/dist/ergonomic/option_validation.d.ts +58 -0
- package/dist/ergonomic/option_validation.js +143 -0
- package/dist/ergonomic/preset_resolver.d.ts +7 -6
- package/dist/ergonomic/preset_resolver.js +43 -39
- package/dist/ergonomic/presets/document_pdf_compress.d.ts +3 -5
- package/dist/ergonomic/presets/document_pdf_compress.js +10 -12
- package/dist/ergonomic/presets/image_compress.d.ts +4 -11
- package/dist/ergonomic/presets/image_compress.js +12 -25
- package/dist/ergonomic/presets/index.d.ts +21 -1
- package/dist/ergonomic/presets/index.js +4 -4
- package/dist/errors.d.ts +25 -0
- package/dist/errors.js +34 -0
- package/dist/file-first.d.ts +241 -49
- package/dist/file-first.js +803 -249
- package/dist/generated/sdk_spec/enums.d.ts +8 -46
- package/dist/generated/sdk_spec/enums.js +12 -33
- package/dist/generated/sdk_spec/presets.js +9 -20
- package/dist/generated/sdk_spec/version.d.ts +3 -3
- package/dist/generated/sdk_spec/version.js +3 -3
- package/dist/gisl.d.ts +8 -1
- package/dist/gisl.js +12 -0
- package/dist/handle.js +9 -1
- package/dist/index.core.d.ts +7 -4
- package/dist/index.core.js +8 -1
- package/dist/types.d.ts +21 -0
- package/package.json +3 -3
|
@@ -4,35 +4,15 @@ export declare const OptimizeFor: {
|
|
|
4
4
|
readonly Quality: "Quality";
|
|
5
5
|
};
|
|
6
6
|
export type OptimizeFor = typeof OptimizeFor[keyof typeof OptimizeFor];
|
|
7
|
-
export declare const ImageMode: {
|
|
8
|
-
readonly Lossy: "lossy";
|
|
9
|
-
readonly Lossless: "lossless";
|
|
10
|
-
readonly Auto: "auto";
|
|
11
|
-
};
|
|
12
|
-
export type ImageMode = typeof ImageMode[keyof typeof ImageMode];
|
|
13
7
|
export declare const ImageFormat: {
|
|
14
8
|
readonly Original: "original";
|
|
15
|
-
readonly Auto: "auto";
|
|
16
|
-
readonly Smallest: "smallest";
|
|
17
|
-
readonly Jpeg: "jpeg";
|
|
18
|
-
readonly Png: "png";
|
|
19
9
|
readonly Webp: "webp";
|
|
20
|
-
readonly Avif: "avif";
|
|
21
10
|
};
|
|
22
11
|
export type ImageFormat = typeof ImageFormat[keyof typeof ImageFormat];
|
|
23
12
|
export declare const ImageMetadataPolicy: {
|
|
24
13
|
readonly All: "all";
|
|
25
|
-
readonly None: "none";
|
|
26
|
-
readonly Copyright: "copyright";
|
|
27
|
-
readonly Sensitive: "sensitive";
|
|
28
14
|
};
|
|
29
15
|
export type ImageMetadataPolicy = typeof ImageMetadataPolicy[keyof typeof ImageMetadataPolicy];
|
|
30
|
-
export declare const IccProfilePolicy: {
|
|
31
|
-
readonly Preserve: "preserve";
|
|
32
|
-
readonly Strip: "strip";
|
|
33
|
-
readonly Srgb: "srgb";
|
|
34
|
-
};
|
|
35
|
-
export type IccProfilePolicy = typeof IccProfilePolicy[keyof typeof IccProfilePolicy];
|
|
36
16
|
export declare const VideoCodec: {
|
|
37
17
|
readonly H264: "h264";
|
|
38
18
|
readonly H265: "h265";
|
|
@@ -82,10 +62,10 @@ export declare const AudioSampleRate: {
|
|
|
82
62
|
};
|
|
83
63
|
export type AudioSampleRate = typeof AudioSampleRate[keyof typeof AudioSampleRate];
|
|
84
64
|
export declare const PdfProfile: {
|
|
85
|
-
readonly
|
|
86
|
-
readonly
|
|
87
|
-
readonly
|
|
88
|
-
readonly
|
|
65
|
+
readonly Screen: "screen";
|
|
66
|
+
readonly Ebook: "ebook";
|
|
67
|
+
readonly Printer: "printer";
|
|
68
|
+
readonly Prepress: "prepress";
|
|
89
69
|
};
|
|
90
70
|
export type PdfProfile = typeof PdfProfile[keyof typeof PdfProfile];
|
|
91
71
|
export declare const PdfColorspace: {
|
|
@@ -102,30 +82,12 @@ export declare const ERGONOMIC_ENUMS: {
|
|
|
102
82
|
readonly Balanced: "Balanced";
|
|
103
83
|
readonly Quality: "Quality";
|
|
104
84
|
};
|
|
105
|
-
readonly ImageMode: {
|
|
106
|
-
readonly Lossy: "lossy";
|
|
107
|
-
readonly Lossless: "lossless";
|
|
108
|
-
readonly Auto: "auto";
|
|
109
|
-
};
|
|
110
85
|
readonly ImageFormat: {
|
|
111
86
|
readonly Original: "original";
|
|
112
|
-
readonly Auto: "auto";
|
|
113
|
-
readonly Smallest: "smallest";
|
|
114
|
-
readonly Jpeg: "jpeg";
|
|
115
|
-
readonly Png: "png";
|
|
116
87
|
readonly Webp: "webp";
|
|
117
|
-
readonly Avif: "avif";
|
|
118
88
|
};
|
|
119
89
|
readonly ImageMetadataPolicy: {
|
|
120
90
|
readonly All: "all";
|
|
121
|
-
readonly None: "none";
|
|
122
|
-
readonly Copyright: "copyright";
|
|
123
|
-
readonly Sensitive: "sensitive";
|
|
124
|
-
};
|
|
125
|
-
readonly IccProfilePolicy: {
|
|
126
|
-
readonly Preserve: "preserve";
|
|
127
|
-
readonly Strip: "strip";
|
|
128
|
-
readonly Srgb: "srgb";
|
|
129
91
|
};
|
|
130
92
|
readonly VideoCodec: {
|
|
131
93
|
readonly H264: "h264";
|
|
@@ -170,10 +132,10 @@ export declare const ERGONOMIC_ENUMS: {
|
|
|
170
132
|
readonly _48000: 48000;
|
|
171
133
|
};
|
|
172
134
|
readonly PdfProfile: {
|
|
173
|
-
readonly
|
|
174
|
-
readonly
|
|
175
|
-
readonly
|
|
176
|
-
readonly
|
|
135
|
+
readonly Screen: "screen";
|
|
136
|
+
readonly Ebook: "ebook";
|
|
137
|
+
readonly Printer: "printer";
|
|
138
|
+
readonly Prepress: "prepress";
|
|
177
139
|
};
|
|
178
140
|
readonly PdfColorspace: {
|
|
179
141
|
readonly Unchanged: "unchanged";
|
|
@@ -7,38 +7,19 @@ export const OptimizeFor = {
|
|
|
7
7
|
Balanced: "Balanced",
|
|
8
8
|
Quality: "Quality",
|
|
9
9
|
};
|
|
10
|
-
// Image
|
|
11
|
-
export const ImageMode = {
|
|
12
|
-
Lossy: "lossy",
|
|
13
|
-
Lossless: "lossless",
|
|
14
|
-
Auto: "auto",
|
|
15
|
-
};
|
|
16
|
-
// Image output format selection. Original keeps input; Auto picks best per browser support; Smallest tries all and returns smallest.
|
|
10
|
+
// Image output format for compress. Original keeps the input format; Webp recompresses to WebP. Other format changes (jpeg/png/avif/...) are the convert operation's job, not compress.
|
|
17
11
|
export const ImageFormat = {
|
|
18
12
|
Original: "original",
|
|
19
|
-
Auto: "auto",
|
|
20
|
-
Smallest: "smallest",
|
|
21
|
-
Jpeg: "jpeg",
|
|
22
|
-
Png: "png",
|
|
23
13
|
Webp: "webp",
|
|
24
|
-
Avif: "avif",
|
|
25
14
|
};
|
|
26
|
-
// Image metadata handling.
|
|
27
|
-
// All
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
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).
|
|
31
21
|
export const ImageMetadataPolicy = {
|
|
32
22
|
All: "all",
|
|
33
|
-
None: "none",
|
|
34
|
-
Copyright: "copyright",
|
|
35
|
-
Sensitive: "sensitive",
|
|
36
|
-
};
|
|
37
|
-
// ICC color profile handling.
|
|
38
|
-
export const IccProfilePolicy = {
|
|
39
|
-
Preserve: "preserve",
|
|
40
|
-
Strip: "strip",
|
|
41
|
-
Srgb: "srgb",
|
|
42
23
|
};
|
|
43
24
|
// Video codec. H264 = widest compatibility; H265/Av1 = better compression but slower.
|
|
44
25
|
export const VideoCodec = {
|
|
@@ -88,12 +69,12 @@ export const AudioSampleRate = {
|
|
|
88
69
|
_44100: 44100,
|
|
89
70
|
_48000: 48000,
|
|
90
71
|
};
|
|
91
|
-
// PDF
|
|
72
|
+
// PDF Ghostscript preset. Screen = smallest; Ebook = mid; Printer = 300dpi; Prepress = print-production.
|
|
92
73
|
export const PdfProfile = {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
74
|
+
Screen: "screen",
|
|
75
|
+
Ebook: "ebook",
|
|
76
|
+
Printer: "printer",
|
|
77
|
+
Prepress: "prepress",
|
|
97
78
|
};
|
|
98
79
|
// PDF output color space.
|
|
99
80
|
export const PdfColorspace = {
|
|
@@ -105,10 +86,8 @@ export const PdfColorspace = {
|
|
|
105
86
|
/** Catalog of every ergonomic enum (canonicalName → wire). */
|
|
106
87
|
export const ERGONOMIC_ENUMS = {
|
|
107
88
|
OptimizeFor,
|
|
108
|
-
ImageMode,
|
|
109
89
|
ImageFormat,
|
|
110
90
|
ImageMetadataPolicy,
|
|
111
|
-
IccProfilePolicy,
|
|
112
91
|
VideoCodec,
|
|
113
92
|
VideoPreset,
|
|
114
93
|
VideoFit,
|
|
@@ -4,26 +4,18 @@
|
|
|
4
4
|
export const PRESETS = Object.freeze({
|
|
5
5
|
"image_compress": Object.freeze({
|
|
6
6
|
Size: Object.freeze({
|
|
7
|
-
"mode": "Lossy",
|
|
8
7
|
"quality": 65,
|
|
9
8
|
"metadata": "All",
|
|
10
|
-
"iccProfile": "Strip",
|
|
11
|
-
"progressive": true,
|
|
12
9
|
"outputFormat": "Original",
|
|
13
10
|
}),
|
|
14
11
|
Balanced: Object.freeze({
|
|
15
|
-
"mode": "Auto",
|
|
16
12
|
"quality": 80,
|
|
17
|
-
"metadata": "
|
|
18
|
-
"iccProfile": "Preserve",
|
|
19
|
-
"progressive": true,
|
|
13
|
+
"metadata": "All",
|
|
20
14
|
"outputFormat": "Original",
|
|
21
15
|
}),
|
|
22
16
|
Quality: Object.freeze({
|
|
23
|
-
"
|
|
24
|
-
"metadata": "
|
|
25
|
-
"iccProfile": "Preserve",
|
|
26
|
-
"progressive": true,
|
|
17
|
+
"quality": 92,
|
|
18
|
+
"metadata": "All",
|
|
27
19
|
"outputFormat": "Original",
|
|
28
20
|
}),
|
|
29
21
|
}),
|
|
@@ -60,19 +52,16 @@ export const PRESETS = Object.freeze({
|
|
|
60
52
|
}),
|
|
61
53
|
"document_pdf_compress": Object.freeze({
|
|
62
54
|
Size: Object.freeze({
|
|
63
|
-
"profile": "
|
|
64
|
-
"
|
|
65
|
-
"flattenForms": false,
|
|
55
|
+
"profile": "Screen",
|
|
56
|
+
"grayscale": true,
|
|
66
57
|
}),
|
|
67
58
|
Balanced: Object.freeze({
|
|
68
|
-
"profile": "
|
|
69
|
-
"
|
|
70
|
-
"flattenForms": false,
|
|
59
|
+
"profile": "Ebook",
|
|
60
|
+
"grayscale": false,
|
|
71
61
|
}),
|
|
72
62
|
Quality: Object.freeze({
|
|
73
|
-
"profile": "
|
|
74
|
-
"
|
|
75
|
-
"flattenForms": false,
|
|
63
|
+
"profile": "Printer",
|
|
64
|
+
"grayscale": false,
|
|
76
65
|
}),
|
|
77
66
|
}),
|
|
78
67
|
"document_office_compress": Object.freeze({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const SDK_SPEC_VERSION: "
|
|
2
|
-
export declare const PRESET_VERSION: "1.
|
|
3
|
-
export declare const PRESET_CONFIG_HASH: "sha256:
|
|
1
|
+
export declare const SDK_SPEC_VERSION: "2.0.0";
|
|
2
|
+
export declare const PRESET_VERSION: "1.4";
|
|
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 = "
|
|
5
|
-
export const PRESET_VERSION = "1.
|
|
6
|
-
export const PRESET_CONFIG_HASH = "sha256:
|
|
4
|
+
export const SDK_SPEC_VERSION = "2.0.0";
|
|
5
|
+
export const PRESET_VERSION = "1.4";
|
|
6
|
+
export const PRESET_CONFIG_HASH = "sha256:62fbada24e33f983dacb0f717b0c9bb80824a208c3dc7f9af8523026e783543a";
|
package/dist/gisl.d.ts
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
import { GislClient } from './client.js';
|
|
20
20
|
import { GislConfigError, GislFeatureRequiresAuthError, GislMissingCredentialsError } from './errors.js';
|
|
21
21
|
import { type ResolveCredentialsOptions, type ResolveEndpointOptions } from './credentials.js';
|
|
22
|
-
import type { GislClientConfig } from './types.js';
|
|
22
|
+
import type { CreditsUsageOptions, GislClientConfig } from './types.js';
|
|
23
|
+
import type { AccountLimits, CreditsBalanceResponse, CreditsUsageResponse } from '@giveitsmaller/contracts/openapi';
|
|
23
24
|
import { OperationBuilder } from './builder.js';
|
|
24
25
|
import { MergeBuilder, type Asset, type MergeOptions } from './merge.js';
|
|
25
26
|
import { PresetDefaults } from './ergonomic/presets/index.js';
|
|
@@ -128,6 +129,12 @@ export type ErgonomicClient = GislClient & {
|
|
|
128
129
|
* over the existing transport.
|
|
129
130
|
*/
|
|
130
131
|
withPresetDefaults(defaults: PresetDefaults): ErgonomicClient;
|
|
132
|
+
/** Current credit balance (sugar for `getCreditsBalance()`). */
|
|
133
|
+
credits(): Promise<CreditsBalanceResponse>;
|
|
134
|
+
/** Credit usage history (sugar for `getCreditsUsage()`). */
|
|
135
|
+
creditsUsage(options?: CreditsUsageOptions): Promise<CreditsUsageResponse>;
|
|
136
|
+
/** Effective account limits / tier-resolved caps (sugar for `getAccountLimits()`). */
|
|
137
|
+
limits(): Promise<AccountLimits>;
|
|
131
138
|
};
|
|
132
139
|
/**
|
|
133
140
|
* The `gisl` namespace — primary ergonomic-layer entry point.
|
package/dist/gisl.js
CHANGED
|
@@ -166,6 +166,18 @@ function wrapErgonomic(client, presetDefaults, scopedPresetDefaults) {
|
|
|
166
166
|
return new MergeBuilder(target, declared, mergeOpts);
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
+
// 8yqUXLCS — first-class ergonomic billing/limits accessors (thin fluent
|
|
170
|
+
// aliases over the low-level getters, surfaced + documented here rather
|
|
171
|
+
// than relying on undocumented Proxy passthrough).
|
|
172
|
+
if (prop === 'credits') {
|
|
173
|
+
return () => target.getCreditsBalance();
|
|
174
|
+
}
|
|
175
|
+
if (prop === 'creditsUsage') {
|
|
176
|
+
return (options) => target.getCreditsUsage(options);
|
|
177
|
+
}
|
|
178
|
+
if (prop === 'limits') {
|
|
179
|
+
return () => target.getAccountLimits();
|
|
180
|
+
}
|
|
169
181
|
return Reflect.get(target, prop, receiver);
|
|
170
182
|
},
|
|
171
183
|
});
|
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
|
/**
|
package/dist/index.core.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { parseSseStream } from './sse.js';
|
|
|
3
3
|
export type { CreditsUsageOptions, ListWorkflowsOptions, GetSchemaOptions, GetSchemaResult, PreflightClipError, PreflightClipsResult, ProbeWaitOptions, ProbeWaitResult, GislClientConfig, GislSseEvent, UploadOptions, WaitOptions, WorkflowCreatePayload, OperationDef, WorkflowSourcePayload, MultiInputSourcePayload, UploadSourcePayload, JobOutputSourcePayload, ExternalImportSourcePayload, ConnectionSourcePayload, JobInputV2Payload, JobDefinitionPayload, ExternalDestinationPayload, DeliveryPayload, DeliveryModePayload, DeliveryBundleFormatPayload, DeliverySelectionPayload, DeliverySelectionTypePayload, DeliveryOutputRefPayload, WorkflowProcessingPayload, ProcessingClassHintPayload, MultipartCheckpointState, _Sdk3HandCodedUploadedPart, _Sdk3HandCodedMultipartStatusResult, _Sdk3HandCodedPresignedPart, _Sdk3HandCodedPresignPartsResult, _Sdk3HandCodedKeepaliveResult, } from './types.js';
|
|
4
4
|
export { uploadSource, jobOutputSource, externalImportSource, connectionSource, } from './types.js';
|
|
5
5
|
export type { GislConfigErrorMetadata } from './errors.js';
|
|
6
|
-
export { GislError, GislApiError, GislValidationError, GislBalanceExhaustedError, GislTierRestrictedError, GislFeatureTierRestrictedError, GislFeatureNotAvailableError, GislWorkflowExpiredError, GislProbePendingError, GislAuthError, GislUploadCapExceededError, GislMultipartPartError, GislMultipartPartCountError, GislMultipartSessionNotFoundError, GislMultipartSessionOwnershipError, GislMultipartSessionAuthRequiredError, GislTimeoutError, GislAbortError, GislNetworkError, GislConfigError, GislMissingCredentialsError, GislFeatureRequiresAuthError, GislUndeclaredAssetError, GislUnusedAssetError, GislPerInputOptionsNotSupportedError, GislChainCardinalityMismatchError, GislBundleAlreadyArchivedError, GislNoSuchKeyError, GislSinkError, GislResultNotReadyError, } from './errors.js';
|
|
6
|
+
export { GislError, GislApiError, GislValidationError, GislBalanceExhaustedError, GislTierRestrictedError, GislFeatureTierRestrictedError, GislFeatureNotAvailableError, GislWorkflowExpiredError, GislProbePendingError, GislAuthError, GislUploadCapExceededError, GislMultipartPartError, GislMultipartPartCountError, GislMultipartSessionNotFoundError, GislMultipartSessionOwnershipError, GislMultipartSessionAuthRequiredError, GislTimeoutError, GislAbortError, GislNetworkError, GislConfigError, GislMissingCredentialsError, GislFeatureRequiresAuthError, GislUndeclaredAssetError, GislUnusedAssetError, GislPerInputOptionsNotSupportedError, GislChainCardinalityMismatchError, GislBundleAlreadyArchivedError, GislNoSuchKeyError, GislSinkError, GislItemFailedError, GislResultNotReadyError, } from './errors.js';
|
|
7
7
|
export type { GislApiErrorOptions, GislUploadCapKind } from './errors.js';
|
|
8
8
|
export { RunResult } from './file-first.js';
|
|
9
9
|
export type { OutputFile, ItemResult, ItemFailure, Manifest, Downloader, } from './file-first.js';
|
|
@@ -13,23 +13,26 @@ 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';
|
|
19
|
-
export { presetDefaults, PresetDefaults, type PresetMedia, type PresetOp, type AnyPresetOptions, ImageCompressPresetOptions, type ImageCompressPresetOptionsInput, AudioCompressPresetOptions, type AudioCompressPresetOptionsInput, VideoCompressPresetOptions, type VideoCompressPresetOptionsInput, DocumentPdfCompressPresetOptions, type DocumentPdfCompressPresetOptionsInput, DocumentOfficeCompressPresetOptions, type DocumentOfficeCompressPresetOptionsInput, DocumentOdfCompressPresetOptions, type DocumentOdfCompressPresetOptionsInput, DocumentEpubCompressPresetOptions, type DocumentEpubCompressPresetOptionsInput, OptimizeFor,
|
|
21
|
+
export { presetDefaults, PresetDefaults, type PresetMedia, type PresetOp, type AnyPresetOptions, ImageCompressPresetOptions, type ImageCompressPresetOptionsInput, AudioCompressPresetOptions, type AudioCompressPresetOptionsInput, VideoCompressPresetOptions, type VideoCompressPresetOptionsInput, DocumentPdfCompressPresetOptions, type DocumentPdfCompressPresetOptionsInput, DocumentOfficeCompressPresetOptions, type DocumentOfficeCompressPresetOptionsInput, DocumentOdfCompressPresetOptions, type DocumentOdfCompressPresetOptionsInput, DocumentEpubCompressPresetOptions, type DocumentEpubCompressPresetOptionsInput, OptimizeFor, ImageMetadataPolicy, ImageFormat, VideoCodec, VideoPreset, VideoFit, AudioBitrate, AudioCodec, AudioSampleRate, PdfProfile, PdfColorspace, } from './ergonomic/presets/index.js';
|
|
20
22
|
export { OperationBuilder, MapEachBuilder } from './builder.js';
|
|
21
23
|
export { MergeBuilder, asset, handle, clip } from './merge.js';
|
|
22
24
|
export type { Asset, ClipEntry, ClipOptions, MergeMediaKind, MergeOptions, SequenceEntry, } from './merge.js';
|
|
23
25
|
export type { Artifact, ArtifactRef, JobBreakdown, OperationBreakdown, ProcessingProgressEvent, ProgressEvent, ResolvedOptions, ResolvedOptionsSources, Result, RunOptions, SubmitOptions, UploadProgressEvent, } from './builder.js';
|
|
24
26
|
export { PRESET_VERSION, resolveCompressOptions } from './ergonomic/preset_resolver.js';
|
|
25
27
|
export type { ResolveCompressOptionsInput, ResolveCompressOptionsOutput, } from './ergonomic/preset_resolver.js';
|
|
26
|
-
export type { AudioWatermarkDecodeRequest, AudioWatermarkDecodeResponse, ContactRequest, CreditsBalanceResponse, CreditsUsageResponse, CreditTransaction, ExternalImportCreatedResponse, ExternalImportRequest, LoginUserRequest, LoginUser200ResponseData, LoginUser200ResponseDataUser, WorkflowCancelResponse, WorkflowResumeResponse, WorkflowPausedDetail, WorkflowPausedDetailLinks, UploadResponse, UploadConstraintsApplied, UploadProbeResponse, UploadProbeMediaMetadata, MultipartInitiateRequestMetadataHint, WorkflowCreateResponse, WorkflowStatusResponse, WorkflowListResponse, WorkflowSummary, WorkflowDownloadResponse, MetadataResponse, MetadataResponseDimensions, MetadataResponseExif, MetadataResponseExifGps, OperationsSchemaResponse, OperationSchemaDefinition, MimeGroupSchema, OptionSchema, PerValueAvailabilityEntry, PerRoleCardinalityEntry, RetryResponse, JobDownload, OperationDownload, WebhookPayload, WebhookOperationContext, JobResponse, OperationResponse, OperationResult, OperationResultMetrics, ExternalDestination, Delivery, DeliveryPlan, DeliveryPlanOutput, WorkflowProcessing, ProcessingPlan, ProcessingPlanJob, WorkflowEdge, WorkflowWarning, JobInputV2, WorkflowSource, UploadSource, JobOutputSource, ConnectionSource, ExternalImportToken, BalanceExhaustedResponse, BalanceExhaustedResponseAllOfLinks, TierRestrictionResponse, FeatureTierRestrictedResponse, FeatureNotAvailableResponse, FeatureViolation, WorkflowExpiredResponse, ProbePendingResponse, AuthErrorResponse, } from '@giveitsmaller/contracts/openapi';
|
|
28
|
+
export type { AccountLimits, AccountLimitsLimits, AccountLimitEntry, AudioWatermarkDecodeRequest, AudioWatermarkDecodeResponse, ContactRequest, CreditsBalanceResponse, CreditsUsageResponse, CreditTransaction, ExternalImportCreatedResponse, ExternalImportRequest, LoginUserRequest, LoginUser200ResponseData, LoginUser200ResponseDataUser, WorkflowCancelResponse, WorkflowResumeResponse, WorkflowPausedDetail, WorkflowPausedDetailLinks, UploadResponse, UploadConstraintsApplied, UploadProbeResponse, UploadProbeMediaMetadata, MultipartInitiateRequestMetadataHint, WorkflowCreateResponse, WorkflowStatusResponse, WorkflowListResponse, WorkflowSummary, WorkflowDownloadResponse, MetadataResponse, MetadataResponseDimensions, MetadataResponseExif, MetadataResponseExifGps, OperationsSchemaResponse, OperationSchemaDefinition, MimeGroupSchema, OptionSchema, PerValueAvailabilityEntry, PerRoleCardinalityEntry, RetryResponse, JobDownload, OperationDownload, DownloadBundle, WebhookPayload, WebhookOperationContext, JobResponse, OperationResponse, OperationResult, OperationResultMetrics, ExternalDestination, Delivery, DeliveryPlan, DeliveryPlanOutput, WorkflowProcessing, ProcessingPlan, ProcessingPlanJob, WorkflowEdge, WorkflowWarning, JobInputV2, WorkflowSource, UploadSource, JobOutputSource, ConnectionSource, ExternalImportToken, BalanceExhaustedResponse, BalanceExhaustedResponseAllOfLinks, TierRestrictionResponse, FeatureTierRestrictedResponse, FeatureNotAvailableResponse, FeatureViolation, WorkflowExpiredResponse, ProbePendingResponse, AuthErrorResponse, } from '@giveitsmaller/contracts/openapi';
|
|
27
29
|
export { AudioWatermarkDecodeRequestMethodHintEnum, AudioWatermarkDecodeResponseMethodEnum, OperationInputModel, ExternalImportRequestProviderHintEnum, ContactSubject, CreditTransactionSourceBucket, UploadProbeStatus, UploadProbeProcessingClass, WorkflowCancelBillingEffect, WorkflowPauseRequiredAction, WorkflowStatus, WarningType, WorkflowWarningSeverity, OperationType, SseEventType, CallbackEventType, OperationStatus, JobStatus, JobInputV2RoleEnum, AuthErrorType, TierRestrictionKind, BalanceExhaustedResponseRequiredActionEnum, ProcessingClassReason, DeliveryPlanReason, UserTier, ProcessingClass, } from '@giveitsmaller/contracts/openapi';
|
|
28
30
|
export type { SseOperationProgressData, SseOperationCompletedData, SseOperationFailedData, SseJobCompletedData, SseJobFailedData, SseWorkflowTerminalData, } from '@giveitsmaller/contracts/openapi';
|
|
29
31
|
export type { MultiOutputCompletion, PageIndexed, PositionIndexed, Unindexed, } from '@giveitsmaller/contracts/asyncapi';
|
|
30
32
|
import type { MultiOutputCompletion as _MultiOutputCompletion } from '@giveitsmaller/contracts/asyncapi';
|
|
31
33
|
export type OperationResultOutputEntry = _MultiOutputCompletion['outputs'][number];
|
|
32
|
-
export type { CompressImageOptions, CompressVideoOptions, CompressAudioOptions, CompressDocumentPdfOptions, CompressDocumentOfficeOptions, CompressDocumentOdfOptions, CompressDocumentEpubOptions, ThumbnailImageOptions, ThumbnailVideoOptions, ThumbnailDocumentOptions, ConvertImageOptions, ConvertVideoOptions, ConvertAudioOptions, ConvertDocumentPdfOptions, MergeImageOptions, MergeVideoOptions, MergeVideoPerInputOptions, MergeAudioOptions, MergeAudioPerInputOptions, ArchiveOptions, ImageWatermarkImageOptions, ImageWatermarkImageGifOptions, TextWatermarkImageOptions, CustomLumaVideoOptions, AudioOverlayAudioOptions, AudioOverlayVideoOptions, AudioWatermarkAudioOptions, AudioWatermarkVideoOptions, AudioToVideoAudioOptions, VideoWatermarkVideoOptions, VideoTextWatermarkVideoOptions, SplitImageGifOptions, SplitDocumentPdfOptions, SplitAudioOptions, SplitVideoOptions, } from '@giveitsmaller/contracts/operations';
|
|
34
|
+
export type { CompressImageOptions, CompressImageJpegOptions, CompressImagePngOptions, CompressImageAvifOptions, CompressVideoOptions, CompressAudioOptions, CompressDocumentPdfOptions, CompressDocumentOfficeOptions, CompressDocumentOdfOptions, CompressDocumentEpubOptions, ThumbnailImageOptions, ThumbnailVideoOptions, ThumbnailDocumentOptions, ConvertImageOptions, ConvertVideoOptions, ConvertAudioOptions, ConvertDocumentPdfOptions, MergeImageOptions, MergeVideoOptions, MergeVideoPerInputOptions, MergeAudioOptions, MergeAudioPerInputOptions, ArchiveOptions, ImageWatermarkImageOptions, ImageWatermarkImageGifOptions, TextWatermarkImageOptions, CustomLumaVideoOptions, AudioOverlayAudioOptions, AudioOverlayVideoOptions, AudioWatermarkAudioOptions, AudioWatermarkVideoOptions, AudioToVideoAudioOptions, VideoWatermarkVideoOptions, VideoTextWatermarkVideoOptions, SplitImageGifOptions, SplitDocumentPdfOptions, SplitAudioOptions, SplitVideoOptions, } from '@giveitsmaller/contracts/operations';
|
|
33
35
|
export { ImageWatermarkImageAnchor, ImageWatermarkImageGifAnchor, TextWatermarkImageAnchor, TextWatermarkImageFontFamily, TextWatermarkImageWatermarkMode, AudioOverlayAudioMode, AudioOverlayVideoMode, AudioOverlayVideoNoAudioTrackBehaviour, AudioWatermarkAudioMethod, AudioWatermarkAudioRobustness, AudioWatermarkAudioDensity, AudioWatermarkVideoMethod, AudioWatermarkVideoRobustness, AudioWatermarkVideoDensity, AudioToVideoAudioOutputResolution, AudioToVideoAudioImageFit, AudioToVideoAudioOutputFormat, VideoWatermarkVideoAnchor, VideoTextWatermarkVideoFontFamily, VideoTextWatermarkVideoWatermarkMode, VideoTextWatermarkVideoAnchor, SplitImageGifOutputFormat, SplitDocumentPdfMode, SplitAudioMode, SplitAudioPrecision, SplitVideoMode, SplitVideoPrecision, } from '@giveitsmaller/contracts/operations';
|
|
34
36
|
export { archiveMetadata, audioOverlayMetadata, audioWatermarkMetadata, compressMetadata, convertMetadata, customLumaMetadata, imageWatermarkMetadata, mergeMetadata, textWatermarkMetadata, thumbnailMetadata, audioToVideoMetadata, videoWatermarkMetadata, videoTextWatermarkMetadata, splitMetadata, } from '@giveitsmaller/contracts/operations';
|
|
37
|
+
export type { ConvertOptions, ThumbnailOptions, TextWatermarkOptions, WatermarkOptions, WatermarkAnchor, } from './ergonomic/option_types.js';
|
|
35
38
|
export type { OperationMetadata, AvailabilityValue, AvailabilityEntry, FeatureEntry, MimeGroupMetadata, OptionMetadata, ProcessingClassConstraints, } from '@giveitsmaller/contracts/operations';
|
package/dist/index.core.js
CHANGED
|
@@ -28,6 +28,8 @@ GislChainCardinalityMismatchError,
|
|
|
28
28
|
GislBundleAlreadyArchivedError,
|
|
29
29
|
// FF1 / 3BIxEnfR — file-first result sink errors.
|
|
30
30
|
GislNoSuchKeyError, GislSinkError,
|
|
31
|
+
// AjhOUuqQ — typed terminal item failure stored in RunResult.failed[].error.
|
|
32
|
+
GislItemFailedError,
|
|
31
33
|
// FF5a / Ao8RPVxD — thrown by the file-first Handle.result() when the
|
|
32
34
|
// workflow is not yet terminal (the non-blocking accessor).
|
|
33
35
|
GislResultNotReadyError, } from './errors.js';
|
|
@@ -48,6 +50,11 @@ export { MergedRecipe } from './file-first.js';
|
|
|
48
50
|
// File-first N→1 bundle (FF3b) — `client.files([...]).archive(opts?)` returns a
|
|
49
51
|
// terminal ArchivedRecipe (zip / tar.gz; no post-bundle chain), then run()/submit().
|
|
50
52
|
export { ArchivedRecipe } from './file-first.js';
|
|
53
|
+
// File-first multi-input watermark (FF4a / Z7zTr789) — `client.file(base)
|
|
54
|
+
// .watermark(overlay, opts)` returns a single-output WatermarkedRecipe you chain
|
|
55
|
+
// post-watermark ops on, then run()/submit(). Routes image_watermark / video_watermark
|
|
56
|
+
// by base media; gates planned/unsupported bases locally pre-upload.
|
|
57
|
+
export { WatermarkedRecipe } from './file-first.js';
|
|
51
58
|
// `HttpDownloader` (Node streaming downloader) is re-exported from the Node-only
|
|
52
59
|
// entry `index.ts`, NOT here — it statically imports node:fs/node:stream.
|
|
53
60
|
// `projectDownloadsToRunResult` is intentionally NOT re-exported here — it is an
|
|
@@ -65,7 +72,7 @@ export { gisl, create } from './gisl.js';
|
|
|
65
72
|
// Ergonomic preset defaults (T4a / VhIj4S7T) — typed leaf DTOs + immutable
|
|
66
73
|
// `PresetDefaults` builder + `presetDefaults()` factory + ergonomic enum
|
|
67
74
|
// re-exports. Resolver wiring (T4b) consumes `PresetDefaults.cellFor()`.
|
|
68
|
-
export { presetDefaults, PresetDefaults, ImageCompressPresetOptions, AudioCompressPresetOptions, VideoCompressPresetOptions, DocumentPdfCompressPresetOptions, DocumentOfficeCompressPresetOptions, DocumentOdfCompressPresetOptions, DocumentEpubCompressPresetOptions, OptimizeFor,
|
|
75
|
+
export { presetDefaults, PresetDefaults, ImageCompressPresetOptions, AudioCompressPresetOptions, VideoCompressPresetOptions, DocumentPdfCompressPresetOptions, DocumentOfficeCompressPresetOptions, DocumentOdfCompressPresetOptions, DocumentEpubCompressPresetOptions, OptimizeFor, ImageMetadataPolicy, ImageFormat, VideoCodec, VideoPreset, VideoFit, AudioBitrate, AudioCodec, AudioSampleRate, PdfProfile, PdfColorspace, } from './ergonomic/presets/index.js';
|
|
69
76
|
// Operation-builder surface (T2 / xVDTIm8C) — `client.compress/convert/thumbnail`
|
|
70
77
|
// returns an `OperationBuilder`; `.run()` projects to a flat `Result` /
|
|
71
78
|
// `.submit({webhook})` returns a `Handle`. Progress events are the
|
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.
|
|
3
|
+
"version": "0.17.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,12 +31,12 @@
|
|
|
31
31
|
"node": ">=18"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@giveitsmaller/contracts": "^0.
|
|
34
|
+
"@giveitsmaller/contracts": "^0.34.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^22",
|
|
38
38
|
"esbuild": "^0.27",
|
|
39
|
-
"typescript": "
|
|
39
|
+
"typescript": "5.9.3",
|
|
40
40
|
"vitest": "^3.1 <3.2.5",
|
|
41
41
|
"yaml": "^2.6"
|
|
42
42
|
},
|