askui 0.8.0 → 0.9.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.
@@ -3,14 +3,16 @@ import { ControlCommand } from '../core/ui-control-commands';
3
3
  import { CustomElement } from '../core/model/test-case-dto';
4
4
  import { Annotation } from '../core/annotation/annotation';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
+ import { ModelCompositionBranch } from './model-composition-branch';
6
7
  export declare class InferenceClient {
7
8
  baseUrl: string;
8
9
  httpClient: HttpClientGot;
9
10
  resize?: number | undefined;
10
11
  readonly workspaceId?: string | undefined;
12
+ readonly modelComposition?: ModelCompositionBranch[] | undefined;
11
13
  apiVersion: string;
12
14
  url: string;
13
- constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, apiVersion?: string);
15
+ constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, modelComposition?: ModelCompositionBranch[] | undefined, apiVersion?: string);
14
16
  isImageRequired(instruction: string): Promise<boolean>;
15
17
  private resizeIfNeeded;
16
18
  inference(customElements?: CustomElement[], image?: string, instruction?: string): Promise<ControlCommand | Annotation>;
@@ -21,11 +21,12 @@ const inference_response_error_1 = require("./inference-response-error");
21
21
  const config_error_1 = require("./config-error");
22
22
  const logger_1 = require("../lib/logger");
