From b4c34b77d749543515d56d1c4e97a8d1f78caa75 Mon Sep 17 00:00:00 2001 From: panda2134 Date: Tue, 17 May 2022 00:41:30 +0800 Subject: [PATCH 1/5] feat: custom endpoint for aws --- .../upload-file/providers/aws-provider.ts | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/features/upload-file/providers/aws-provider.ts b/src/features/upload-file/providers/aws-provider.ts index c1faf80..4eb7df2 100644 --- a/src/features/upload-file/providers/aws-provider.ts +++ b/src/features/upload-file/providers/aws-provider.ts @@ -1,6 +1,6 @@ import fs from 'fs' // eslint-disable-next-line import/no-extraneous-dependencies -import { S3 } from 'aws-sdk' +import { S3, Endpoint } from 'aws-sdk' import { UploadedFile } from 'adminjs' import { ERROR_MESSAGES, DAY_IN_MINUTES } from '../constants' @@ -29,6 +29,11 @@ export type AWSOptions = { * S3 Bucket where files will be stored */ bucket: string; + /** + * The endpoint URI to send requests to. + * The default endpoint is built from the configured region. + */ + endpoint?: string | Endpoint; /** * indicates how long links should be available after page load (in minutes). * Default to 24h. If set to 0 adapter will mark uploaded files as PUBLIC ACL. @@ -36,11 +41,16 @@ export type AWSOptions = { expires?: number; } +/** + * Generic S3 Provider for S3-compatible Object Storage Services, like Tencent Cloud COS. + */ export class AWSProvider extends BaseProvider { private s3: S3 public expires: number + public endpoint?: Endpoint + constructor(options: AWSOptions) { super(options.bucket) @@ -52,8 +62,14 @@ export class AWSProvider extends BaseProvider { } catch (error) { throw new Error(ERROR_MESSAGES.NO_AWS_SDK) } - this.expires = options.expires ?? DAY_IN_MINUTES - this.s3 = new AWS_S3(options) + const newOptions = options + if (typeof newOptions.endpoint === 'string') { + // convert into Endpoint object + newOptions.endpoint = new Endpoint(newOptions.endpoint) + } + this.expires = newOptions.expires ?? DAY_IN_MINUTES + this.endpoint = newOptions.endpoint + this.s3 = new AWS_S3(newOptions) } public async upload(file: UploadedFile, key: string): Promise { @@ -82,7 +98,15 @@ export class AWSProvider extends BaseProvider { Expires: this.expires, }) } - // https://bucket.s3.amazonaws.com/key - return `https://${bucket}.s3.amazonaws.com/${key}` + + let keyedPath: string + + if (this.endpoint) { + keyedPath = `${this.endpoint.protocol}://${this.endpoint.host}/${key}` + } else { + // https://bucket.s3.amazonaws.com/key + keyedPath = `https://${bucket}.s3.amazonaws.com/${key}` + } + return keyedPath } } From 1b4a31270d0a4cb7bde9e862972d937015740905 Mon Sep 17 00:00:00 2001 From: panda2134 Date: Thu, 19 May 2022 19:16:06 +0800 Subject: [PATCH 2/5] feat: custom record key func allows the user to specify a function for calculating `key` field in the database. if the `recordPath` property is set, on-the-fly path calculation at frontend is disabled, and the function is then used to calculate `key` in the database. --- package.json | 4 +-- .../factories/update-record-factory.ts | 11 ++++---- .../upload-file/types/upload-options.type.ts | 9 +++++-- .../upload-file/utils/build-remote-path.ts | 6 ++--- .../utils/fill-record-with-path.ts | 25 +++++++++++-------- yarn.lock | 18 ++++++------- 6 files changed, 42 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index e5e9a8a..99ebbd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adminjs/upload", - "version": "2.0.2", + "version": "2.0.2-dev2", "main": "index.js", "types": "types/index.d.ts", "private": false, @@ -25,7 +25,7 @@ }, "optionalDependencies": { "@google-cloud/storage": "^5.3.0", - "aws-sdk": "^2.728.0" + "aws-sdk": "^2.1135.0" }, "devDependencies": { "@commitlint/cli": "^8.3.5", diff --git a/src/features/upload-file/factories/update-record-factory.ts b/src/features/upload-file/factories/update-record-factory.ts index d684baa..17302d8 100644 --- a/src/features/upload-file/factories/update-record-factory.ts +++ b/src/features/upload-file/factories/update-record-factory.ts @@ -17,7 +17,7 @@ export const updateRecordFactory = ( uploadOptionsWithDefault: UploadOptionsWithDefault, provider: BaseProvider, ): After => { - const { properties, uploadPath, multiple } = uploadOptionsWithDefault + const { properties, uploadPath, recordPath, multiple } = uploadOptionsWithDefault const updateRecord = async ( response: RecordActionResponse, @@ -110,12 +110,13 @@ export const updateRecordFactory = ( const uploadedFile: UploadedFile = files[0] const oldRecordParams = { ...record.params } - const key = buildRemotePath(record, uploadedFile, uploadPath) + const remoteKey = buildRemotePath(record, uploadedFile, uploadPath) + const recordKey = recordPath ? buildRemotePath(record, uploadedFile, recordPath) : remoteKey - await provider.upload(uploadedFile, key, context) + await provider.upload(uploadedFile, remoteKey, context) const params = { - [properties.key]: key, + [properties.key]: recordKey, ...properties.bucket && { [properties.bucket]: provider.bucket }, ...properties.size && { [properties.size]: uploadedFile.size?.toString() }, ...properties.mimeType && { [properties.mimeType]: uploadedFile.type }, @@ -129,7 +130,7 @@ export const updateRecordFactory = ( properties.bucket && oldRecordParams[properties.bucket] ) || provider.bucket - if (oldKey && oldBucket && (oldKey !== key || oldBucket !== provider.bucket)) { + if (oldKey && oldBucket && (oldKey !== remoteKey || oldBucket !== provider.bucket)) { await provider.delete(oldKey, oldBucket, context) } diff --git a/src/features/upload-file/types/upload-options.type.ts b/src/features/upload-file/types/upload-options.type.ts index b6c6c3d..6640814 100644 --- a/src/features/upload-file/types/upload-options.type.ts +++ b/src/features/upload-file/types/upload-options.type.ts @@ -67,7 +67,12 @@ export type UploadOptions = { * Function which defines where the file should be placed inside the bucket. * Default to `${record.id()}/${filename}`. */ - uploadPath?: UploadPathFunction; + uploadPath?: UploadOrRecordPathFunction; + /** + * Function which defines what the path should be inside of the record. + * Default to `${record.id()}/${filename}`. + */ + recordPath?: UploadOrRecordPathFunction; /** * Indicates if feature should handle uploading multiple files */ @@ -109,7 +114,7 @@ export type FeatureInvocation = { * @memberof module:@adminjs/upload * @alias UploadPathFunction */ -export type UploadPathFunction = ( +export type UploadOrRecordPathFunction = ( /** * Record for which file is uploaded */ diff --git a/src/features/upload-file/utils/build-remote-path.ts b/src/features/upload-file/utils/build-remote-path.ts index 91f658c..cf35ecc 100644 --- a/src/features/upload-file/utils/build-remote-path.ts +++ b/src/features/upload-file/utils/build-remote-path.ts @@ -1,7 +1,7 @@ import path from 'path' import { BaseRecord, UploadedFile } from 'adminjs' import { ERROR_MESSAGES } from '../constants' -import { UploadPathFunction } from '../types/upload-options.type' +import { UploadOrRecordPathFunction } from '../types/upload-options.type' /** * Creates a path to the file. Related to the given provider. If it is an AWS @@ -9,7 +9,7 @@ import { UploadPathFunction } from '../types/upload-options.type' * * @param {BaseRecord} record * @param {UploadedFile} file uploaded file - * @param {UploadPathFunction} [pathFunction] + * @param {UploadOrRecordPathFunction} [pathFunction] * * @return {string} * @private @@ -17,7 +17,7 @@ import { UploadPathFunction } from '../types/upload-options.type' export const buildRemotePath = ( record: BaseRecord, file: UploadedFile, - uploadPathFunction?: UploadPathFunction, + uploadPathFunction?: UploadOrRecordPathFunction, ): string => { if (!record.id()) { throw new Error(ERROR_MESSAGES.NO_PERSISTENT_RECORD_UPLOAD) diff --git a/src/features/upload-file/utils/fill-record-with-path.ts b/src/features/upload-file/utils/fill-record-with-path.ts index 347b959..2828ae3 100644 --- a/src/features/upload-file/utils/fill-record-with-path.ts +++ b/src/features/upload-file/utils/fill-record-with-path.ts @@ -8,22 +8,27 @@ export const fillRecordWithPath = async ( uploadOptionsWithDefault: UploadOptionsWithDefault, provider: BaseProvider, ): Promise => { - const { properties, multiple } = uploadOptionsWithDefault + const { properties, multiple, recordPath } = uploadOptionsWithDefault const key = flat.get(record?.params, properties.key) const storedBucket = properties.bucket && flat.get(record?.params, properties.bucket) let filePath: string | Array | undefined - if (multiple && key && key.length) { - filePath = await Promise.all(key.map(async (singleKey, index) => ( - provider.path( - singleKey, storedBucket?.[index] ?? provider.bucket, context, + if (!recordPath) { + if (multiple && key && key.length) { + filePath = await Promise.all(key.map(async (singleKey, index) => ( + provider.path( + singleKey, storedBucket?.[index] ?? provider.bucket, context, + ) + ))) + } else if (!multiple && key) { + filePath = await provider.path( + key, storedBucket ?? provider.bucket, context, ) - ))) - } else if (!multiple && key) { - filePath = await provider.path( - key, storedBucket ?? provider.bucket, context, - ) + } + } else { + // disable calculation on-the-fly, and use recordPath instead + filePath = key } return { diff --git a/yarn.lock b/yarn.lock index 9bdd053..d88a965 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2250,15 +2250,15 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -aws-sdk@^2.728.0: - version "2.746.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.746.0.tgz#19f2b8d5d628774030ae184b9e59a67bb9de1f63" - integrity sha512-TMa/jxS2AHuZqAYNyv0X+Ltjt2NebjraT7xdL6NqKUiu0U61j0uav+gr2zw9lkz5q+KeTeYo7pg+S9LXVawHXw== +aws-sdk@^2.1135.0: + version "2.1135.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1135.0.tgz#8c14aa6894be529cb5fb7b6d19f3dc70e4f35816" + integrity sha512-bl9n4QgrEh52hmQ+Jo76BgJXM/p+PwfVZvImEQHFeel/33H/PDLcTJquEw5bzxM1HRNI24iH+FNPwyWLMrttTw== dependencies: buffer "4.9.2" events "1.1.1" ieee754 "1.1.13" - jmespath "0.15.0" + jmespath "0.16.0" querystring "0.2.0" sax "1.2.1" url "0.10.3" @@ -5081,10 +5081,10 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jmespath@0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" - integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc= +jmespath@0.16.0: + version "0.16.0" + resolved "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" + integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" From 349f5fa2f61453b6c5a08b38692189dca6314ecb Mon Sep 17 00:00:00 2001 From: panda2134 Date: Thu, 19 May 2022 21:33:58 +0800 Subject: [PATCH 3/5] Revert "feat: custom record key func" This reverts commit 1b4a31270d0a4cb7bde9e862972d937015740905. --- package.json | 4 +-- .../factories/update-record-factory.ts | 11 ++++---- .../upload-file/types/upload-options.type.ts | 9 ++----- .../upload-file/utils/build-remote-path.ts | 6 ++--- .../utils/fill-record-with-path.ts | 25 ++++++++----------- yarn.lock | 18 ++++++------- 6 files changed, 31 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 99ebbd9..e5e9a8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adminjs/upload", - "version": "2.0.2-dev2", + "version": "2.0.2", "main": "index.js", "types": "types/index.d.ts", "private": false, @@ -25,7 +25,7 @@ }, "optionalDependencies": { "@google-cloud/storage": "^5.3.0", - "aws-sdk": "^2.1135.0" + "aws-sdk": "^2.728.0" }, "devDependencies": { "@commitlint/cli": "^8.3.5", diff --git a/src/features/upload-file/factories/update-record-factory.ts b/src/features/upload-file/factories/update-record-factory.ts index 17302d8..d684baa 100644 --- a/src/features/upload-file/factories/update-record-factory.ts +++ b/src/features/upload-file/factories/update-record-factory.ts @@ -17,7 +17,7 @@ export const updateRecordFactory = ( uploadOptionsWithDefault: UploadOptionsWithDefault, provider: BaseProvider, ): After => { - const { properties, uploadPath, recordPath, multiple } = uploadOptionsWithDefault + const { properties, uploadPath, multiple } = uploadOptionsWithDefault const updateRecord = async ( response: RecordActionResponse, @@ -110,13 +110,12 @@ export const updateRecordFactory = ( const uploadedFile: UploadedFile = files[0] const oldRecordParams = { ...record.params } - const remoteKey = buildRemotePath(record, uploadedFile, uploadPath) - const recordKey = recordPath ? buildRemotePath(record, uploadedFile, recordPath) : remoteKey + const key = buildRemotePath(record, uploadedFile, uploadPath) - await provider.upload(uploadedFile, remoteKey, context) + await provider.upload(uploadedFile, key, context) const params = { - [properties.key]: recordKey, + [properties.key]: key, ...properties.bucket && { [properties.bucket]: provider.bucket }, ...properties.size && { [properties.size]: uploadedFile.size?.toString() }, ...properties.mimeType && { [properties.mimeType]: uploadedFile.type }, @@ -130,7 +129,7 @@ export const updateRecordFactory = ( properties.bucket && oldRecordParams[properties.bucket] ) || provider.bucket - if (oldKey && oldBucket && (oldKey !== remoteKey || oldBucket !== provider.bucket)) { + if (oldKey && oldBucket && (oldKey !== key || oldBucket !== provider.bucket)) { await provider.delete(oldKey, oldBucket, context) } diff --git a/src/features/upload-file/types/upload-options.type.ts b/src/features/upload-file/types/upload-options.type.ts index 6640814..b6c6c3d 100644 --- a/src/features/upload-file/types/upload-options.type.ts +++ b/src/features/upload-file/types/upload-options.type.ts @@ -67,12 +67,7 @@ export type UploadOptions = { * Function which defines where the file should be placed inside the bucket. * Default to `${record.id()}/${filename}`. */ - uploadPath?: UploadOrRecordPathFunction; - /** - * Function which defines what the path should be inside of the record. - * Default to `${record.id()}/${filename}`. - */ - recordPath?: UploadOrRecordPathFunction; + uploadPath?: UploadPathFunction; /** * Indicates if feature should handle uploading multiple files */ @@ -114,7 +109,7 @@ export type FeatureInvocation = { * @memberof module:@adminjs/upload * @alias UploadPathFunction */ -export type UploadOrRecordPathFunction = ( +export type UploadPathFunction = ( /** * Record for which file is uploaded */ diff --git a/src/features/upload-file/utils/build-remote-path.ts b/src/features/upload-file/utils/build-remote-path.ts index cf35ecc..91f658c 100644 --- a/src/features/upload-file/utils/build-remote-path.ts +++ b/src/features/upload-file/utils/build-remote-path.ts @@ -1,7 +1,7 @@ import path from 'path' import { BaseRecord, UploadedFile } from 'adminjs' import { ERROR_MESSAGES } from '../constants' -import { UploadOrRecordPathFunction } from '../types/upload-options.type' +import { UploadPathFunction } from '../types/upload-options.type' /** * Creates a path to the file. Related to the given provider. If it is an AWS @@ -9,7 +9,7 @@ import { UploadOrRecordPathFunction } from '../types/upload-options.type' * * @param {BaseRecord} record * @param {UploadedFile} file uploaded file - * @param {UploadOrRecordPathFunction} [pathFunction] + * @param {UploadPathFunction} [pathFunction] * * @return {string} * @private @@ -17,7 +17,7 @@ import { UploadOrRecordPathFunction } from '../types/upload-options.type' export const buildRemotePath = ( record: BaseRecord, file: UploadedFile, - uploadPathFunction?: UploadOrRecordPathFunction, + uploadPathFunction?: UploadPathFunction, ): string => { if (!record.id()) { throw new Error(ERROR_MESSAGES.NO_PERSISTENT_RECORD_UPLOAD) diff --git a/src/features/upload-file/utils/fill-record-with-path.ts b/src/features/upload-file/utils/fill-record-with-path.ts index 2828ae3..347b959 100644 --- a/src/features/upload-file/utils/fill-record-with-path.ts +++ b/src/features/upload-file/utils/fill-record-with-path.ts @@ -8,27 +8,22 @@ export const fillRecordWithPath = async ( uploadOptionsWithDefault: UploadOptionsWithDefault, provider: BaseProvider, ): Promise => { - const { properties, multiple, recordPath } = uploadOptionsWithDefault + const { properties, multiple } = uploadOptionsWithDefault const key = flat.get(record?.params, properties.key) const storedBucket = properties.bucket && flat.get(record?.params, properties.bucket) let filePath: string | Array | undefined - if (!recordPath) { - if (multiple && key && key.length) { - filePath = await Promise.all(key.map(async (singleKey, index) => ( - provider.path( - singleKey, storedBucket?.[index] ?? provider.bucket, context, - ) - ))) - } else if (!multiple && key) { - filePath = await provider.path( - key, storedBucket ?? provider.bucket, context, + if (multiple && key && key.length) { + filePath = await Promise.all(key.map(async (singleKey, index) => ( + provider.path( + singleKey, storedBucket?.[index] ?? provider.bucket, context, ) - } - } else { - // disable calculation on-the-fly, and use recordPath instead - filePath = key + ))) + } else if (!multiple && key) { + filePath = await provider.path( + key, storedBucket ?? provider.bucket, context, + ) } return { diff --git a/yarn.lock b/yarn.lock index d88a965..9bdd053 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2250,15 +2250,15 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -aws-sdk@^2.1135.0: - version "2.1135.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1135.0.tgz#8c14aa6894be529cb5fb7b6d19f3dc70e4f35816" - integrity sha512-bl9n4QgrEh52hmQ+Jo76BgJXM/p+PwfVZvImEQHFeel/33H/PDLcTJquEw5bzxM1HRNI24iH+FNPwyWLMrttTw== +aws-sdk@^2.728.0: + version "2.746.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.746.0.tgz#19f2b8d5d628774030ae184b9e59a67bb9de1f63" + integrity sha512-TMa/jxS2AHuZqAYNyv0X+Ltjt2NebjraT7xdL6NqKUiu0U61j0uav+gr2zw9lkz5q+KeTeYo7pg+S9LXVawHXw== dependencies: buffer "4.9.2" events "1.1.1" ieee754 "1.1.13" - jmespath "0.16.0" + jmespath "0.15.0" querystring "0.2.0" sax "1.2.1" url "0.10.3" @@ -5081,10 +5081,10 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jmespath@0.16.0: - version "0.16.0" - resolved "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" - integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== +jmespath@0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" + integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc= "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" From 716b8cbff36a5fba2a7da07edd4821bbab90786e Mon Sep 17 00:00:00 2001 From: panda2134 Date: Thu, 19 May 2022 21:48:04 +0800 Subject: [PATCH 4/5] fix: protocol concat error --- src/features/upload-file/providers/aws-provider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/upload-file/providers/aws-provider.ts b/src/features/upload-file/providers/aws-provider.ts index 4eb7df2..785bfd6 100644 --- a/src/features/upload-file/providers/aws-provider.ts +++ b/src/features/upload-file/providers/aws-provider.ts @@ -32,6 +32,7 @@ export type AWSOptions = { /** * The endpoint URI to send requests to. * The default endpoint is built from the configured region. + * Note that `bucket` should not appear in `endpoint`. */ endpoint?: string | Endpoint; /** @@ -102,7 +103,8 @@ export class AWSProvider extends BaseProvider { let keyedPath: string if (this.endpoint) { - keyedPath = `${this.endpoint.protocol}://${this.endpoint.host}/${key}` + // NOTE: protocal contains a trailing ':' ! + keyedPath = `${this.endpoint.protocol}//${bucket}.${this.endpoint.host}/${key}` } else { // https://bucket.s3.amazonaws.com/key keyedPath = `https://${bucket}.s3.amazonaws.com/${key}` From 3d116af7b7ac117dbfeb7541a1fc3d62366ae0e0 Mon Sep 17 00:00:00 2001 From: panda2134 Date: Thu, 19 May 2022 22:01:01 +0800 Subject: [PATCH 5/5] chore(bump): aws-sdk to 2.1138.0 --- package.json | 6 +++--- yarn.lock | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index e5e9a8a..992c5d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adminjs/upload", - "version": "2.0.2", + "version": "2.0.2-dev3", "main": "index.js", "types": "types/index.d.ts", "private": false, @@ -25,7 +25,7 @@ }, "optionalDependencies": { "@google-cloud/storage": "^5.3.0", - "aws-sdk": "^2.728.0" + "aws-sdk": "^2.1138.0" }, "devDependencies": { "@commitlint/cli": "^8.3.5", @@ -39,7 +39,7 @@ "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^3.7.0", "adminjs": "^5.0.0", - "aws-sdk": "^2.728.0", + "aws-sdk": "^2.1138.0", "chai": "^4.2.0", "eslint": "^7.5.0", "eslint-config-airbnb": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index 9bdd053..2b8c99f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2250,15 +2250,15 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -aws-sdk@^2.728.0: - version "2.746.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.746.0.tgz#19f2b8d5d628774030ae184b9e59a67bb9de1f63" - integrity sha512-TMa/jxS2AHuZqAYNyv0X+Ltjt2NebjraT7xdL6NqKUiu0U61j0uav+gr2zw9lkz5q+KeTeYo7pg+S9LXVawHXw== +aws-sdk@^2.1138.0: + version "2.1138.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1138.0.tgz#5975e028807a327e0900075de6a054fdd939a1f0" + integrity sha512-81Bs7qVf1/NrZBDCVIPpynODNN8fvXLdbsK024VITKFjts6DpvWjWPCsRYvEtaksF6uypMx5D02nTYJ8RiXq9w== dependencies: buffer "4.9.2" events "1.1.1" ieee754 "1.1.13" - jmespath "0.15.0" + jmespath "0.16.0" querystring "0.2.0" sax "1.2.1" url "0.10.3" @@ -5081,10 +5081,10 @@ jest-worker@^26.0.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jmespath@0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" - integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc= +jmespath@0.16.0: + version "0.16.0" + resolved "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" + integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0"