@attlaz/client 1.103.0 → 1.104.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.
|
@@ -11,6 +11,14 @@ export declare class AdapterConnectionEndpoint extends Endpoint {
|
|
|
11
11
|
getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
|
|
12
12
|
getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
|
|
13
13
|
saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
|
|
14
|
+
/**
|
|
15
|
+
* Writes the supplied configurations and leaves the rest of the connection alone — PATCH, since
|
|
16
|
+
* it is a partial update. A configuration the API does not let a client set (a provider token)
|
|
17
|
+
* is untouched rather than cleared.
|
|
18
|
+
*
|
|
19
|
+
* Needs an API that serves the PATCH route; it is also still registered as POST for clients
|
|
20
|
+
* released before the verb changed.
|
|
21
|
+
*/
|
|
14
22
|
saveConnectionConfiguration(connectionId: string, configuration: AdapterConnectionConfigurationValue[]): Promise<boolean>;
|
|
15
23
|
getConnectionEvents(connectionId: string, pagination: CursorPagination): Promise<CollectionResult<AdapterConnectionEvent>>;
|
|
16
24
|
/**
|
|
@@ -79,11 +79,19 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
79
79
|
throw error;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Writes the supplied configurations and leaves the rest of the connection alone — PATCH, since
|
|
84
|
+
* it is a partial update. A configuration the API does not let a client set (a provider token)
|
|
85
|
+
* is untouched rather than cleared.
|
|
86
|
+
*
|
|
87
|
+
* Needs an API that serves the PATCH route; it is also still registered as POST for clients
|
|
88
|
+
* released before the verb changed.
|
|
89
|
+
*/
|
|
82
90
|
async saveConnectionConfiguration(connectionId, configuration) {
|
|
83
91
|
try {
|
|
84
92
|
const url = path('/connections/:connectionId/configuration', { connectionId });
|
|
85
93
|
const parser = (raw) => ({ saved: raw.saved });
|
|
86
|
-
const result = await this.requestObject(url, { configuration: configuration }, parser, '
|
|
94
|
+
const result = await this.requestObject(url, { configuration: configuration }, parser, 'PATCH');
|
|
87
95
|
const res = result.getData();
|
|
88
96
|
if (res === null) {
|
|
89
97
|
throw new Error('Unable to save connection configuration: wrong response from API');
|