notification-processor 4.7.0 → 4.10.0
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/.github/PULL_REQUEST_TEMPLATE.md +2 -0
- package/copyToFunction +9 -0
- package/lib/exceptions/non.retryable.js +1 -1
- package/lib/index.js +1 -1
- package/lib/observers/deadLetterSucceeded.observer.js +1 -1
- package/lib/observers/delay.levels.js +1 -1
- package/lib/observers/delay.observer.js +1 -1
- package/lib/observers/didLastRetry.observer.js +1 -1
- package/lib/observers/incidentsApi.observer.js +5 -6
- package/lib/observers/logger.observer.js +1 -1
- package/lib/observers/redis.observer.js +1 -1
- package/lib/processor.builder.js +1 -1
- package/lib/processor.js +1 -1
- package/lib/processors/deadletter.processor.js +1 -1
- package/lib/processors/job/index.js +1 -1
- package/lib/processors/job/job.processor.js +37 -5
- package/lib/processors/job/notification.api.js +143 -20
- package/lib/processors/maxRetries.processor.js +1 -1
- package/lib/processors/request.async.processor.js +5 -3
- package/lib/processors/request.processor.js +1 -1
- package/lib/processors/requestWithRetries.async.processor.js +1 -1
- package/lib/senders/async.producteca.sender.js +52 -0
- package/lib/senders/index.js +3 -2
- package/lib/senders/meli.sender.js +1 -1
- package/lib/senders/producteca.sender.js +1 -1
- package/lib/services/oAuthApi.js +54 -0
- package/lib/services/redis.js +1 -1
- package/lib/sources/index.js +1 -1
- package/lib/sources/queue.source.js +1 -1
- package/lib/sources/service.bus.source.js +1 -1
- package/lib/sources/table.source.js +1 -1
- package/lib/sources/unknown.source.js +1 -1
- package/lib/specHelpers/fixture.js +1 -1
- package/lib/specHelpers/redis.observer.mock.js +1 -1
- package/notification-processor.sublime-workspace +1506 -0
- package/package.json +3 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
4
|
+
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
|
|
7
|
+
// Generated by CoffeeScript 2.7.0
|
|
8
|
+
(function () {
|
|
9
|
+
var AuthApi, OAUTH_API_URL, request;
|
|
10
|
+
|
|
11
|
+
request = require("request-promise");
|
|
12
|
+
|
|
13
|
+
OAUTH_API_URL = process.env.OAUTH_API_URL || "https://apps.producteca.com/oauth";
|
|
14
|
+
|
|
15
|
+
module.exports = AuthApi = function () {
|
|
16
|
+
function AuthApi(accessToken) {
|
|
17
|
+
_classCallCheck(this, AuthApi);
|
|
18
|
+
|
|
19
|
+
this.companyId = this.companyId.bind(this);
|
|
20
|
+
this._me = this._me.bind(this);
|
|
21
|
+
this._doRequest = this._doRequest.bind(this);
|
|
22
|
+
this.accessToken = accessToken;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_createClass(AuthApi, [{
|
|
26
|
+
key: "companyId",
|
|
27
|
+
value: function companyId() {
|
|
28
|
+
return this._me().get("id");
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "_me",
|
|
32
|
+
value: function _me() {
|
|
33
|
+
return this._doRequest("get", "/users/me", {
|
|
34
|
+
access_token: this.accessToken
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "_doRequest",
|
|
39
|
+
value: function _doRequest(verb, path) {
|
|
40
|
+
var qs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
|
+
|
|
42
|
+
var options;
|
|
43
|
+
options = {
|
|
44
|
+
url: OAUTH_API_URL + path,
|
|
45
|
+
qs: qs,
|
|
46
|
+
json: true
|
|
47
|
+
};
|
|
48
|
+
return request[verb](options).promise();
|
|
49
|
+
}
|
|
50
|
+
}]);
|
|
51
|
+
|
|
52
|
+
return AuthApi;
|
|
53
|
+
}();
|
|
54
|
+
}).call(undefined);
|
package/lib/services/redis.js
CHANGED
package/lib/sources/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
|
4
4
|
|
|
5
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
6
|
|
|
7
|
-
// Generated by CoffeeScript 2.
|
|
7
|
+
// Generated by CoffeeScript 2.7.0
|
|
8
8
|
(function () {
|
|
9
9
|
var MockRedis, MockRedisClient, Promise, _, proxyquire, sinon, stub;
|
|
10
10
|
|