store-s3-aws 1.3.8 → 1.3.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "store-s3-aws",
3
- "version": "1.3.8",
3
+ "version": "1.3.12",
4
4
  "description": "Lib to store files in AWS S3",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/send-npm.sh CHANGED
@@ -1,25 +1,36 @@
1
1
  #!/bin/bash
2
+ set -euo pipefail
2
3
 
3
- set -e
4
+ NPM_TOKEN="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"
4
5
 
5
- NPM_TOKEN="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"
6
+ cleanup() {
7
+ rm -f .npmrc
8
+ }
9
+ trap cleanup EXIT
6
10
 
7
- # Usa token vindo da variável de ambiente
8
11
  if [ -z "$NPM_TOKEN" ]; then
9
12
  echo "❌ NPM_TOKEN não definido"
10
13
  exit 1
11
14
  fi
12
15
 
13
- echo "🔑 Configurando token npm..."
16
+ echo "🔑 Configurando token..."
14
17
  echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
15
18
 
16
- echo "📦 Atualizando versão (patch)..."
17
- npm version patch
19
+ echo "🔍 Validando autenticação..."
20
+ npm whoami >/dev/null 2>&1 || {
21
+ echo "❌ Token inválido ou expirado"
22
+ exit 1
23
+ }
18
24
 
19
- echo "🚀 Publicando no npm..."
20
- npm publish --access public
25
+ echo "📦 Atualizando versão (patch)..."
26
+ NEW_VERSION=$(npm version patch)
21
27
 
22
- echo "🧹 Limpando credenciais..."
23
- rm -f .npmrc
28
+ echo "🚀 Publicando..."
29
+ if ! npm publish --access public; then
30
+ echo "❌ Publish falhou. Revertendo versão..."
31
+ git tag -d "$NEW_VERSION" || true
32
+ git reset --hard HEAD~1
33
+ exit 1
34
+ fi
24
35
 
25
36
  echo "✅ Publicação concluída!"
package/src/AwsS3Store.js CHANGED
@@ -56,7 +56,7 @@ class AwsS3Store {
56
56
  options.remoteFilePath = remoteFilePath;
57
57
  //await this.#deletePrevious(options);
58
58
 
59
- const fileStream = createReadStream(`${fileName}.zip`);
59
+ const fileStream = createReadStream(`${options.session}.zip`);
60
60
 
61
61
  const upload = new Upload({
62
62
  client: this.#getClientS3(),