From df542ec67ace14338a3f0d64c8761f33e95b9708 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 28 Apr 2026 12:44:01 +0000 Subject: [PATCH] fix: remove legacy platform env fallbacks --- changelog.md | 6 +++++- package.json | 2 +- readme.md | 6 +++--- ts/00_commitinfo_data.ts | 2 +- ts/classes.platformclient.ts | 8 +++----- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 6ced8e8..2002173 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/package.json b/package.json index c82313f..a4c706c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/readme.md b/readme.md index 404f9bf..9f0f505 100644 --- a/readme.md +++ b/readme.md @@ -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 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 2e3cd7e..da92e72 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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' } diff --git a/ts/classes.platformclient.ts b/ts/classes.platformclient.ts index cd7a949..58972b5 100644 --- a/ts/classes.platformclient.ts +++ b/ts/classes.platformclient.ts @@ -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')) ); }