Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typeorm-transactional-cls-hooked

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeorm-transactional-cls-hooked - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

.vscode/settings.json

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.1.12
* Using connectionName as string | ()=>string [#44](https://github.com/odavid/typeorm-transactional-cls-hooked/issues/44)
## 0.1.11
* Move @types/cls-hooked to dependencies [#42](https://github.com/odavid/typeorm-transactional-cls-hooked/issues/42)
## 0.1.10

@@ -2,0 +8,0 @@ * dist folder missing in package version 0.1.9 [#33](https://github.com/odavid/typeorm-transactional-cls-hooked/issues/33)

2

dist/Transactional.d.ts
import { IsolationLevel } from './IsolationLevel';
import { Propagation } from './Propagation';
export declare function Transactional(options?: {
connectionName?: string;
connectionName?: string | (() => string | undefined);
propagation?: Propagation;
isolationLevel?: IsolationLevel;
}): MethodDecorator;

@@ -45,5 +45,2 @@ "use strict";

function Transactional(options) {
var connectionName = options && options.connectionName ? options.connectionName : 'default';
var propagation = options && options.propagation ? options.propagation : Propagation_1.Propagation.REQUIRED;
var isolationLevel = options && options.isolationLevel;
return function (target, methodName, descriptor) {

@@ -61,2 +58,9 @@ var originalMethod = descriptor.value;

}
var tempConnectionName = options && options.connectionName ? options.connectionName : 'default';
if (typeof tempConnectionName !== 'string') {
tempConnectionName = tempConnectionName() || 'default';
}
var connectionName = tempConnectionName;
var propagation = options && options.propagation ? options.propagation : Propagation_1.Propagation.REQUIRED;
var isolationLevel = options && options.isolationLevel;
var runOriginal = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {

@@ -63,0 +67,0 @@ return [2, originalMethod.apply(this, args.slice())];

{
"name": "typeorm-transactional-cls-hooked",
"version": "0.1.11",
"version": "0.1.12",
"description": "A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -110,2 +110,3 @@ # typeorm-transactional-cls-hooked

- The decorator can take a `connectionName` as argument (by default it is `default`)
- In some cases, where the connectionName should be dynamically evaluated, the value of connectionName can be a function that returns a string.
- The decorator can take an optional `propagation` as argument to define the [propagation behaviour](#transaction-propagation)

@@ -112,0 +113,0 @@ - The decorator can take an optional `isolationLevel` as argument to define the [isolation level](#isolation-levels) (by default it will use your database driver's default isolation level.)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc