angles-javascript-client 1.0.46 → 1.0.47
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/lib/models/requests/CompareOptions.d.ts +8 -0
- package/dist/lib/models/requests/CompareOptions.js +7 -0
- package/dist/lib/models/requests/CompareOptions.js.map +1 -0
- package/dist/lib/models/response/ImageCompareResponse.d.ts +16 -0
- package/dist/lib/models/response/ImageCompareResponse.js +4 -1
- package/dist/lib/models/response/ImageCompareResponse.js.map +1 -1
- package/dist/lib/requests/ScreenshotRequests.d.ts +12 -2
- package/dist/lib/requests/ScreenshotRequests.js +24 -6
- package/dist/lib/requests/ScreenshotRequests.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class CompareOptions {
|
|
2
|
+
/** Comparison algorithm: 'pixel' (default), 'ssim', or 'phash' (JSON endpoints only). */
|
|
3
|
+
algorithm?: 'pixel' | 'ssim' | 'phash';
|
|
4
|
+
/** Per-pixel colour-distance threshold (0-1, pixel algorithm only). Defaults to 0.5. */
|
|
5
|
+
threshold?: number;
|
|
6
|
+
/** When true (pixel algorithm only), changed pixels are clustered into regions. */
|
|
7
|
+
regions?: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareOptions.js","sourceRoot":"","sources":["../../../../src/lib/models/requests/CompareOptions.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;CAO1B;AAPD,wCAOC"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
export declare class DiffRegion {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
/** Number of changed pixels inside the region. */
|
|
7
|
+
pixels: number;
|
|
8
|
+
}
|
|
1
9
|
export declare class ImageCompareResponse {
|
|
10
|
+
/** Algorithm that produced this result: 'pixel', 'ssim', or 'phash'. */
|
|
11
|
+
algorithm?: string;
|
|
2
12
|
isSameDimensions: boolean;
|
|
3
13
|
rawMisMatchPercentage: number;
|
|
4
14
|
misMatchPercentage: number;
|
|
5
15
|
analysisTime: number;
|
|
16
|
+
/** SSIM score in [-1, 1] (1 = identical); present when algorithm is 'ssim'. */
|
|
17
|
+
ssim?: number;
|
|
18
|
+
/** Normalised perceptual-hash distance (0-1); present when algorithm is 'phash'. */
|
|
19
|
+
distance?: number;
|
|
20
|
+
/** Clustered change regions; present when requested with regions=true (pixel only). */
|
|
21
|
+
regions?: DiffRegion[];
|
|
6
22
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImageCompareResponse = void 0;
|
|
3
|
+
exports.ImageCompareResponse = exports.DiffRegion = void 0;
|
|
4
|
+
class DiffRegion {
|
|
5
|
+
}
|
|
6
|
+
exports.DiffRegion = DiffRegion;
|
|
4
7
|
class ImageCompareResponse {
|
|
5
8
|
}
|
|
6
9
|
exports.ImageCompareResponse = ImageCompareResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCompareResponse.js","sourceRoot":"","sources":["../../../../src/lib/models/response/ImageCompareResponse.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"ImageCompareResponse.js","sourceRoot":"","sources":["../../../../src/lib/models/response/ImageCompareResponse.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;CAOtB;AAPD,gCAOC;AAED,MAAa,oBAAoB;CAahC;AAbD,oDAaC"}
|
|
@@ -5,6 +5,7 @@ import { StoreScreenshot } from '../models/requests/StoreScreenshot';
|
|
|
5
5
|
import { ImageCompareResponse } from '../models/response/ImageCompareResponse';
|
|
6
6
|
import { ImageFindResponse } from '../models/response/ImageFindResponse';
|
|
7
7
|
import { FindImageOptions } from '../models/requests/FindImageOptions';
|
|
8
|
+
import { CompareOptions } from '../models/requests/CompareOptions';
|
|
8
9
|
import { DefaultResponse } from "../models/response/DefaultResponse";
|
|
9
10
|
export declare class ScreenshotRequests extends BaseRequests {
|
|
10
11
|
constructor(axiosInstance: AxiosInstance);
|
|
@@ -25,8 +26,17 @@ export declare class ScreenshotRequests extends BaseRequests {
|
|
|
25
26
|
deleteScreenshot(screenshotId: string): Promise<DefaultResponse>;
|
|
26
27
|
getScreenshotImage(screenshotId: string): Promise<AxiosResponse>;
|
|
27
28
|
getDynamicBaselineImage(screenshotId: string, numberOfImagesToCompare: number): Promise<Screenshot>;
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Compares two stored screenshots and returns the comparison statistics.
|
|
31
|
+
* @param {CompareOptions} [options] - algorithm/threshold/regions
|
|
32
|
+
*/
|
|
33
|
+
compareScreenshots(screenshotId: string, screenshotCompareId: string, options?: CompareOptions): Promise<ImageCompareResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Compares two stored screenshots and resolves with the diff image.
|
|
36
|
+
*/
|
|
37
|
+
compareScreenshotsImage(screenshotId: string, screenshotCompareId: string, cache?: boolean, options?: CompareOptions): Promise<AxiosResponse>;
|
|
38
|
+
getBaselineCompareImage(screenshotId: string, cache: boolean, options?: CompareOptions): Promise<AxiosResponse>;
|
|
39
|
+
getBaselineCompare(screenshotId: string, options?: CompareOptions): Promise<ImageCompareResponse>;
|
|
30
40
|
/**
|
|
31
41
|
* Finds a stored screenshot (the template) within another stored screenshot using
|
|
32
42
|
* multi-scale template matching, and returns the matched region(s).
|
|
@@ -107,17 +107,35 @@ class ScreenshotRequests extends BaseRequests_1.BaseRequests {
|
|
|
107
107
|
}
|
|
108
108
|
return this.get(path);
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Compares two stored screenshots and returns the comparison statistics.
|
|
112
|
+
* @param {CompareOptions} [options] - algorithm/threshold/regions
|
|
113
|
+
*/
|
|
114
|
+
compareScreenshots(screenshotId, screenshotCompareId, options) {
|
|
115
|
+
return this.get(`screenshot/${screenshotId}/compare/${screenshotCompareId}`, {
|
|
116
|
+
params: options,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Compares two stored screenshots and resolves with the diff image.
|
|
121
|
+
*/
|
|
122
|
+
compareScreenshotsImage(screenshotId, screenshotCompareId, cache, options) {
|
|
123
|
+
return this.get(`screenshot/${screenshotId}/compare/${screenshotCompareId}/image`, {
|
|
124
|
+
params: Object.assign({ useCache: cache || false }, options),
|
|
125
|
+
responseType: 'arraybuffer',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
getBaselineCompareImage(screenshotId, cache, options) {
|
|
113
129
|
const useCache = cache || false;
|
|
114
130
|
return this.get(`screenshot/${screenshotId}/baseline/compare/image/`, {
|
|
115
|
-
params: { useCache },
|
|
131
|
+
params: Object.assign({ useCache }, options),
|
|
116
132
|
responseType: 'arraybuffer'
|
|
117
133
|
});
|
|
118
134
|
}
|
|
119
|
-
getBaselineCompare(screenshotId) {
|
|
120
|
-
return this.get(`screenshot/${screenshotId}/baseline/compare
|
|
135
|
+
getBaselineCompare(screenshotId, options) {
|
|
136
|
+
return this.get(`screenshot/${screenshotId}/baseline/compare/`, {
|
|
137
|
+
params: options,
|
|
138
|
+
});
|
|
121
139
|
}
|
|
122
140
|
/**
|
|
123
141
|
* Finds a stored screenshot (the template) within another stored screenshot using
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenshotRequests.js","sourceRoot":"","sources":["../../../src/lib/requests/ScreenshotRequests.ts"],"names":[],"mappings":";;;;;;AACA,0DAAiC;AACjC,iDAA8C;
|
|
1
|
+
{"version":3,"file":"ScreenshotRequests.js","sourceRoot":"","sources":["../../../src/lib/requests/ScreenshotRequests.ts"],"names":[],"mappings":";;;;;;AACA,0DAAiC;AACjC,iDAA8C;AAS9C,MAAa,kBAAmB,SAAQ,2BAAY;IAElD,Y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