murlock 2.1.0-beta.1 → 3.0.0-beta.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/README.md
CHANGED
|
@@ -23,14 +23,14 @@ npm install --save murlock redis reflect-metadata
|
|
|
23
23
|
|
|
24
24
|
MurLock is primarily used through the `@MurLock()` decorator.
|
|
25
25
|
|
|
26
|
-
First, you need to import
|
|
26
|
+
First, you need to import the `MurLockModule` and set it up in your module using `forRoot`. This method is used for global configuration that can be reused across different parts of your application.
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
29
|
import { MurLockModule } from 'murlock';
|
|
30
30
|
|
|
31
31
|
@Module({
|
|
32
32
|
imports: [
|
|
33
|
-
MurLockModule.
|
|
33
|
+
MurLockModule.forRoot({
|
|
34
34
|
redisOptions: { host: 'localhost', port: 6379 },
|
|
35
35
|
wait: 1000,
|
|
36
36
|
maxAttempts: 3,
|
|
@@ -55,7 +55,7 @@ export class AppService {
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
By default, if there is single wrapped parameter, the property of parameter can be called
|
|
58
|
+
By default, if there is single wrapped parameter, the property of parameter can be called directly as it shown
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
61
|
import { MurLock } from 'murlock';
|
|
@@ -96,7 +96,7 @@ import { MurLockModule } from 'murlock';
|
|
|
96
96
|
|
|
97
97
|
@Module({
|
|
98
98
|
imports: [
|
|
99
|
-
MurLockModule.
|
|
99
|
+
MurLockModule.forRootAsync({
|
|
100
100
|
imports: [ConfigModule],
|
|
101
101
|
useFactory: async (configService: ConfigService) => ({
|
|
102
102
|
redisOptions: configService.get('REDIS_OPTIONS'),
|
package/dist/murlock.module.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { DynamicModule } from '@nestjs/common';
|
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import { MurLockModuleAsyncOptions, MurLockModuleOptions } from './interfaces';
|
|
4
4
|
export declare class MurLockModule {
|
|
5
|
-
static
|
|
6
|
-
static
|
|
5
|
+
static forRoot(options: MurLockModuleOptions): DynamicModule;
|
|
6
|
+
static forRootAsync(options: MurLockModuleAsyncOptions): DynamicModule;
|
|
7
7
|
private static createAsyncOptionsProvider;
|
|
8
8
|
}
|
package/dist/murlock.module.js
CHANGED
|
@@ -14,7 +14,7 @@ require("reflect-metadata");
|
|
|
14
14
|
const constants_1 = require("./constants");
|
|
15
15
|
const nestjs_cls_1 = require("nestjs-cls");
|
|
16
16
|
let MurLockModule = MurLockModule_1 = class MurLockModule {
|
|
17
|
-
static
|
|
17
|
+
static forRoot(options) {
|
|
18
18
|
return {
|
|
19
19
|
module: MurLockModule_1,
|
|
20
20
|
providers: [
|
|
@@ -35,7 +35,7 @@ let MurLockModule = MurLockModule_1 = class MurLockModule {
|
|
|
35
35
|
exports: [murlock_service_1.MurLockService],
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
static
|
|
38
|
+
static forRootAsync(options) {
|
|
39
39
|
return {
|
|
40
40
|
module: MurLockModule_1,
|
|
41
41
|
imports: options.imports || [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"murlock.module.js","sourceRoot":"","sources":["../lib/murlock.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,uDAAmD;AACnD,4BAA0B;AAE1B,2CAA2D;AAC3D,2CAAuC;AAahC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"murlock.module.js","sourceRoot":"","sources":["../lib/murlock.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,uDAAmD;AACnD,4BAA0B;AAE1B,2CAA2D;AAC3D,2CAAuC;AAahC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB,MAAM,CAAC,OAAO,CAAC,OAA6B;QAC1C,OAAO;YACL,MAAM,EAAE,eAAa;YACrB,SAAS,EAAE;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