attlaz-client 1.10.26 → 1.11.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
@@ -14,7 +14,7 @@ import { FlowEndpoint } from './Service/FlowEndpoint.js';
14
14
  import { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint.js';
15
15
  import { StorageEndpoint } from './Service/StorageEndpoint.js';
16
16
  import { QueueEndpoint } from './Service/QueueEndpoint.js';
17
- import { NotificationsEndpoint } from './Service/NotificationsEndpoint.js';
17
+ import { InboxEndpoint } from './Service/InboxEndpoint';
18
18
  import { CodeDeployEndpoint } from './Service/CodeDeployEndpoint.js';
19
19
  import { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint.js';
20
20
  import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint.js';
@@ -53,7 +53,7 @@ export declare class Client {
53
53
  getCodeDeployEndpoint(): CodeDeployEndpoint;
54
54
  getChannelEndpoint(): ChannelEndpoint;
55
55
  getConfigEndpoint(): ConfigEndpoint;
56
- getNotificationsEndpoint(): NotificationsEndpoint;
56
+ getInboxEndpoint(): InboxEndpoint;
57
57
  getPlatformEndpoint(): PlatformEndpoint;
58
58
  getSubscriberEndpoint(): SubscriberEndpoint;
59
59
  getLogEndPoint(): LogEndpoint;
package/dist/Client.js CHANGED
@@ -13,7 +13,7 @@ import { FlowEndpoint } from './Service/FlowEndpoint.js';
13
13
  import { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint.js';
14
14
  import { StorageEndpoint } from './Service/StorageEndpoint.js';
15
15
  import { QueueEndpoint } from './Service/QueueEndpoint.js';
16
- import { NotificationsEndpoint } from './Service/NotificationsEndpoint.js';
16
+ import { InboxEndpoint } from './Service/InboxEndpoint';
17
17
  import { CodeDeployEndpoint } from './Service/CodeDeployEndpoint.js';
18
18
  import { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint.js';
19
19
  import { OAuthClientOptions } from './Http/OAuthClientOptions.js';
@@ -44,7 +44,7 @@ export class Client {
44
44
  QueueEndpoint,
45
45
  ChannelEndpoint,
46
46
  ConfigEndpoint,
47
- NotificationsEndpoint,
47
+ InboxEndpoint,
48
48
  SubscriberEndpoint,
49
49
  LogEndpoint,
50
50
  FlowEndpoint,
@@ -145,8 +145,8 @@ export class Client {
145
145
  getConfigEndpoint() {
146
146
  return this.getEndpoint('config', this.Store.ConfigEndpoint);
147
147
  }
148
- getNotificationsEndpoint() {
149
- return this.getEndpoint('notification', this.Store.NotificationsEndpoint);
148
+ getInboxEndpoint() {
149
+ return this.getEndpoint('inbox', this.Store.InboxEndpoint);
150
150
  }
151
151
  getPlatformEndpoint() {
152
152
  return this.getEndpoint('platform', this.Store.PlatformEndpoint);
@@ -1,9 +1,7 @@
1
1
  import { DataValueValue } from '../DataValue.js';
2
- import { DataValueCollection } from '../DataValueCollection.js';
3
2
  export declare class AdapterConnectionConfigurationValue {
4
3
  id: string;
5
- config_id: string;
6
- config_key: string;
4
+ adapterConnectionId: string;
5
+ configurationId: string;
7
6
  value: DataValueValue | null;
8
- static toDataValueCollection(configurationValues: AdapterConnectionConfigurationValue[]): DataValueCollection;
9
7
  }
@@ -1,16 +1,6 @@
1
- import { DataValueCollection } from '../DataValueCollection.js';
2
1
  export class AdapterConnectionConfigurationValue {
3
2
  id;
4
- config_id;
5
- config_key;
3
+ adapterConnectionId;
4
+ configurationId;
6
5
  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
6
  }
@@ -0,0 +1,10 @@
1
+ export declare class InboxMessage {
2
+ id: string;
3
+ userId: string;
4
+ type: string;
5
+ subject: string;
6
+ body: string;
7
+ time: Date;
8
+ acknowledged: boolean;
9
+ static parse(rawNotification: any): InboxMessage;
10
+ }
@@ -0,0 +1,21 @@
1
+ import { Utils } from '../../Utils';
2
+ export class InboxMessage {
3
+ id;
4
+ userId;
5
+ type;
6
+ subject;
7
+ body;
8
+ time;
9
+ acknowledged = false;
10
+ static parse(rawNotification) {
11
+ const inboxMessage = new InboxMessage();
12
+ inboxMessage.id = rawNotification.id;
13
+ inboxMessage.userId = rawNotification.user;
14
+ inboxMessage.type = rawNotification.type;
15
+ inboxMessage.subject = rawNotification.subject;
16
+ inboxMessage.body = rawNotification.body;
17
+ inboxMessage.time = Utils.parseRawDate(rawNotification.time);
18
+ inboxMessage.acknowledged = rawNotification.acknowledged === 1;
19
+ return inboxMessage;
20
+ }
21
+ }
@@ -3,7 +3,6 @@ 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
5
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
6
- import { DataValueCollection } from '../Model/DataValueCollection.js';
7
6
  import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue.js';
8
7
  export declare class AdapterEndpoint extends Endpoint {
9
8
  getAdapters(): Promise<CollectionResult<Adapter>>;
@@ -14,5 +13,5 @@ export declare class AdapterEndpoint extends Endpoint {
14
13
  getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
15
14
  getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
16
15
  saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
17
- saveConnectionConfiguration(connectionId: string, configuration: DataValueCollection): Promise<boolean>;
16
+ saveConnectionConfiguration(connectionId: string, configuration: AdapterConnectionConfigurationValue[]): Promise<boolean>;
18
17
  }
@@ -82,7 +82,10 @@ export class AdapterEndpoint extends Endpoint {
82
82
  try {
83
83
  const url = '/connections/' + connectionId + '/configuration';
84
84
  const parser = (raw) => ({
85
- id: raw.id, config_id: raw.config, config_key: raw.config_key, value: raw.value,
85
+ id: raw.id,
86
+ adapterConnectionId: raw.adapter_connection,
87
+ configurationId: raw.configuration,
88
+ value: raw.value,
86
89
  });
87
90
  return this.requestCollection(url, parser);
88
91
  }
@@ -0,0 +1,7 @@
1
+ import { Endpoint } from './Endpoint.js';
2
+ import { CollectionResult } from '../Model/Result/CollectionResult.js';
3
+ import { InboxMessage } from '../Model/Inbox/InboxMessage';
4
+ export declare class InboxEndpoint extends Endpoint {
5
+ getAll(unacknowledgedOnly?: boolean): Promise<CollectionResult<InboxMessage>>;
6
+ save(notification: Notification): Promise<InboxMessage>;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { Endpoint } from './Endpoint.js';
2
+ import { InboxMessage } from '../Model/Inbox/InboxMessage';
3
+ export class InboxEndpoint extends Endpoint {
4
+ async getAll(unacknowledgedOnly = false) {
5
+ const result = await this.requestCollection('/inbox_messages?unacknowledgedOnly=' + unacknowledgedOnly, InboxMessage.parse);
6
+ return result;
7
+ }
8
+ async save(notification) {
9
+ const result = await this.requestObject('/inbox_messages', notification, InboxMessage.parse, 'POST');
10
+ const savedNotification = result.getData();
11
+ if (savedNotification === null) {
12
+ throw new Error('Unable to save inbox message: wrong response from API');
13
+ }
14
+ return savedNotification;
15
+ }
16
+ }
package/dist/index.d.ts CHANGED
@@ -90,7 +90,7 @@ export { WorkspaceMemberRole } from './Model/Workspace/WorkspaceMemberRole.js';
90
90
  /** * */
91
91
  export { Config } from './Model/Config.js';
92
92
  export { DataValue, DataValueValue } from './Model/DataValue.js';
93
- export { Notification } from './Model/Notification.js';
93
+ export { InboxMessage } from './Model/Inbox/InboxMessage.js';
94
94
  export { State } from './Model/State.js';
95
95
  /** Flow * */
96
96
  export { Flow } from './Model/Flow/Flow.js';
@@ -110,7 +110,7 @@ export { ConfigEndpoint } from './Service/ConfigEndpoint.js';
110
110
  export { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint.js';
111
111
  export { LogEndpoint } from './Service/LogEndpoint.js';
112
112
  export { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint.js';
113
- export { NotificationsEndpoint } from './Service/NotificationsEndpoint.js';
113
+ export { InboxEndpoint } from './Service/InboxEndpoint';
114
114
  export { PlatformEndpoint } from './Service/PlatformEndpoint.js';
115
115
  export { CodeDeployEndpoint } from './Service/CodeDeployEndpoint.js';
116
116
  export { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint.js';
package/dist/index.js CHANGED
@@ -90,7 +90,7 @@ export { WorkspaceMemberRole } from './Model/Workspace/WorkspaceMemberRole.js';
90
90
  /** * */
91
91
  export { Config } from './Model/Config.js';
92
92
  export { DataValue } from './Model/DataValue.js';
93
- export { Notification } from './Model/Notification.js';
93
+ export { InboxMessage } from './Model/Inbox/InboxMessage.js';
94
94
  export { State } from './Model/State.js';
95
95
  /** Flow * */
96
96
  export { Flow } from './Model/Flow/Flow.js';
@@ -111,7 +111,7 @@ export { ConfigEndpoint } from './Service/ConfigEndpoint.js';
111
111
  export { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint.js';
112
112
  export { LogEndpoint } from './Service/LogEndpoint.js';
113
113
  export { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint.js';
114
- export { NotificationsEndpoint } from './Service/NotificationsEndpoint.js';
114
+ export { InboxEndpoint } from './Service/InboxEndpoint';
115
115
  export { PlatformEndpoint } from './Service/PlatformEndpoint.js';
116
116
  export { CodeDeployEndpoint } from './Service/CodeDeployEndpoint.js';
117
117
  export { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.10.10";
1
+ export declare const VERSION = "1.11.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.10.10";
1
+ export const VERSION = "1.11.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.10.26",
3
+ "version": "1.11.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -1,10 +0,0 @@
1
- export declare class Notification {
2
- id: number;
3
- userId: number;
4
- type: string;
5
- subject: string;
6
- body: string;
7
- time: Date;
8
- acknowledged: boolean;
9
- static parse(rawNotification: any): Notification;
10
- }
@@ -1,21 +0,0 @@
1
- import { Utils } from '../Utils.js';
2
- export class Notification {
3
- id;
4
- userId;
5
- type;
6
- subject;
7
- body;
8
- time;
9
- acknowledged = false;
10
- static parse(rawNotification) {
11
- const notification = new Notification();
12
- notification.id = rawNotification.id;
13
- notification.userId = rawNotification.user;
14
- notification.type = rawNotification.type;
15
- notification.subject = rawNotification.subject;
16
- notification.body = rawNotification.body;
17
- notification.time = Utils.parseRawDate(rawNotification.time);
18
- notification.acknowledged = rawNotification.acknowledged === 1;
19
- return notification;
20
- }
21
- }
@@ -1,7 +0,0 @@
1
- import { Endpoint } from './Endpoint.js';
2
- import { Notification } from '../Model/Notification.js';
3
- import { CollectionResult } from '../Model/Result/CollectionResult.js';
4
- export declare class NotificationsEndpoint extends Endpoint {
5
- getAll(unacknowledgedOnly?: boolean): Promise<CollectionResult<Notification>>;
6
- save(notification: Notification): Promise<Notification>;
7
- }
@@ -1,16 +0,0 @@
1
- import { Endpoint } from './Endpoint.js';
2
- import { Notification } from '../Model/Notification.js';
3
- export class NotificationsEndpoint extends Endpoint {
4
- async getAll(unacknowledgedOnly = false) {
5
- const result = await this.requestCollection('/notifications?unacknowledgedOnly=' + unacknowledgedOnly, Notification.parse);
6
- return result;
7
- }
8
- async save(notification) {
9
- const result = await this.requestObject('/notifications', notification, Notification.parse, 'POST');
10
- const savedNotification = result.getData();
11
- if (savedNotification === null) {
12
- throw new Error('Unable to save notification: wrong response from API');
13
- }
14
- return savedNotification;
15
- }
16
- }