screenshotone-api-sdk
Advanced tools
Comparing version 1.0.27 to 1.0.29
@@ -47,2 +47,9 @@ /** | ||
animate(options: AnimateOptions): Promise<Blob>; | ||
/** | ||
* Generates an animated screenshot and return the image blob. | ||
* | ||
* @param options | ||
* @returns | ||
*/ | ||
store(options: AnimateOptions | TakeOptions, path: string, bucket?: string, acl?: "public-read" | "", storageClass?: string): Promise<void>; | ||
} | ||
@@ -196,2 +203,6 @@ /** | ||
/** | ||
* Blocks banners by heuristics. | ||
*/ | ||
blockBannersByHeuristics(block: boolean): TakeOptions; | ||
/** | ||
* Blocks cookie banners. | ||
@@ -285,2 +296,3 @@ */ | ||
storagePath(path: string): TakeOptions; | ||
storageACL(acl: string): TakeOptions; | ||
/** | ||
@@ -514,2 +526,3 @@ * You can override the default bucket you configured with storage_bucket=<bucket name>. | ||
storageClass(storageClass: string): AnimateOptions; | ||
storageACL(acl: string): AnimateOptions; | ||
/** | ||
@@ -516,0 +529,0 @@ * Sets animation duration. |
@@ -126,2 +126,25 @@ "use strict"; | ||
} | ||
/** | ||
* Generates an animated screenshot and return the image blob. | ||
* | ||
* @param options | ||
* @returns | ||
*/ | ||
async store(options, path, bucket, acl, storageClass) { | ||
options | ||
.store(true) | ||
.storagePath(path); | ||
if (bucket) { | ||
options.storageBucket(bucket); | ||
} | ||
if (acl) { | ||
options.storageACL(acl); | ||
} | ||
if (storageClass) { | ||
options.storageClass(storageClass); | ||
} | ||
const url = (options instanceof TakeOptions) | ||
? this.generateSignedTakeURL(options) | ||
: this.generateSignedAnimateURL(options); | ||
} | ||
} | ||
@@ -373,2 +396,9 @@ exports.Client = Client; | ||
/** | ||
* Blocks banners by heuristics. | ||
*/ | ||
blockBannersByHeuristics(block) { | ||
this.put("block_banners_by_heuristics", block ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Blocks cookie banners. | ||
@@ -519,2 +549,6 @@ */ | ||
} | ||
storageACL(acl) { | ||
this.put("storage_acl", acl); | ||
return this; | ||
} | ||
/** | ||
@@ -899,2 +933,6 @@ * You can override the default bucket you configured with storage_bucket=<bucket name>. | ||
} | ||
storageACL(acl) { | ||
this.put("storage_acl", acl); | ||
return this; | ||
} | ||
/** | ||
@@ -901,0 +939,0 @@ * Sets animation duration. |
{ | ||
"name": "screenshotone-api-sdk", | ||
"homepage": "https://screenshotone.com", | ||
"version": "1.0.27", | ||
"version": "1.0.29", | ||
"description": "Use ScreenshotOne.com API to generate screenshots of any website.", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -117,2 +117,28 @@ import * as crypto from 'crypto'; | ||
} | ||
/** | ||
* Generates an animated screenshot and return the image blob. | ||
* | ||
* @param options | ||
* @returns | ||
*/ | ||
async store(options: AnimateOptions | TakeOptions, path: string, bucket?: string, acl?: "public-read" | "", storageClass?: string) { | ||
options | ||
.store(true) | ||
.storagePath(path); | ||
if (bucket) { | ||
options.storageBucket(bucket); | ||
} | ||
if (acl) { | ||
options.storageACL(acl); | ||
} | ||
if (storageClass) { | ||
options.storageClass(storageClass) | ||
} | ||
const url = (options instanceof TakeOptions) | ||
? this.generateSignedTakeURL(options) | ||
: this.generateSignedAnimateURL(options); | ||
} | ||
} | ||
@@ -427,2 +453,11 @@ | ||
/** | ||
* Blocks banners by heuristics. | ||
*/ | ||
blockBannersByHeuristics(block: boolean): TakeOptions { | ||
this.put("block_banners_by_heuristics", block ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Blocks cookie banners. | ||
@@ -612,2 +647,8 @@ */ | ||
storageACL(acl: string): TakeOptions { | ||
this.put("storage_acl", acl); | ||
return this; | ||
} | ||
/** | ||
@@ -1088,2 +1129,8 @@ * You can override the default bucket you configured with storage_bucket=<bucket name>. | ||
storageACL(acl: string): AnimateOptions { | ||
this.put("storage_acl", acl); | ||
return this; | ||
} | ||
/** | ||
@@ -1090,0 +1137,0 @@ * Sets animation duration. |
90706
2476