Skip to content
Closed
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": "cfc415f2b7501e153280b32bcd6aa4af1353e860",
"originGitCommit": "33003769980b6b0155f602109c8e34cc0a2b432d",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0-alpha.1",
"requestedVersion": "3.0.0-alpha.4",
"ciProvider": "github",
"sdkVersion": "3.0.0-alpha.1"
"sdkVersion": "3.0.0-alpha.4"
}
29 changes: 15 additions & 14 deletions .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ jobs:
fi
echo "commit=$tagged_commit" >> "$GITHUB_OUTPUT"

- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.version.outputs.tag }}
PRERELEASE: ${{ steps.version.outputs.prerelease }}
run: |
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
exit 0
fi
args=(--verify-tag --generate-notes --title "CloudPDF PHP SDK $RELEASE_TAG")
if [ "$PRERELEASE" = 'true' ]; then args+=(--prerelease); fi
gh release create "$RELEASE_TAG" "${args[@]}"

- name: Wait for Packagist publication
env:
VERSION: ${{ steps.version.outputs.version }}
Expand All @@ -105,7 +118,8 @@ jobs:
const fs = require('node:fs');
const metadata = JSON.parse(fs.readFileSync(process.env.METADATA_FILE, 'utf8'));
const releases = metadata.packages?.['cloudpdf/sdk'] ?? [];
const release = releases.find((candidate) => candidate.version === process.env.VERSION);
const acceptableVersions = new Set([process.env.VERSION, `v${process.env.VERSION}`]);
const release = releases.find((candidate) => acceptableVersions.has(candidate.version));
if (!release) process.exit(2);
if (release.source?.reference !== process.env.TAGGED_COMMIT) {
throw new Error(`Packagist ${process.env.VERSION} points to ${release.source?.reference}, expected ${process.env.TAGGED_COMMIT}`);
Expand All @@ -126,16 +140,3 @@ jobs:
done
echo "::error::Packagist did not index cloudpdf/sdk $VERSION. Register the repository and enable its GitHub hook, then rerun."
exit 1

- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.version.outputs.tag }}
PRERELEASE: ${{ steps.version.outputs.prerelease }}
run: |
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
exit 0
fi
args=(--verify-tag --generate-notes --title "CloudPDF PHP SDK $RELEASE_TAG")
if [ "$PRERELEASE" = 'true' ]; then args+=(--prerelease); fi
gh release create "$RELEASE_TAG" "${args[@]}"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ Instantiate and use the client with the following:
namespace Example;

use CloudPDF\CloudPDFClient;
use CloudPDF\Tenants\Requests\TenantsCreateRequest;
use CloudPDF\Shares\Requests\SharesExchangeRequest;

$client = new CloudPDFClient(
token: '<token>',
);
$client->tenants->create(
new TenantsCreateRequest([
'id' => 'id',
$client->shares->exchange(
new SharesExchangeRequest([
'shareToken' => 'shareToken',
]),
);

Expand All @@ -59,7 +59,7 @@ use CloudPDF\Exceptions\CloudPDFApiException;
use CloudPDF\Exceptions\CloudPDFException;

try {
$response = $client->tenants->create(...);
$response = $client->shares->exchange(...);
} catch (CloudPDFApiException $e) {
echo 'API Exception occurred: ' . $e->getMessage() . "\n";
echo 'Status Code: ' . $e->getCode() . "\n";
Expand Down Expand Up @@ -118,7 +118,7 @@ The `retryStatusCodes` configuration controls which [5XX](https://developer.mozi
Use the `maxRetries` request option to configure this behavior.

```php
$response = $client->tenants->create(
$response = $client->shares->exchange(
...,
options: [
'maxRetries' => 0 // Override maxRetries at the request level
Expand All @@ -131,7 +131,7 @@ $response = $client->tenants->create(
The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior.

```php
$response = $client->tenants->create(
$response = $client->shares->exchange(
...,
options: [
'timeout' => 3.0 // Override timeout at the request level
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.0.0-next.1",
"sdkVersion": "3.0.0-alpha.1",
"canonicalVersion": "3.0.0-next.4",
"sdkVersion": "3.0.0-alpha.4",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "6858ce7912e9063d8fb171ade95fc473db01c5971a3af241a612dda79cc05100",
"gitCommit": "cfc415f2b7501e153280b32bcd6aa4af1353e860",
"openapiSha256": "901c23684e7c9e33b5248942779b13537764a1d9065db815dd8aedb592c5ec59",
"gitCommit": "33003769980b6b0155f602109c8e34cc0a2b432d",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
Loading
Loading