@stack0/sdk 0.5.12 → 0.5.15

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.
@@ -178,12 +178,55 @@ interface VideoVariant {
178
178
  codec?: VideoCodec;
179
179
  bitrate?: number;
180
180
  }
181
+ /**
182
+ * Watermark burned into a video during transcode.
183
+ *
184
+ * The image-watermark fields mirror the image-upload watermark config
185
+ * ({@link ImageWatermarkConfig}), so the same settings you use to watermark photos work
186
+ * for video — the original asset stays clean and every transcoded rendition is watermarked.
187
+ * Set `type: "text"` to burn a text string instead of a logo.
188
+ */
181
189
  interface WatermarkOptions {
182
- type: "image" | "text";
183
- imageAssetId?: string;
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"). */
184
197
  text?: string;
185
- position: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center";
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;
204
+ /** Placement on the frame (default: "bottom-right"). */
205
+ position?: ImageWatermarkPosition;
206
+ /** Horizontal inset from the anchored edge in pixels (default: 20). */
207
+ offsetX?: number;
208
+ /** Vertical inset from the anchored edge in pixels (default: 20). */
209
+ 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
+ /** Opacity 0-100 (default: 80). */
186
219
  opacity?: number;
220
+ /** Tile the watermark across the whole frame, e.g. for copyright protection (default: false). */
221
+ tile?: boolean;
222
+ /** Horizontal spacing between tiles in pixels (default: 100). */
223
+ tileSpacingX?: number;
224
+ /** Vertical spacing between tiles in pixels (default: 100). */
225
+ tileSpacingY?: number;
226
+ /** Rotation in degrees, -360 to 360 (default: 0). Image watermarks only. */
227
+ rotation?: number;
228
+ /** Corner radius in pixels clipping the logo, 0-500 (default: 0). Image watermarks only. */
229
+ borderRadius?: number;
187
230
  }
188
231
  /** Position options for image watermarks */
189
232
  type ImageWatermarkPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
