diff --git a/src/cli/Descript.CLI/Commands/ExportTranscriptRequestOptionSet.g.cs b/src/cli/Descript.CLI/Commands/ExportTranscriptRequestOptionSet.g.cs index 6bf144c..1c541f4 100644 --- a/src/cli/Descript.CLI/Commands/ExportTranscriptRequestOptionSet.g.cs +++ b/src/cli/Descript.CLI/Commands/ExportTranscriptRequestOptionSet.g.cs @@ -6,7 +6,7 @@ namespace Descript.CLI.Commands; internal sealed record ExportTranscriptRequestOptionSet( Option ProjectId, - Option CompositionId, + Option CompositionId, Option Format, Option IncludeSpeakerLabels, Option IncludeMarkers) @@ -22,9 +22,15 @@ public static ExportTranscriptRequestOptionSet Create(string? prefix = null) Description = @"The ID of the project to export from.", Required = true, }, - CompositionId: new Option($"--{normalizedPrefix}composition-id") + CompositionId: new Option($"--{normalizedPrefix}composition-id") { - Description = @"The ID of the composition to export. Defaults to the first composition.", + Description = @"Composition to export. If omitted, the first composition in the project is used. + +Accepts any of the following formats: +- A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`) +- A 5-character short ID from a Descript URL (e.g. `39677`) +- A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`) +", }, Format: new Option($"--{normalizedPrefix}format") { diff --git a/src/cli/Descript.CLI/Descript.CLI.csproj b/src/cli/Descript.CLI/Descript.CLI.csproj index e0ac932..bccb579 100644 --- a/src/cli/Descript.CLI/Descript.CLI.csproj +++ b/src/cli/Descript.CLI/Descript.CLI.csproj @@ -18,11 +18,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscript.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscript.g.cs index c72e7e2..2c8b664 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscript.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscript.g.cs @@ -605,7 +605,11 @@ partial void ProcessExportTranscriptResponseContent( /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -634,7 +638,7 @@ partial void ProcessExportTranscriptResponseContent( public async global::System.Threading.Tasks.Task ExportTranscriptAsync( global::System.Guid projectId, global::Descript.ExportTranscriptRequestFormat format, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? includeSpeakerLabels = default, bool? includeMarkers = default, global::Descript.ExportTranscriptRequestTimecodes? timecodes = default, diff --git a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscriptAsBytes.g.cs b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscriptAsBytes.g.cs index d63cd25..1af9daf 100644 --- a/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscriptAsBytes.g.cs +++ b/src/libs/Descript/Generated/Descript.ApiEndpointsClient.ExportTranscriptAsBytes.g.cs @@ -1082,7 +1082,11 @@ partial void ProcessExportTranscriptAsBytesResponseContent( /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -1111,7 +1115,7 @@ partial void ProcessExportTranscriptAsBytesResponseContent( public async global::System.Threading.Tasks.Task ExportTranscriptAsBytesAsync( global::System.Guid projectId, global::Descript.ExportTranscriptRequestFormat format, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? includeSpeakerLabels = default, bool? includeMarkers = default, global::Descript.ExportTranscriptRequestTimecodes? timecodes = default, diff --git a/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs b/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs index 7401d04..7b01926 100644 --- a/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs +++ b/src/libs/Descript/Generated/Descript.AutoSDKHttpResponse.g.cs @@ -118,4 +118,111 @@ public AutoSDKHttpResponse( /// public T Body { get; } } + + /// + /// Represents the result of a conditional HTTP request. A not-modified response has no body + /// and preserves the response entity tag so callers can keep their cached representation. + /// + public sealed class AutoSDKConditionalResponse + { + internal AutoSDKConditionalResponse( + bool notModified, + string? entityTag, + global::Descript.AutoSDKHttpResponse? response) + { + NotModified = notModified; + EntityTag = entityTag; + Response = response; + } + + /// Gets whether the server returned HTTP 304 Not Modified. + public bool NotModified { get; } + + /// Gets the response ETag, when one was supplied. + public string? EntityTag { get; } + + /// Gets the successful response, or null when is true. + public global::Descript.AutoSDKHttpResponse? Response { get; } + } + + /// + /// Helpers for standards-based ETag conditional requests. Generated clients already expose + /// request headers through and successful response + /// headers through ; this helper also turns an OpenAPI + /// 304 error response into a typed not-modified result. + /// + public static class AutoSDKConditionalRequests + { + /// + /// Executes a generated AsResponseAsync method with an optional If-None-Match header. + /// + public static async global::System.Threading.Tasks.Task> SendAsync( + global::System.Func>> send, + string? entityTag = null, + global::Descript.AutoSDKRequestOptions? requestOptions = null, + global::System.Threading.CancellationToken cancellationToken = default) + { + send = send ?? throw new global::System.ArgumentNullException(nameof(send)); + requestOptions = CloneRequestOptions(requestOptions); + if (!string.IsNullOrWhiteSpace(entityTag)) + { + requestOptions.Headers["If-None-Match"] = entityTag!; + } + + try + { + var response = await send(requestOptions, cancellationToken).ConfigureAwait(false); + return new global::Descript.AutoSDKConditionalResponse( + notModified: false, + entityTag: GetEntityTag(response.Headers), + response: response); + } + catch (global::Descript.ApiException exception) + when (exception.StatusCode == global::System.Net.HttpStatusCode.NotModified) + { + return new global::Descript.AutoSDKConditionalResponse( + notModified: true, + entityTag: GetEntityTag(exception.ResponseHeaders) ?? entityTag, + response: null); + } + } + + private static global::Descript.AutoSDKRequestOptions CloneRequestOptions( + global::Descript.AutoSDKRequestOptions? source) + { + var clone = new global::Descript.AutoSDKRequestOptions(); + if (source == null) + { + return clone; + } + + foreach (var header in source.Headers) + { + clone.Headers[header.Key] = header.Value; + } + + foreach (var parameter in source.QueryParameters) + { + clone.QueryParameters[parameter.Key] = parameter.Value; + } + + clone.Timeout = source.Timeout; + clone.Retry = source.Retry; + clone.ReadResponseAsString = source.ReadResponseAsString; + clone.Authorizations = source.Authorizations; + return clone; + } + + /// Gets the first ETag header value from a generated response header map. + public static string? GetEntityTag( + global::System.Collections.Generic.Dictionary>? headers) + { + if (headers == null || !headers.TryGetValue("ETag", out var values)) + { + return null; + } + + return global::System.Linq.Enumerable.FirstOrDefault(values); + } + } } \ No newline at end of file diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscript.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscript.g.cs index bf47d68..2213691 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscript.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscript.g.cs @@ -54,7 +54,11 @@ public partial interface IApiEndpointsClient /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -83,7 +87,7 @@ public partial interface IApiEndpointsClient global::System.Threading.Tasks.Task ExportTranscriptAsync( global::System.Guid projectId, global::Descript.ExportTranscriptRequestFormat format, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? includeSpeakerLabels = default, bool? includeMarkers = default, global::Descript.ExportTranscriptRequestTimecodes? timecodes = default, diff --git a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscriptAsBytes.g.cs b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscriptAsBytes.g.cs index dd88690..f4ed631 100644 --- a/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscriptAsBytes.g.cs +++ b/src/libs/Descript/Generated/Descript.IApiEndpointsClient.ExportTranscriptAsBytes.g.cs @@ -72,7 +72,11 @@ public partial interface IApiEndpointsClient /// Example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb /// /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -101,7 +105,7 @@ public partial interface IApiEndpointsClient global::System.Threading.Tasks.Task ExportTranscriptAsBytesAsync( global::System.Guid projectId, global::Descript.ExportTranscriptRequestFormat format, - global::System.Guid? compositionId = default, + string? compositionId = default, global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? includeSpeakerLabels = default, bool? includeMarkers = default, global::Descript.ExportTranscriptRequestTimecodes? timecodes = default, diff --git a/src/libs/Descript/Generated/Descript.Models.ExportTranscriptRequest.g.cs b/src/libs/Descript/Generated/Descript.Models.ExportTranscriptRequest.g.cs index c26c89f..5d89419 100644 --- a/src/libs/Descript/Generated/Descript.Models.ExportTranscriptRequest.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.ExportTranscriptRequest.g.cs @@ -18,12 +18,16 @@ public sealed partial class ExportTranscriptRequest public required global::System.Guid ProjectId { get; set; } /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 ///
/// 39677a40-1c43-4c36-8449-46cfbc4de2b5 [global::System.Text.Json.Serialization.JsonPropertyName("composition_id")] - public global::System.Guid? CompositionId { get; set; } + public string? CompositionId { get; set; } /// /// Transcript file format. The response body is the raw transcript file
@@ -79,7 +83,11 @@ public sealed partial class ExportTranscriptRequest /// The `srt` format exports a SubRip subtitle file with timed captions. /// /// - /// The ID of the composition to export. Defaults to the first composition.
+ /// Composition to export. If omitted, the first composition in the project is used.
+ /// Accepts any of the following formats:
+ /// - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`)
+ /// - A 5-character short ID from a Descript URL (e.g. `39677`)
+ /// - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`)
/// Example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 /// /// @@ -103,7 +111,7 @@ public sealed partial class ExportTranscriptRequest public ExportTranscriptRequest( global::System.Guid projectId, global::Descript.ExportTranscriptRequestFormat format, - global::System.Guid? compositionId, + string? compositionId, global::Descript.ExportTranscriptRequestIncludeSpeakerLabels? includeSpeakerLabels, bool? includeMarkers, global::Descript.ExportTranscriptRequestTimecodes? timecodes) diff --git a/src/libs/Descript/Generated/Descript.Models.ImportProjectMediaRequestAddCompositionClip.g.cs b/src/libs/Descript/Generated/Descript.Models.ImportProjectMediaRequestAddCompositionClip.g.cs index e6dd1c3..1972fa7 100644 --- a/src/libs/Descript/Generated/Descript.Models.ImportProjectMediaRequestAddCompositionClip.g.cs +++ b/src/libs/Descript/Generated/Descript.Models.ImportProjectMediaRequestAddCompositionClip.g.cs @@ -17,6 +17,17 @@ public sealed partial class ImportProjectMediaRequestAddCompositionClip [global::System.Text.Json.Serialization.JsonRequired] public required string Media { get; set; } + /// + /// Mute the track this clip plays on. For a sequence clip, mutes the sequence's own tracks.
+ /// For any other clip, mutes the composition's script layer, which silences every
+ /// clip on it — including clips already in the composition. Defaults to false.
+ /// Default Value: false
+ /// Example: true + ///
+ /// true + [global::System.Text.Json.Serialization.JsonPropertyName("mute")] + public bool? Mute { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -30,13 +41,22 @@ public sealed partial class ImportProjectMediaRequestAddCompositionClip /// Media reference ID (display name) of the media to add as a clip
/// Example: Misc/intro.mp4 /// + /// + /// Mute the track this clip plays on. For a sequence clip, mutes the sequence's own tracks.
+ /// For any other clip, mutes the composition's script layer, which silences every
+ /// clip on it — including clips already in the composition. Defaults to false.
+ /// Default Value: false
+ /// Example: true + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ImportProjectMediaRequestAddCompositionClip( - string media) + string media, + bool? mute) { this.Media = media ?? throw new global::System.ArgumentNullException(nameof(media)); + this.Mute = mute; } /// diff --git a/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs b/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs index 36b17b2..9eee49e 100644 --- a/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs +++ b/src/libs/Descript/Generated/Descript.OptionsSupport.g.cs @@ -903,11 +903,14 @@ private static void ApplyHeadersCore( foreach (var header in headers) { request.Headers.Remove(header.Key); - request.Content?.Headers.Remove(header.Key); + if (request.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty)) + { + continue; + } - if (!request.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty) && - request.Content != null) + if (request.Content != null) { + request.Content.Headers.Remove(header.Key); request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty); } } diff --git a/src/libs/Descript/openapi.yaml b/src/libs/Descript/openapi.yaml index 60b50e9..e61334d 100644 --- a/src/libs/Descript/openapi.yaml +++ b/src/libs/Descript/openapi.yaml @@ -487,6 +487,14 @@ paths: type: string description: Media reference ID (display name) of the media to add as a clip example: Misc/intro.mp4 + mute: + type: boolean + description: | + Mute the track this clip plays on. For a sequence clip, mutes the sequence's own tracks. + For any other clip, mutes the composition's script layer, which silences every + clip on it — including clips already in the composition. Defaults to false. + default: false + example: true additionalProperties: false required: - clips @@ -1386,8 +1394,13 @@ paths: example: 9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb composition_id: type: string - format: uuid - description: The ID of the composition to export. Defaults to the first composition. + description: | + Composition to export. If omitted, the first composition in the project is used. + + Accepts any of the following formats: + - A full composition UUID (e.g. `39677a40-1c43-4c36-8449-46cfbc4de2b5`) + - A 5-character short ID from a Descript URL (e.g. `39677`) + - A full Descript project URL (e.g. `https://web.descript.com/{project_id}/39677`) example: 39677a40-1c43-4c36-8449-46cfbc4de2b5 format: type: string