@attlaz/client 1.119.0 → 1.120.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { OAuthClientToken } from './Http/OAuthClientToken.js';
2
2
  import { ITransport, ParseErrorHandler } from './Http/Transport/ITransport.js';
3
3
  import { OAuthClient, TokenChangeHandler } from './Http/Transport/OAuthClient.js';
4
- import { ApiInformation } from './Model/ApiInformation.js';
4
+ import { ApiInfo } from './Model/ApiInformation.js';
5
5
  import { AccessTokenEndpoint } from './Service/AccessTokenEndpoint.js';
6
6
  import { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
7
7
  import { ConnectionBundleEndpoint } from './Service/ConnectionBundleEndpoint.js';
@@ -112,7 +112,8 @@ export declare class Client {
112
112
  * rejected. Pass null to stop observing. OAuth-only; a custom transport has no token.
113
113
  */
114
114
  setTokenChangeHandler(handler: TokenChangeHandler | null): void;
115
- getApiInformation(): Promise<ApiInformation>;
115
+ /** The gateway first, then every API it routes to. A non-administrator is shown the gateway alone. */
116
+ getApiInformation(): Promise<ApiInfo[]>;
116
117
  getAdapterEndpoint(): AdapterEndpoint;
117
118
  getAdapterConnectionEndpoint(): AdapterConnectionEndpoint;
118
119
  getConnectionBundleEndpoint(): ConnectionBundleEndpoint;
package/dist/Client.js CHANGED
@@ -211,14 +211,13 @@ export class Client {
211
211
  setTokenChangeHandler(handler) {
212
212
  this.httpClient.setTokenChangeHandler(handler);
213
213
  }
214
+ /** The gateway first, then every API it routes to. A non-administrator is shown the gateway alone. */
214
215
  async getApiInformation() {
215
216
  const result = await this.httpClient.request('/system/info', null, 'GET', true);
216
- // The gateway is the first entry, and the only one a non-administrator is shown.
217
- const gateway = result.apis?.[0];
218
- if (gateway === undefined || gateway.version === null) {
217
+ if (result.apis === undefined || result.apis.length === 0) {
219
218
  throw new Error('Unable to get API information: invalid response');
220
219
  }
221
- return { version: gateway.version, apis: result.apis ?? [] };
220
+ return result.apis;
222
221
  }
223
222
  /* Endpoints */
224
223
  getAdapterEndpoint() {
@@ -16,14 +16,3 @@ export type ApiInfo = {
16
16
  }[];
17
17
  error: string | null;
18
18
  };
19
- /**
20
- * What the endpoint is running.
21
- *
22
- * `apis` lists the gateway first, then every API it routes to — but only an administrator is shown
23
- * more than the gateway, so a normal caller gets a single entry.
24
- */
25
- export type ApiInformation = {
26
- /** The gateway's version — what `version` meant before `apis` existed. */
27
- version: string;
28
- apis: ApiInfo[];
29
- };
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export type { TokenChangeHandler } from './Http/Transport/OAuthClient.js';
15
15
  export { OAuthClientOptions } from './Http/OAuthClientOptions.js';
16
16
  export { OAuthClientToken } from './Http/OAuthClientToken.js';
17
17
  export { ClientError } from './Http/ClientError.js';
18
- export { ApiInfo, ApiInformation } from './Model/ApiInformation.js';
18
+ export { ApiInfo } from './Model/ApiInformation.js';
19
19
  export { ApiError } from './Model/Error/ApiError.js';
20
20
  export type { ParseErrorHandler } from './Http/Transport/ITransport.js';
21
21
  export { HttpStatus } from './Http/HttpStatus.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.118.0";
1
+ export declare const VERSION = "1.119.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.118.0";
1
+ export const VERSION = "1.119.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.119.0",
3
+ "version": "1.120.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",