Skip to content

Commit

Permalink
Merge pull request #3 from apideck-libraries/speakeasy-sdk-regen-1733…
Browse files Browse the repository at this point in the history
…922060

chore: 🐝 Update SDK - Generate 0.0.4
  • Loading branch information
Amzani authored Dec 11, 2024
2 parents 090a1d5 + 4b9b7be commit e368030
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 21 deletions.
21 changes: 12 additions & 9 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: 0e1578f5-5df8-4086-96d6-369ac62fc49d
management:
docChecksum: 5a3c61710af05ae5c21380b118217322
docChecksum: 6385e11ae594d46afc1910ffab8d003a
docVersion: 10.8.3
speakeasyVersion: 1.453.0
generationVersion: 2.472.1
releaseVersion: 0.0.3
configChecksum: dac14721849799a0fe7ba3949bcc1164
speakeasyVersion: 1.454.0
generationVersion: 2.477.0
releaseVersion: 0.0.4
configChecksum: c3a2f196fe8dd693b6d6914e96dab69a
repoURL: https://github.com/apideck-libraries/sdk-php.git
installationURL: https://github.com/apideck-libraries/sdk-php
published: true
features:
php:
constsAndDefaults: 0.2.0
core: 3.7.3
core: 3.7.4
deprecations: 2.81.1
errors: 0.3.0
flattening: 2.81.1
Expand Down Expand Up @@ -1438,13 +1438,16 @@ generatedFiles:
- src/Hooks/AfterSuccessHook.php
- src/Hooks/BeforeRequestContext.php
- src/Hooks/BeforeRequestHook.php
- src/Hooks/Credentials.php
- src/Hooks/ErrorResponseContext.php
- src/Hooks/FailEarlyException.php
- src/Hooks/HookContext.php
- src/Hooks/Hooks.php
- src/Hooks/SDKHooks.php
- src/Hooks/SDKInitHook.php
- src/Hooks/SDKRequestContext.php
- src/Hooks/Session.php
- src/Hooks/TokenResponse.php
- src/Hris.php
- src/InvoiceItems.php
- src/Invoices.php
Expand Down Expand Up @@ -9088,7 +9091,7 @@ examples:
"422":
application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"}
default:
application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"}
application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"}
vault.validateConnectionState:
"":
parameters:
Expand All @@ -9110,7 +9113,7 @@ examples:
"404":
application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"}
"422":
application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"}
application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"}
default:
application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"}
vault.createCallbackState:
Expand All @@ -9136,7 +9139,7 @@ examples:
"404":
application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"}
"422":
application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"}
application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"}
default:
application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"}
vault.connectionSettingsAll:
Expand Down
7 changes: 6 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
php:
version: 0.0.3
version: 0.0.4
additionalDependencies:
autoload: {}
autoload-dev: {}
require: {}
require-dev: {}
clientServerStatusCodesAsErrors: true
defaultErrorName: APIException
flattenGlobalSecurity: true
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.453.0
speakeasyVersion: 1.454.0
sources:
Apideck:
sourceNamespace: apideck
sourceRevisionDigest: sha256:0b5c1d9084456845b39928c8770817584e9e6b460f251fa25ba6a52f2cd5b584
sourceBlobDigest: sha256:c78223a6f6e3fb5b1d9f0d663d8bd72bf35ecc3ed8435dd81561c45569a9f642
sourceRevisionDigest: sha256:1c2ab08139231ee4ce3aa2e75d21f8660b997b38a72c8508f2e010f1e4f01212
sourceBlobDigest: sha256:86718b5c608b0821aa024e8ed3a416e4347cbac957b0e241d46daf111903fdc0
tags:
- latest
- speakeasy-sdk-regen-1733502108
- speakeasy-sdk-regen-1733922060
- 10.8.3
targets:
apideck:
source: Apideck
sourceNamespace: apideck
sourceRevisionDigest: sha256:0b5c1d9084456845b39928c8770817584e9e6b460f251fa25ba6a52f2cd5b584
sourceBlobDigest: sha256:c78223a6f6e3fb5b1d9f0d663d8bd72bf35ecc3ed8435dd81561c45569a9f642
sourceRevisionDigest: sha256:1c2ab08139231ee4ce3aa2e75d21f8660b997b38a72c8508f2e010f1e4f01212
sourceBlobDigest: sha256:86718b5c608b0821aa024e8ed3a416e4347cbac957b0e241d46daf111903fdc0
codeSamplesNamespace: apideck-php-code-samples
codeSamplesRevisionDigest: sha256:7d5b42a9f7fc00e6906f6d824349da197434acf00cda00270de112a3c14be53e
codeSamplesRevisionDigest: sha256:54aa4c61991565aef222572e6c223e47e2e0c78fc8299e4db4f8c2700e435596
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ Based on:
### Generated
- [php v0.0.3] .
### Releases
- [Composer v0.0.3] https://packagist.org/packages/apideck-libraries/sdk-php#v0.0.3 - .
- [Composer v0.0.3] https://packagist.org/packages/apideck-libraries/sdk-php#v0.0.3 - .

