@autofleet/sequelize-utils 5.1.5 → 5.1.6
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/index.d.ts +1 -2
- package/dist/index.js +2 -1
- package/package.json +1 -1
- package/src/index.ts +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Sequelize } from 'sequelize';
|
|
2
|
-
import addModelEventHooks from './model-event-hooks';
|
|
3
2
|
declare const _default: (sequelize: Sequelize) => {
|
|
4
3
|
transactionWithRetry: any;
|
|
5
4
|
httpBasedTransaction: any;
|
|
6
|
-
|
|
5
|
+
registerModelEventHooks: any;
|
|
7
6
|
};
|
|
8
7
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -58,9 +58,10 @@ exports.default = (sequelize) => {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
|
+
const registerModelEventHooks = (modelTableMapping) => model_event_hooks_1.default(sequelize, modelTableMapping);
|
|
61
62
|
return {
|
|
62
63
|
httpBasedTransaction,
|
|
63
64
|
transactionWithRetry,
|
|
64
|
-
|
|
65
|
+
registerModelEventHooks,
|
|
65
66
|
};
|
|
66
67
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ const abortErrorText = 'Transaction cancelled due to request cancellation';
|
|
|
11
11
|
export default (sequelize: Sequelize): {
|
|
12
12
|
transactionWithRetry: any,
|
|
13
13
|
httpBasedTransaction: any,
|
|
14
|
-
|
|
14
|
+
registerModelEventHooks: any
|
|
15
15
|
} => {
|
|
16
16
|
const transactionWithRetry = async (funcToRun: any, retriesCount = 2, options?: any): Promise<any> => {
|
|
17
17
|
try {
|
|
@@ -62,9 +62,11 @@ export default (sequelize: Sequelize): {
|
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
const registerModelEventHooks = (modelTableMapping) => addModelEventHooks(sequelize, modelTableMapping);
|
|
66
|
+
|
|
65
67
|
return {
|
|
66
68
|
httpBasedTransaction,
|
|
67
69
|
transactionWithRetry,
|
|
68
|
-
|
|
70
|
+
registerModelEventHooks,
|
|
69
71
|
};
|
|
70
72
|
};
|