attlaz-client 1.10.19 → 1.10.21
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,9 @@
|
|
|
1
|
+
import { DataValueValue } from '../DataValue.js';
|
|
2
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
3
|
+
export declare class AdapterConnectionConfigurationValue {
|
|
4
|
+
id: string;
|
|
5
|
+
config_id: string;
|
|
6
|
+
config_key: string;
|
|
7
|
+
value: DataValueValue | null;
|
|
8
|
+
static toDataValueCollection(configurationValues: AdapterConnectionConfigurationValue[]): DataValueCollection;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
2
|
+
export class AdapterConnectionConfigurationValue {
|
|
3
|
+
id;
|
|
4
|
+
config_id;
|
|
5
|
+
config_key;
|
|
6
|
+
value;
|
|
7
|
+
static toDataValueCollection(configurationValues) {
|
|
8
|
+
const result = new DataValueCollection();
|
|
9
|
+
for (const configurationValue of configurationValues) {
|
|
10
|
+
if (configurationValue.value !== null) {
|
|
11
|
+
result.set(configurationValue.config_key, configurationValue.value);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -4,6 +4,7 @@ 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 { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
7
|
+
import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue';
|
|
7
8
|
export declare class AdapterEndpoint extends Endpoint {
|
|
8
9
|
getAdapters(): Promise<CollectionResult<Adapter>>;
|
|
9
10
|
getAdapter(adapterId: string): Promise<Adapter | null>;
|
|
@@ -11,7 +12,7 @@ export declare class AdapterEndpoint extends Endpoint {
|
|
|
11
12
|
getConnections(projectId: string): Promise<CollectionResult<AdapterConnection>>;
|
|
12
13
|
getConnectionById(connectionId: string): Promise<AdapterConnection | null>;
|
|
13
14
|
getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
|
|
14
|
-
getConnectionConfiguration(connectionId: string): Promise<
|
|
15
|
+
getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
|
|
15
16
|
saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
|
|
16
17
|
saveConnectionConfiguration(connectionId: string, configuration: DataValueCollection): Promise<boolean>;
|
|
17
18
|
}
|
|
@@ -2,7 +2,6 @@ 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 { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
6
5
|
export class AdapterEndpoint extends Endpoint {
|
|
7
6
|
async getAdapters() {
|
|
8
7
|
try {
|
|
@@ -82,13 +81,10 @@ export class AdapterEndpoint extends Endpoint {
|
|
|
82
81
|
async getConnectionConfiguration(connectionId) {
|
|
83
82
|
try {
|
|
84
83
|
const url = '/connections/' + connectionId + '/configuration';
|
|
85
|
-
const parser = (raw) => (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
throw new Error('Adapter configuration loaded');
|
|
90
|
-
}
|
|
91
|
-
return configuration;
|
|
84
|
+
const parser = (raw) => ({
|
|
85
|
+
id: raw.id, config_id: raw.config, config_key: raw.config_key, value: raw.value,
|
|
86
|
+
});
|
|
87
|
+
return this.requestCollection(url, parser);
|
|
92
88
|
}
|
|
93
89
|
catch (error) {
|
|
94
90
|
if (this.httpClient.isDebugEnabled()) {
|