Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"base-exception-class-name": "CloudPDFException",
"base-api-exception-class-name": "CloudPDFApiException"
},
"originGitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd",
"originGitCommit": "1345fb7a45ee660a352774d29decce25cb54b8ea",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0-next.6",
"requestedVersion": "3.0.0-next.7",
"ciProvider": "github",
"sdkVersion": "3.0.0-next.6"
"sdkVersion": "3.0.0-next.7"
}
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "csharp",
"canonicalVersion": "3.0.0-next.6",
"sdkVersion": "3.0.0-next.6",
"canonicalVersion": "3.0.0-next.7",
"sdkVersion": "3.0.0-next.7",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "b3e236a932673e27e05825352e1bc3675369d7505040bf7d7760e542aae8d38d",
"gitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd",
"openapiSha256": "f6fc610bfd193f278a7e8ec063d9e96b8fef86bdec7ade5e7bc4b19879673147",
"gitCommit": "1345fb7a45ee660a352774d29decce25cb54b8ea",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
2 changes: 1 addition & 1 deletion src/CloudPDF/CloudPDF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<Version>3.0.0-next.6</Version>
<Version>3.0.0-next.7</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<PackageReadmeFile Condition="Exists('..\..\README.md')">README.md</PackageReadmeFile>
Expand Down
2 changes: 1 addition & 1 deletion src/CloudPDF/Core/Public/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace CloudPDF;
[Serializable]
internal class Version
{
public const string Current = "3.0.0-next.6";
public const string Current = "3.0.0-next.7";
}
15 changes: 15 additions & 0 deletions src/CloudPDF/Documents/Requests/DocumentsImportFromRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,39 @@ public record DocumentsImportFromRequest
[JsonIgnore]
public required string TenantId { get; set; }

/// <summary>
/// Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.
/// </summary>
[JsonPropertyName("source")]
public required DocumentsImportFromRequestSource Source { get; set; }

/// <summary>
/// Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
/// </summary>
[JsonPropertyName("expected")]
public DocumentsImportFromRequestExpected? Expected { get; set; }

[JsonPropertyName("metadata")]
public Dictionary<string, object?>? Metadata { get; set; }

/// <summary>
/// Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.
/// </summary>
[JsonPropertyName("idempotencyKey")]
public string? IdempotencyKey { get; set; }

/// <summary>
/// always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.
/// </summary>
[JsonPropertyName("dedupMode")]
public DocumentsImportFromRequestDedupMode? DedupMode { get; set; }

[JsonPropertyName("docId")]
public string? DocId { get; set; }

/// <summary>
/// sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.
/// </summary>
[JsonPropertyName("mode")]
public DocumentsImportFromRequestMode? Mode { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions src/CloudPDF/Documents/Requests/DocumentsInitRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public record DocumentsInitRequest
[JsonPropertyName("idempotencyKey")]
public string? IdempotencyKey { get; set; }

/// <summary>
/// always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.
/// </summary>
[JsonPropertyName("dedupMode")]
public DocumentsInitRequestDedupMode? DedupMode { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@

namespace CloudPDF;

/// <summary>
/// Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
/// </summary>
[Serializable]
public record DocumentsImportFromRequestExpected : IJsonOnDeserialized
{
[JsonExtensionData]
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// Checked against the source's declared Content-Length before the transfer.
/// </summary>
[JsonPropertyName("sizeBytes")]
public int? SizeBytes { get; set; }

/// <summary>
/// Checked against the server-observed digest after the transfer. Required when dedupMode is reuse-existing.
/// </summary>
[JsonPropertyName("sha256")]
public string? Sha256 { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

namespace CloudPDF;

/// <summary>
/// Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.
/// </summary>
[JsonConverter(typeof(DocumentsImportFromRequestSource.JsonConverter))]
[Serializable]
public record DocumentsImportFromRequestSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@

namespace CloudPDF;

/// <summary>
/// The operator pre-registered the authority: the request names a connection and a key inside it. Which provider backs the connection (S3, GCS, Azure Blob, filesystem, ...) is deployment configuration, never wire surface.
/// </summary>
[Serializable]
public record DocumentsImportFromRequestSourceConnection : IJsonOnDeserialized
{
[JsonExtensionData]
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// The operator-registered storage connection to read from.
/// </summary>
[JsonPropertyName("connectionId")]
public required string ConnectionId { get; set; }

/// <summary>
/// The object key to read, inside the connection's configured scope. At most 1024 UTF-8 bytes.
/// </summary>
[JsonPropertyName("key")]
public required string Key { get; set; }

/// <summary>
/// Pins a specific version of the object. Provider-interpreted (S3 VersionId, GCS generation, Azure version id); providers without versioning reject it.
/// </summary>
[JsonPropertyName("revision")]
public string? Revision { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

namespace CloudPDF;

/// <summary>
/// The caller supplies the authority: a presigned S3/GCS/Azure/R2/MinIO GET, or any HTTPS endpoint the deployment import policy allows. The URL is a capability — treat it as a secret. CloudPDF never echoes its query string back in errors, logs, or stored failure reasons.
/// </summary>
[Serializable]
public record DocumentsImportFromRequestSourceUrl : IJsonOnDeserialized
{
[JsonExtensionData]
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// The URL to fetch. Must be allowed by the deployment import policy (scheme, network range, size) and must declare a length.
/// </summary>
[JsonPropertyName("url")]
public required string Url { get; set; }

Expand Down
Loading