@awsless/awsless 0.0.68 → 0.0.70

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
 
@@ -28196,8 +28195,10 @@ const sync = async (sourceBucketName, sourceObjectKey, sourceObjectVersion, dest
28196
28195
  await unzipBundle(bundleFile, contentsDirectory);
28197
28196
  console.log('List remote files...');
28198
28197
  const remoteFiles = await listRemoteFiles(destinationBucketName);
28198
+ console.log(remoteFiles);
28199
28199
  console.log('List local files...');
28200
28200
  const localFiles = await listLocalFiles(contentsDirectory);
28201
+ console.log(localFiles);
28201
28202
  const inserts = localFiles.filter((local)=>{
28202
28203
  return !remoteFiles.find((remote)=>{
28203
28204
  return local.key === remote.key && local.etag === remote.etag;
@@ -28223,18 +28224,27 @@ const sync = async (sourceBucketName, sourceObjectKey, sourceObjectVersion, dest
28223
28224
  };
28224
28225
  const uploadFiles = (bucketName, files)=>{
28225
28226
  return Promise.all(files.map(async (file)=>{
28226
- const upload = new Upload({
28227
- client,
28228
- params: {
28229
- Bucket: bucketName,
28230
- Key: file.key,
28231
- Body: createReadStream(join$1(contentsDirectory, file.key)),
28232
- ContentType: getContentType(file.key),
28233
- CacheControl: getCacheControl(file.key)
28234
- }
28235
- });
28236
- await upload.done();
28227
+ await client.send(new PutObjectCommand({
28228
+ Bucket: bucketName,
28229
+ Key: file.key,
28230
+ Body: createReadStream(join$1(contentsDirectory, file.key)),
28231
+ ContentType: getContentType(file.key),
28232
+ CacheControl: getCacheControl(file.key)
28233
+ }));
28237
28234
  }));
28235
+ // return Promise.all(files.map(async file => {
28236
+ // const upload = new Upload({
28237
+ // client,
28238
+ // params: {
28239
+ // Bucket: bucketName,
28240
+ // Key: file.key,
28241
+ // Body: createReadStream(join(contentsDirectory, file.key)),
28242
+ // ContentType: getContentType(file.key),
28243
+ // CacheControl: getCacheControl(file.key),
28244
+ // }
28245
+ // })
28246
+ // await upload.done()
28247
+ // }))
28238
28248
  };
28239
28249
  const deleteFiles = async (bucketName, files)=>{
28240
28250
  await client.send(new DeleteObjectsCommand({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.68",
3
+ "version": "0.0.70",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,8 +26,8 @@
26
26
  "peerDependencies": {
27
27
  "@awsless/lambda": "^0.0.6",
28
28
  "@awsless/sns": "^0.0.6",
29
- "@awsless/ssm": "^0.0.7",
30
- "@awsless/sqs": "^0.0.6"
29
+ "@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",