## 2024-12-11 14:16:31
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.454.0 (2.477.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [php v0.0.4] .
### Releases
- [Composer v0.0.4] https://packagist.org/packages/apideck-libraries/sdk-php#v0.0.4 - .
14 changes: 14 additions & 0 deletions src/Hooks/AfterErrorContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ public function __construct(HookContext $hookCtx)
{
parent::__construct($hookCtx->operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource);
}

/**
* @param string $name
* @param array<mixed> $args
* @return mixed
*/
public function __call($name, $args): mixed
{
if ($name === 'securitySource') {
return call_user_func_array($this->securitySource, $args);
}

return null;
}
}
14 changes: 14 additions & 0 deletions src/Hooks/BeforeRequestContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ public function __construct(HookContext $hookCtx)
{
parent::__construct($hookCtx->operationID, $hookCtx->oauth2Scopes, $hookCtx->securitySource);
}

/**
* @param string $name
* @param array<mixed> $args
* @return mixed
*/
public function __call($name, $args): mixed
{
if ($name === 'securitySource') {
return call_user_func_array($this->securitySource, $args);
}

return null;
}
}
24 changes: 24 additions & 0 deletions src/Hooks/Credentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/


declare(strict_types=1);

namespace Apideck\Unify\Hooks;

class Credentials
{
public string $clientID;
public string $clientSecret;
public string $tokenURL;

public function __construct(string $clientID, string $clientSecret, string $tokenURL)
{
$this->clientID = $clientID;
$this->clientSecret = $clientSecret;
$this->tokenURL = $tokenURL;
}
}
13 changes: 13 additions & 0 deletions src/Hooks/HookContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,17 @@ public function __construct(string $operationID, ?array $oauth2Scopes, ?\Closure
$this->oauth2Scopes = $oauth2Scopes;
$this->securitySource = $securitySource;
}
/**
* @param string $name
* @param array<mixed> $args
* @return mixed
*/
public function __call($name, $args): mixed
{
if ($name === 'securitySource') {
return call_user_func_array($this->securitySource, $args);
}

return null;
}
}
37 changes: 37 additions & 0 deletions src/Hooks/Session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/


declare(strict_types=1);

namespace Apideck\Unify\Hooks;

use Brick\DateTime\LocalTime;

class Session
{
public Credentials $credentials;
public string $token;
/**
* @var array<string> scopes
*/
public array $scopes;
public ?LocalTime $expiresAt;

/**
* @param Credentials $credentials
* @param string $token
* @param array<string> $scopes
* @param ?LocalTime $expiresAt
*/
public function __construct(Credentials $credentials, string $token, array $scopes, ?LocalTime $expiresAt = null)
{
$this->credentials = $credentials;
$this->token = $token;
$this->scopes = $scopes;
$this->expiresAt = $expiresAt;
}
}
17 changes: 17 additions & 0 deletions src/Hooks/TokenResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/


