screenshotone-api-sdk 1.1.3 → 1.1.5
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/@types/main.d.ts +8 -0
- package/dist/main.js +14 -0
- package/dist/signature.js +3 -1
- package/package.json +1 -1
- package/src/main.ts +18 -0
- package/src/signature.ts +4 -1
package/dist/@types/main.d.ts
CHANGED
|
@@ -528,6 +528,14 @@ export declare class AnimateOptions {
|
|
|
528
528
|
* Make sure you configured access to S3.
|
|
529
529
|
*/
|
|
530
530
|
store(store: boolean): AnimateOptions;
|
|
531
|
+
/**
|
|
532
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
533
|
+
*/
|
|
534
|
+
storageAccessKeyId(accessKeyId: string): AnimateOptions;
|
|
535
|
+
/**
|
|
536
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
537
|
+
*/
|
|
538
|
+
storageSecretAccessKey(secretAccessKey: string): AnimateOptions;
|
|
531
539
|
/**
|
|
532
540
|
* The parameter is required if you set store=true.
|
|
533
541
|
* You must specify the key for the file, but don’t specify an extension,
|
package/dist/main.js
CHANGED
|
@@ -935,6 +935,20 @@ class AnimateOptions {
|
|
|
935
935
|
this.put("store", store ? "true" : "false");
|
|
936
936
|
return this;
|
|
937
937
|
}
|
|
938
|
+
/**
|
|
939
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
940
|
+
*/
|
|
941
|
+
storageAccessKeyId(accessKeyId) {
|
|
942
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
943
|
+
return this;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
947
|
+
*/
|
|
948
|
+
storageSecretAccessKey(secretAccessKey) {
|
|
949
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
950
|
+
return this;
|
|
951
|
+
}
|
|
938
952
|
/**
|
|
939
953
|
* The parameter is required if you set store=true.
|
|
940
954
|
* You must specify the key for the file, but don’t specify an extension,
|
package/dist/signature.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.signQueryString = void 0;
|
|
|
4
4
|
const webcrypto_1 = require("@peculiar/webcrypto");
|
|
5
5
|
const encoder = new TextEncoder();
|
|
6
6
|
async function signQueryString(queryString, secretKey) {
|
|
7
|
-
const webCrypto =
|
|
7
|
+
const webCrypto = typeof globalThis.crypto !== "undefined"
|
|
8
|
+
? globalThis.crypto
|
|
9
|
+
: new webcrypto_1.Crypto();
|
|
8
10
|
let algorithm = { name: "HMAC", hash: "SHA-256" };
|
|
9
11
|
let key = await webCrypto.subtle.importKey("raw", encoder.encode(secretKey), algorithm, false, ["sign", "verify"]);
|
|
10
12
|
const digest = await webCrypto.subtle.sign(algorithm.name, key, encoder.encode(queryString));
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -1188,6 +1188,24 @@ export class AnimateOptions {
|
|
|
1188
1188
|
return this;
|
|
1189
1189
|
}
|
|
1190
1190
|
|
|
1191
|
+
/**
|
|
1192
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
1193
|
+
*/
|
|
1194
|
+
storageAccessKeyId(accessKeyId: string): AnimateOptions {
|
|
1195
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
1196
|
+
|
|
1197
|
+
return this
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
1202
|
+
*/
|
|
1203
|
+
storageSecretAccessKey(secretAccessKey: string): AnimateOptions {
|
|
1204
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
1205
|
+
|
|
1206
|
+
return this
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1191
1209
|
/**
|
|
1192
1210
|
* The parameter is required if you set store=true.
|
|
1193
1211
|
* You must specify the key for the file, but don’t specify an extension,
|
package/src/signature.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { Crypto } from "@peculiar/webcrypto";
|
|
|
3
3
|
const encoder = new TextEncoder();
|
|
4
4
|
|
|
5
5
|
export async function signQueryString(queryString: string, secretKey: string) {
|
|
6
|
-
const webCrypto =
|
|
6
|
+
const webCrypto =
|
|
7
|
+
typeof globalThis.crypto !== "undefined"
|
|
8
|
+
? globalThis.crypto
|
|
9
|
+
: new Crypto();
|
|
7
10
|
|
|
8
11
|
let algorithm = { name: "HMAC", hash: "SHA-256" };
|
|
9
12
|
let key = await webCrypto.subtle.importKey(
|