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 +1 -1
- package/send-npm.sh +18 -15
- package/src/AwsS3Store.js +3 -0
package/package.json
CHANGED
package/send-npm.sh
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
echo "🔐 Verificando autenticação npm..."
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 "
|
|
14
|
-
|
|
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
|
|
20
|
-
npm publish --access public
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,
|