notification-processor 4.18.1 → 4.19.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.
@@ -115,7 +115,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
115
115
  eventTimestamp = _ref3.eventTimestamp,
116
116
  parentEventId = _ref3.parentEventId,
117
117
  app = _ref3.app,
118
- job = _ref3.job;
118
+ job = _ref3.job,
119
+ partialMessage = _ref3.partialMessage;
119
120
 
120
121
  var now, theRequest;
121
122
  if (!eventId) {
@@ -147,7 +148,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
147
148
  error: _.omit(err, ["detail.request", "cause.detail.request"]),
148
149
  request: _.omit(theRequest, _.castArray(_this3.propertiesToOmit).concat("auth")),
149
150
  type: err && _.get(err, "type", "unknown"),
150
- tags: _.get(err, "tags", [])
151
+ tags: _.get(err, "tags", []),
152
+ message: partialMessage || notification.message
151
153
  }),
152
154
  status: executionStatus,
153
155
  resource: resource,
@@ -27,8 +27,8 @@
27
27
  nonRetryable: nonRetryable,
28
28
  notificationApiUrl: notificationApiUrl
29
29
  });
30
- return function (it) {
31
- return jobProcesor.process(it);
30
+ return function (it, context, executionId) {
31
+ return jobProcesor.process(it, context, executionId);
32
32
  };
33
33
  };
34
34
  }).call(undefined);
@@ -61,12 +61,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
61
61
 
62
62
  _createClass(JobProcessor, [{
63
63
  key: "process",
64
- value: function process(notification) {
64
+ value: function process(notification, context, executionId) {
65
65
  var _this2 = this;
66
66
 
67
67
  boundMethodCheck(this, JobProcessor);
68
68
  return this._ifJobIsNotStopped(notification.message, function () {
69
- return _get(JobProcessor.prototype.__proto__ || Object.getPrototypeOf(JobProcessor.prototype), "process", _this2).call(_this2, notification).thenReturn();
69
+ return _get(JobProcessor.prototype.__proto__ || Object.getPrototypeOf(JobProcessor.prototype), "process", _this2).call(_this2, notification, context, executionId).thenReturn();
70
70
  });
71
71
  }
72
72
  }, {
@@ -111,7 +111,7 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
111
111
  name = _ref3$job.name,
112
112
  creationDate = _ref3$job.creationDate;
113
113
 
114
- var eventId, jobCreationDate, messageInsertionTime, ref, ref1, ref2;
114
+ var eventId, headersWithoutAuth, jobCreationDate, messageInsertionTime, ref, ref1, ref2;
115
115
  eventId = notification.message.JobId || _headerValue(notification.message.HeadersForRequest, "x-producteca-event-id", null) || _headerValue(notification.message.HeadersForRequest, "X-producteca-event-id", null) || (notification != null ? (ref = notification.meta) != null ? ref.messageId : void 0 : void 0) || uuid();
116
116
  if (creationDate) {
117
117
  jobCreationDate = new Date(creationDate).getTime();
@@ -119,6 +119,11 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
119
119
  if (notification != null ? (ref1 = notification.meta) != null ? ref1.insertionTime : void 0 : void 0) {
120
120
  messageInsertionTime = new Date(notification != null ? (ref2 = notification.meta) != null ? ref2.insertionTime : void 0 : void 0).getTime();
121
121
  }
122
+ headersWithoutAuth = _.reject(notification.message.HeadersForRequest, function (_ref4) {
123
+ var Key = _ref4.Key;
124
+
125
+ return (Key != null ? Key.toLowerCase() : void 0) === 'authorization';
126
+ });
122
127
  return Promise.props({
123
128
  eventType: 'http',
124
129
  resource: _this.resource(notification),
@@ -129,7 +134,10 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
129
134
  externalReference: null,
130
135
  eventId: eventId,
131
136
  eventTimestamp: jobCreationDate || messageInsertionTime,
132
- parentEventId: null
137
+ parentEventId: null,
138
+ partialMessage: _.assign({}, notification.message, {
139
+ HeadersForRequest: headersWithoutAuth
140
+ })
133
141
  });
134
142
  });
135
143
  }