declare(strict_types=1);

namespace Apideck\Unify\Hooks;

class TokenResponse
{
public ?string $accessToken;
public ?string $tokenType;
public ?float $expiresIn;
}
6 changes: 3 additions & 3 deletions src/SDKConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class SDKConfiguration

public string $openapiDocVersion = '10.8.3';

public string $sdkVersion = '0.0.3';
public string $sdkVersion = '0.0.4';

public string $genVersion = '2.472.1';
public string $genVersion = '2.477.0';

public string $userAgent = 'speakeasy-sdk/php 0.0.3 2.472.1 10.8.3 apideck-libraries/sdk-php';
public string $userAgent = 'speakeasy-sdk/php 0.0.4 2.477.0 10.8.3 apideck-libraries/sdk-php';
/** @var array<string, array<string, array<string, mixed>>> */
public ?array $globals = [
'parameters' => [],
Expand Down
105 changes: 105 additions & 0 deletions src/Utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,111 @@ public static function removeHeaders(RequestInterface $request): RequestInterfac
return $request;
}

/**
* urljoin joins a base URL and a relative URL.
* this is a PHP port of the Python urllib.urljoin function
*
* @param string $base
* @param string $rel
* @return string
*/
public static function urljoin(string $base, string $rel): string
{
$pbase = parse_url($base);
if ($pbase === false) {
throw new \InvalidArgumentException('Invalid base URL: '.$base);
} else {
$pbase = (array) $pbase;
}
$prel = parse_url($rel);
if ($prel === false) {
throw new \InvalidArgumentException('Invalid relative URL: '.$rel);
} else {
$prel = (array) $prel;
}

$merged = array_merge($pbase, $prel);
if (array_key_exists('path', $pbase) && array_key_exists('path', $prel) && $prel['path'][0] != '/') {
// Relative path
$dir = preg_replace('@/[^/]*$@', '', $pbase['path']);
$merged['path'] = $dir.'/'.$prel['path'];
} elseif (array_key_exists('path', $pbase)) {
$merged['path'] = $pbase['path'];
} elseif (array_key_exists('path', $prel)) {
$merged['path'] = $prel['path'];
} else {
$merged['path'] = '';
}

// Get the path components, and remove the initial empty one
$pathParts = explode('/', $merged['path']);
array_shift($pathParts);

$path = [];
$prevPart = '';
foreach ($pathParts as $part) {
if ($part == '..' && count($path) > 0) {
// Cancel out the parent directory (if there's a parent to cancel)
$parent = array_pop($path);
// But if it was also a parent directory, leave it in
if ($parent == '..') {
array_push($path, $parent);
array_push($path, $part);
}
} elseif ($prevPart != '' || ($part != '.' && $part != '')) {
// Don't include empty or current-directory components
if ($part == '.') {
$part = '';
}
array_push($path, $part);
}
$prevPart = $part;
}
$merged['path'] = '/'.implode('/', $path);

$ret = '';
if (isset($merged['scheme'])) {
$ret .= $merged['scheme'].':';
}

if (isset($merged['scheme']) || isset($merged['host'])) {
$ret .= '//';
}

if (isset($prel['host'])) {
$hostSource = $prel;
} else {
$hostSource = $pbase;
}

// username, password, and port are associated with the hostname, not merged
if (isset($hostSource['host'])) {
if (isset($hostSource['user'])) {
$ret .= $hostSource['user'];
if (isset($hostSource['pass'])) {
$ret .= ':'.$hostSource['pass'];
}
$ret .= '@';
}
$ret .= $hostSource['host'];
if (isset($hostSource['port'])) {
$ret .= ':'.$hostSource['port'];
}
}

$ret .= $merged['path'];

if (isset($prel['query'])) {
$ret .= '?'.$prel['query'];
}

if (isset($prel['fragment'])) {
$ret .= '#'.$prel['fragment'];
}

return $ret;
}

}

function removePrefix(string $text, string $prefix): string
Expand Down

0 comments on commit e368030

Please sign in to comment.