attlaz-client 1.46.1 → 1.46.3

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.
@@ -9,4 +9,5 @@ export declare abstract class MetaDataWithIconAware {
9
9
  updatedAt: Date | null;
10
10
  createdAt: Date | null;
11
11
  static parseMetaData<T extends MetaDataWithIconAware>(input: T, raw: ApiRecord): T;
12
+ static parseIcon(icon: unknown): string | null;
12
13
  }
@@ -8,7 +8,19 @@ export class MetaDataWithIconAware {
8
8
  createdAt = null;
9
9
  static parseMetaData(input, raw) {
10
10
  input = MetaDataAware.parseMetaData(input, raw);
11
- input.icon = raw.icon;
11
+ input.icon = MetaDataWithIconAware.parseIcon(raw.icon);
12
12
  return input;
13
13
  }
14
+ static parseIcon(icon) {
15
+ if (icon === null) {
16
+ return null;
17
+ }
18
+ if (typeof icon === 'object') {
19
+ if ('type' in icon && 'data' in icon) {
20
+ return icon.data;
21
+ }
22
+ console.log('Icon', { icon });
23
+ }
24
+ return icon;
25
+ }
14
26
  }
@@ -3,7 +3,7 @@ import { ApiRecord } from '../ApiRecord.js';
3
3
  export declare class Adapter extends MetaDataWithIconAware {
4
4
  id: string;
5
5
  vendor: string;
6
- logo: string;
6
+ logo: string | null;
7
7
  type: string;
8
8
  longDescription: string | null;
9
9
  capabilities: string[];
@@ -11,5 +11,4 @@ export declare class Adapter extends MetaDataWithIconAware {
11
11
  docs: string | null;
12
12
  website: string | null;
13
13
  static parse(rawAdapter: ApiRecord): Adapter;
14
- static parseIcon(icon: any): string;
15
14
  }
@@ -18,17 +18,11 @@ export class Adapter extends MetaDataWithIconAware {
18
18
  adapter.longDescription = rawAdapter.long_description;
19
19
  adapter.capabilities = rawAdapter.capabilities;
20
20
  // adapter.icon = rawAdapter.icon as string;
21
- adapter.logo = Adapter.parseIcon(rawAdapter.logo);
21
+ adapter.logo = MetaDataWithIconAware.parseIcon(rawAdapter.logo);
22
22
  adapter.type = rawAdapter.type;
23
23
  adapter.categoryIds = rawAdapter.categories;
24
24
  adapter.docs = rawAdapter.docs;
25
25
  adapter.website = rawAdapter.website;
26
26
  return adapter;
27
27
  }
28
- static parseIcon(icon) {
29
- if (typeof icon === 'object' && 'url' in icon) {
30
- return icon.url;
31
- }
32
- return icon;
33
- }
34
28
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.46.1";
1
+ export declare const VERSION = "1.46.2";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.46.1";
1
+ export const VERSION = "1.46.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.46.1",
3
+ "version": "1.46.3",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",