@obisey/nest 0.1.13 → 0.1.15
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/package.json +13 -15
- package/prototipos/baseService.d.ts +4 -4
- package/prototipos/baseService.js +1 -2
- package/types.d.ts +1 -2
- package/types.js +4 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obisey/nest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "NestJS utilities and base classes by Obisey",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,32 +20,30 @@
|
|
|
20
20
|
"author": "Ulises",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@apollo/subgraph": "^2.
|
|
24
|
-
"graphql": "^16.
|
|
23
|
+
"@apollo/subgraph": "^2.11.0",
|
|
24
|
+
"graphql": "^16.0.0",
|
|
25
25
|
"graphql-scalars": "^1.23.0",
|
|
26
26
|
"lodash": "^4.17.21",
|
|
27
|
-
"sequelize": "^6.
|
|
28
|
-
"sequelize-typescript": "^2.1.
|
|
29
|
-
"type-graphql": "^1.2.0-beta.1"
|
|
30
|
-
"typegraphql-nestjs": "^0.7.0"
|
|
27
|
+
"sequelize": "^6.37.7",
|
|
28
|
+
"sequelize-typescript": "^2.1.6",
|
|
29
|
+
"type-graphql": "^1.2.0-beta.1"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@nestjs/axios": "^4.0.0",
|
|
34
33
|
"@nestjs/cache-manager": "^3.0.1",
|
|
35
|
-
"@nestjs/common": "^
|
|
36
|
-
"@nestjs/core": "^
|
|
37
|
-
"@nestjs/graphql": "^
|
|
34
|
+
"@nestjs/common": "^11.1.3",
|
|
35
|
+
"@nestjs/core": "^11.1.3",
|
|
36
|
+
"@nestjs/graphql": "^13.1.0",
|
|
38
37
|
"@types/sequelize": "^4.28.20",
|
|
39
38
|
"cache-manager": "^7.0.0",
|
|
40
39
|
"cache-manager-redis-store": "^3.0.1",
|
|
41
|
-
"graphql": "^16.
|
|
40
|
+
"graphql": "^16.0.0",
|
|
42
41
|
"ioredis": "^5.6.1",
|
|
43
42
|
"reflect-metadata": "^0.2.2",
|
|
44
|
-
"sequelize": "^6.
|
|
45
|
-
"sequelize-typescript": "^2.1.
|
|
43
|
+
"sequelize": "^6.37.7",
|
|
44
|
+
"sequelize-typescript": "^2.1.6",
|
|
46
45
|
"type-graphql": "^1.2.0-beta.1",
|
|
47
|
-
"
|
|
48
|
-
"typescript": "^5.4.5"
|
|
46
|
+
"typescript": "^5.8.3"
|
|
49
47
|
},
|
|
50
48
|
"dependencies": {
|
|
51
49
|
"dayjs": "^1.11.13",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cache } from 'cache-manager';
|
|
2
|
-
import {
|
|
2
|
+
import { createClient } from 'redis';
|
|
3
3
|
import { Key } from './utils/keyInterface';
|
|
4
4
|
export declare const redis_on = true;
|
|
5
5
|
type Ctor = new (...a: any[]) => any;
|
|
@@ -15,7 +15,7 @@ interface Peticion {
|
|
|
15
15
|
}
|
|
16
16
|
export declare function BaseService(modelo: string): {
|
|
17
17
|
new <T extends {
|
|
18
|
-
readonly redis:
|
|
18
|
+
readonly redis: ReturnType<typeof createClient>;
|
|
19
19
|
readonly cacheManager: Cache;
|
|
20
20
|
buscarXid<Ctor>({ value: { id, cacheable }, key, Clase, repository, pagina, }: Peticion): Promise<Ctor>;
|
|
21
21
|
buscarTodos<Ctor>({ value, key, Clase, repository, pagina, cacheable, }: Peticion): Promise<Ctor[]>;
|
|
@@ -52,8 +52,8 @@ export declare function BaseService(modelo: string): {
|
|
|
52
52
|
repository: any;
|
|
53
53
|
}): Promise<Ctor>;
|
|
54
54
|
eliminarCache(items: string[], borrarSSR?: boolean): Promise<boolean[][]>;
|
|
55
|
-
}>(redis:
|
|
56
|
-
readonly redis:
|
|
55
|
+
}>(redis: ReturnType<typeof createClient>, cacheManager: Cache): {
|
|
56
|
+
readonly redis: ReturnType<typeof createClient>;
|
|
57
57
|
readonly cacheManager: Cache;
|
|
58
58
|
buscarXid<Ctor>({ value: { id, cacheable }, key, Clase, repository, pagina, }: Peticion): Promise<Ctor>;
|
|
59
59
|
buscarTodos<Ctor>({ value, key, Clase, repository, pagina, cacheable, }: Peticion): Promise<Ctor[]>;
|
|
@@ -33,8 +33,7 @@ var stringifyInclude = ({ where, as, include }) => ({
|
|
|
33
33
|
});
|
|
34
34
|
function BaseService(modelo) {
|
|
35
35
|
return class BaseService {
|
|
36
|
-
constructor(redis,
|
|
37
|
-
cacheManager) {
|
|
36
|
+
constructor(redis, cacheManager) {
|
|
38
37
|
this.redis = redis;
|
|
39
38
|
this.cacheManager = cacheManager;
|
|
40
39
|
}
|
package/types.d.ts
CHANGED
package/types.js
CHANGED
|
@@ -9,10 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.UtilsTypes = exports.OrderInput = exports.ArgsFechas = exports.Status = exports.Conteo = exports.peticion = exports.paginate = void 0;
|
|
13
13
|
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
-
const common_1 = require("@nestjs/common");
|
|
15
|
-
const typegraphql_nestjs_1 = require("typegraphql-nestjs");
|
|
16
14
|
const paginate = ({ where, pagina, limite, order }) => {
|
|
17
15
|
const offset = (pagina - 1) * limite;
|
|
18
16
|
const limit = limite;
|
|
@@ -84,15 +82,6 @@ __decorate([
|
|
|
84
82
|
exports.OrderInput = OrderInput = __decorate([
|
|
85
83
|
(0, graphql_1.InputType)()
|
|
86
84
|
], OrderInput);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
exports.UtilsModule = UtilsModule = __decorate([
|
|
91
|
-
(0, common_1.Module)({
|
|
92
|
-
imports: [
|
|
93
|
-
typegraphql_nestjs_1.TypeGraphQLModule.forFeature({
|
|
94
|
-
orphanedTypes: [ArgsFechas, Status, Conteo, OrderInput],
|
|
95
|
-
}),
|
|
96
|
-
],
|
|
97
|
-
})
|
|
98
|
-
], UtilsModule);
|
|
85
|
+
exports.UtilsTypes = [
|
|
86
|
+
ArgsFechas, Status, Conteo, OrderInput
|
|
87
|
+
];
|