scrapfly-sdk 0.6.9 → 0.7.1
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.
|
@@ -26,6 +26,24 @@ export declare enum Format {
|
|
|
26
26
|
WEBP = "webp",
|
|
27
27
|
GIF = "gif"
|
|
28
28
|
}
|
|
29
|
+
export declare enum VisionDeficiency {
|
|
30
|
+
/**
|
|
31
|
+
Simulate vision deficiency for accessibility testing (WCAG compliance)
|
|
32
|
+
Attributes:
|
|
33
|
+
DEUTERANOPIA: Difficulty distinguishing green from red; green appears beige/gray
|
|
34
|
+
PROTANOPIA: Reduced sensitivity to red light; red appears dark/black
|
|
35
|
+
TRITANOPIA: Difficulty distinguishing blue from yellow and violet from red
|
|
36
|
+
ACHROMATOPSIA: Complete inability to perceive color; sees only in grayscale
|
|
37
|
+
REDUCED_CONTRAST: Simulates reduced contrast due to aging, low light, or other factors
|
|
38
|
+
BLURRED_VISION: Simulates uncorrected refractive errors or age-related vision loss
|
|
39
|
+
*/
|
|
40
|
+
DEUTERANOPIA = "deuteranopia",
|
|
41
|
+
PROTANOPIA = "protanopia",
|
|
42
|
+
TRITANOPIA = "tritanopia",
|
|
43
|
+
ACHROMATOPSIA = "achromatopsia",
|
|
44
|
+
REDUCED_CONTRAST = "reducedContrast",
|
|
45
|
+
BLURRED_VISION = "blurredVision"
|
|
46
|
+
}
|
|
29
47
|
type ScreenshotConfigOptions = {
|
|
30
48
|
url: string;
|
|
31
49
|
format?: 'jpg' | 'png' | 'webp' | 'gif' | Format;
|
|
@@ -41,6 +59,7 @@ type ScreenshotConfigOptions = {
|
|
|
41
59
|
cache?: boolean;
|
|
42
60
|
cache_ttl?: number;
|
|
43
61
|
cache_clear?: boolean;
|
|
62
|
+
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredvision' | VisionDeficiency;
|
|
44
63
|
webhook?: string;
|
|
45
64
|
};
|
|
46
65
|
export declare class ScreenshotConfig {
|
|
@@ -58,6 +77,7 @@ export declare class ScreenshotConfig {
|
|
|
58
77
|
cache?: boolean;
|
|
59
78
|
cache_ttl?: number;
|
|
60
79
|
cache_clear?: boolean;
|
|
80
|
+
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredvision' | VisionDeficiency;
|
|
61
81
|
webhook?: string;
|
|
62
82
|
constructor(options: ScreenshotConfigOptions);
|
|
63
83
|
private validateOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshotconfig.d.ts","sourceRoot":"","sources":["../src/screenshotconfig.ts"],"names":[],"mappings":"AAIA,oBAAY,OAAO;IACjB;;;;;;;QAOI;IACJ,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,MAAM;IAChB;;;;;;;QAOI;IACJ,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,aAAa,GAAG,WAAW,GAAG,eAAe,GAAG,oBAAoB,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,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AE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,aAAa,GAAG,WAAW,GAAG,eAAe,GAAG,oBAAoB,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,gBAAgB,CAAC;IACxH,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEL,OAAO,EAAE,uBAAuB;IA+B5C,OAAO,CAAC,eAAe;IASvB,WAAW,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAyE3D"}
|
package/esm/screenshotconfig.js
CHANGED
|
@@ -31,6 +31,25 @@ export var Format;
|
|
|
31
31
|
Format["WEBP"] = "webp";
|
|
32
32
|
Format["GIF"] = "gif";
|
|
33
33
|
})(Format || (Format = {}));
|
|
34
|
+
export var VisionDeficiency;
|
|
35
|
+
(function (VisionDeficiency) {
|
|
36
|
+
/**
|
|
37
|
+
Simulate vision deficiency for accessibility testing (WCAG compliance)
|
|
38
|
+
Attributes:
|
|
39
|
+
DEUTERANOPIA: Difficulty distinguishing green from red; green appears beige/gray
|
|
40
|
+
PROTANOPIA: Reduced sensitivity to red light; red appears dark/black
|
|
41
|
+
TRITANOPIA: Difficulty distinguishing blue from yellow and violet from red
|
|
42
|
+
ACHROMATOPSIA: Complete inability to perceive color; sees only in grayscale
|
|
43
|
+
REDUCED_CONTRAST: Simulates reduced contrast due to aging, low light, or other factors
|
|
44
|
+
BLURRED_VISION: Simulates uncorrected refractive errors or age-related vision loss
|
|
45
|
+
*/
|
|
46
|
+
VisionDeficiency["DEUTERANOPIA"] = "deuteranopia";
|
|
47
|
+
VisionDeficiency["PROTANOPIA"] = "protanopia";
|
|
48
|
+
VisionDeficiency["TRITANOPIA"] = "tritanopia";
|
|
49
|
+
VisionDeficiency["ACHROMATOPSIA"] = "achromatopsia";
|
|
50
|
+
VisionDeficiency["REDUCED_CONTRAST"] = "reducedContrast";
|
|
51
|
+
VisionDeficiency["BLURRED_VISION"] = "blurredVision";
|
|
52
|
+
})(VisionDeficiency || (VisionDeficiency = {}));
|
|
34
53
|
export class ScreenshotConfig {
|
|
35
54
|
constructor(options) {
|
|
36
55
|
Object.defineProperty(this, "url", {
|
|
@@ -117,6 +136,12 @@ export class ScreenshotConfig {
|
|
|
117
136
|
writable: true,
|
|
118
137
|
value: void 0
|
|
119
138
|
});
|
|
139
|
+
Object.defineProperty(this, "vision_deficiency", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
configurable: true,
|
|
142
|
+
writable: true,
|
|
143
|
+
value: void 0
|
|
144
|
+
});
|
|
120
145
|
Object.defineProperty(this, "webhook", {
|
|
121
146
|
enumerable: true,
|
|
122
147
|
configurable: true,
|
|
@@ -149,6 +174,7 @@ export class ScreenshotConfig {
|
|
|
149
174
|
this.cache = options.cache ?? this.cache;
|
|
150
175
|
this.cache_ttl = options.cache_ttl ?? this.cache_ttl;
|
|
151
176
|
this.cache_clear = options.cache_clear ?? this.cache_clear;
|
|
177
|
+
this.vision_deficiency = options.vision_deficiency ?? this.vision_deficiency;
|
|
152
178
|
this.webhook = options.webhook;
|
|
153
179
|
}
|
|
154
180
|
validateOptions(options) {
|
|
@@ -211,6 +237,9 @@ export class ScreenshotConfig {
|
|
|
211
237
|
log.warn('Params "cache_clear" is ignored. Works only if cache is enabled');
|
|
212
238
|
}
|
|
213
239
|
}
|
|
240
|
+
if (this.vision_deficiency) {
|
|
241
|
+
params.vision_deficiency = this.vision_deficiency;
|
|
242
|
+
}
|
|
214
243
|
if (this.webhook) {
|
|
215
244
|
params.webhook_name = this.webhook;
|
|
216
245
|
}
|
package/package.json
CHANGED
|
@@ -26,6 +26,24 @@ export declare enum Format {
|
|
|
26
26
|
WEBP = "webp",
|
|
27
27
|
GIF = "gif"
|
|
28
28
|
}
|
|
29
|
+
export declare enum VisionDeficiency {
|
|
30
|
+
/**
|
|
31
|
+
Simulate vision deficiency for accessibility testing (WCAG compliance)
|
|
32
|
+
Attributes:
|
|
33
|
+
DEUTERANOPIA: Difficulty distinguishing green from red; green appears beige/gray
|
|
34
|
+
PROTANOPIA: Reduced sensitivity to red light; red appears dark/black
|
|
35
|
+
TRITANOPIA: Difficulty distinguishing blue from yellow and violet from red
|
|
36
|
+
ACHROMATOPSIA: Complete inability to perceive color; sees only in grayscale
|
|
37
|
+
REDUCED_CONTRAST: Simulates reduced contrast due to aging, low light, or other factors
|
|
38
|
+
BLURRED_VISION: Simulates uncorrected refractive errors or age-related vision loss
|
|
39
|
+
*/
|
|
40
|
+
DEUTERANOPIA = "deuteranopia",
|
|
41
|
+
PROTANOPIA = "protanopia",
|
|
42
|
+
TRITANOPIA = "tritanopia",
|
|
43
|
+
ACHROMATOPSIA = "achromatopsia",
|
|
44
|
+
REDUCED_CONTRAST = "reducedContrast",
|
|
45
|
+
BLURRED_VISION = "blurredVision"
|
|
46
|
+
}
|
|
29
47
|
type ScreenshotConfigOptions = {
|
|
30
48
|
url: string;
|
|
31
49
|
format?: 'jpg' | 'png' | 'webp' | 'gif' | Format;
|
|
@@ -41,6 +59,7 @@ type ScreenshotConfigOptions = {
|
|
|
41
59
|
cache?: boolean;
|
|
42
60
|
cache_ttl?: number;
|
|
43
61
|
cache_clear?: boolean;
|
|
62
|
+
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredvision' | VisionDeficiency;
|
|
44
63
|
webhook?: string;
|
|
45
64
|
};
|
|
46
65
|
export declare class ScreenshotConfig {
|
|
@@ -58,6 +77,7 @@ export declare class ScreenshotConfig {
|
|
|
58
77
|
cache?: boolean;
|
|
59
78
|
cache_ttl?: number;
|
|
60
79
|
cache_clear?: boolean;
|
|
80
|
+
vision_deficiency?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'achromatopsia' | 'blurredvision' | VisionDeficiency;
|
|
61
81
|
webhook?: string;
|
|
62
82
|
constructor(options: ScreenshotConfigOptions);
|
|
63
83
|
private validateOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshotconfig.d.ts","sourceRoot":"","sources":["../src/screenshotconfig.ts"],"names":[],"mappings":"AAIA,oBAAY,OAAO;IACjB;;;;;;;QAOI;IACJ,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,MAAM;IAChB;;;;;;;QAOI;IACJ,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,aAAa,GAAG,WAAW,GAAG,eAAe,GAAG,oBAAoB,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACt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,eAAe,GAAG,oBAAoB,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,GAAG,gBAAgB,CAAC;IACxH,OAAO,CAAC,EAAE,MAAM,CAAC;gBAEL,OAAO,EAAE,uBAAuB;IA+B5C,OAAO,CAAC,eAAe;IASvB,WAAW,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAyE3D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScreenshotConfig = exports.Format = exports.Options = void 0;
|
|
3
|
+
exports.ScreenshotConfig = exports.VisionDeficiency = exports.Format = exports.Options = void 0;
|
|
4
4
|
const errors_js_1 = require("./errors.js");
|
|
5
5
|
const utils_js_1 = require("./utils.js");
|
|
6
6
|
const logger_js_1 = require("./logger.js");
|
|
@@ -34,6 +34,25 @@ var Format;
|
|
|
34
34
|
Format["WEBP"] = "webp";
|
|
35
35
|
Format["GIF"] = "gif";
|
|
36
36
|
})(Format || (exports.Format = Format = {}));
|
|
37
|
+
var VisionDeficiency;
|
|
38
|
+
(function (VisionDeficiency) {
|
|
39
|
+
/**
|
|
40
|
+
Simulate vision deficiency for accessibility testing (WCAG compliance)
|
|
41
|
+
Attributes:
|
|
42
|
+
DEUTERANOPIA: Difficulty distinguishing green from red; green appears beige/gray
|
|
43
|
+
PROTANOPIA: Reduced sensitivity to red light; red appears dark/black
|
|
44
|
+
TRITANOPIA: Difficulty distinguishing blue from yellow and violet from red
|
|
45
|
+
ACHROMATOPSIA: Complete inability to perceive color; sees only in grayscale
|
|
46
|
+
REDUCED_CONTRAST: Simulates reduced contrast due to aging, low light, or other factors
|
|
47
|
+
BLURRED_VISION: Simulates uncorrected refractive errors or age-related vision loss
|
|
48
|
+
*/
|
|
49
|
+
VisionDeficiency["DEUTERANOPIA"] = "deuteranopia";
|
|
50
|
+
VisionDeficiency["PROTANOPIA"] = "protanopia";
|
|
51
|
+
VisionDeficiency["TRITANOPIA"] = "tritanopia";
|
|
52
|
+
VisionDeficiency["ACHROMATOPSIA"] = "achromatopsia";
|
|
53
|
+
VisionDeficiency["REDUCED_CONTRAST"] = "reducedContrast";
|
|
54
|
+
VisionDeficiency["BLURRED_VISION"] = "blurredVision";
|
|
55
|
+
})(VisionDeficiency || (exports.VisionDeficiency = VisionDeficiency = {}));
|
|
37
56
|
class ScreenshotConfig {
|
|
38
57
|
constructor(options) {
|
|
39
58
|
Object.defineProperty(this, "url", {
|
|
@@ -120,6 +139,12 @@ class ScreenshotConfig {
|
|
|
120
139
|
writable: true,
|
|
121
140
|
value: void 0
|
|
122
141
|
});
|
|
142
|
+
Object.defineProperty(this, "vision_deficiency", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
configurable: true,
|
|
145
|
+
writable: true,
|
|
146
|
+
value: void 0
|
|
147
|
+
});
|
|
123
148
|
Object.defineProperty(this, "webhook", {
|
|
124
149
|
enumerable: true,
|
|
125
150
|
configurable: true,
|
|
@@ -152,6 +177,7 @@ class ScreenshotConfig {
|
|
|
152
177
|
this.cache = options.cache ?? this.cache;
|
|
153
178
|
this.cache_ttl = options.cache_ttl ?? this.cache_ttl;
|
|
154
179
|
this.cache_clear = options.cache_clear ?? this.cache_clear;
|
|
180
|
+
this.vision_deficiency = options.vision_deficiency ?? this.vision_deficiency;
|
|
155
181
|
this.webhook = options.webhook;
|
|
156
182
|
}
|
|
157
183
|
validateOptions(options) {
|
|
@@ -214,6 +240,9 @@ class ScreenshotConfig {
|
|
|
214
240
|
logger_js_1.log.warn('Params "cache_clear" is ignored. Works only if cache is enabled');
|
|
215
241
|
}
|
|
216
242
|
}
|
|
243
|
+
if (this.vision_deficiency) {
|
|
244
|
+
params.vision_deficiency = this.vision_deficiency;
|
|
245
|
+
}
|
|
217
246
|
if (this.webhook) {
|
|
218
247
|
params.webhook_name = this.webhook;
|
|
219
248
|
}
|