@open-norantec/herbal 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
Files changed (2) hide show
  1. package/dist/core.js +4 -5
  2. package/package.json +1 -1
package/dist/core.js CHANGED
@@ -312,7 +312,7 @@ function HerbalGuard(options) {
312
312
  var _a, e_1, _b, _c;
313
313
  var _d, _e, _f, _g, _h, _j, _k, _l, _m;
314
314
  return __awaiter(this, void 0, void 0, function () {
315
- var sequelizeInstance, transaction, request, response, traceId, chunks, _o, request_1, request_1_1, chunk, e_1_1, _p, parsedBody, rawHandlerName, handlerPropertype, handlerName, methodPool, authAdapters, error_2, _i, authAdapters_1, AuthAdapterClass, adapter, authenticateResult, error_3, _q;
315
+ var sequelizeInstance, transaction, request, response, traceId, chunks, _o, request_1, request_1_1, chunk, e_1_1, _p, parsedBody, rawHandlerName, handlerPropertype, handlerName, methodPool, authAdapters, shouldHaveTransaction, error_2, _i, authAdapters_1, AuthAdapterClass, adapter, authenticateResult, error_3, _q;
316
316
  var _this = this;
317
317
  return __generator(this, function (_r) {
318
318
  switch (_r.label) {
@@ -386,9 +386,8 @@ function HerbalGuard(options) {
386
386
  authAdapters = (_h = methodPool === null || methodPool === void 0 ? void 0 : methodPool.getAuthAdapters) === null || _h === void 0 ? void 0 : _h.call(methodPool, handlerName);
387
387
  if (authAdapters === null)
388
388
  authAdapters = auth_adapter_decorator_1.AuthAdapters.getAdapters(handlerPropertype, handlerName);
389
- if (!(!(sequelizeInstance instanceof Error) &&
390
- !decorators_1.NoTransaction.isDisabled(handlerPropertype, rawHandlerName) &&
391
- !((_j = methodPool === null || methodPool === void 0 ? void 0 : methodPool.transactionDisabled) === null || _j === void 0 ? void 0 : _j.call(methodPool, handlerName)))) return [3, 20];
389
+ shouldHaveTransaction = !decorators_1.NoTransaction.isDisabled(handlerPropertype, rawHandlerName) && !((_j = methodPool === null || methodPool === void 0 ? void 0 : methodPool.transactionDisabled) === null || _j === void 0 ? void 0 : _j.call(methodPool, handlerName));
390
+ if (!(!(sequelizeInstance instanceof Error) && shouldHaveTransaction)) return [3, 20];
392
391
  _r.label = 16;
393
392
  case 16:
394
393
  _r.trys.push([16, 18, , 19]);
@@ -406,7 +405,7 @@ function HerbalGuard(options) {
406
405
  return [3, 19];
407
406
  case 19: return [3, 21];
408
407
  case 20:
409
- if (decorators_1.NoTransaction.isDisabled(handlerPropertype, handlerName)) {
408
+ if (!shouldHaveTransaction) {
410
409
  this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":transaction] Transaction is disabled for this route: ").concat(handlerName));
411
410
  }
412
411
  _r.label = 21;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-norantec/herbal",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "Herbal is a builder and toolchain for Nest.js applications",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {