@stack0/sdk 0.5.14 → 0.5.16
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/dist/cdn/index.d.mts +49 -32
- package/dist/cdn/index.d.ts +49 -32
- package/dist/cdn/index.js +3 -1
- package/dist/cdn/index.js.map +1 -1
- package/dist/cdn/index.mjs +3 -1
- package/dist/cdn/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cdn/index.d.mts
CHANGED
|
@@ -181,53 +181,58 @@ interface VideoVariant {
|
|
|
181
181
|
/**
|
|
182
182
|
* Watermark burned into a video during transcode.
|
|
183
183
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* Set `type: "text"` to burn a text string instead of a logo.
|
|
184
|
+
* Image watermarks mirror the image-upload controls. Image and text watermarks share
|
|
185
|
+
* placement, opacity, rotation, and tiling. The original asset stays clean and every
|
|
186
|
+
* transcoded rendition is watermarked.
|
|
188
187
|
*/
|
|
189
|
-
interface
|
|
190
|
-
/** "image" (default) composites a logo; "text" burns a text string. */
|
|
191
|
-
type?: "image" | "text";
|
|
192
|
-
/** Logo source: another CDN asset (image watermark). Provide `assetId` or `url`. */
|
|
193
|
-
assetId?: string;
|
|
194
|
-
/** Logo source: a direct URL (image watermark, alternative to `assetId`). */
|
|
195
|
-
url?: string;
|
|
196
|
-
/** Text to render (required when `type` is "text"). */
|
|
197
|
-
text?: string;
|
|
198
|
-
/** Font family for text watermarks. */
|
|
199
|
-
fontFamily?: string;
|
|
200
|
-
/** Font size in pixels for text watermarks. */
|
|
201
|
-
fontSize?: number;
|
|
202
|
-
/** Text color as `#RRGGBB` (text watermarks). */
|
|
203
|
-
fontColor?: string;
|
|
188
|
+
interface BaseVideoWatermarkOptions {
|
|
204
189
|
/** Placement on the frame (default: "bottom-right"). */
|
|
205
190
|
position?: ImageWatermarkPosition;
|
|
206
191
|
/** Horizontal inset from the anchored edge in pixels (default: 20). */
|
|
207
192
|
offsetX?: number;
|
|
208
193
|
/** Vertical inset from the anchored edge in pixels (default: 20). */
|
|
209
194
|
offsetY?: number;
|
|
210
|
-
/** "relative" sizes by a percentage of the video width; "absolute" uses width/height (default: "relative"). */
|
|
211
|
-
sizingMode?: ImageWatermarkSizingMode;
|
|
212
|
-
/** Absolute width in pixels (used when `sizingMode` is "absolute"). */
|
|
213
|
-
width?: number;
|
|
214
|
-
/** Absolute height in pixels (used when `sizingMode` is "absolute"). */
|
|
215
|
-
height?: number;
|
|
216
|
-
/** Relative size as a percentage of the video width (used when `sizingMode` is "relative"; default: 15). */
|
|
217
|
-
scale?: number;
|
|
218
195
|
/** Opacity 0-100 (default: 80). */
|
|
219
196
|
opacity?: number;
|
|
220
|
-
/**
|
|
197
|
+
/** Repeat the watermark across the whole frame (default: false). */
|
|
221
198
|
tile?: boolean;
|
|
222
199
|
/** Horizontal spacing between tiles in pixels (default: 100). */
|
|
223
200
|
tileSpacingX?: number;
|
|
224
201
|
/** Vertical spacing between tiles in pixels (default: 100). */
|
|
225
202
|
tileSpacingY?: number;
|
|
226
|
-
/** Rotation in degrees, -360 to 360 (default: 0).
|
|
203
|
+
/** Rotation in degrees, -360 to 360 (default: 0). */
|
|
227
204
|
rotation?: number;
|
|
228
|
-
|
|
205
|
+
}
|
|
206
|
+
interface ImageVideoWatermarkOptions extends BaseVideoWatermarkOptions {
|
|
207
|
+
/** Omit for backward compatibility; image is the default watermark type. */
|
|
208
|
+
type?: "image";
|
|
209
|
+
/** Logo source: another CDN asset. Provide `assetId` or `url`. */
|
|
210
|
+
assetId?: string;
|
|
211
|
+
/** Logo source: a direct URL (alternative to `assetId`). */
|
|
212
|
+
url?: string;
|
|
213
|
+
/** "relative" sizes by a percentage of the video width; "absolute" uses width/height (default: "relative"). */
|
|
214
|
+
sizingMode?: ImageWatermarkSizingMode;
|
|
215
|
+
/** Absolute width in pixels (used when `sizingMode` is "absolute"). */
|
|
216
|
+
width?: number;
|
|
217
|
+
/** Absolute height in pixels (used when `sizingMode` is "absolute"). */
|
|
218
|
+
height?: number;
|
|
219
|
+
/** Relative size as a percentage of the video width (used when `sizingMode` is "relative"; default: 15). */
|
|
220
|
+
scale?: number;
|
|
221
|
+
/** Corner radius in pixels clipping the logo, 0-500 (default: 0). */
|
|
229
222
|
borderRadius?: number;
|
|
230
223
|
}
|
|
224
|
+
interface TextVideoWatermarkOptions extends BaseVideoWatermarkOptions {
|
|
225
|
+
type: "text";
|
|
226
|
+
/** Text to render. */
|
|
227
|
+
text: string;
|
|
228
|
+
/** Font family (default: "Liberation Sans"). */
|
|
229
|
+
fontFamily?: string;
|
|
230
|
+
/** Font size in pixels (default: 48). */
|
|
231
|
+
fontSize?: number;
|
|
232
|
+
/** Text color as `#RRGGBB` (default: "#FFFFFF"). */
|
|
233
|
+
fontColor?: string;
|
|
234
|
+
}
|
|
235
|
+
type WatermarkOptions = ImageVideoWatermarkOptions | TextVideoWatermarkOptions;
|
|
231
236
|
/** Position options for image watermarks */
|
|
232
237
|
type ImageWatermarkPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
233
238
|
/** Sizing mode for image watermarks */
|
|
@@ -291,7 +296,8 @@ interface TranscodeJob {
|
|
|
291
296
|
outputFormat: VideoOutputFormat;
|
|
292
297
|
variants: VideoVariant[];
|
|
293
298
|
progress: number | null;
|
|
294
|
-
|
|
299
|
+
/** Provider or preprocessing failure details when status is `failed`. */
|
|
300
|
+
errorMessage: string | null;
|
|
295
301
|
mediaConvertJobId: string | null;
|
|
296
302
|
createdAt: Date;
|
|
297
303
|
startedAt: Date | null;
|
|
@@ -638,6 +644,7 @@ interface MovePrivateFilesResponse {
|
|
|
638
644
|
type MergeStatus = TranscodingStatus;
|
|
639
645
|
type MergeQuality = VideoQuality;
|
|
640
646
|
type MergeOutputFormat = "mp4" | "webm";
|
|
647
|
+
type MergeAspectRatio = "auto" | "16:9" | "9:16" | "1:1";
|
|
641
648
|
/**
|
|
642
649
|
* Text overlay shadow configuration
|
|
643
650
|
*/
|
|
@@ -724,6 +731,13 @@ interface MergeOutputConfig {
|
|
|
724
731
|
format?: MergeOutputFormat;
|
|
725
732
|
/** Output quality (default: 720p) */
|
|
726
733
|
quality?: MergeQuality;
|
|
734
|
+
/**
|
|
735
|
+
* Output aspect ratio (default: "auto").
|
|
736
|
+
* "auto" matches the orientation of the first visual input — portrait inputs
|
|
737
|
+
* produce portrait output (e.g. 1080x1920 at 1080p), ideal for Reels/TikTok.
|
|
738
|
+
* Explicit values force the canvas; the quality sets the short edge.
|
|
739
|
+
*/
|
|
740
|
+
aspectRatio?: MergeAspectRatio;
|
|
727
741
|
/** Custom filename for the output */
|
|
728
742
|
filename?: string;
|
|
729
743
|
}
|
|
@@ -781,6 +795,7 @@ interface MergeJob {
|
|
|
781
795
|
audioTrackAssetId: string | null;
|
|
782
796
|
outputFormat: MergeOutputFormat;
|
|
783
797
|
outputQuality: MergeQuality;
|
|
798
|
+
outputAspectRatio: MergeAspectRatio;
|
|
784
799
|
outputFilename: string | null;
|
|
785
800
|
outputAssetId: string | null;
|
|
786
801
|
status: MergeStatus;
|
|
@@ -1254,6 +1269,7 @@ declare class CDN {
|
|
|
1254
1269
|
* ```typescript
|
|
1255
1270
|
* const job = await cdn.getJob('job-id');
|
|
1256
1271
|
* console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
|
|
1272
|
+
* if (job.status === 'failed') console.error(job.errorMessage);
|
|
1257
1273
|
* ```
|
|
1258
1274
|
*/
|
|
1259
1275
|
getJob(jobId: string): Promise<TranscodeJob>;
|
|
@@ -1693,6 +1709,7 @@ declare class CDN {
|
|
|
1693
1709
|
* output: {
|
|
1694
1710
|
* format: 'mp4',
|
|
1695
1711
|
* quality: '1080p',
|
|
1712
|
+
* aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
|
|
1696
1713
|
* filename: 'final-video.mp4',
|
|
1697
1714
|
* },
|
|
1698
1715
|
* webhookUrl: 'https://your-app.com/webhook',
|
|
@@ -1857,4 +1874,4 @@ declare class CDN {
|
|
|
1857
1874
|
private convertImportFileDates;
|
|
1858
1875
|
}
|
|
1859
1876
|
|
|
1860
|
-
export { type Asset, type AssetStatus, type AssetType, type AudioTrackInput, type BundleDownloadUrlRequest, type BundleDownloadUrlResponse, type BundleStatus, CDN, type CancelImportResponse, type CancelMergeJobRequest, type CdnEnvironment, type CdnStorageBreakdownItem, type CdnStorageBreakdownRequest, type CdnStorageBreakdownResponse, type CdnUsageDataPoint, type CdnUsageHistoryRequest, type CdnUsageHistoryResponse, type CdnUsageRequest, type CdnUsageResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CreateBundleRequest, type CreateBundleResponse, type CreateFolderRequest, type CreateImportRequest, type CreateImportResponse, type CreateMergeJobRequest, type DeleteAssetRequest, type DeleteAssetsRequest, type DeleteAssetsResponse, type DownloadBundle, type ExtractAudioRequest, type ExtractAudioResponse, type Folder, type FolderListItem, type FolderTreeNode, type GenerateGifRequest, type GetAssetRequest, type GetFolderByPathRequest, type GetFolderRequest, type GetFolderTreeRequest, type GetMergeJobRequest, type GifStatus, type ImageWatermarkConfig, type ImageWatermarkPosition, type ImageWatermarkSizingMode, type ImportAuthType, type ImportError, type ImportFile, type ImportFileStatus, type ImportJob, type ImportJobStatus, type ImportJobSummary, type ImportPathMode, type ListAssetsRequest, type ListAssetsResponse, type ListBundlesRequest, type ListBundlesResponse, type ListFoldersRequest, type ListFoldersResponse, type ListGifsRequest, type ListImportFilesRequest, type ListImportFilesResponse, type ListImportsRequest, type ListImportsResponse, type ListJobsRequest, type ListJobsResponse, type ListMergeJobsRequest, type ListMergeJobsResponse, type ListPrivateFilesRequest, type ListPrivateFilesResponse, type ListThumbnailsRequest, type ListThumbnailsResponse, type MergeInputItem, type MergeJob, type MergeJobWithOutput, type MergeOutputConfig, type MergeOutputFormat, type MergeQuality, type MergeStatus, type MoveAssetsRequest, type MoveAssetsResponse, type MoveFolderRequest, type MoveFolderResponse, type MovePrivateFilesRequest, type MovePrivateFilesResponse, type PrivateDownloadUrlRequest, type PrivateDownloadUrlResponse, type PrivateFile, type PrivateFileStatus, type PrivateUploadUrlRequest, type PrivateUploadUrlResponse, type RegenerateThumbnailRequest, type RegenerateThumbnailResponse, type RetryImportResponse, type StreamingUrls, type TextOverlay, type TextOverlayShadow, type TextOverlayStroke, type ThumbnailRequest, type ThumbnailResponse, type TranscodeJob, type TranscodeVideoRequest, type TranscodingStatus, type TransformOptions, type TrimOptions, type UpdateAssetRequest, type UpdateFolderRequest, type UpdatePrivateFileRequest, type UploadFromUrlRequest, type UploadUrlRequest, type UploadUrlResponse, type VideoCodec, type VideoGif, type VideoOutputFormat, type VideoQuality, type VideoThumbnail, type VideoVariant, type WatermarkOptions };
|
|
1877
|
+
export { type Asset, type AssetStatus, type AssetType, type AudioTrackInput, type BundleDownloadUrlRequest, type BundleDownloadUrlResponse, type BundleStatus, CDN, type CancelImportResponse, type CancelMergeJobRequest, type CdnEnvironment, type CdnStorageBreakdownItem, type CdnStorageBreakdownRequest, type CdnStorageBreakdownResponse, type CdnUsageDataPoint, type CdnUsageHistoryRequest, type CdnUsageHistoryResponse, type CdnUsageRequest, type CdnUsageResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CreateBundleRequest, type CreateBundleResponse, type CreateFolderRequest, type CreateImportRequest, type CreateImportResponse, type CreateMergeJobRequest, type DeleteAssetRequest, type DeleteAssetsRequest, type DeleteAssetsResponse, type DownloadBundle, type ExtractAudioRequest, type ExtractAudioResponse, type Folder, type FolderListItem, type FolderTreeNode, type GenerateGifRequest, type GetAssetRequest, type GetFolderByPathRequest, type GetFolderRequest, type GetFolderTreeRequest, type GetMergeJobRequest, type GifStatus, type ImageVideoWatermarkOptions, type ImageWatermarkConfig, type ImageWatermarkPosition, type ImageWatermarkSizingMode, type ImportAuthType, type ImportError, type ImportFile, type ImportFileStatus, type ImportJob, type ImportJobStatus, type ImportJobSummary, type ImportPathMode, type ListAssetsRequest, type ListAssetsResponse, type ListBundlesRequest, type ListBundlesResponse, type ListFoldersRequest, type ListFoldersResponse, type ListGifsRequest, type ListImportFilesRequest, type ListImportFilesResponse, type ListImportsRequest, type ListImportsResponse, type ListJobsRequest, type ListJobsResponse, type ListMergeJobsRequest, type ListMergeJobsResponse, type ListPrivateFilesRequest, type ListPrivateFilesResponse, type ListThumbnailsRequest, type ListThumbnailsResponse, type MergeAspectRatio, type MergeInputItem, type MergeJob, type MergeJobWithOutput, type MergeOutputConfig, type MergeOutputFormat, type MergeQuality, type MergeStatus, type MoveAssetsRequest, type MoveAssetsResponse, type MoveFolderRequest, type MoveFolderResponse, type MovePrivateFilesRequest, type MovePrivateFilesResponse, type PrivateDownloadUrlRequest, type PrivateDownloadUrlResponse, type PrivateFile, type PrivateFileStatus, type PrivateUploadUrlRequest, type PrivateUploadUrlResponse, type RegenerateThumbnailRequest, type RegenerateThumbnailResponse, type RetryImportResponse, type StreamingUrls, type TextOverlay, type TextOverlayShadow, type TextOverlayStroke, type TextVideoWatermarkOptions, type ThumbnailRequest, type ThumbnailResponse, type TranscodeJob, type TranscodeVideoRequest, type TranscodingStatus, type TransformOptions, type TrimOptions, type UpdateAssetRequest, type UpdateFolderRequest, type UpdatePrivateFileRequest, type UploadFromUrlRequest, type UploadUrlRequest, type UploadUrlResponse, type VideoCodec, type VideoGif, type VideoOutputFormat, type VideoQuality, type VideoThumbnail, type VideoVariant, type WatermarkOptions };
|
package/dist/cdn/index.d.ts
CHANGED
|
@@ -181,53 +181,58 @@ interface VideoVariant {
|
|
|
181
181
|
/**
|
|
182
182
|
* Watermark burned into a video during transcode.
|
|
183
183
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* Set `type: "text"` to burn a text string instead of a logo.
|
|
184
|
+
* Image watermarks mirror the image-upload controls. Image and text watermarks share
|
|
185
|
+
* placement, opacity, rotation, and tiling. The original asset stays clean and every
|
|
186
|
+
* transcoded rendition is watermarked.
|
|
188
187
|
*/
|
|
189
|
-
interface
|
|
190
|
-
/** "image" (default) composites a logo; "text" burns a text string. */
|
|
191
|
-
type?: "image" | "text";
|
|
192
|
-
/** Logo source: another CDN asset (image watermark). Provide `assetId` or `url`. */
|
|
193
|
-
assetId?: string;
|
|
194
|
-
/** Logo source: a direct URL (image watermark, alternative to `assetId`). */
|
|
195
|
-
url?: string;
|
|
196
|
-
/** Text to render (required when `type` is "text"). */
|
|
197
|
-
text?: string;
|
|
198
|
-
/** Font family for text watermarks. */
|
|
199
|
-
fontFamily?: string;
|
|
200
|
-
/** Font size in pixels for text watermarks. */
|
|
201
|
-
fontSize?: number;
|
|
202
|
-
/** Text color as `#RRGGBB` (text watermarks). */
|
|
203
|
-
fontColor?: string;
|
|
188
|
+
interface BaseVideoWatermarkOptions {
|
|
204
189
|
/** Placement on the frame (default: "bottom-right"). */
|
|
205
190
|
position?: ImageWatermarkPosition;
|
|
206
191
|
/** Horizontal inset from the anchored edge in pixels (default: 20). */
|
|
207
192
|
offsetX?: number;
|
|
208
193
|
/** Vertical inset from the anchored edge in pixels (default: 20). */
|
|
209
194
|
offsetY?: number;
|
|
210
|
-
/** "relative" sizes by a percentage of the video width; "absolute" uses width/height (default: "relative"). */
|
|
211
|
-
sizingMode?: ImageWatermarkSizingMode;
|
|
212
|
-
/** Absolute width in pixels (used when `sizingMode` is "absolute"). */
|
|
213
|
-
width?: number;
|
|
214
|
-
/** Absolute height in pixels (used when `sizingMode` is "absolute"). */
|
|
215
|
-
height?: number;
|
|
216
|
-
/** Relative size as a percentage of the video width (used when `sizingMode` is "relative"; default: 15). */
|
|
217
|
-
scale?: number;
|
|
218
195
|
/** Opacity 0-100 (default: 80). */
|
|
219
196
|
opacity?: number;
|
|
220
|
-
/**
|
|
197
|
+
/** Repeat the watermark across the whole frame (default: false). */
|
|
221
198
|
tile?: boolean;
|
|
222
199
|
/** Horizontal spacing between tiles in pixels (default: 100). */
|
|
223
200
|
tileSpacingX?: number;
|
|
224
201
|
/** Vertical spacing between tiles in pixels (default: 100). */
|
|
225
202
|
tileSpacingY?: number;
|
|
226
|
-
/** Rotation in degrees, -360 to 360 (default: 0).
|
|
203
|
+
/** Rotation in degrees, -360 to 360 (default: 0). */
|
|
227
204
|
rotation?: number;
|
|
228
|
-
|
|
205
|
+
}
|
|
206
|
+
interface ImageVideoWatermarkOptions extends BaseVideoWatermarkOptions {
|
|
207
|
+
/** Omit for backward compatibility; image is the default watermark type. */
|
|
208
|
+
type?: "image";
|
|
209
|
+
/** Logo source: another CDN asset. Provide `assetId` or `url`. */
|
|
210
|
+
assetId?: string;
|
|
211
|
+
/** Logo source: a direct URL (alternative to `assetId`). */
|
|
212
|
+
url?: string;
|
|
213
|
+
/** "relative" sizes by a percentage of the video width; "absolute" uses width/height (default: "relative"). */
|
|
214
|
+
sizingMode?: ImageWatermarkSizingMode;
|
|
215
|
+
/** Absolute width in pixels (used when `sizingMode` is "absolute"). */
|
|
216
|
+
width?: number;
|
|
217
|
+
/** Absolute height in pixels (used when `sizingMode` is "absolute"). */
|
|
218
|
+
height?: number;
|
|
219
|
+
/** Relative size as a percentage of the video width (used when `sizingMode` is "relative"; default: 15). */
|
|
220
|
+
scale?: number;
|
|
221
|
+
/** Corner radius in pixels clipping the logo, 0-500 (default: 0). */
|
|
229
222
|
borderRadius?: number;
|
|
230
223
|
}
|
|
224
|
+
interface TextVideoWatermarkOptions extends BaseVideoWatermarkOptions {
|
|
225
|
+
type: "text";
|
|
226
|
+
/** Text to render. */
|
|
227
|
+
text: string;
|
|
228
|
+
/** Font family (default: "Liberation Sans"). */
|
|
229
|
+
fontFamily?: string;
|
|
230
|
+
/** Font size in pixels (default: 48). */
|
|
231
|
+
fontSize?: number;
|
|
232
|
+
/** Text color as `#RRGGBB` (default: "#FFFFFF"). */
|
|
233
|
+
fontColor?: string;
|
|
234
|
+
}
|
|
235
|
+
type WatermarkOptions = ImageVideoWatermarkOptions | TextVideoWatermarkOptions;
|
|
231
236
|
/** Position options for image watermarks */
|
|
232
237
|
type ImageWatermarkPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
233
238
|
/** Sizing mode for image watermarks */
|
|
@@ -291,7 +296,8 @@ interface TranscodeJob {
|
|
|
291
296
|
outputFormat: VideoOutputFormat;
|
|
292
297
|
variants: VideoVariant[];
|
|
293
298
|
progress: number | null;
|
|
294
|
-
|
|
299
|
+
/** Provider or preprocessing failure details when status is `failed`. */
|
|
300
|
+
errorMessage: string | null;
|
|
295
301
|
mediaConvertJobId: string | null;
|
|
296
302
|
createdAt: Date;
|
|
297
303
|
startedAt: Date | null;
|
|
@@ -638,6 +644,7 @@ interface MovePrivateFilesResponse {
|
|
|
638
644
|
type MergeStatus = TranscodingStatus;
|
|
639
645
|
type MergeQuality = VideoQuality;
|
|
640
646
|
type MergeOutputFormat = "mp4" | "webm";
|
|
647
|
+
type MergeAspectRatio = "auto" | "16:9" | "9:16" | "1:1";
|
|
641
648
|
/**
|
|
642
649
|
* Text overlay shadow configuration
|
|
643
650
|
*/
|
|
@@ -724,6 +731,13 @@ interface MergeOutputConfig {
|
|
|
724
731
|
format?: MergeOutputFormat;
|
|
725
732
|
/** Output quality (default: 720p) */
|
|
726
733
|
quality?: MergeQuality;
|
|
734
|
+
/**
|
|
735
|
+
* Output aspect ratio (default: "auto").
|
|
736
|
+
* "auto" matches the orientation of the first visual input — portrait inputs
|
|
737
|
+
* produce portrait output (e.g. 1080x1920 at 1080p), ideal for Reels/TikTok.
|
|
738
|
+
* Explicit values force the canvas; the quality sets the short edge.
|
|
739
|
+
*/
|
|
740
|
+
aspectRatio?: MergeAspectRatio;
|
|
727
741
|
/** Custom filename for the output */
|
|
728
742
|
filename?: string;
|
|
729
743
|
}
|
|
@@ -781,6 +795,7 @@ interface MergeJob {
|
|
|
781
795
|
audioTrackAssetId: string | null;
|
|
782
796
|
outputFormat: MergeOutputFormat;
|
|
783
797
|
outputQuality: MergeQuality;
|
|
798
|
+
outputAspectRatio: MergeAspectRatio;
|
|
784
799
|
outputFilename: string | null;
|
|
785
800
|
outputAssetId: string | null;
|
|
786
801
|
status: MergeStatus;
|
|
@@ -1254,6 +1269,7 @@ declare class CDN {
|
|
|
1254
1269
|
* ```typescript
|
|
1255
1270
|
* const job = await cdn.getJob('job-id');
|
|
1256
1271
|
* console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
|
|
1272
|
+
* if (job.status === 'failed') console.error(job.errorMessage);
|
|
1257
1273
|
* ```
|
|
1258
1274
|
*/
|
|
1259
1275
|
getJob(jobId: string): Promise<TranscodeJob>;
|
|
@@ -1693,6 +1709,7 @@ declare class CDN {
|
|
|
1693
1709
|
* output: {
|
|
1694
1710
|
* format: 'mp4',
|
|
1695
1711
|
* quality: '1080p',
|
|
1712
|
+
* aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
|
|
1696
1713
|
* filename: 'final-video.mp4',
|
|
1697
1714
|
* },
|
|
1698
1715
|
* webhookUrl: 'https://your-app.com/webhook',
|
|
@@ -1857,4 +1874,4 @@ declare class CDN {
|
|
|
1857
1874
|
private convertImportFileDates;
|
|
1858
1875
|
}
|
|
1859
1876
|
|
|
1860
|
-
export { type Asset, type AssetStatus, type AssetType, type AudioTrackInput, type BundleDownloadUrlRequest, type BundleDownloadUrlResponse, type BundleStatus, CDN, type CancelImportResponse, type CancelMergeJobRequest, type CdnEnvironment, type CdnStorageBreakdownItem, type CdnStorageBreakdownRequest, type CdnStorageBreakdownResponse, type CdnUsageDataPoint, type CdnUsageHistoryRequest, type CdnUsageHistoryResponse, type CdnUsageRequest, type CdnUsageResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CreateBundleRequest, type CreateBundleResponse, type CreateFolderRequest, type CreateImportRequest, type CreateImportResponse, type CreateMergeJobRequest, type DeleteAssetRequest, type DeleteAssetsRequest, type DeleteAssetsResponse, type DownloadBundle, type ExtractAudioRequest, type ExtractAudioResponse, type Folder, type FolderListItem, type FolderTreeNode, type GenerateGifRequest, type GetAssetRequest, type GetFolderByPathRequest, type GetFolderRequest, type GetFolderTreeRequest, type GetMergeJobRequest, type GifStatus, type ImageWatermarkConfig, type ImageWatermarkPosition, type ImageWatermarkSizingMode, type ImportAuthType, type ImportError, type ImportFile, type ImportFileStatus, type ImportJob, type ImportJobStatus, type ImportJobSummary, type ImportPathMode, type ListAssetsRequest, type ListAssetsResponse, type ListBundlesRequest, type ListBundlesResponse, type ListFoldersRequest, type ListFoldersResponse, type ListGifsRequest, type ListImportFilesRequest, type ListImportFilesResponse, type ListImportsRequest, type ListImportsResponse, type ListJobsRequest, type ListJobsResponse, type ListMergeJobsRequest, type ListMergeJobsResponse, type ListPrivateFilesRequest, type ListPrivateFilesResponse, type ListThumbnailsRequest, type ListThumbnailsResponse, type MergeInputItem, type MergeJob, type MergeJobWithOutput, type MergeOutputConfig, type MergeOutputFormat, type MergeQuality, type MergeStatus, type MoveAssetsRequest, type MoveAssetsResponse, type MoveFolderRequest, type MoveFolderResponse, type MovePrivateFilesRequest, type MovePrivateFilesResponse, type PrivateDownloadUrlRequest, type PrivateDownloadUrlResponse, type PrivateFile, type PrivateFileStatus, type PrivateUploadUrlRequest, type PrivateUploadUrlResponse, type RegenerateThumbnailRequest, type RegenerateThumbnailResponse, type RetryImportResponse, type StreamingUrls, type TextOverlay, type TextOverlayShadow, type TextOverlayStroke, type ThumbnailRequest, type ThumbnailResponse, type TranscodeJob, type TranscodeVideoRequest, type TranscodingStatus, type TransformOptions, type TrimOptions, type UpdateAssetRequest, type UpdateFolderRequest, type UpdatePrivateFileRequest, type UploadFromUrlRequest, type UploadUrlRequest, type UploadUrlResponse, type VideoCodec, type VideoGif, type VideoOutputFormat, type VideoQuality, type VideoThumbnail, type VideoVariant, type WatermarkOptions };
|
|
1877
|
+
export { type Asset, type AssetStatus, type AssetType, type AudioTrackInput, type BundleDownloadUrlRequest, type BundleDownloadUrlResponse, type BundleStatus, CDN, type CancelImportResponse, type CancelMergeJobRequest, type CdnEnvironment, type CdnStorageBreakdownItem, type CdnStorageBreakdownRequest, type CdnStorageBreakdownResponse, type CdnUsageDataPoint, type CdnUsageHistoryRequest, type CdnUsageHistoryResponse, type CdnUsageRequest, type CdnUsageResponse, type ConfirmUploadRequest, type ConfirmUploadResponse, type CreateBundleRequest, type CreateBundleResponse, type CreateFolderRequest, type CreateImportRequest, type CreateImportResponse, type CreateMergeJobRequest, type DeleteAssetRequest, type DeleteAssetsRequest, type DeleteAssetsResponse, type DownloadBundle, type ExtractAudioRequest, type ExtractAudioResponse, type Folder, type FolderListItem, type FolderTreeNode, type GenerateGifRequest, type GetAssetRequest, type GetFolderByPathRequest, type GetFolderRequest, type GetFolderTreeRequest, type GetMergeJobRequest, type GifStatus, type ImageVideoWatermarkOptions, type ImageWatermarkConfig, type ImageWatermarkPosition, type ImageWatermarkSizingMode, type ImportAuthType, type ImportError, type ImportFile, type ImportFileStatus, type ImportJob, type ImportJobStatus, type ImportJobSummary, type ImportPathMode, type ListAssetsRequest, type ListAssetsResponse, type ListBundlesRequest, type ListBundlesResponse, type ListFoldersRequest, type ListFoldersResponse, type ListGifsRequest, type ListImportFilesRequest, type ListImportFilesResponse, type ListImportsRequest, type ListImportsResponse, type ListJobsRequest, type ListJobsResponse, type ListMergeJobsRequest, type ListMergeJobsResponse, type ListPrivateFilesRequest, type ListPrivateFilesResponse, type ListThumbnailsRequest, type ListThumbnailsResponse, type MergeAspectRatio, type MergeInputItem, type MergeJob, type MergeJobWithOutput, type MergeOutputConfig, type MergeOutputFormat, type MergeQuality, type MergeStatus, type MoveAssetsRequest, type MoveAssetsResponse, type MoveFolderRequest, type MoveFolderResponse, type MovePrivateFilesRequest, type MovePrivateFilesResponse, type PrivateDownloadUrlRequest, type PrivateDownloadUrlResponse, type PrivateFile, type PrivateFileStatus, type PrivateUploadUrlRequest, type PrivateUploadUrlResponse, type RegenerateThumbnailRequest, type RegenerateThumbnailResponse, type RetryImportResponse, type StreamingUrls, type TextOverlay, type TextOverlayShadow, type TextOverlayStroke, type TextVideoWatermarkOptions, type ThumbnailRequest, type ThumbnailResponse, type TranscodeJob, type TranscodeVideoRequest, type TranscodingStatus, type TransformOptions, type TrimOptions, type UpdateAssetRequest, type UpdateFolderRequest, type UpdatePrivateFileRequest, type UploadFromUrlRequest, type UploadUrlRequest, type UploadUrlResponse, type VideoCodec, type VideoGif, type VideoOutputFormat, type VideoQuality, type VideoThumbnail, type VideoVariant, type WatermarkOptions };
|
package/dist/cdn/index.js
CHANGED
|
@@ -484,6 +484,7 @@ var CDN = class {
|
|
|
484
484
|
* ```typescript
|
|
485
485
|
* const job = await cdn.getJob('job-id');
|
|
486
486
|
* console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
|
|
487
|
+
* if (job.status === 'failed') console.error(job.errorMessage);
|
|
487
488
|
* ```
|
|
488
489
|
*/
|
|
489
490
|
async getJob(jobId) {
|
|
@@ -537,7 +538,7 @@ var CDN = class {
|
|
|
537
538
|
* ```
|
|
538
539
|
*/
|
|
539
540
|
async getStreamingUrls(assetId) {
|
|
540
|
-
return this.http.get(`/cdn/video
|
|
541
|
+
return this.http.get(`/cdn/video/${assetId}/stream`);
|
|
541
542
|
}
|
|
542
543
|
/**
|
|
543
544
|
* Generate a thumbnail from a video at a specific timestamp
|
|
@@ -1191,6 +1192,7 @@ var CDN = class {
|
|
|
1191
1192
|
* output: {
|
|
1192
1193
|
* format: 'mp4',
|
|
1193
1194
|
* quality: '1080p',
|
|
1195
|
+
* aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
|
|
1194
1196
|
* filename: 'final-video.mp4',
|
|
1195
1197
|
* },
|
|
1196
1198
|
* webhookUrl: 'https://your-app.com/webhook',
|