attlaz-client 1.18.10 → 1.19.1

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
@@ -30,6 +30,7 @@ import { CodeSourceStrategiesEndpoint } from './Service/CodeSourceStrategiesEndp
30
30
  import { SearchEndpoint } from './Service/SearchEndpoint.js';
31
31
  import { UserActionEndpoint } from './Service/UserActionEndpoint.js';
32
32
  import { AccessTokenEndpoint } from './Service/AccessTokenEndpoint.js';
33
+ import { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
33
34
  export declare class Client {
34
35
  private readonly endpoints;
35
36
  private httpClient;
@@ -51,6 +52,7 @@ export declare class Client {
51
52
  version: string;
52
53
  }>;
53
54
  getAdapterEndpoint(): AdapterEndpoint;
55
+ getAdapterConnectionEndpoint(): AdapterConnectionEndpoint;
54
56
  getProjectEndpoint(): ProjectEndpoint;
55
57
  getProjectEnvironmentEndpoint(): ProjectEnvironmentEndpoint;
56
58
  getCodeDeployEndpoint(): CodeDeployEndpoint;
package/dist/Client.js CHANGED
@@ -31,40 +31,42 @@ import { CodeSourceStrategiesEndpoint } from './Service/CodeSourceStrategiesEndp
31
31
  import { SearchEndpoint } from './Service/SearchEndpoint.js';
32
32
  import { UserActionEndpoint } from './Service/UserActionEndpoint.js';
33
33
  import { AccessTokenEndpoint } from './Service/AccessTokenEndpoint.js';
34
+ import { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
34
35
  export class Client {
35
36
  endpoints;
36
37
  httpClient;
37
38
  Store = {
38
- WorkerEndpoint,
39
+ AccessTokenEndpoint,
40
+ AdapterConnectionEndpoint,
39
41
  AdapterEndpoint,
40
- ProjectEndpoint,
41
- ProjectEnvironmentEndpoint,
42
- CodeDeployEndpoint,
43
- QueueEndpoint,
44
42
  ChannelEndpoint,
43
+ CodeDeployEndpoint,
44
+ CodeSourceStrategiesEndpoint,
45
45
  ConfigEndpoint,
46
- InboxEndpoint,
47
- SubscriberEndpoint,
48
- LogEndpoint,
46
+ FirewallEndpoint,
49
47
  FlowEndpoint,
50
48
  FlowRunEndpoint,
51
49
  FlowRunRequestEndpoint,
52
- WorkspaceEndpoint,
53
- TriggerEndpoint,
54
- UserEndpoint,
55
- WorkspaceMemberEndpoint,
56
- SourcesAccountEndpoint,
57
- PlatformLanguageEndpoint,
58
- StorageEndpoint,
59
- WorkerConfigEndpoint,
50
+ FlowRunStatsEndpoint,
60
51
  HealthAlertEndpoint,
52
+ InboxEndpoint,
53
+ LogEndpoint,
61
54
  PlatformEndpoint,
62
- FlowRunStatsEndpoint,
63
- CodeSourceStrategiesEndpoint,
64
- FirewallEndpoint,
55
+ PlatformLanguageEndpoint,
56
+ ProjectEndpoint,
57
+ ProjectEnvironmentEndpoint,
58
+ QueueEndpoint,
65
59
  SearchEndpoint,
60
+ SourcesAccountEndpoint,
61
+ StorageEndpoint,
62
+ SubscriberEndpoint,
63
+ TriggerEndpoint,
66
64
  UserActionEndpoint,
67
- AccessTokenEndpoint,
65
+ UserEndpoint,
66
+ WorkerConfigEndpoint,
67
+ WorkerEndpoint,
68
+ WorkspaceEndpoint,
69
+ WorkspaceMemberEndpoint,
68
70
  };
69
71
  apiEndpoint = 'https://api.attlaz.com';
70
72
  parseConfig(config) {
@@ -120,6 +122,9 @@ export class Client {
120
122
  getAdapterEndpoint() {
121
123
  return this.getEndpoint('adapter', this.Store.AdapterEndpoint);
122
124
  }
125
+ getAdapterConnectionEndpoint() {
126
+ return this.getEndpoint('adapter-connection', this.Store.AdapterConnectionEndpoint);
127
+ }
123
128
  getProjectEndpoint() {
124
129
  return this.getEndpoint('project', this.Store.ProjectEndpoint);
125
130
  }
@@ -6,5 +6,6 @@ export declare class AdapterConnection {
6
6
  name: string;
7
7
  projectId: string;
8
8
  status: AdapterConnectionStatus;
9
+ lastUsed: Date | null;
9
10
  static parse(rawAdapterConnection: any): AdapterConnection;
10
11
  }
@@ -1,3 +1,4 @@
1
+ import { Utils } from '../../Utils.js';
1
2
  import { AdapterConnectionStatus } from './AdapterConnectionStatus.js';
2
3
  export class AdapterConnection {
3
4
  id;
@@ -6,6 +7,7 @@ export class AdapterConnection {
6
7
  name;
7
8
  projectId;
8
9
  status;
10
+ lastUsed = null;
9
11
  static parse(rawAdapterConnection) {
10
12
  const adapterConnection = new AdapterConnection();
11
13
  adapterConnection.id = rawAdapterConnection.id;
@@ -14,6 +16,7 @@ export class AdapterConnection {
14
16
  adapterConnection.name = rawAdapterConnection.name;
15
17
  adapterConnection.projectId = rawAdapterConnection.project;
16
18
  adapterConnection.status = AdapterConnectionStatus.fromString(rawAdapterConnection.status);
19
+ adapterConnection.lastUsed = rawAdapterConnection.last_used === null ? null : Utils.parseRawDate(rawAdapterConnection.last_used);
17
20
  return adapterConnection;
18
21
  }
19
22
  }
@@ -0,0 +1,9 @@
1
+ import { DataValueCollection } from '../DataValueCollection.js';
2
+ export declare class AdapterConnectionEvent {
3
+ id: string;
4
+ adapterConnection: string;
5
+ type: string;
6
+ time: Date;
7
+ data: DataValueCollection;
8
+ static parse(rawAdapterConnection: any): AdapterConnectionEvent;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { DataValueCollection } from '../DataValueCollection.js';
2
+ import { Utils } from '../../Utils.js';
3
+ export class AdapterConnectionEvent {
4
+ id;
5
+ adapterConnection;
6
+ type;
7
+ time;
8
+ data;
9
+ static parse(rawAdapterConnection) {
10
+ const adapterConnectionEvent = new AdapterConnectionEvent();
11
+ adapterConnectionEvent.id = rawAdapterConnection.id;
12
+ adapterConnectionEvent.adapterConnection = rawAdapterConnection.adapter_connection;
13
+ adapterConnectionEvent.type = rawAdapterConnection.type;
14
+ adapterConnectionEvent.time = Utils.parseRawDate(rawAdapterConnection.time);
15
+ adapterConnectionEvent.data = DataValueCollection.fromObject(rawAdapterConnection.data);
16
+ return adapterConnectionEvent;
17
+ }
18
+ }
@@ -0,0 +1,15 @@
1
+ import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
2
+ import { CollectionResult } from '../Model/Result/CollectionResult.js';
3
+ import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue.js';
4
+ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
5
+ import { AdapterConnectionEvent } from '../Model/Adapter/AdapterConnectionEvent.js';
6
+ import { Endpoint } from './Endpoint.js';
7
+ export declare class AdapterConnectionEndpoint extends Endpoint {
8
+ getConnections(projectId: string, pagination: CursorPagination): Promise<CollectionResult<AdapterConnection>>;
9
+ getConnectionById(connectionId: string): Promise<AdapterConnection | null>;
10
+ getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
11
+ getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
12
+ saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
13
+ saveConnectionConfiguration(connectionId: string, configuration: AdapterConnectionConfigurationValue[]): Promise<boolean>;
14
+ getConnectionEvents(connectionId: string, pagination: CursorPagination): Promise<CollectionResult<AdapterConnectionEvent>>;
15
+ }
@@ -0,0 +1,103 @@
1
+ import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
2
+ import { QueryString } from '../Http/Data/QueryString.js';
3
+ import { AdapterConnectionEvent } from '../Model/Adapter/AdapterConnectionEvent.js';
4
+ import { Endpoint } from './Endpoint.js';
5
+ export class AdapterConnectionEndpoint extends Endpoint {
6
+ async getConnections(projectId, pagination) {
7
+ try {
8
+ const queryString = new QueryString('/projects/' + projectId + '/connections');
9
+ queryString.addPagination(pagination);
10
+ return await this.requestCollection(queryString, AdapterConnection.parse);
11
+ }
12
+ catch (error) {
13
+ if (this.httpClient.isDebugEnabled()) {
14
+ console.error('Failed to load adapters: ', error);
15
+ }
16
+ throw error;
17
+ }
18
+ }
19
+ async getConnectionById(connectionId) {
20
+ try {
21
+ const url = '/connections/' + connectionId;
22
+ const result = await this.requestObject(url, null, AdapterConnection.parse);
23
+ return result.getData();
24
+ }
25
+ catch (error) {
26
+ if (this.httpClient.isDebugEnabled()) {
27
+ console.error('Failed to load connection: ', error);
28
+ }
29
+ throw error;
30
+ }
31
+ }
32
+ async getConnectionByKey(projectId, connectionKey) {
33
+ try {
34
+ const url = '/projects/' + projectId + '/connections/' + connectionKey;
35
+ const result = await this.requestObject(url, null, AdapterConnection.parse);
36
+ return result.getData();
37
+ }
38
+ catch (error) {
39
+ if (this.httpClient.isDebugEnabled()) {
40
+ console.error('Failed to load connection: ', error);
41
+ }
42
+ throw error;
43
+ }
44
+ }
45
+ async getConnectionConfiguration(connectionId) {
46
+ try {
47
+ const url = '/connections/' + connectionId + '/configuration';
48
+ const parser = (raw) => ({
49
+ id: raw.id,
50
+ adapterConnectionId: raw.adapter_connection,
51
+ configurationId: raw.configuration,
52
+ value: raw.value,
53
+ });
54
+ return await this.requestCollection(url, parser);
55
+ }
56
+ catch (error) {
57
+ if (this.httpClient.isDebugEnabled()) {
58
+ console.error('Failed to load connection: ', error);
59
+ }
60
+ throw error;
61
+ }
62
+ }
63
+ async saveConnection(projectId, connection) {
64
+ try {
65
+ const url = '/projects/' + projectId + '/connections';
66
+ const result = await this.requestObject(url, connection, AdapterConnection.parse, 'POST');
67
+ const updatedAdapterConnection = result.getData();
68
+ if (updatedAdapterConnection === null) {
69
+ throw new Error('AdapterConnection not updated');
70
+ }
71
+ return updatedAdapterConnection;
72
+ }
73
+ catch (error) {
74
+ if (this.httpClient.isDebugEnabled()) {
75
+ console.error('Failed to save connection: ', error);
76
+ }
77
+ throw error;
78
+ }
79
+ }
80
+ async saveConnectionConfiguration(connectionId, configuration) {
81
+ try {
82
+ const url = '/connections/' + connectionId + '/configuration';
83
+ const parser = (raw) => ({ saved: raw.saved });
84
+ const result = await this.requestObject(url, { configuration: configuration }, parser, 'POST');
85
+ const res = result.getData();
86
+ if (res === null) {
87
+ throw new Error('Unable to save connection configuration: wrong response from API');
88
+ }
89
+ return res.saved;
90
+ }
91
+ catch (error) {
92
+ if (this.httpClient.isDebugEnabled()) {
93
+ console.error('Failed to save connection: ', error);
94
+ }
95
+ throw error;
96
+ }
97
+ }
98
+ async getConnectionEvents(connectionId, pagination) {
99
+ const queryString = new QueryString('/adapters/connections/' + connectionId + '/events');
100
+ queryString.addPagination(pagination);
101
+ return await this.requestCollection(queryString, AdapterConnectionEvent.parse);
102
+ }
103
+ }
@@ -1,8 +1,6 @@
1
1
  import { Adapter } from '../Model/Adapter/Adapter.js';
2
- import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
3
2
  import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration.js';
4
3
  import { CollectionResult } from '../Model/Result/CollectionResult.js';
5
- import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue.js';
6
4
  import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
7
5
  import { AdapterCategory } from '../Model/Adapter/AdapterCategory.js';
8
6
  import { Endpoint } from './Endpoint.js';
@@ -10,11 +8,5 @@ export declare class AdapterEndpoint extends Endpoint {
10
8
  getAdapters(pagination?: CursorPagination | null, withMedia?: boolean): Promise<CollectionResult<Adapter>>;
11
9
  getAdapter(adapterId: string, withMedia?: boolean): Promise<Adapter | null>;
12
10
  getAdapterConfiguration(adapterId: string): Promise<CollectionResult<AdapterConfiguration>>;
13
- getConnections(projectId: string, pagination: CursorPagination): Promise<CollectionResult<AdapterConnection>>;
14
- getConnectionById(connectionId: string): Promise<AdapterConnection | null>;
15
- getConnectionByKey(projectId: string, connectionKey: string): Promise<AdapterConnection | null>;
16
- getConnectionConfiguration(connectionId: string): Promise<CollectionResult<AdapterConnectionConfigurationValue>>;
17
- saveConnection(projectId: string, connection: AdapterConnection): Promise<AdapterConnection>;
18
- saveConnectionConfiguration(connectionId: string, configuration: AdapterConnectionConfigurationValue[]): Promise<boolean>;
19
11
  getAdapterCategories(pagination: CursorPagination): Promise<CollectionResult<AdapterCategory>>;
20
12
  }
@@ -1,5 +1,4 @@
1
1
  import { Adapter } from '../Model/Adapter/Adapter.js';
2
- import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
3
2
  import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration.js';
4
3
  import { QueryString } from '../Http/Data/QueryString.js';
5
4
  import { AdapterCategory } from '../Model/Adapter/AdapterCategory.js';
@@ -49,98 +48,6 @@ export class AdapterEndpoint extends Endpoint {
49
48
  throw error;
50
49
  }
51
50
  }
52
- async getConnections(projectId, pagination) {
53
- try {
54
- const queryString = new QueryString('/projects/' + projectId + '/connections');
55
- queryString.addPagination(pagination);
56
- return await this.requestCollection(queryString, AdapterConnection.parse);
57
- }
58
- catch (error) {
59
- if (this.httpClient.isDebugEnabled()) {
60
- console.error('Failed to load adapters: ', error);
61
- }
62
- throw error;
63
- }
64
- }
65
- async getConnectionById(connectionId) {
66
- try {
67
- const url = '/connections/' + connectionId;
68
- const result = await this.requestObject(url, null, AdapterConnection.parse);
69
- return result.getData();
70
- }
71
- catch (error) {
72
- if (this.httpClient.isDebugEnabled()) {
73
- console.error('Failed to load connection: ', error);
74
- }
75
- throw error;
76
- }
77
- }
78
- async getConnectionByKey(projectId, connectionKey) {
79
- try {
80
- const url = '/projects/' + projectId + '/connections/' + connectionKey;
81
- const result = await this.requestObject(url, null, AdapterConnection.parse);
82
- return result.getData();
83
- }
84
- catch (error) {
85
- if (this.httpClient.isDebugEnabled()) {
86
- console.error('Failed to load connection: ', error);
87
- }
88
- throw error;
89
- }
90
- }
91
- async getConnectionConfiguration(connectionId) {
92
- try {
93
- const url = '/connections/' + connectionId + '/configuration';
94
- const parser = (raw) => ({
95
- id: raw.id,
96
- adapterConnectionId: raw.adapter_connection,
97
- configurationId: raw.configuration,
98
- value: raw.value,
99
- });
100
- return await this.requestCollection(url, parser);
101
- }
102
- catch (error) {
103
- if (this.httpClient.isDebugEnabled()) {
104
- console.error('Failed to load connection: ', error);
105
- }
106
- throw error;
107
- }
108
- }
109
- async saveConnection(projectId, connection) {
110
- try {
111
- const url = '/projects/' + projectId + '/connections';
112
- const result = await this.requestObject(url, connection, AdapterConnection.parse, 'POST');
113
- const updatedAdapterConnection = result.getData();
114
- if (updatedAdapterConnection === null) {
115
- throw new Error('AdapterConnection not updated');
116
- }
117
- return updatedAdapterConnection;
118
- }
119
- catch (error) {
120
- if (this.httpClient.isDebugEnabled()) {
121
- console.error('Failed to save connection: ', error);
122
- }
123
- throw error;
124
- }
125
- }
126
- async saveConnectionConfiguration(connectionId, configuration) {
127
- try {
128
- const url = '/connections/' + connectionId + '/configuration';
129
- const parser = (raw) => ({ saved: raw.saved });
130
- const result = await this.requestObject(url, { configuration: configuration }, parser, 'POST');
131
- const res = result.getData();
132
- if (res === null) {
133
- throw new Error('Unable to save connection configuration: wrong response from API');
134
- }
135
- return res.saved;
136
- }
137
- catch (error) {
138
- if (this.httpClient.isDebugEnabled()) {
139
- console.error('Failed to save connection: ', error);
140
- }
141
- throw error;
142
- }
143
- }
144
51
  async getAdapterCategories(pagination) {
145
52
  try {
146
53
  const queryString = new QueryString('/adapter-categories');
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
23
23
  export { AdapterCategory } from './Model/Adapter/AdapterCategory.js';
24
24
  export { AdapterConnectionStatus } from './Model/Adapter/AdapterConnectionStatus.js';
25
25
  export { AdapterConnectionConfigurationValue } from './Model/Adapter/AdapterConnectionConfigurationValue.js';
26
+ export { AdapterConnectionEvent } from './Model/Adapter/AdapterConnectionEvent.js';
26
27
  export { EventType } from './Model/Event/EventType.js';
27
28
  export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
28
29
  export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
@@ -117,6 +118,7 @@ export { UserAction } from './Model/User/UserAction.js';
117
118
  export { RunnerImage } from './Model/Runner/RunnerImage.js';
118
119
  export { Endpoint } from './Service/Endpoint.js';
119
120
  export { AdapterEndpoint } from './Service/AdapterEndpoint.js';
121
+ export { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
120
122
  export { ChannelEndpoint } from './Service/ChannelEndpoint.js';
121
123
  export { ProjectEndpoint } from './Service/ProjectEndpoint.js';
122
124
  export { ConfigEndpoint } from './Service/ConfigEndpoint.js';
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
18
18
  export { AdapterCategory } from './Model/Adapter/AdapterCategory.js';
19
19
  export { AdapterConnectionStatus } from './Model/Adapter/AdapterConnectionStatus.js';
20
20
  export { AdapterConnectionConfigurationValue } from './Model/Adapter/AdapterConnectionConfigurationValue.js';
21
+ export { AdapterConnectionEvent } from './Model/Adapter/AdapterConnectionEvent.js';
21
22
  export { EventType } from './Model/Event/EventType.js';
22
23
  export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
23
24
  export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
@@ -112,6 +113,7 @@ export { RunnerImage } from './Model/Runner/RunnerImage.js';
112
113
  export { Endpoint } from './Service/Endpoint.js';
113
114
  /* Endpoints */
114
115
  export { AdapterEndpoint } from './Service/AdapterEndpoint.js';
116
+ export { AdapterConnectionEndpoint } from './Service/AdapterConnectionEndpoint.js';
115
117
  export { ChannelEndpoint } from './Service/ChannelEndpoint.js';
116
118
  export { ProjectEndpoint } from './Service/ProjectEndpoint.js';
117
119
  export { ConfigEndpoint } from './Service/ConfigEndpoint.js';
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.18.5";
1
+ export declare const VERSION = "1.19.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.18.5";
1
+ export const VERSION = "1.19.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.18.10",
3
+ "version": "1.19.1",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",