attlaz-client 1.10.10 → 1.10.12

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,9 +1,10 @@
1
1
  import { DataValueCollection } from '../DataValueCollection.js';
2
2
  export declare class AdapterConnection {
3
- id: number;
3
+ id: string;
4
4
  key: string;
5
5
  adapter: string;
6
6
  name: string;
7
+ projectId: string;
7
8
  configuration: DataValueCollection;
8
9
  constructor();
9
10
  static parse(rawAdapterConnection: any): AdapterConnection;
@@ -4,6 +4,7 @@ export class AdapterConnection {
4
4
  key;
5
5
  adapter;
6
6
  name;
7
+ projectId;
7
8
  configuration;
8
9
  constructor() {
9
10
  this.configuration = new DataValueCollection();
@@ -14,6 +15,7 @@ export class AdapterConnection {
14
15
  adapterConnection.key = rawAdapterConnection.key;
15
16
  adapterConnection.adapter = rawAdapterConnection.adapter;
16
17
  adapterConnection.name = rawAdapterConnection.name;
18
+ adapterConnection.projectId = rawAdapterConnection.project;
17
19
  adapterConnection.configuration = DataValueCollection.fromObject(rawAdapterConnection.configuration);
18
20
  return adapterConnection;
19
21
  // adapter.id = rawAdapter.id;
@@ -5,10 +5,11 @@ import { Flow } from '../Flow/Flow.js';
5
5
  import { FlowRun } from '../Flow/FlowRun.js';
6
6
  import { Channel } from '../Messaging/Channel/Channel.js';
7
7
  import { Adapter } from '../Adapter/Adapter.js';
8
+ import { AdapterConnection } from '../Adapter/AdapterConnection.js';
8
9
  export declare class SearchResult {
9
10
  type: string;
10
11
  label: string;
11
12
  description: string;
12
- object: Workspace | Project | ProjectEnvironment | Flow | FlowRun | Channel | Adapter;
13
+ object: Workspace | Project | ProjectEnvironment | Flow | FlowRun | Channel | Adapter | AdapterConnection;
13
14
  static parse(rawResult: any): SearchResult;
14
15
  }
@@ -4,6 +4,7 @@ import { ProjectEnvironment } from '../Project/ProjectEnvironment.js';
4
4
  import { Flow } from '../Flow/Flow.js';
5
5
  import { FlowRun } from '../Flow/FlowRun.js';
6
6
  import { Adapter } from '../Adapter/Adapter.js';
7
+ import { AdapterConnection } from '../Adapter/AdapterConnection.js';
7
8
  export class SearchResult {
8
9
  type;
9
10
  label;
@@ -18,6 +19,7 @@ export class SearchResult {
18
19
  switch (rawResult.type) {
19
20
  case 'workspace':
20
21
  searchResult.object = Workspace.parse(rawResult.object);
22
+ searchResult.label = searchResult.object.name;
21
23
  break;
22
24
  case 'project':
23
25
  searchResult.object = Project.parse(rawResult.object);
@@ -39,6 +41,10 @@ export class SearchResult {
39
41
  searchResult.object = Adapter.parse(rawResult.object);
40
42
  searchResult.label = searchResult.object.id;
41
43
  break;
44
+ case 'adapter-connection':
45
+ searchResult.object = AdapterConnection.parse(rawResult.object);
46
+ searchResult.label = searchResult.object.name;
47
+ break;
42
48
  default:
43
49
  throw new Error('Unknown search result type "' + rawResult.type + '"');
44
50
  }
@@ -133,15 +133,23 @@ export class Endpoint {
133
133
  throw new Error('Invalid data');
134
134
  }
135
135
  for (const rawDataEntry of rawData) {
136
- data.push(this.parseObject(rawDataEntry, parser));
136
+ const parsedObject = this.parseObject(rawDataEntry, parser);
137
+ if (parsedObject !== null) {
138
+ data.push(parsedObject);
139
+ }
137
140
  }
138
141
  return data;
139
142
  }
140
143
  parseObject(rawObject, parser) {
141
144
  // TODO: is it interesting to keep this wrapper, or only in develop mode?
142
145
  const wrappedData = ObjectWrapper.wrap(rawObject);
143
- const parsedData = parser(wrappedData);
144
- return parsedData;
146
+ try {
147
+ return parser(wrappedData);
148
+ }
149
+ catch (e) {
150
+ console.error('Unable to parse: ' + e.message);
151
+ }
152
+ return null;
145
153
  }
146
154
  buildQuery(pagination) {
147
155
  const queryString = new QueryString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.10.10",
3
+ "version": "1.10.12",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",