notification-processor 6.0.2 → 6.0.4
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/CHANGELOG.md +14 -0
- package/lib/services/userIdTranslator.js +23 -11
- package/lib/sources/aws.sqs.source.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [6.0.4](https://github.com/Parsimotion/notification-processor/compare/v6.0.3...v6.0.4) (2025-10-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add message correctly ([f1724be](https://github.com/Parsimotion/notification-processor/commit/f1724be28f07f6e2f4fde1c6a51e4645673ae44e))
|
|
7
|
+
|
|
8
|
+
## [6.0.3](https://github.com/Parsimotion/notification-processor/compare/v6.0.2...v6.0.3) (2025-09-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* avoid retry on 401 ([f4e027f](https://github.com/Parsimotion/notification-processor/commit/f4e027f78be81d242d9b53860b2d67304636983f))
|
|
14
|
+
|
|
1
15
|
## [6.0.2](https://github.com/Parsimotion/notification-processor/compare/v6.0.1...v6.0.2) (2025-09-11)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -35,6 +35,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
35
35
|
this.getCompanyId = this.getCompanyId.bind(this);
|
|
36
36
|
this._setInCache = this._setInCache.bind(this);
|
|
37
37
|
this._translateUserId = this._translateUserId.bind(this);
|
|
38
|
+
this._fetchUser = this._fetchUser.bind(this);
|
|
38
39
|
this.translatedCache = translatedCache;
|
|
39
40
|
this.translate = this.translate.bind(this);
|
|
40
41
|
}
|
|
@@ -75,17 +76,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
75
76
|
|
|
76
77
|
console.log("Making request to translate", userId);
|
|
77
78
|
return retry(function () {
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
user: "" + userId,
|
|
86
|
-
password: MERCADOLIBRE_API_MASTER_TOKEN
|
|
87
|
-
}
|
|
88
|
-
}).promise();
|
|
79
|
+
return _this._fetchUser(userId);
|
|
80
|
+
}, {
|
|
81
|
+
max_tries: 3,
|
|
82
|
+
throw_original: true,
|
|
83
|
+
predicate: function predicate(err) {
|
|
84
|
+
return err.statusCode !== 401;
|
|
85
|
+
}
|
|
89
86
|
}).then(function (userInformation) {
|
|
90
87
|
return {
|
|
91
88
|
app: userInformation.app,
|
|
@@ -104,6 +101,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
104
101
|
return _this._setInCache(userId, companyId);
|
|
105
102
|
});
|
|
106
103
|
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "_fetchUser",
|
|
106
|
+
value: function _fetchUser(userId) {
|
|
107
|
+
return request.get({
|
|
108
|
+
url: MERCADOLIBRE_API_CORE_URL + "/users/me",
|
|
109
|
+
json: true,
|
|
110
|
+
qs: {
|
|
111
|
+
authenticationType: "mercadolibre"
|
|
112
|
+
},
|
|
113
|
+
auth: {
|
|
114
|
+
user: "" + userId,
|
|
115
|
+
password: MERCADOLIBRE_API_MASTER_TOKEN
|
|
116
|
+
}
|
|
117
|
+
}).promise();
|
|
118
|
+
}
|
|
107
119
|
}]);
|
|
108
120
|
|
|
109
121
|
return UserIdTranslator;
|