@mondart/nestjs-common-module 1.1.50 → 1.1.52
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.
|
@@ -3,15 +3,16 @@ export declare enum SharedMessages {
|
|
|
3
3
|
NOT_IMPLEMENTED = "This feature has not been implemented yet.",
|
|
4
4
|
RECURSIVE_CHILD = "Some children IDs are invalid, the parent product can not be used in children, it is recursive.",
|
|
5
5
|
SUCCESSFUL = "Operation completed successfully.",
|
|
6
|
-
|
|
6
|
+
IS_UNIQUE = "Field must be unique.",
|
|
7
|
+
FIELD_REQUIRE = "Field {0} is Required",
|
|
8
|
+
OPERATION_FIELD = "This operation can not be completed! {0}",
|
|
9
|
+
DUPLICATED_FIELD = "The {0} is reserved.",
|
|
10
|
+
INVALID_ITEMS = "{0} items are invalid.",
|
|
7
11
|
CREATE_FAILED = "Failed to create: {0}.",
|
|
8
12
|
CREATE_DENIED = "Permission denied to create: {0}.",
|
|
9
13
|
FETCH_FAILED = "Failed to fetch: {0}.",
|
|
10
14
|
RESOURCE_NOT_FOUND = "The requested {0} was not found.",
|
|
11
|
-
|
|
12
|
-
DUPLICATED_CODE = "The Code is reserved.",
|
|
13
|
-
INVALID_COMPOSITE_SUB_ITEMS = "Composite sub items are invalid.",
|
|
14
|
-
INVALID_GROUPED_SUB_ITEMS = "Sub items are invalid.",
|
|
15
|
+
RESOURCE_ALREADY_EXISTS = "The Requested {0} is already exists!.",
|
|
15
16
|
UPDATE_FAILED = "Failed to update: {0}.",
|
|
16
17
|
UPDATE_DENIED = "Permission denied to update: {0}.",
|
|
17
18
|
UPSERT_FAILED = "Failed to upsert: {0}.",
|
|
@@ -7,15 +7,16 @@ var SharedMessages;
|
|
|
7
7
|
SharedMessages["NOT_IMPLEMENTED"] = "This feature has not been implemented yet.";
|
|
8
8
|
SharedMessages["RECURSIVE_CHILD"] = "Some children IDs are invalid, the parent product can not be used in children, it is recursive.";
|
|
9
9
|
SharedMessages["SUCCESSFUL"] = "Operation completed successfully.";
|
|
10
|
-
SharedMessages["
|
|
10
|
+
SharedMessages["IS_UNIQUE"] = "Field must be unique.";
|
|
11
|
+
SharedMessages["FIELD_REQUIRE"] = "Field {0} is Required";
|
|
12
|
+
SharedMessages["OPERATION_FIELD"] = "This operation can not be completed! {0}";
|
|
13
|
+
SharedMessages["DUPLICATED_FIELD"] = "The {0} is reserved.";
|
|
14
|
+
SharedMessages["INVALID_ITEMS"] = "{0} items are invalid.";
|
|
11
15
|
SharedMessages["CREATE_FAILED"] = "Failed to create: {0}.";
|
|
12
16
|
SharedMessages["CREATE_DENIED"] = "Permission denied to create: {0}.";
|
|
13
17
|
SharedMessages["FETCH_FAILED"] = "Failed to fetch: {0}.";
|
|
14
18
|
SharedMessages["RESOURCE_NOT_FOUND"] = "The requested {0} was not found.";
|
|
15
|
-
SharedMessages["
|
|
16
|
-
SharedMessages["DUPLICATED_CODE"] = "The Code is reserved.";
|
|
17
|
-
SharedMessages["INVALID_COMPOSITE_SUB_ITEMS"] = "Composite sub items are invalid.";
|
|
18
|
-
SharedMessages["INVALID_GROUPED_SUB_ITEMS"] = "Sub items are invalid.";
|
|
19
|
+
SharedMessages["RESOURCE_ALREADY_EXISTS"] = "The Requested {0} is already exists!.";
|
|
19
20
|
SharedMessages["UPDATE_FAILED"] = "Failed to update: {0}.";
|
|
20
21
|
SharedMessages["UPDATE_DENIED"] = "Permission denied to update: {0}.";
|
|
21
22
|
SharedMessages["UPSERT_FAILED"] = "Failed to upsert: {0}.";
|
|
@@ -12,20 +12,24 @@ const common_1 = require("@nestjs/common");
|
|
|
12
12
|
const caching_service_1 = require("./caching.service");
|
|
13
13
|
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
14
14
|
const caching_interface_1 = require("./caching.interface");
|
|
15
|
-
const
|
|
15
|
+
const cache_manager_ioredis_yet_1 = require("cache-manager-ioredis-yet");
|
|
16
16
|
let CachingModule = CachingModule_1 = class CachingModule {
|
|
17
17
|
static register(options) {
|
|
18
|
-
const cacheModuleOptions = {
|
|
19
|
-
store: redisStore,
|
|
20
|
-
ttl: Number(options.ttl),
|
|
21
|
-
host: options.host,
|
|
22
|
-
port: Number(options.port),
|
|
23
|
-
password: options.password,
|
|
24
|
-
max: 10000,
|
|
25
|
-
};
|
|
26
18
|
return {
|
|
27
19
|
module: CachingModule_1,
|
|
28
|
-
imports: [
|
|
20
|
+
imports: [
|
|
21
|
+
cache_manager_1.CacheModule.register({
|
|
22
|
+
isGlobal: true,
|
|
23
|
+
useFactory: async (cachingOptions) => ({
|
|
24
|
+
store: await (0, cache_manager_ioredis_yet_1.redisStore)({
|
|
25
|
+
host: cachingOptions.host,
|
|
26
|
+
port: cachingOptions.port,
|
|
27
|
+
password: cachingOptions.password,
|
|
28
|
+
ttl: cachingOptions.ttl,
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
29
33
|
providers: [
|
|
30
34
|
{
|
|
31
35
|
provide: caching_interface_1.CACHING_MODULE_OPTIONS,
|
|
@@ -46,17 +50,24 @@ let CachingModule = CachingModule_1 = class CachingModule {
|
|
|
46
50
|
cache_manager_1.CacheModule.registerAsync({
|
|
47
51
|
imports: [asyncOptionsProvider],
|
|
48
52
|
useFactory: async (cachingOptions) => ({
|
|
49
|
-
store: redisStore
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
store: await (0, cache_manager_ioredis_yet_1.redisStore)({
|
|
54
|
+
host: cachingOptions.host,
|
|
55
|
+
port: cachingOptions.port,
|
|
56
|
+
password: cachingOptions.password,
|
|
57
|
+
ttl: cachingOptions.ttl,
|
|
58
|
+
}),
|
|
54
59
|
max: 10000,
|
|
55
60
|
}),
|
|
56
61
|
inject: [caching_interface_1.CACHING_MODULE_OPTIONS],
|
|
57
62
|
}),
|
|
58
63
|
],
|
|
59
|
-
providers: [
|
|
64
|
+
providers: [
|
|
65
|
+
{
|
|
66
|
+
provide: caching_service_1.CachingService,
|
|
67
|
+
useFactory: (cacheManager) => new caching_service_1.CachingService(cacheManager),
|
|
68
|
+
inject: [cache_manager_1.CACHE_MANAGER],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
60
71
|
exports: [caching_service_1.CachingService, cache_manager_1.CacheModule],
|
|
61
72
|
};
|
|
62
73
|
}
|