fix: remove legacy platform env fallbacks
This commit is contained in:
+5
-1
@@ -1,11 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-04-28 - 1.1.4 - fix(platformclient)
|
||||
Keep platform environment configuration clean.
|
||||
|
||||
- Kept only `SERVEZONE_PLATFORM_URL`, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, and platform binding discovery.
|
||||
|
||||
## 2026-04-28 - 1.1.3 - feat(platformclient)
|
||||
Add runtime platform binding configuration.
|
||||
|
||||
- Added `SERVEZONE_PLATFORM_URL`, `SERVEZONE_PLATFORM_AUTHORIZATION`, and `SERVEZONE_PLATFORM_TOKEN` support.
|
||||
- Added environment binding discovery through `SERVEZONE_PLATFORM_BINDING` and `SERVEZONE_PLATFORM_BINDINGS`.
|
||||
- Preserved `SERVEZONE_API_DOMAIN` and `SERVEZONE_PLATFROM_AUTHORIZATION` fallbacks.
|
||||
|
||||
## 2024-10-05 - 1.1.2 - fix(core)
|
||||
Fix authorization handling and format code.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@serve.zone/platformclient",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"private": false,
|
||||
"description": "a module that makes it really easy to use the serve.zone platform inside your app",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -43,7 +43,7 @@ await platformClient.emailConnector.sendEmail({
|
||||
});
|
||||
```
|
||||
|
||||
The client connects to the platform endpoint configured through `SERVEZONE_PLATFORM_URL`, a runtime platform binding, or the legacy `SERVEZONE_API_DOMAIN` fallback.
|
||||
The client connects to the platform endpoint configured through `SERVEZONE_PLATFORM_URL` or a runtime platform binding.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -51,8 +51,8 @@ The client needs two values:
|
||||
|
||||
| Value | How to provide it | Notes |
|
||||
| --- | --- | --- |
|
||||
| Authorization token | Constructor argument, `init()` argument, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, binding credential env, or `SERVEZONE_PLATFROM_AUTHORIZATION` | The misspelled legacy env name remains supported for compatibility. |
|
||||
| Platform URL | Constructor options, `SERVEZONE_PLATFORM_URL`, binding endpoint, or `SERVEZONE_API_DOMAIN` | Loaded on demand through `@push.rocks/qenv`. |
|
||||
| Authorization token | Constructor argument, `init()` argument, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, or binding credential env | Loaded on demand through `@push.rocks/qenv`. |
|
||||
| Platform URL | Constructor options, `SERVEZONE_PLATFORM_URL`, or binding endpoint | Loaded on demand through `@push.rocks/qenv`. |
|
||||
| Runtime bindings | Constructor options, `SERVEZONE_PLATFORM_BINDING`, or `SERVEZONE_PLATFORM_BINDINGS` | Values are JSON-encoded `IPlatformBinding` objects from `@serve.zone/interfaces`. |
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/platformclient',
|
||||
version: '1.1.3',
|
||||
version: '1.1.4',
|
||||
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
||||
}
|
||||
|
||||
@@ -105,9 +105,8 @@ export class SzPlatformClient {
|
||||
const connectionAddress =
|
||||
this.connectionAddress ||
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_URL')) ||
|
||||
this.getConnectionAddressFromBindings() ||
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_API_DOMAIN'));
|
||||
if (!connectionAddress) throw new Error('SERVEZONE_PLATFORM_URL or SERVEZONE_API_DOMAIN is required');
|
||||
this.getConnectionAddressFromBindings();
|
||||
if (!connectionAddress) throw new Error('SERVEZONE_PLATFORM_URL or platform binding endpoint is required');
|
||||
return connectionAddress;
|
||||
}
|
||||
|
||||
@@ -138,8 +137,7 @@ export class SzPlatformClient {
|
||||
private async getConfiguredAuthorizationString() {
|
||||
return (
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_AUTHORIZATION')) ||
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_TOKEN')) ||
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFROM_AUTHORIZATION'))
|
||||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_TOKEN'))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user