23
23
  class InferenceClient {
24
- constructor(baseUrl, httpClient, resize, workspaceId, apiVersion = 'v3') {
24
+ constructor(baseUrl, httpClient, resize, workspaceId, modelComposition, apiVersion = 'v3') {
25
25
  this.baseUrl = baseUrl;
26
26
  this.httpClient = httpClient;
27
27
  this.resize = resize;
28
28
  this.workspaceId = workspaceId;
29
+ this.modelComposition = modelComposition;
29
30
  this.apiVersion = apiVersion;
30
31
  const versionedBaseUrl = (0, url_join_1.default)(this.baseUrl, 'api', this.apiVersion);
31
32
  this.url = workspaceId
@@ -62,6 +63,7 @@ class InferenceClient {
62
63
  image: resizedImage.base64Image,
63
64
  instruction,
64
65
  customElements,
66
+ modelComposition: this.modelComposition,
65
67
  };
66
68
  const url = (0, url_join_1.default)(this.url, 'inference');
67
69
  const response = yield this.httpClient.post(url, requestBody);
@@ -0,0 +1,8 @@
1
+ export interface ModelCompositionBranch {
2
+ task: string;
3
+ architecture: string;
4
+ version: string;
5
+ interface: string;
6
+ useCase: string;
7
+ tags: string[];
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -52,7 +52,7 @@ class UiControlClient extends dsl_1.ApiCommands {
52
52
  return this._uiControllerClient;
53
53
  }
54
54
  get inferenceClient() {
55
- return new inference_client_1.InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId);
55
+ return new inference_client_1.InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId, this.clientArgs.modelComposition);
56
56
  }
57
57
  get executionRuntime() {
58
58
  return new execution_runtime_1.ExecutionRuntime(this.uiControllerClient, this.inferenceClient);
@@ -1,6 +1,7 @@
1
1
  import { AnnotationLevel } from './annotation-level';
2
2
  import { CredentialArgs } from './credentials-args';
3
3
  import { ProxyAgentArgs } from '../shared/proxy-agent-args';
4
+ import { ModelCompositionBranch } from './model-composition-branch';
4
5
  /**
5
6
  * Configuration options for the askui UI Control Client
6
7
  *
@@ -32,6 +33,7 @@ export interface ClientArgs {
32
33
  readonly credentials?: CredentialArgs;
33
34
  readonly proxyAgents?: ProxyAgentArgs;
34
35
  readonly resize?: number;
36
+ readonly modelComposition?: ModelCompositionBranch[];
35
37
  }
36
38
  export interface ClientArgsWithDefaults extends ClientArgs {
37
39
  readonly uiControllerUrl: string;
@@ -48,7 +48,7 @@ class UiControllerClient {
48
48
  this.ws.on('error', (error) => {
49
49
  this.connectionState = ui_controller_client_connection_state_1.UiControllerClientConnectionState.ERROR;
50
50
  reject(new ui_control_client_error_1.UiControlClientError(`Connection to UI Controller cannot be established,
51
- Probably it was not started. Makse sure you started UI Controller with this
51
+ Probably it was not started. Make sure you started UI Controller with this
52
52
  Url ${this.url}. Error message ${error.message}`));
53
53
  });
54
54
  }
@@ -3,14 +3,16 @@ import { ControlCommand } from '../core/ui-control-commands';
3
3
  import { CustomElement } from '../core/model/test-case-dto';
4
4
  import { Annotation } from '../core/annotation/annotation';
5
5
  import { DetectedElement } from '../core/model/annotation-result/detected-element';
6
+ import { ModelCompositionBranch } from './model-composition-branch';
6
7
  export declare class InferenceClient {
7
8
  baseUrl: string;
8
9
  httpClient: HttpClientGot;
9
10
  resize?: number | undefined;
10
11
  readonly workspaceId?: string | undefined;
12
+ readonly modelComposition?: ModelCompositionBranch[] | undefined;
11
13
  apiVersion: string;
12
14
  url: string;
13
- constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, apiVersion?: string);
15
+ constructor(baseUrl: string, httpClient: HttpClientGot, resize?: number | undefined, workspaceId?: string | undefined, modelComposition?: ModelCompositionBranch[] | undefined, apiVersion?: string);
14
16
  isImageRequired(instruction: string): Promise<boolean>;
15
17
  private resizeIfNeeded;
16
18
  inference(customElements?: CustomElement[], image?: string, instruction?: string): Promise<ControlCommand | Annotation>;
@@ -15,11 +15,12 @@ import { InferenceResponseError } from './inference-response-error';
15
15
  import { ConfigurationError } from './config-error';
16
16
  import { logger } from '../lib/logger';
17
17
  export class InferenceClient {
18
- constructor(baseUrl, httpClient, resize, workspaceId, apiVersion = 'v3') {
18
+ constructor(baseUrl, httpClient, resize, workspaceId, modelComposition, apiVersion = 'v3') {
19
19
  this.baseUrl = baseUrl;
20
20
  this.httpClient = httpClient;
21
21
  this.resize = resize;
22
22
  this.workspaceId = workspaceId;
23
+ this.modelComposition = modelComposition;
23
24
  this.apiVersion = apiVersion;
24
25
  const versionedBaseUrl = urljoin(this.baseUrl, 'api', this.apiVersion);
25
26
  this.url = workspaceId
@@ -56,6 +57,7 @@ export class InferenceClient {
56
57
  image: resizedImage.base64Image,
57
58
  instruction,
58
59
  customElements,
60
+ modelComposition: this.modelComposition,
59
61
  };
60
62
  const url = urljoin(this.url, 'inference');
61
63
  const response = yield this.httpClient.post(url, requestBody);
@@ -0,0 +1,8 @@
1
+ export interface ModelCompositionBranch {
2
+ task: string;
3
+ architecture: string;
4
+ version: string;
5
+ interface: string;
6
+ useCase: string;
7
+ tags: string[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -49,7 +49,7 @@ export class UiControlClient extends ApiCommands {
49
49
  return this._uiControllerClient;
50
50
  }
51
51
  get inferenceClient() {
52
- return new InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId);
52
+ return new InferenceClient(this.clientArgs.inferenceServerUrl, this.httpClient, this.clientArgs.resize, this.workspaceId, this.clientArgs.modelComposition);
53
53
  }
54
54
  get executionRuntime() {
55
55
  return new ExecutionRuntime(this.uiControllerClient, this.inferenceClient);
@@ -1,6 +1,7 @@
1
1
  import { AnnotationLevel } from './annotation-level';
2
2
  import { CredentialArgs } from './credentials-args';
3
3
  import { ProxyAgentArgs } from '../shared/proxy-agent-args';
4
+ import { ModelCompositionBranch } from './model-composition-branch';
4
5
  /**
5
6
  * Configuration options for the askui UI Control Client
6
7
  *
@@ -32,6 +33,7 @@ export interface ClientArgs {
32
33
  readonly credentials?: CredentialArgs;
33
34
  readonly proxyAgents?: ProxyAgentArgs;
34
35
  readonly resize?: number;
36
+ readonly modelComposition?: ModelCompositionBranch[];
35
37
  }
36
38
  export interface ClientArgsWithDefaults extends ClientArgs {
37
39
  readonly uiControllerUrl: string;
@@ -42,7 +42,7 @@ export class UiControllerClient {
42
42
  this.ws.on('error', (error) => {
43
43
  this.connectionState = UiControllerClientConnectionState.ERROR;
44
44
  reject(new UiControlClientError(`Connection to UI Controller cannot be established,
45
- Probably it was not started. Makse sure you started UI Controller with this
45
+ Probably it was not started. Make sure you started UI Controller with this
46
46
  Url ${this.url}. Error message ${error.message}`));
47
47
  });
48
48
  }
@@ -12,9 +12,9 @@ Use following command to set up Jest:
12
12
  npm i -D jest @types/jest ts-jest typescript
13
13
  ```
14
14
 
15
- ## How to execute the example test
15
+ ## How to execute the example
16
16
 
17
- This test can be executed with the following command:
17
+ This can be executed with the following command:
18
18
  ```shell
19
19
  npx jest --config ./test/jest.config.ts
20
20
  ```
@@ -1,14 +1,14 @@
1
1
  import { aui } from './helper/jest.setup';
2
2
 
3
3
  describe('jest with askui', () => {
4
-
5
4
  it('should generate an interactive annotation', async () => {
6
5
  await aui.annotateInteractively();
7
6
  });
8
7
 
9
8
  it('should click on my element', async () => {
10
9
  await aui
11
- .click()
12
- // <INSERT YOUR COPIED FILTER HERE AND UNCOMMENT THIS LINE>.exec();
10
+ .click();
11
+ // <INSERT YOUR COPIED ELEMENT DESCRIPTION HERE AND UNCOMMENT THIS AND THE NEXT LINE>
12
+ // .exec();
13
13
  });
14
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askui",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "author": "askui GmbH <info@askui.com> (http://www.askui.com/)",
6
6
  "description": "Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on",