store-s3-aws 1.3.11 → 1.3.13

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.11",
3
+ "version": "1.3.13",
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,28 @@
1
1
  #!/bin/bash
2
+ set -euo pipefail
2
3
 
3
- set -e
4
+ echo "🔐 Verificando autenticação npm..."
4
5
 
5
- NPM_TOKEN="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"
6
-
7
- # Usa token vindo da variável de ambiente
8
- if [ -z "$NPM_TOKEN" ]; then
9
- echo "❌ NPM_TOKEN não definido"
10
- exit 1
6
+ if ! npm whoami >/dev/null 2>&1; then
7
+ echo "🌐 Você não está logado. Iniciando login via browser..."
8
+ npm login
11
9
  fi
12
10
 
13
- echo "🔑 Configurando token npm..."
14
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
11
+ echo "🔍 Validando autenticação..."
12
+ npm whoami >/dev/null 2>&1 || {
13
+ echo "❌ Falha na autenticação"
14
+ exit 1
15
+ }
15
16
 
16
17
  echo "📦 Atualizando versão (patch)..."
17
- npm version patch
18
+ NEW_VERSION=$(npm version patch)
18
19
 
19
- echo "🚀 Publicando no npm..."
20
- npm publish --access public
21
-
22
- echo "🧹 Limpando credenciais..."
23
- rm -f .npmrc
20
+ echo "🚀 Publicando..."
21
+ if ! npm publish --access public; then
22
+ echo "❌ Publish falhou. Revertendo versão..."
23
+ git tag -d "$NEW_VERSION" || true
24
+ git reset --hard HEAD~1
25
+ exit 1
26
+ fi
24
27
 
25
28
  echo "✅ Publicação concluída!"
package/src/AwsS3Store.js CHANGED
@@ -50,6 +50,7 @@ class AwsS3Store {
50
50
 
51
51
  async save(options) {
52
52
  this.debugLog('[METHOD: save] Triggered.');
53
+ this.debugLog(`Options: ${JSON.stringify(options, null, 2)}`);
53
54
 
54
55
  const fileName = path.basename(options.session)
55
56
  const remoteFilePath = path.join(this.remoteDataPath, `${fileName}.zip`).replace(/\\/g, '/');
@@ -76,6 +77,8 @@ class AwsS3Store {
76
77
  async extract(options) {
77
78
  this.debugLog('[METHOD: extract] Triggered.');
78
79
 
80
+ this.debugLog(`Options: ${JSON.stringify(options, null, 2)}`);
81
+
79
82
  const remoteFilePath = path.join(this.remoteDataPath, `${options.session}.zip`).replace(/\\/g, '/');
80
83
  const params = {
81
84
  Bucket: this.bucketName,