attlaz-client 1.13.25 → 1.13.26

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.
@@ -0,0 +1,6 @@
1
+ export declare class AdapterCategory {
2
+ id: string;
3
+ slug: string;
4
+ name: string;
5
+ static parse(rawAdapterCategory: any): AdapterCategory;
6
+ }
@@ -0,0 +1,12 @@
1
+ export class AdapterCategory {
2
+ id;
3
+ slug;
4
+ name;
5
+ static parse(rawAdapterCategory) {
6
+ const adapterCategory = new AdapterCategory();
7
+ adapterCategory.id = rawAdapterCategory.id;
8
+ adapterCategory.slug = rawAdapterCategory.slug;
9
+ adapterCategory.name = rawAdapterCategory.name;
10
+ return adapterCategory;
11
+ }
12
+ }
@@ -4,14 +4,17 @@ import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
4
4
  import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration.js';
5
5
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
6
6
  import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue.js';
7
+ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
8
+ import { AdapterCategory } from '../Model/Adapter/AdapterCategory.js';
7
9
  export declare class AdapterEndpoint extends Endpoint {
8
- getAdapters(): Promise<CollectionResult<Adapter>>;
10
+ getAdapters(pagination?: CursorPagination | null): Promise<CollectionResult<Adapter>>;
9
11
  getAdapter(adapterId: string): Promise<Adapter | null>;
10
12
  getAdapterConfiguration(adapterId: string): Promise<CollectionResult<AdapterConfiguration>>;
11
- getConnections(projectId: string): Promise<CollectionResult<AdapterConnection>>;
13
+ getConnections(projectId: string, pagination: CursorPagination): Promise<CollectionResult<AdapterConnection>>;
12
14
  getConnectionById(connectionId: string): Promise<AdapterConnection | null>;
13
15
  getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
14
16
  getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
15
17
  saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
16
18
  saveConnectionConfiguration(connectionId: string, configuration: AdapterConnectionConfigurationValue[]): Promise<boolean>;
19
+ getAdapterCategories(pagination: CursorPagination): Promise<CollectionResult<AdapterCategory>>;
17
20
  }
@@ -2,11 +2,14 @@ import { Endpoint } from './Endpoint.js';
2
2
  import { Adapter } from '../Model/Adapter/Adapter.js';
3
3
  import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
4
4
  import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration.js';
5
+ import { QueryString } from '../Http/Data/QueryString.js';
6
+ import { AdapterCategory } from '../Model/Adapter/AdapterCategory.js';
5
7
  export class AdapterEndpoint extends Endpoint {
6
- async getAdapters() {
8
+ async getAdapters(pagination = null) {
7
9
  try {
8
- const url = '/adapters';
9
- return await this.requestCollection(url, Adapter.parse);
10
+ const queryString = new QueryString('/adapters');
11
+ queryString.addPagination(pagination);
12
+ return await this.requestCollection(queryString, Adapter.parse);
10
13
  }
11
14
  catch (error) {
12
15
  if (this.httpClient.isDebugEnabled()) {
@@ -40,10 +43,11 @@ export class AdapterEndpoint extends Endpoint {
40
43
  throw error;
41
44
  }
42
45
  }
43
- async getConnections(projectId) {
46
+ async getConnections(projectId, pagination) {
44
47
  try {
45
- const url = '/projects/' + projectId + '/connections';
46
- return await this.requestCollection(url, AdapterConnection.parse);
48
+ const queryString = new QueryString('/projects/' + projectId + '/connections');
49
+ queryString.addPagination(pagination);
50
+ return await this.requestCollection(queryString, AdapterConnection.parse);
47
51
  }
48
52
  catch (error) {
49
53
  if (this.httpClient.isDebugEnabled()) {
@@ -131,4 +135,17 @@ export class AdapterEndpoint extends Endpoint {
131
135
  throw error;
132
136
  }
133
137
  }
138
+ async getAdapterCategories(pagination) {
139
+ try {
140
+ const queryString = new QueryString('/adapter-categories');
141
+ queryString.addPagination(pagination);
142
+ return await this.requestCollection(queryString, AdapterCategory.parse);
143
+ }
144
+ catch (error) {
145
+ if (this.httpClient.isDebugEnabled()) {
146
+ console.error('Failed to load adapter categories: ', error);
147
+ }
148
+ throw error;
149
+ }
150
+ }
134
151
  }
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { ClientError } from './Http/ClientError.js';
14
14
  export { Adapter } from './Model/Adapter/Adapter.js';
15
15
  export { AdapterConfiguration } from './Model/Adapter/AdapterConfiguration.js';
16
16
  export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
17
+ export { AdapterCategory } from './Model/Adapter/AdapterCategory.js';
17
18
  export { EventType } from './Model/Event/EventType.js';
18
19
  export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
19
20
  export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ export { ClientError } from './Http/ClientError.js';
14
14
  export { Adapter } from './Model/Adapter/Adapter.js';
15
15
  export { AdapterConfiguration } from './Model/Adapter/AdapterConfiguration.js';
16
16
  export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
17
+ export { AdapterCategory } from './Model/Adapter/AdapterCategory.js';
17
18
  export { EventType } from './Model/Event/EventType.js';
18
19
  export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
19
20
  export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.13.25",
3
+ "version": "1.13.26",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",