Skip to content

Commit

Permalink
chore: revert aws sdk PR (#28379)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpowell88 authored Nov 21, 2023
1 parent 2877454 commit 9337e4e
Show file tree
Hide file tree
Showing 3 changed files with 596 additions and 1,045 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
"prepare": "husky install"
},
"devDependencies": {
"@aws-sdk/client-s3": "3.450.0",
"@aws-sdk/credential-providers": "3.450.0",
"@aws-sdk/credential-providers": "3.53.0",
"@cypress/questions-remain": "1.0.1",
"@cypress/request": "^3.0.0",
"@cypress/request-promise": "^5.0.0",
Expand Down Expand Up @@ -127,6 +126,7 @@
"@urql/introspection": "^0.3.0",
"ascii-table": "0.0.9",
"autobarrel": "^1.1.0",
"aws-sdk": "2.814.0",
"babel-eslint": "10.1.0",
"bluebird": "3.5.3",
"bluebird-retry": "0.11.0",
Expand Down
24 changes: 11 additions & 13 deletions scripts/binary/s3-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const debug = require('debug')('cypress:binary')
import la from 'lazy-ass'
import is from 'check-more-types'
import { CopyObjectCommandInput, CopyObjectCommandOutput, ObjectCannedACL, S3 } from '@aws-sdk/client-s3'
import S3 from 'aws-sdk/clients/s3'

export const hasOnlyStringValues = (o) => {
return Object.values(o).every((v) => is.unemptyString(v))
Expand All @@ -22,11 +22,9 @@ export const s3helpers = {
}

return new S3({
credentials: {
accessKeyId: aws.accessKeyId,
secretAccessKey: aws.secretAccessKey,
sessionToken: aws.sessionToken,
},
accessKeyId: aws.accessKeyId,
secretAccessKey: aws.secretAccessKey,
sessionToken: aws.sessionToken,
})
},

Expand Down Expand Up @@ -85,12 +83,12 @@ export const s3helpers = {
* and ACL 'public-read'
*/
copyS3 (sourceKey: string, destinationKey: string, bucket: string,
contentType: string, acl: ObjectCannedACL,
s3: S3): Promise<CopyObjectCommandOutput> {
contentType: S3.ContentType, acl: S3.ObjectCannedACL,
s3: S3): Promise<S3.CopyObjectOutput> {
return new Promise((resolve, reject) => {
debug('copying %s in bucket %s to %s', sourceKey, bucket, destinationKey)

const params: CopyObjectCommandInput = {
const params: S3.CopyObjectRequest = {
Bucket: bucket,
CopySource: `${bucket}/${sourceKey}`,
Key: destinationKey,
Expand Down Expand Up @@ -118,7 +116,7 @@ export const s3helpers = {
* but the returned object has these prefixes stripped. Thus if we set
* a single "x-amz-meta-user: gleb", the resolved object will be simply {user: "gleb"}
*/
getUserMetadata (bucket: string, key: string, s3: S3): Promise<Record<string, string>> {
getUserMetadata (bucket: string, key: string, s3: S3): Promise<S3.Metadata> {
return new Promise((resole, reject) => {
debug('getting user metadata from %s %s', bucket, key)

Expand All @@ -141,15 +139,15 @@ export const s3helpers = {
* Setting user metadata can be accomplished with copying the object back onto itself
* with replaced metadata object.
*/
setUserMetadata (bucket: string, key: string, metadata: Record<string, string>,
contentType: string, acl: ObjectCannedACL, s3: S3): Promise<CopyObjectCommandOutput> {
setUserMetadata (bucket: string, key: string, metadata: S3.Metadata,
contentType: S3.ContentType, acl: S3.ObjectCannedACL, s3: S3): Promise<S3.CopyObjectOutput> {
la(hasOnlyStringValues(metadata),
'metadata object can only have string values', metadata)

return new Promise((resolve, reject) => {
debug('setting metadata to %o for %s %s', metadata, bucket, key)

const params: CopyObjectCommandInput = {
const params: S3.CopyObjectRequest = {
Bucket: bucket,
CopySource: `${bucket}/${key}`,
Key: key,
Expand Down
Loading

5 comments on commit 9337e4e

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9337e4e Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.6.0/linux-x64/develop-9337e4e1e00b9455b50d42757a577459ad6829a3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9337e4e Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.6.0/linux-arm64/develop-9337e4e1e00b9455b50d42757a577459ad6829a3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9337e4e Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.6.0/darwin-x64/develop-9337e4e1e00b9455b50d42757a577459ad6829a3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9337e4e Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.6.0/darwin-arm64/develop-9337e4e1e00b9455b50d42757a577459ad6829a3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9337e4e Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.6.0/win32-x64/develop-9337e4e1e00b9455b50d42757a577459ad6829a3/cypress.tgz

Please sign in to comment.