@awsless/awsless 0.0.68 → 0.0.69
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S3Client, DeleteObjectsCommand, ListObjectsV2Command, GetObjectCommand } from '@aws-sdk/client-s3';
|
|
1
|
+
import { S3Client, PutObjectCommand, DeleteObjectsCommand, ListObjectsV2Command, GetObjectCommand } from '@aws-sdk/client-s3';
|
|
2
2
|
import require$$0$4, { createReadStream, createWriteStream } from 'fs';
|
|
3
3
|
import { pipeline } from 'stream/promises';
|
|
4
4
|
import require$$1$1 from 'util';
|
|
@@ -11,7 +11,6 @@ import require$$6 from 'assert';
|
|
|
11
11
|
import require$$0$5, { join as join$1, extname } from 'path';
|
|
12
12
|
import { readdir, stat } from 'fs/promises';
|
|
13
13
|
import { createHash } from 'crypto';
|
|
14
|
-
import { Upload } from '@aws-sdk/lib-storage';
|
|
15
14
|
|
|
16
15
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17
16
|
|
|
@@ -28223,18 +28222,27 @@ const sync = async (sourceBucketName, sourceObjectKey, sourceObjectVersion, dest
|
|
|
28223
28222
|
};
|
|
28224
28223
|
const uploadFiles = (bucketName, files)=>{
|
|
28225
28224
|
return Promise.all(files.map(async (file)=>{
|
|
28226
|
-
|
|
28227
|
-
|
|
28228
|
-
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
CacheControl: getCacheControl(file.key)
|
|
28234
|
-
}
|
|
28235
|
-
});
|
|
28236
|
-
await upload.done();
|
|
28225
|
+
await client.send(new PutObjectCommand({
|
|
28226
|
+
Bucket: bucketName,
|
|
28227
|
+
Key: file.key,
|
|
28228
|
+
Body: createReadStream(join$1(contentsDirectory, file.key)),
|
|
28229
|
+
ContentType: getContentType(file.key),
|
|
28230
|
+
CacheControl: getCacheControl(file.key)
|
|
28231
|
+
}));
|
|
28237
28232
|
}));
|
|
28233
|
+
// return Promise.all(files.map(async file => {
|
|
28234
|
+
// const upload = new Upload({
|
|
28235
|
+
// client,
|
|
28236
|
+
// params: {
|
|
28237
|
+
// Bucket: bucketName,
|
|
28238
|
+
// Key: file.key,
|
|
28239
|
+
// Body: createReadStream(join(contentsDirectory, file.key)),
|
|
28240
|
+
// ContentType: getContentType(file.key),
|
|
28241
|
+
// CacheControl: getCacheControl(file.key),
|
|
28242
|
+
// }
|
|
28243
|
+
// })
|
|
28244
|
+
// await upload.done()
|
|
28245
|
+
// }))
|
|
28238
28246
|
};
|
|
28239
28247
|
const deleteFiles = async (bucketName, files)=>{
|
|
28240
28248
|
await client.send(new DeleteObjectsCommand({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.69",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@awsless/lambda": "^0.0.6",
|
|
28
|
+
"@awsless/sqs": "^0.0.6",
|
|
28
29
|
"@awsless/sns": "^0.0.6",
|
|
29
|
-
"@awsless/ssm": "^0.0.7"
|
|
30
|
-
"@awsless/sqs": "^0.0.6"
|
|
30
|
+
"@awsless/ssm": "^0.0.7"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@aws-sdk/client-cloudformation": "^3.369.0",
|