Skip to content

Commit

Permalink
chore: removed unused lines
Browse files Browse the repository at this point in the history
  • Loading branch information
msudgh committed Jan 28, 2024
1 parent 661d38b commit cedc950
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 28 deletions.
11 changes: 0 additions & 11 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ import { ZodError } from 'zod'

import { Storage } from './schemas/input'

// can be removed if not needed
export class InvalidOptionsError extends Error {
constructor(message: string) {
super(message)
this.name = 'InvalidOptionsError'
this.message = message

console.error('InvalidOptionsError')
}
}

export class InvalidConfigError extends Error {
constructor(message: string, issues: ZodError) {
super(message)
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class SyncCloudStorage implements ServerlessPlugin {
* const client = this.getS3Client()
*/
getS3Client(): S3Client {
console.log('getS3Client called')
const provider = this.serverless.getProvider('aws')
const credentials = getCredentials(provider)
const endpoint = this.config.syncCloudStorage.offline
Expand Down Expand Up @@ -161,7 +160,6 @@ class SyncCloudStorage implements ServerlessPlugin {
const updatedMetadata = await Promise.allSettled(
this._storages.map((bucket) => syncMetadata(this.client, bucket))
)
console.log('updatedMetadata', updatedMetadata)

return updatedMetadata
}
Expand Down
2 changes: 0 additions & 2 deletions src/providers/s3/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
ListBucketsCommand,
MetadataDirective,
PutBucketAclCommand,
// PutBucketAclCommand,
PutBucketTaggingCommand,
S3Client,
_Object,
Expand Down Expand Up @@ -169,7 +168,6 @@ export const syncMetadata = async (
: file.Key,
})
)
console.log('headCommand', headCommand)

syncedMetadata.push({
Key: file.Key,
Expand Down
4 changes: 0 additions & 4 deletions src/providers/s3/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export const uploadObjects = async (
Bucket: storage.name,
Key: fileToUpload.Key,
Body: fs.createReadStream(fileToUpload.LocalPath),
// ACL: storage.acl,
ContentType: lookup(fileToUpload.LocalPath) ?? undefined,
},
})
Expand Down Expand Up @@ -136,13 +135,11 @@ export const deleteObjects = async (
try {
const listVersionsParams = {
Bucket: storage.name,
// Prefix: storage.bucketPrefix ? storage.bucketPrefix : undefined,
}

const versions = await client.send(
new ListObjectVersionsCommand(listVersionsParams)
)
console.log('versions', versions)

const deleteMarkers = (versions.DeleteMarkers ?? []).map((marker) => ({
Key: marker.Key,
Expand All @@ -161,7 +158,6 @@ export const deleteObjects = async (
...deleteMarkers,
...versionsToDelete,
]
console.log('objectsToDelete', objectsToDelete)

if (objectsToDelete.length > 0) {
const deleteParams = {
Expand Down
8 changes: 0 additions & 8 deletions src/schemas/serverless.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('SyncCloudStorage ', () => {
if (process.env.IS_OFFLINE === 'true' && customEndpoint !== undefined) {
const configuredEndpoint =
await syncCloudStorage.client?.config?.endpoint?.()
console.log('configuredEndpoint', configuredEndpoint)

expect(customEndpoint.includes(`${configuredEndpoint?.hostname}`)).toBe(
true
)
Expand Down

0 comments on commit cedc950

Please sign in to comment.