@obisey/nest 0.1.0 → 0.1.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/package.json +5 -4
- package/types.d.ts +39 -0
- package/types.js +98 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obisey/nest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "NestJS utilities and base classes by Obisey",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@nestjs/axios": "^4.0.0",
|
|
30
30
|
"@nestjs/cache-manager": "^3.0.1",
|
|
31
|
-
"@nestjs/common": "^
|
|
32
|
-
"@nestjs/core": "^
|
|
33
|
-
"@nestjs/graphql": "^
|
|
31
|
+
"@nestjs/common": "^10.3.3",
|
|
32
|
+
"@nestjs/core": "^10.3.3",
|
|
33
|
+
"@nestjs/graphql": "^12.1.1",
|
|
34
|
+
"typegraphql-nestjs": "^0.7.0",
|
|
34
35
|
"@types/moment": "^2.11.29",
|
|
35
36
|
"cache-manager": "^7.0.0",
|
|
36
37
|
"cache-manager-redis-store": "^3.0.1",
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface Peticion {
|
|
2
|
+
where: any;
|
|
3
|
+
include: any;
|
|
4
|
+
cacheable?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare const paginate: ({ where, pagina, limite, order }: {
|
|
7
|
+
where: any;
|
|
8
|
+
pagina: any;
|
|
9
|
+
limite: any;
|
|
10
|
+
order: any;
|
|
11
|
+
}) => {
|
|
12
|
+
where: any;
|
|
13
|
+
offset: number;
|
|
14
|
+
limit: any;
|
|
15
|
+
order: any;
|
|
16
|
+
};
|
|
17
|
+
export declare const peticion: ({ where, include, cacheable }: Peticion) => {
|
|
18
|
+
cacheable: any;
|
|
19
|
+
include?: any;
|
|
20
|
+
where?: any;
|
|
21
|
+
};
|
|
22
|
+
export declare class Conteo {
|
|
23
|
+
conteo: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class Status {
|
|
26
|
+
status: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class ArgsFechas {
|
|
29
|
+
inicio: Date;
|
|
30
|
+
final: Date;
|
|
31
|
+
}
|
|
32
|
+
export declare class OrderInput {
|
|
33
|
+
as: String;
|
|
34
|
+
acomodo: String;
|
|
35
|
+
key: String;
|
|
36
|
+
}
|
|
37
|
+
export declare class UtilsModule {
|
|
38
|
+
}
|
|
39
|
+
export {};
|
package/types.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UtilsModule = exports.OrderInput = exports.ArgsFechas = exports.Status = exports.Conteo = exports.peticion = exports.paginate = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const typegraphql_nestjs_1 = require("typegraphql-nestjs");
|
|
16
|
+
const paginate = ({ where, pagina, limite, order }) => {
|
|
17
|
+
const offset = (pagina - 1) * limite;
|
|
18
|
+
const limit = limite;
|
|
19
|
+
return {
|
|
20
|
+
where,
|
|
21
|
+
offset,
|
|
22
|
+
limit,
|
|
23
|
+
order,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.paginate = paginate;
|
|
27
|
+
const peticion = ({ where, include, cacheable }) => {
|
|
28
|
+
return {
|
|
29
|
+
...(where ? { where } : {}),
|
|
30
|
+
...(include ? { include } : {}),
|
|
31
|
+
cacheable,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.peticion = peticion;
|
|
35
|
+
let Conteo = class Conteo {
|
|
36
|
+
};
|
|
37
|
+
exports.Conteo = Conteo;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, graphql_1.Field)(),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], Conteo.prototype, "conteo", void 0);
|
|
42
|
+
exports.Conteo = Conteo = __decorate([
|
|
43
|
+
(0, graphql_1.ObjectType)()
|
|
44
|
+
], Conteo);
|
|
45
|
+
let Status = class Status {
|
|
46
|
+
};
|
|
47
|
+
exports.Status = Status;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, graphql_1.Field)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], Status.prototype, "status", void 0);
|
|
52
|
+
exports.Status = Status = __decorate([
|
|
53
|
+
(0, graphql_1.ObjectType)()
|
|
54
|
+
], Status);
|
|
55
|
+
let ArgsFechas = class ArgsFechas {
|
|
56
|
+
};
|
|
57
|
+
exports.ArgsFechas = ArgsFechas;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, graphql_1.Field)(),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], ArgsFechas.prototype, "inicio", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, graphql_1.Field)(),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], ArgsFechas.prototype, "final", void 0);
|
|
66
|
+
exports.ArgsFechas = ArgsFechas = __decorate([
|
|
67
|
+
(0, graphql_1.ArgsType)()
|
|
68
|
+
], ArgsFechas);
|
|
69
|
+
let OrderInput = class OrderInput {
|
|
70
|
+
};
|
|
71
|
+
exports.OrderInput = OrderInput;
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, graphql_1.Field)((type) => String, { nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], OrderInput.prototype, "as", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, graphql_1.Field)((type) => String),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], OrderInput.prototype, "acomodo", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, graphql_1.Field)((type) => String),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], OrderInput.prototype, "key", void 0);
|
|
84
|
+
exports.OrderInput = OrderInput = __decorate([
|
|
85
|
+
(0, graphql_1.InputType)()
|
|
86
|
+
], OrderInput);
|
|
87
|
+
let UtilsModule = class UtilsModule {
|
|
88
|
+
};
|
|
89
|
+
exports.UtilsModule = UtilsModule;
|
|
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);
|