-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1-0-0 See merge request fluxlabs/flux-eco/open-api-client!3
- Loading branch information
Showing
15 changed files
with
156 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace fluxOpenApiClient; | ||
|
||
use FluxEco\OpenApiClient; | ||
|
||
function query(string $endpoint, array $filter = [], string $envPrefix = '') : array | ||
{ | ||
return OpenApiClient\Api::newFromEnv($envPrefix)->query($endpoint, $filter); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace FluxEco\OpenApiClient\Adapters; | ||
use FluxEco\OpenApiClient\Core\Ports; | ||
|
||
class Outbounds implements Ports\Outbounds | ||
{ | ||
private Ports\Config $config; | ||
|
||
private function __construct(Ports\Config $config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
public static function new(Ports\Config $config): self | ||
{ | ||
return new self($config); | ||
} | ||
|
||
final public function getConfig(): Ports\Config | ||
{ | ||
return $this->config; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Core/Ports/Configs/OpenApiConfig.php → src/Core/Ports/Config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace FluxEco\OpenApiClient\Core\Ports; | ||
|
||
interface Outbounds | ||
{ | ||
public function getConfig(): Config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
|
||
namespace FluxEco\OpenApiClient; | ||
|
||
use FluxEco\OpenApiClient\Core\{Ports}; | ||
|
||
class Env | ||
{ | ||
public const OPEN_API_CLIENT_ID='OPEN_API_CLIENT_ID'; | ||
public const OPEN_API_SECRET='OPEN_API_SECRET'; | ||
public const OPEN_API_SCOPE='OPEN_API_SCOPE'; | ||
public const OPEN_API_API_URL='OPEN_API_API_URL'; | ||
public const OPEN_API_AUTHENTICATION_URL='OPEN_API_AUTHENTICATION_URL'; | ||
|
||
private string $envPrefix; | ||
|
||
private function __construct(string $envPrefix) { | ||
$this->envPrefix = $envPrefix; | ||
} | ||
|
||
public static function new(string $envPrefix = '') { | ||
return new self($envPrefix); | ||
} | ||
|
||
public function getOpenApiClientId(): string { | ||
return getenv($this->envPrefix.self::OPEN_API_CLIENT_ID); | ||
} | ||
|
||
public function getOpenApiSecret(): string { | ||
return getenv($this->envPrefix.self::OPEN_API_SECRET); | ||
} | ||
|
||
public function getOpenApiScope(): string { | ||
return getenv($this->envPrefix.self::OPEN_API_SCOPE); | ||
} | ||
|
||
public function getOpenApiUrl(): string { | ||
return getenv($this->envPrefix.self::OPEN_API_API_URL); | ||
} | ||
|
||
public function getOpenApiAuthenticationUrl(): string { | ||
return getenv($this->envPrefix.self::OPEN_API_AUTHENTICATION_URL); | ||
} | ||
} |