@rnw-community/nestjs-enterprise 0.80.0 → 0.80.1
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/dist/cjs/decorator/lock/lock-observable/lock-observable.decorator.d.ts.map +1 -1
- package/dist/cjs/decorator/lock/lock-observable/lock-observable.decorator.js +6 -12
- package/dist/cjs/decorator/lock/lock-observable/lock-observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/lock/lock-promise/lock-promise.decorator.js +7 -9
- package/dist/cjs/decorator/lock/lock-promise/lock-promise.decorator.js.map +1 -1
- package/dist/esm/decorator/lock/lock-observable/lock-observable.decorator.d.ts.map +1 -1
- package/dist/esm/decorator/lock/lock-observable/lock-observable.decorator.js +7 -13
- package/dist/esm/decorator/lock/lock-observable/lock-observable.decorator.js.map +1 -1
- package/dist/esm/decorator/lock/lock-promise/lock-promise.decorator.js +7 -9
- package/dist/esm/decorator/lock/lock-promise/lock-promise.decorator.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-observable.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,eAAO,MAAM,cAAc,GACtB,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE,uBACpB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,YAC/C,MAAM,kBACA,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KAC5C,mBAAmB,CAAC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"lock-observable.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,eAAO,MAAM,cAAc,GACtB,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE,uBACpB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,YAC/C,MAAM,kBACA,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KAC5C,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAsCpC,CAAC"}
|
|
@@ -11,20 +11,14 @@ const LockObservable = (preLock, duration, catchErrorFn$) => (target, propertyKe
|
|
|
11
11
|
// eslint-disable-next-line max-statements,func-names
|
|
12
12
|
descriptor.value = function (...args) {
|
|
13
13
|
return (0, rxjs_1.of)(true).pipe((0, rxjs_1.tap)(() => void (0, validate_redlock_util_1.validateRedlock)(this)), (0, rxjs_1.map)(() => (0, run_pre_lock_util_1.runPreLock)(preLock, ...args)), (0, rxjs_1.concatMap)(lockKeys => (0, rxjs_1.from)(this.redlock.acquire(lockKeys, duration)).pipe((0, rxjs_1.concatMap)(currentLock => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!(0, rxjs_1.isObservable)(result)) {
|
|
17
|
-
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return an observable`);
|
|
18
|
-
}
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
finally {
|
|
22
|
-
/*
|
|
23
|
-
* HINT: Finalize does not work in this case, rxjs bug?
|
|
24
|
-
* HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
25
|
-
*/
|
|
14
|
+
const result = originalMethod.apply(this, args);
|
|
15
|
+
if (!(0, rxjs_1.isObservable)(result)) {
|
|
26
16
|
void currentLock.release().catch(() => void 0);
|
|
17
|
+
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return an observable`);
|
|
27
18
|
}
|
|
19
|
+
return result.pipe((0, rxjs_1.finalize)(() => {
|
|
20
|
+
void currentLock.release().catch(() => void 0);
|
|
21
|
+
}));
|
|
28
22
|
}), (0, shared_1.isDefined)(catchErrorFn$)
|
|
29
23
|
? (0, rxjs_1.catchError)((err) => catchErrorFn$(err))
|
|
30
24
|
: (0, rxjs_1.tap)())));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-observable.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"lock-observable.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":";;;AAAA,+BAA0G;AAE1G,kDAAkD;AAElD,iEAAuD;AACvD,yEAAgE;AAMzD,MAAM,cAAc,GACvB,CACI,OAAyD,EACzD,QAAgB,EAChB,aAA2C,EACR,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,qDAAqD;IACrD,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,OAAO,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC,IAAI,CAChB,IAAA,UAAG,EAAC,GAAG,EAAE,CAAC,KAAK,IAAA,uCAAe,EAAC,IAAI,CAAC,CAAC,EACrC,IAAA,UAAG,EAAC,GAAG,EAAE,CAAC,IAAA,8BAAU,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EACvC,IAAA,gBAAS,EAAC,QAAQ,CAAC,EAAE,CACjB,IAAA,WAAI,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAC/C,IAAA,gBAAS,EAAC,WAAW,CAAC,EAAE;YACpB,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAwB,CAAC;YAEvE,IAAI,CAAC,IAAA,mBAAY,EAAC,MAAM,CAAC,EAAE,CAAC;gBACxB,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;gBAE/C,MAAM,IAAI,KAAK,CACX,UAAU,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC,WAAW,CAAC,gCAAgC,CAC5F,CAAC;YACN,CAAC;YAED,OAAO,MAAM,CAAC,IAAI,CACd,IAAA,eAAQ,EAAC,GAAG,EAAE;gBACV,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,CACL,CAAC;QACN,CAAC,CAAC,EACF,IAAA,kBAAS,EAAC,aAAa,CAAC;YACpB,CAAC,CAAC,IAAA,iBAAU,EAAC,CAAC,GAAY,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAwB,CAAC;YACzE,CAAC,CAAC,IAAA,UAAG,GAAE,CACd,CACJ,CACO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AA3CO,QAAA,cAAc,kBA2CrB"}
|
|
@@ -22,18 +22,16 @@ const LockPromise = (preLock, duration, catchErrorFn) => (target, propertyKey, d
|
|
|
22
22
|
return this.redlock
|
|
23
23
|
.acquire(lockKeys, duration)
|
|
24
24
|
.then(currentLock => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (!(0, shared_1.isPromise)(originalResult)) {
|
|
28
|
-
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return a promise`);
|
|
29
|
-
}
|
|
30
|
-
return originalResult;
|
|
31
|
-
// eslint-disable-next-line promise/always-return
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
25
|
+
const originalResult = originalMethod.apply(this, args);
|
|
26
|
+
if (!(0, shared_1.isPromise)(originalResult)) {
|
|
34
27
|
// HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
35
28
|
void currentLock.release().catch(() => void 0);
|
|
29
|
+
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return a promise`);
|
|
36
30
|
}
|
|
31
|
+
return originalResult.finally(() => {
|
|
32
|
+
// HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
33
|
+
void currentLock.release().catch(() => void 0);
|
|
34
|
+
});
|
|
37
35
|
})
|
|
38
36
|
.catch((err) => {
|
|
39
37
|
if ((0, shared_1.isDefined)(catchErrorFn)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-promise.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-promise/lock-promise.decorator.ts"],"names":[],"mappings":";;;AAAA,kDAA6D;AAE7D,iEAAuD;AACvD,yEAAgE;AAMzD,MAAM,WAAW,GACpB,CACI,OAAyD,EACzD,QAAgB,EAChB,YAA0C,EACP,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,8CAA8C;IAC9C,sCAAsC;IACtC,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,IAAI,QAAQ,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC;YACD,IAAA,uCAAe,EAAC,IAAI,CAAC,CAAC;YACtB,QAAQ,GAAG,IAAA,8BAAU,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,2EAA2E;YAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,CAAC,OAAO;aACd,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC3B,IAAI,CAAC,WAAW,CAAC,EAAE;YAChB,
|
|
1
|
+
{"version":3,"file":"lock-promise.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-promise/lock-promise.decorator.ts"],"names":[],"mappings":";;;AAAA,kDAA6D;AAE7D,iEAAuD;AACvD,yEAAgE;AAMzD,MAAM,WAAW,GACpB,CACI,OAAyD,EACzD,QAAgB,EAChB,YAA0C,EACP,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,8CAA8C;IAC9C,sCAAsC;IACtC,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,IAAI,QAAQ,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC;YACD,IAAA,uCAAe,EAAC,IAAI,CAAC,CAAC;YACtB,QAAQ,GAAG,IAAA,8BAAU,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,2EAA2E;YAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,CAAC,OAAO;aACd,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC3B,IAAI,CAAC,WAAW,CAAC,EAAE;YAChB,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACxD,IAAI,CAAC,IAAA,kBAAS,EAAC,cAAc,CAAC,EAAE,CAAC;gBAC7B,iEAAiE;gBACjE,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;gBAE/C,MAAM,IAAI,KAAK,CACX,UAAU,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC,WAAW,CAAC,4BAA4B,CACxF,CAAC;YACN,CAAC;YAED,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC/B,iEAAiE;gBACjE,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACpB,IAAI,IAAA,kBAAS,EAAC,YAAY,CAAC,EAAE,CAAC;gBAC1B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;YAC7B,CAAC;YAED,MAAM,GAAG,CAAC;QACd,CAAC,CAAC,CAAC;IACX,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAlDO,QAAA,WAAW,eAkDlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-observable.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,eAAO,MAAM,cAAc,GACtB,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE,uBACpB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,YAC/C,MAAM,kBACA,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KAC5C,mBAAmB,CAAC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"lock-observable.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,eAAO,MAAM,cAAc,GACtB,OAAO,EAAE,KAAK,SAAS,OAAO,EAAE,uBACpB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,YAC/C,MAAM,kBACA,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,KAC5C,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAsCpC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { catchError, concatMap, from, isObservable, map, of, tap } from 'rxjs';
|
|
1
|
+
import { catchError, concatMap, finalize, from, isObservable, map, of, tap } from 'rxjs';
|
|
2
2
|
import { isDefined } from '@rnw-community/shared';
|
|
3
3
|
import { runPreLock } from '../util/run-pre-lock.util';
|
|
4
4
|
import { validateRedlock } from '../util/validate-redlock.util';
|
|
@@ -8,20 +8,14 @@ export const LockObservable = (preLock, duration, catchErrorFn$) => (target, pro
|
|
|
8
8
|
// eslint-disable-next-line max-statements,func-names
|
|
9
9
|
descriptor.value = function (...args) {
|
|
10
10
|
return of(true).pipe(tap(() => void validateRedlock(this)), map(() => runPreLock(preLock, ...args)), concatMap(lockKeys => from(this.redlock.acquire(lockKeys, duration)).pipe(concatMap(currentLock => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!isObservable(result)) {
|
|
14
|
-
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return an observable`);
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
finally {
|
|
19
|
-
/*
|
|
20
|
-
* HINT: Finalize does not work in this case, rxjs bug?
|
|
21
|
-
* HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
22
|
-
*/
|
|
11
|
+
const result = originalMethod.apply(this, args);
|
|
12
|
+
if (!isObservable(result)) {
|
|
23
13
|
void currentLock.release().catch(() => void 0);
|
|
14
|
+
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return an observable`);
|
|
24
15
|
}
|
|
16
|
+
return result.pipe(finalize(() => {
|
|
17
|
+
void currentLock.release().catch(() => void 0);
|
|
18
|
+
}));
|
|
25
19
|
}), isDefined(catchErrorFn$)
|
|
26
20
|
? catchError((err) => catchErrorFn$(err))
|
|
27
21
|
: tap())));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-observable.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"lock-observable.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-observable/lock-observable.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1G,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE,MAAM,CAAC,MAAM,cAAc,GACvB,CACI,OAAyD,EACzD,QAAgB,EAChB,aAA2C,EACR,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,qDAAqD;IACrD,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAChB,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,eAAe,CAAC,IAAI,CAAC,CAAC,EACrC,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EACvC,SAAS,CAAC,QAAQ,CAAC,EAAE,CACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAC/C,SAAS,CAAC,WAAW,CAAC,EAAE;YACpB,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAwB,CAAC;YAEvE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxB,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;gBAE/C,MAAM,IAAI,KAAK,CACX,UAAU,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC,WAAW,CAAC,gCAAgC,CAC5F,CAAC;YACN,CAAC;YAED,OAAO,MAAM,CAAC,IAAI,CACd,QAAQ,CAAC,GAAG,EAAE;gBACV,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,CACL,CAAC;QACN,CAAC,CAAC,EACF,SAAS,CAAC,aAAa,CAAC;YACpB,CAAC,CAAC,UAAU,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAwB,CAAC;YACzE,CAAC,CAAC,GAAG,EAAE,CACd,CACJ,CACO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -19,18 +19,16 @@ export const LockPromise = (preLock, duration, catchErrorFn) => (target, propert
|
|
|
19
19
|
return this.redlock
|
|
20
20
|
.acquire(lockKeys, duration)
|
|
21
21
|
.then(currentLock => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!isPromise(originalResult)) {
|
|
25
|
-
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return a promise`);
|
|
26
|
-
}
|
|
27
|
-
return originalResult;
|
|
28
|
-
// eslint-disable-next-line promise/always-return
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
22
|
+
const originalResult = originalMethod.apply(this, args);
|
|
23
|
+
if (!isPromise(originalResult)) {
|
|
31
24
|
// HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
32
25
|
void currentLock.release().catch(() => void 0);
|
|
26
|
+
throw new Error(`Method ${target.constructor.name}::${String(propertyKey)} does not return a promise`);
|
|
33
27
|
}
|
|
28
|
+
return originalResult.finally(() => {
|
|
29
|
+
// HINT: https://github.com/mike-marcacci/node-redlock/issues/168
|
|
30
|
+
void currentLock.release().catch(() => void 0);
|
|
31
|
+
});
|
|
34
32
|
})
|
|
35
33
|
.catch((err) => {
|
|
36
34
|
if (isDefined(catchErrorFn)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-promise.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-promise/lock-promise.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE,MAAM,CAAC,MAAM,WAAW,GACpB,CACI,OAAyD,EACzD,QAAgB,EAChB,YAA0C,EACP,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,8CAA8C;IAC9C,sCAAsC;IACtC,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,IAAI,QAAQ,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC;YACD,eAAe,CAAC,IAAI,CAAC,CAAC;YACtB,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,2EAA2E;YAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,CAAC,OAAO;aACd,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC3B,IAAI,CAAC,WAAW,CAAC,EAAE;YAChB,
|
|
1
|
+
{"version":3,"file":"lock-promise.decorator.js","sourceRoot":"","sources":["../../../../../src/decorator/lock/lock-promise/lock-promise.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE,MAAM,CAAC,MAAM,WAAW,GACpB,CACI,OAAyD,EACzD,QAAgB,EAChB,YAA0C,EACP,EAAE,CACzC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE;IAChC,oEAAoE;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;IAEzC,8CAA8C;IAC9C,sCAAsC;IACtC,UAAU,CAAC,KAAK,GAAG,UAAiC,GAAG,IAAW;QAC9D,IAAI,QAAQ,GAAa,EAAE,CAAC;QAC5B,IAAI,CAAC;YACD,eAAe,CAAC,IAAI,CAAC,CAAC;YACtB,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,2EAA2E;YAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,CAAC,OAAO;aACd,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;aAC3B,IAAI,CAAC,WAAW,CAAC,EAAE;YAChB,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACxD,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC7B,iEAAiE;gBACjE,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;gBAE/C,MAAM,IAAI,KAAK,CACX,UAAU,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC,WAAW,CAAC,4BAA4B,CACxF,CAAC;YACN,CAAC;YAED,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC/B,iEAAiE;gBACjE,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACpB,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC1B,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;YAC7B,CAAC;YAED,MAAM,GAAG,CAAC;QACd,CAAC,CAAC,CAAC;IACX,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnw-community/nestjs-enterprise",
|
|
3
|
-
"version": "0.80.
|
|
3
|
+
"version": "0.80.1",
|
|
4
4
|
"description": "NestJS Enterprise is a collection of enterprise-grade modules for NestJS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nestjs",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"clear": "rm -rf coverage && rm -rf dist && rm -f *.tsbuildinfo",
|
|
62
62
|
"clear:deps": "rm -rf ./node_modules && rm -rf ./dist"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "16f90b689174f049d94b2f7ef73c1869b110edf7",
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@rnw-community/shared": "0.80.0"
|
|
67
67
|
},
|