attlaz-client 1.9.1 → 1.9.2

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.
@@ -1,6 +1,6 @@
1
1
  export declare class CollectionResult<T> {
2
2
  private data;
3
- private hasMore;
3
+ hasMore: boolean;
4
4
  constructor();
5
5
  setData(data: T[], hasMore: boolean): void;
6
6
  getData(): T[];
@@ -2,7 +2,6 @@ import { Endpoint } from './Endpoint';
2
2
  import { Adapter } from '../Model/Adapter/Adapter';
3
3
  import { AdapterConnection } from '../Model/Adapter/AdapterConnection';
4
4
  import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration';
5
- import { ObjectResult } from '../Model/Result/ObjectResult';
6
5
  import { CollectionResult } from '../Model/Result/CollectionResult';
7
6
  export declare class AdapterEndpoint extends Endpoint {
8
7
  getAdapters(): Promise<CollectionResult<Adapter>>;
@@ -10,5 +9,5 @@ export declare class AdapterEndpoint extends Endpoint {
10
9
  getAdapterConfiguration(adapterId: string): Promise<CollectionResult<AdapterConfiguration>>;
11
10
  getConnections(projectId: string): Promise<CollectionResult<AdapterConnection>>;
12
11
  getConnectionByKey(connectionKey: string): Promise<AdapterConnection | null>;
13
- saveConnection(projectId: string, adapter: AdapterConnection): Promise<ObjectResult<AdapterConnection>>;
12
+ saveConnection(projectId: string, adapter: AdapterConnection): Promise<AdapterConnection>;
14
13
  }
@@ -75,7 +75,11 @@ class AdapterEndpoint extends Endpoint_1.Endpoint {
75
75
  try {
76
76
  let url = '/projects/' + projectId + '/connections';
77
77
  const result = await this.requestObject(url, adapter, AdapterConnection_1.AdapterConnection.parse, 'POST');
78
- return result;
78
+ const updatedAdapterConnection = result.getData();
79
+ if (updatedAdapterConnection === null) {
80
+ throw new Error('AdapterConnection not updated');
81
+ }
82
+ return updatedAdapterConnection;
79
83
  }
80
84
  catch (error) {
81
85
  if (this.httpClient.isDebugEnabled()) {
@@ -7,6 +7,6 @@ export declare class ChannelEndpoint extends Endpoint {
7
7
  getByWorkspace(workspaceId: string): Promise<CollectionResult<Channel>>;
8
8
  getByOwner(): Promise<CollectionResult<Channel>>;
9
9
  getMessages(channelId: string): Promise<CollectionResult<ChannelHistory>>;
10
- save(subscriberChannel: Channel): Promise<Channel | null>;
10
+ save(subscriberChannel: Channel): Promise<Channel>;
11
11
  testChannel(subscriberChannel: Channel): Promise<any>;
12
12
  }
@@ -81,7 +81,11 @@ class ChannelEndpoint extends Endpoint_1.Endpoint {
81
81
  try {
82
82
  let url = '/channels/';
83
83
  const result = await this.requestObject(url, subscriberChannel, Channel_1.Channel.parse, 'POST');
84
- return result.getData();
84
+ const updatedChannel = result.getData();
85
+ if (updatedChannel === null) {
86
+ throw new Error('Channel not updated');
87
+ }
88
+ return updatedChannel;
85
89
  }
86
90
  catch (ex) {
87
91
  if (this.httpClient.isDebugEnabled()) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.9.1";
1
+ export declare const VERSION = "1.9.2";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.9.1";
4
+ exports.VERSION = "1.9.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",