@@ -248,7 +291,8 @@ interface TranscodeJob {
248
291
  outputFormat: VideoOutputFormat;
249
292
  variants: VideoVariant[];
250
293
  progress: number | null;
251
- error: string | null;
294
+ /** Provider or preprocessing failure details when status is `failed`. */
295
+ errorMessage: string | null;
252
296
  mediaConvertJobId: string | null;
253
297
  createdAt: Date;
254
298
  startedAt: Date | null;
@@ -595,6 +639,7 @@ interface MovePrivateFilesResponse {
595
639
  type MergeStatus = TranscodingStatus;
596
640
  type MergeQuality = VideoQuality;
597
641
  type MergeOutputFormat = "mp4" | "webm";
642
+ type MergeAspectRatio = "auto" | "16:9" | "9:16" | "1:1";
598
643
  /**
599
644
  * Text overlay shadow configuration
600
645
  */
@@ -681,6 +726,13 @@ interface MergeOutputConfig {
681
726
  format?: MergeOutputFormat;
682
727
  /** Output quality (default: 720p) */
683
728
  quality?: MergeQuality;
729
+ /**
730
+ * Output aspect ratio (default: "auto").
731
+ * "auto" matches the orientation of the first visual input — portrait inputs
732
+ * produce portrait output (e.g. 1080x1920 at 1080p), ideal for Reels/TikTok.
733
+ * Explicit values force the canvas; the quality sets the short edge.
734
+ */
735
+ aspectRatio?: MergeAspectRatio;
684
736
  /** Custom filename for the output */
685
737
  filename?: string;
686
738
  }
@@ -738,6 +790,7 @@ interface MergeJob {
738
790
  audioTrackAssetId: string | null;
739
791
  outputFormat: MergeOutputFormat;
740
792
  outputQuality: MergeQuality;
793
+ outputAspectRatio: MergeAspectRatio;
741
794
  outputFilename: string | null;
742
795
  outputAssetId: string | null;
743
796
  status: MergeStatus;
@@ -1186,6 +1239,22 @@ declare class CDN {
1186
1239
  * });
1187
1240
  * console.log(`Job started: ${job.id}`);
1188
1241
  * ```
1242
+ *
1243
+ * @example Burn in a logo watermark (same config shape as image watermarks)
1244
+ * ```typescript
1245
+ * const job = await cdn.transcode({
1246
+ * projectSlug: 'my-project',
1247
+ * assetId: 'video-asset-id',
1248
+ * outputFormat: 'mp4',
1249
+ * variants: [{ quality: '1080p', codec: 'h264' }],
1250
+ * watermark: {
1251
+ * assetId: 'logo-asset-id',
1252
+ * position: 'bottom-right',
1253
+ * scale: 15, // 15% of the video width
1254
+ * opacity: 80,
1255
+ * },
1256
+ * });
1257
+ * ```
1189
1258
  */
1190
1259
  transcode(request: TranscodeVideoRequest): Promise<TranscodeJob>;
1191
1260
  /**
@@ -1195,6 +1264,7 @@ declare class CDN {
1195
1264
  * ```typescript
1196
1265
  * const job = await cdn.getJob('job-id');
1197
1266
  * console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
1267
+ * if (job.status === 'failed') console.error(job.errorMessage);
1198
1268
  * ```
1199
1269
  */
1200
1270
  getJob(jobId: string): Promise<TranscodeJob>;
@@ -1634,6 +1704,7 @@ declare class CDN {
1634
1704
  * output: {
1635
1705
  * format: 'mp4',
1636
1706
  * quality: '1080p',
1707
+ * aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
1637
1708
  * filename: 'final-video.mp4',
1638
1709
  * },
1639
1710
  * webhookUrl: 'https://your-app.com/webhook',
@@ -1798,4 +1869,4 @@ declare class CDN {
1798
1869
  private convertImportFileDates;
1799
1870
  }
1800
1871
 
1801
- 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 };
1872
+ 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 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 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 };
@@ -178,12 +178,55 @@ interface VideoVariant {
178
178
  codec?: VideoCodec;
179
179
  bitrate?: number;
180
180
  }
181
+ /**
182
+ * Watermark burned into a video during transcode.
183
+ *
184
+ * The image-watermark fields mirror the image-upload watermark config
185
+ * ({@link ImageWatermarkConfig}), so the same settings you use to watermark photos work
186
+ * for video — the original asset stays clean and every transcoded rendition is watermarked.
187
+ * Set `type: "text"` to burn a text string instead of a logo.
188
+ */
181
189
  interface WatermarkOptions {
182
- type: "image" | "text";
183
- imageAssetId?: string;
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"). */
184
197
  text?: string;
185
- position: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center";
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;
204
+ /** Placement on the frame (default: "bottom-right"). */
205
+ position?: ImageWatermarkPosition;
206
+ /** Horizontal inset from the anchored edge in pixels (default: 20). */
207
+ offsetX?: number;
208
+ /** Vertical inset from the anchored edge in pixels (default: 20). */
209
+ 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
+ /** Opacity 0-100 (default: 80). */
186
219
  opacity?: number;
220
+ /** Tile the watermark across the whole frame, e.g. for copyright protection (default: false). */
221
+ tile?: boolean;
222
+ /** Horizontal spacing between tiles in pixels (default: 100). */
223
+ tileSpacingX?: number;
224
+ /** Vertical spacing between tiles in pixels (default: 100). */
225
+ tileSpacingY?: number;
226
+ /** Rotation in degrees, -360 to 360 (default: 0). Image watermarks only. */
227
+ rotation?: number;
228
+ /** Corner radius in pixels clipping the logo, 0-500 (default: 0). Image watermarks only. */
229
+ borderRadius?: number;
187
230
  }
188
231
  /** Position options for image watermarks */
189
232
  type ImageWatermarkPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
@@ -248,7 +291,8 @@ interface TranscodeJob {
248
291
  outputFormat: VideoOutputFormat;
249
292
  variants: VideoVariant[];
250
293
  progress: number | null;
251
- error: string | null;
294
+ /** Provider or preprocessing failure details when status is `failed`. */
295
+ errorMessage: string | null;
252
296
  mediaConvertJobId: string | null;
253
297
  createdAt: Date;
254
298
  startedAt: Date | null;
@@ -595,6 +639,7 @@ interface MovePrivateFilesResponse {
595
639
  type MergeStatus = TranscodingStatus;
596
640
  type MergeQuality = VideoQuality;
597
641
  type MergeOutputFormat = "mp4" | "webm";
642
+ type MergeAspectRatio = "auto" | "16:9" | "9:16" | "1:1";
598
643
  /**
599
644
  * Text overlay shadow configuration
600
645
  */
@@ -681,6 +726,13 @@ interface MergeOutputConfig {
681
726
  format?: MergeOutputFormat;
682
727
  /** Output quality (default: 720p) */
683
728
  quality?: MergeQuality;
729
+ /**
730
+ * Output aspect ratio (default: "auto").
731
+ * "auto" matches the orientation of the first visual input — portrait inputs
732
+ * produce portrait output (e.g. 1080x1920 at 1080p), ideal for Reels/TikTok.
733
+ * Explicit values force the canvas; the quality sets the short edge.
734
+ */
735
+ aspectRatio?: MergeAspectRatio;
684
736
  /** Custom filename for the output */
685
737
  filename?: string;
686
738
  }
@@ -738,6 +790,7 @@ interface MergeJob {
738
790
  audioTrackAssetId: string | null;
739
791
  outputFormat: MergeOutputFormat;
740
792
  outputQuality: MergeQuality;
793
+ outputAspectRatio: MergeAspectRatio;
741
794
  outputFilename: string | null;
742
795
  outputAssetId: string | null;
743
796
  status: MergeStatus;
@@ -1186,6 +1239,22 @@ declare class CDN {
1186
1239
  * });
1187
1240
  * console.log(`Job started: ${job.id}`);
1188
1241
  * ```
1242
+ *
1243
+ * @example Burn in a logo watermark (same config shape as image watermarks)
1244
+ * ```typescript
1245
+ * const job = await cdn.transcode({
1246
+ * projectSlug: 'my-project',
1247
+ * assetId: 'video-asset-id',
1248
+ * outputFormat: 'mp4',
1249
+ * variants: [{ quality: '1080p', codec: 'h264' }],
1250
+ * watermark: {
1251
+ * assetId: 'logo-asset-id',
1252
+ * position: 'bottom-right',
1253
+ * scale: 15, // 15% of the video width
1254
+ * opacity: 80,
1255
+ * },
1256
+ * });
1257
+ * ```
1189
1258
  */
1190
1259
  transcode(request: TranscodeVideoRequest): Promise<TranscodeJob>;
1191
1260
  /**
@@ -1195,6 +1264,7 @@ declare class CDN {
1195
1264
  * ```typescript
1196
1265
  * const job = await cdn.getJob('job-id');
1197
1266
  * console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
1267
+ * if (job.status === 'failed') console.error(job.errorMessage);
1198
1268
  * ```
1199
1269
  */
1200
1270
  getJob(jobId: string): Promise<TranscodeJob>;
@@ -1634,6 +1704,7 @@ declare class CDN {
1634
1704
  * output: {
1635
1705
  * format: 'mp4',
1636
1706
  * quality: '1080p',
1707
+ * aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
1637
1708
  * filename: 'final-video.mp4',
1638
1709
  * },
1639
1710
  * webhookUrl: 'https://your-app.com/webhook',
@@ -1798,4 +1869,4 @@ declare class CDN {
1798
1869
  private convertImportFileDates;
1799
1870
  }
1800
1871
 
1801
- 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 };
1872
+ 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 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 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
@@ -456,6 +456,22 @@ var CDN = class {
456
456
  * });
457
457
  * console.log(`Job started: ${job.id}`);
458
458
  * ```
459
+ *
460
+ * @example Burn in a logo watermark (same config shape as image watermarks)
461
+ * ```typescript
462
+ * const job = await cdn.transcode({
463
+ * projectSlug: 'my-project',
464
+ * assetId: 'video-asset-id',
465
+ * outputFormat: 'mp4',
466
+ * variants: [{ quality: '1080p', codec: 'h264' }],
467
+ * watermark: {
468
+ * assetId: 'logo-asset-id',
469
+ * position: 'bottom-right',
470
+ * scale: 15, // 15% of the video width
471
+ * opacity: 80,
472
+ * },
473
+ * });
474
+ * ```
459
475
  */
460
476
  async transcode(request) {
461
477
  const response = await this.http.post("/cdn/video/transcode", request);
@@ -468,6 +484,7 @@ var CDN = class {
468
484
  * ```typescript
469
485
  * const job = await cdn.getJob('job-id');
470
486
  * console.log(`Status: ${job.status}, Progress: ${job.progress}%`);
487
+ * if (job.status === 'failed') console.error(job.errorMessage);
471
488
  * ```
472
489
  */
473
490
  async getJob(jobId) {
@@ -521,7 +538,7 @@ var CDN = class {
521
538
  * ```
522
539
  */
523
540
  async getStreamingUrls(assetId) {
524
- return this.http.get(`/cdn/video/stream/${assetId}`);
541
+ return this.http.get(`/cdn/video/${assetId}/stream`);
525
542
  }
526
543
  /**
527
544
  * Generate a thumbnail from a video at a specific timestamp
@@ -1175,6 +1192,7 @@ var CDN = class {
1175
1192
  * output: {
1176
1193
  * format: 'mp4',
1177
1194
  * quality: '1080p',
1195
+ * aspectRatio: 'auto', // match first input's orientation ('9:16' forces vertical)
1178
1196
  * filename: 'final-video.mp4',
1179
1197
  * },
1180
1198
  * webhookUrl: 'https://your-app.com/webhook',