Skip to content

Commit

Permalink
Improve storage options
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Nov 22, 2023
1 parent 0623222 commit 4446c6b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
32 changes: 29 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1194,7 +1220,7 @@ export class AnimateOptions {
storageAccessKeyId(accessKeyId: string): AnimateOptions {
this.put("storage_access_key_id", accessKeyId);

return this
return this;
}

/**
Expand All @@ -1203,7 +1229,7 @@ export class AnimateOptions {
storageSecretAccessKey(secretAccessKey: string): AnimateOptions {
this.put("storage_secret_access_key", secretAccessKey);

return this
return this;
}

/**
Expand Down

0 comments on commit 4446c6b

Please sign in to comment.