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 @@ -11,10 +11,10 @@
"homepage": "https://www.cloudpdf.com"
}
},
"originGitCommit": "e074ee8465006a168ff6d8cfa73928df13ae159c",
"originGitCommit": "4b156274cbffac1a19f266d36d27b4ed07bf2b53",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.2.0",
"requestedVersion": "3.3.0",
"ciProvider": "github",
"sdkVersion": "3.2.0"
"sdkVersion": "3.3.0"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use CloudPDF\Doc\Requests\DocChangesRequest;
use CloudPDF\Doc\Types\DocChangesRequestChangesItem;

$client = new CloudPDFClient(
embedPdfVersion: '3.2',
embedPdfVersion: '3.3',
token: '<token>',
);
$client->doc->changes(
Expand Down
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "php",
"canonicalVersion": "3.2.0",
"sdkVersion": "3.2.0",
"canonicalVersion": "3.3.0",
"sdkVersion": "3.3.0",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "92b335b44d0957c70139f64ee3dd92e19d9d3a1452c90077002ed31dbddc3e7d",
"gitCommit": "e074ee8465006a168ff6d8cfa73928df13ae159c",
"openapiSha256": "8d6fda1d157a3f3f82d3a16835381932eaa6efe3054100bb0aa63c0ad5ac6909",
"gitCommit": "4b156274cbffac1a19f266d36d27b4ed07bf2b53",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
208 changes: 205 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5877,7 +5877,7 @@ $client->doc->signatures->analysis(
<dl>
<dd>

Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '<key>' }`, and that PDF as the part `resource:<key>`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made.
Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '<key>' }`, and that PDF as the part `resource:<key>`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A document timestamp (`kind: 'timestamp'`) may leave `field` out, since 3.3: the engine then makes a field of no size for it, under a name no other field has, and the answer names it in `field`. That needs `doc.sign` for the document. The signature is made over the layer's own base: the upload, or the version its last signature made.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -5937,6 +5937,186 @@ $client->doc->signatures->prepare(
</dl>


</dd>
</dl>
</details>

<details><summary><code>$client-&gt;doc-&gt;signatures-&gt;validationInfo($docId, $layerName, $request) -> ?DocSignaturesValidationInfoResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Each entry is one DER object, base64. It reads the layer as it is now, so entries stored and not yet sealed by a signature are among them. Arrived in 3.3.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```php
$client->doc->signatures->validationInfo(
'docId',
'layerName',
new ValidationInfoSignaturesRequest([]),
);
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**$docId:** `string`

</dd>
</dl>

<dl>
<dd>

**$layerName:** `string`

</dd>
</dl>

<dl>
<dd>

**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>$client-&gt;doc-&gt;signatures-&gt;addValidationInfo($docId, $layerName, $request) -> ?DocSignaturesAddValidationInfoResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Each entry is one DER object of at most 16 MiB, base64. An entry the file already holds, byte for byte, is not stored again: `added` counts the new ones. An entry that is not one DER object fails the request and nothing is stored; the error names it, as in `certificates[1]`. The server stores what it is given and asks no certificate authority: collect the answers first. It needs `doc.sign` for the document, not for a group of fields, and is refused after a certification that allows no changes. It cannot be undone, and it leaves undo for earlier changes as it was. Arrived in 3.3.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```php
$client->doc->signatures->addValidationInfo(
'docId',
'layerName',
new DocSignaturesAddValidationInfoRequest([]),
);
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**$docId:** `string`

</dd>
</dl>

<dl>
<dd>

**$layerName:** `string`

</dd>
</dl>

<dl>
<dd>

**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

</dd>
</dl>

<dl>
<dd>

**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.

</dd>
</dl>

<dl>
<dd>

**$certificates:** `?array`

</dd>
</dl>

<dl>
<dd>

**$ocspResponses:** `?array`

</dd>
</dl>

<dl>
<dd>

**$crls:** `?array`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -6028,7 +6208,7 @@ $client->doc->versions->list(
<dl>
<dd>

Exactly one of `since.signature` / `since.revision`; `until=<revision>` defaults to the last. The same answer for every caller.
Exactly one of `since.signature` / `since.revision`; `until=<revision>` defaults to the last. The same answer for every caller. A version never changes, but the rules that judge it can: with `engine`, the `analysis` value of the layer's head, a settled answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -6119,7 +6299,7 @@ $client->doc->versions->analysis(
<dl>
<dd>

**$policy:** `?int`
**$engine:** `?string` — The `analysis` engine value from the layer's head (`engine.analysis`): the rules the answer is judged with. With it, a settled answer is cached.

</dd>
</dl>
Expand Down Expand Up @@ -6290,6 +6470,20 @@ $client->doc->versions->revision(
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

A version never changes, but what the server reads from it can: with `engine`, the `signatures` value of the layer's head, the answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down Expand Up @@ -6343,6 +6537,14 @@ $client->doc->versions->signatures(
<dl>
<dd>

**$engine:** `?string` — The `signatures` engine value from the layer's head (`engine.signatures`): what the answer is computed with besides the file. With it, the answer is cached.

</dd>
</dl>

<dl>
<dd>

**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

</dd>
Expand Down
6 changes: 3 additions & 3 deletions src/CloudPDFClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public function __construct(
?array $options = null,
) {
$defaultHeaders = [
'EmbedPDF-Version' => '3.2',
'EmbedPDF-Version' => '3.3',
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'CloudPDF',
'X-Fern-SDK-Version' => '3.2.0',
'User-Agent' => 'cloudpdf/sdk/3.2.0',
'X-Fern-SDK-Version' => '3.3.0',
'User-Agent' => 'cloudpdf/sdk/3.3.0',
];
if ($token != null) {
$defaultHeaders['Authorization'] = "Bearer $token";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace CloudPDF\Doc\Signatures\Requests;

use CloudPDF\Core\Json\JsonSerializableType;
use CloudPDF\Core\Json\JsonProperty;
use CloudPDF\Core\Types\ArrayType;

class DocSignaturesAddValidationInfoRequest extends JsonSerializableType
{
/**
* @var ?string $documentPassword Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
*/
public ?string $documentPassword;

/**
* @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
*/
public ?string $idempotencyKey;

/**
* @var ?array<string> $certificates
*/
#[JsonProperty('certificates'), ArrayType(['string'])]
public ?array $certificates;

/**
* @var ?array<string> $ocspResponses
*/
#[JsonProperty('ocspResponses'), ArrayType(['string'])]
public ?array $ocspResponses;

/**
* @var ?array<string> $crls
*/
#[JsonProperty('crls'), ArrayType(['string'])]
public ?array $crls;

/**
* @param array{
* documentPassword?: ?string,
* idempotencyKey?: ?string,
* certificates?: ?array<string>,
* ocspResponses?: ?array<string>,
* crls?: ?array<string>,
* } $values
*/
public function __construct(
array $values = [],
) {
$this->documentPassword = $values['documentPassword'] ?? null;
$this->idempotencyKey = $values['idempotencyKey'] ?? null;
$this->certificates = $values['certificates'] ?? null;
$this->ocspResponses = $values['ocspResponses'] ?? null;
$this->crls = $values['crls'] ?? null;
}
}
24 changes: 24 additions & 0 deletions src/Doc/Signatures/Requests/ValidationInfoSignaturesRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace CloudPDF\Doc\Signatures\Requests;

use CloudPDF\Core\Json\JsonSerializableType;

class ValidationInfoSignaturesRequest extends JsonSerializableType
{
/**
* @var ?string $documentPassword Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
*/
public ?string $documentPassword;

/**
* @param array{
* documentPassword?: ?string,
* } $values
*/
public function __construct(
array $values = [],
) {
$this->documentPassword = $values['documentPassword'] ?? null;
}
}
Loading
Loading