diff --git a/package.json b/package.json index 13a9141..15e0c04 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "screenshotone-api-sdk", "homepage": "https://screenshotone.com", - "version": "1.1.5", + "version": "1.1.6", "description": "Use ScreenshotOne.com API to generate screenshots of any website.", "repository": { "type": "git", diff --git a/src/main.ts b/src/main.ts index 408b80a..b182ac3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -139,7 +139,9 @@ export class Client { path: string, bucket?: string, acl?: "public-read" | "", - storageClass?: string + storageClass?: string, + accessKeyId?: string, + secretAccessKey?: string, ): Promise<{ bucket: string | null; key: string | null }> { options.store(true).storagePath(path).responseType("empty"); @@ -152,6 +154,12 @@ export class Client { if (storageClass) { options.storageClass(storageClass); } + if (accessKeyId) { + options.storageAccessKeyId(accessKeyId) + } + if (secretAccessKey) { + options.storageSecretAccessKey(secretAccessKey) + } const url = options instanceof TakeOptions @@ -724,6 +732,24 @@ export class TakeOptions { return this; } + /** + * Access key ID. It overrides the one specified in the dashboard configuration. + */ + storageAccessKeyId(accessKeyId: string): TakeOptions { + this.put("storage_access_key_id", accessKeyId); + + return this; + } + + /** + * Secret access key. It overrides the one specified in the dashboard configuration. + */ + storageSecretAccessKey(secretAccessKey: string): TakeOptions { + this.put("storage_secret_access_key", secretAccessKey); + + return this; + } + /** * Storage class allows you to specify the object storage class. */ @@ -1194,7 +1220,7 @@ export class AnimateOptions { storageAccessKeyId(accessKeyId: string): AnimateOptions { this.put("storage_access_key_id", accessKeyId); - return this + return this; } /** @@ -1203,7 +1229,7 @@ export class AnimateOptions { storageSecretAccessKey(secretAccessKey: string): AnimateOptions { this.put("storage_secret_access_key", secretAccessKey); - return this + return this; } /**