attlaz-client 1.10.22 → 1.10.24

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.
@@ -5,7 +5,6 @@ export class AdapterConnection {
5
5
  name;
6
6
  projectId;
7
7
  status;
8
- // configuration: DataValueCollection;
9
8
  constructor() {
10
9
  }
11
10
  static parse(rawAdapterConnection) {
@@ -16,14 +15,6 @@ export class AdapterConnection {
16
15
  adapterConnection.name = rawAdapterConnection.name;
17
16
  adapterConnection.projectId = rawAdapterConnection.project;
18
17
  adapterConnection.status = rawAdapterConnection.status;
19
- // adapterConnection.configuration = DataValueCollection.fromObject(rawAdapterConnection.configuration);
20
18
  return adapterConnection;
21
- // adapter.id = rawAdapter.id;
22
- // adapter.name = rawAdapter.name;
23
- // adapter.description = rawAdapter.description;
24
- // adapter.vendor = rawAdapter.vendor;
25
- // adapter.image = rawAdapter.image;
26
- // adapter.type = rawAdapter.type;
27
- // return adapter;
28
19
  }
29
20
  }
@@ -0,0 +1,13 @@
1
+ import { StateAware } from '../StateAware.js';
2
+ import { State } from '../State.js';
3
+ export declare class RunnerImage implements StateAware {
4
+ id: string;
5
+ name: string;
6
+ image: string;
7
+ version: string;
8
+ buildDate: Date;
9
+ deprecated: boolean;
10
+ endOfSupport: Date | null;
11
+ endOfLife: Date | null;
12
+ state: State;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { State } from '../State.js';
2
+ export class RunnerImage {
3
+ id;
4
+ name;
5
+ image;
6
+ version;
7
+ buildDate;
8
+ deprecated = false;
9
+ endOfSupport = null;
10
+ endOfLife = null;
11
+ state = State.Active;
12
+ }
@@ -4,7 +4,7 @@ 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
6
  import { DataValueCollection } from '../Model/DataValueCollection.js';
7
- import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue';
7
+ import { AdapterConnectionConfigurationValue } from '../Model/Adapter/AdapterConnectionConfigurationValue.js';
8
8
  export declare class AdapterEndpoint extends Endpoint {
9
9
  getAdapters(): Promise<CollectionResult<Adapter>>;
10
10
  getAdapter(adapterId: string): Promise<Adapter | null>;
@@ -1,6 +1,9 @@
1
1
  import { Endpoint } from './Endpoint.js';
2
2
  import { Worker } from '../Model/Worker/Worker.js';
3
+ import { RunnerImage } from '../Model/Runner/RunnerImage';
4
+ import { CollectionResult } from '../Model/Result/CollectionResult';
3
5
  export declare class WorkerEndpoint extends Endpoint {
4
6
  getByProjectEnvironment(projectEnvironmentId: string): Promise<Worker | null>;
5
7
  update(projectEnvironmentId: string): Promise<boolean>;
8
+ getImages(): Promise<CollectionResult<RunnerImage>>;
6
9
  }
@@ -1,5 +1,8 @@
1
1
  import { Endpoint } from './Endpoint.js';
2
2
  import { Worker } from '../Model/Worker/Worker.js';
3
+ import { RunnerImage } from '../Model/Runner/RunnerImage';
4
+ import { Utils } from '../Utils';
5
+ import { State } from '../Model/State';
3
6
  export class WorkerEndpoint extends Endpoint {
4
7
  async getByProjectEnvironment(projectEnvironmentId) {
5
8
  try {
@@ -32,4 +35,26 @@ export class WorkerEndpoint extends Endpoint {
32
35
  throw error;
33
36
  }
34
37
  }
38
+ async getImages() {
39
+ const url = '/runners/images';
40
+ const parser = (rawImage) => {
41
+ const runnerImage = new RunnerImage();
42
+ runnerImage.id = rawImage.id;
43
+ runnerImage.name = rawImage.name;
44
+ runnerImage.image = rawImage.image;
45
+ runnerImage.version = rawImage.image;
46
+ runnerImage.buildDate = Utils.parseRawDate(rawImage.build_date);
47
+ runnerImage.deprecated = Utils.isTrue(rawImage.deprecated);
48
+ if (rawImage.end_of_support !== null && rawImage.end_of_support !== undefined) {
49
+ runnerImage.endOfSupport = Utils.parseRawDate(rawImage.end_of_support);
50
+ }
51
+ if (rawImage.end_of_life !== null && rawImage.end_of_life !== undefined) {
52
+ runnerImage.endOfLife = Utils.parseRawDate(rawImage.end_of_life);
53
+ }
54
+ runnerImage.state = State.fromString(rawImage.state);
55
+ return runnerImage;
56
+ };
57
+ const result = await this.requestCollection(url, parser);
58
+ return result;
59
+ }
35
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.10.22",
3
+ "version": "1.10.24",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",