test-entity-library-asm 2.6.2 → 2.6.3
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/entities/Permission.d.ts +9 -9
- package/dist/entities/Permission.js +63 -63
- package/dist/entities/Role.d.ts +12 -12
- package/dist/entities/Role.js +81 -81
- package/dist/entities/RoleVisibleTo.d.ts +6 -6
- package/dist/entities/RoleVisibleTo.js +47 -47
- package/dist/entities/ScheduleCategory.d.ts +9 -9
- package/dist/entities/ScheduleCategory.js +48 -48
- package/dist/entities/TypeFood.d.ts +8 -8
- package/dist/entities/TypeFood.js +68 -68
- package/dist/middlewares/timezoneMiddleware.d.ts +3 -3
- package/dist/middlewares/timezoneMiddleware.js +22 -22
- package/dist/repositories/VerifyLocalRepository.d.ts +4 -4
- package/dist/repositories/VerifyLocalRepository.js +142 -142
- package/dist/transformations.d.ts +4 -4
- package/dist/transformations.js +16 -16
- package/dist/views/MasterNotifications.d.ts +2 -0
- package/dist/views/MasterNotifications.js +8 -0
- package/package.json +29 -29
- package/src/views/MasterNotifications.ts +6 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Role } from './Role';
|
|
2
|
-
export declare class Permission {
|
|
3
|
-
id: number;
|
|
4
|
-
code: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description: string;
|
|
7
|
-
status: number;
|
|
8
|
-
roles: Role[];
|
|
9
|
-
}
|
|
1
|
+
import { Role } from './Role';
|
|
2
|
+
export declare class Permission {
|
|
3
|
+
id: number;
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: number;
|
|
8
|
+
roles: Role[];
|
|
9
|
+
}
|
|
@@ -1,63 +1,63 @@
|
|
|
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.Permission = void 0;
|
|
13
|
-
var typeorm_1 = require("typeorm");
|
|
14
|
-
var Role_1 = require("./Role");
|
|
15
|
-
var Permission = /** @class */ (function () {
|
|
16
|
-
function Permission() {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
-
}),
|
|
22
|
-
__metadata("design:type", Number)
|
|
23
|
-
], Permission.prototype, "id", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, typeorm_1.Column)({ length: 10, unique: true, comment: 'Código del permiso.' }),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], Permission.prototype, "code", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)({
|
|
30
|
-
length: 40,
|
|
31
|
-
comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
|
|
32
|
-
}),
|
|
33
|
-
__metadata("design:type", String)
|
|
34
|
-
], Permission.prototype, "name", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({
|
|
37
|
-
length: 40,
|
|
38
|
-
comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
|
|
39
|
-
}),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], Permission.prototype, "description", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)({
|
|
44
|
-
default: 1,
|
|
45
|
-
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
46
|
-
}),
|
|
47
|
-
__metadata("design:type", Number)
|
|
48
|
-
], Permission.prototype, "status", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typeorm_1.ManyToMany)(function () { return Role_1.Role; }),
|
|
51
|
-
(0, typeorm_1.JoinTable)({
|
|
52
|
-
name: 'role_permission',
|
|
53
|
-
}),
|
|
54
|
-
__metadata("design:type", Array)
|
|
55
|
-
], Permission.prototype, "roles", void 0);
|
|
56
|
-
Permission = __decorate([
|
|
57
|
-
(0, typeorm_1.Entity)('permission', {
|
|
58
|
-
comment: 'Permisos que va a tener cada rol.',
|
|
59
|
-
})
|
|
60
|
-
], Permission);
|
|
61
|
-
return Permission;
|
|
62
|
-
}());
|
|
63
|
-
exports.Permission = Permission;
|
|
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.Permission = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Role_1 = require("./Role");
|
|
15
|
+
var Permission = /** @class */ (function () {
|
|
16
|
+
function Permission() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
+
}),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], Permission.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ length: 10, unique: true, comment: 'Código del permiso.' }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Permission.prototype, "code", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({
|
|
30
|
+
length: 40,
|
|
31
|
+
comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Permission.prototype, "name", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({
|
|
37
|
+
length: 40,
|
|
38
|
+
comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Permission.prototype, "description", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({
|
|
44
|
+
default: 1,
|
|
45
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], Permission.prototype, "status", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToMany)(function () { return Role_1.Role; }),
|
|
51
|
+
(0, typeorm_1.JoinTable)({
|
|
52
|
+
name: 'role_permission',
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], Permission.prototype, "roles", void 0);
|
|
56
|
+
Permission = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)('permission', {
|
|
58
|
+
comment: 'Permisos que va a tener cada rol.',
|
|
59
|
+
})
|
|
60
|
+
], Permission);
|
|
61
|
+
return Permission;
|
|
62
|
+
}());
|
|
63
|
+
exports.Permission = Permission;
|
package/dist/entities/Role.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Permission } from './Permission';
|
|
2
|
-
import { RoleVisibleTo } from './RoleVisibleTo';
|
|
3
|
-
export declare class Role {
|
|
4
|
-
id: number;
|
|
5
|
-
code: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
status: number;
|
|
9
|
-
permissions: Permission[];
|
|
10
|
-
rolesVisibleTo: RoleVisibleTo[];
|
|
11
|
-
visiblesTo: RoleVisibleTo[];
|
|
12
|
-
}
|
|
1
|
+
import { Permission } from './Permission';
|
|
2
|
+
import { RoleVisibleTo } from './RoleVisibleTo';
|
|
3
|
+
export declare class Role {
|
|
4
|
+
id: number;
|
|
5
|
+
code: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
status: number;
|
|
9
|
+
permissions: Permission[];
|
|
10
|
+
rolesVisibleTo: RoleVisibleTo[];
|
|
11
|
+
visiblesTo: RoleVisibleTo[];
|
|
12
|
+
}
|
package/dist/entities/Role.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
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.Role = void 0;
|
|
13
|
-
var typeorm_1 = require("typeorm");
|
|
14
|
-
var Permission_1 = require("./Permission");
|
|
15
|
-
var RoleVisibleTo_1 = require("./RoleVisibleTo");
|
|
16
|
-
var Role = /** @class */ (function () {
|
|
17
|
-
function Role() {
|
|
18
|
-
}
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", Number)
|
|
24
|
-
], Role.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, typeorm_1.Column)({ length: 10, comment: 'Código único del rol.' }),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], Role.prototype, "code", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, typeorm_1.Column)({
|
|
31
|
-
length: 40,
|
|
32
|
-
comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
33
|
-
}),
|
|
34
|
-
__metadata("design:type", String)
|
|
35
|
-
], Role.prototype, "name", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, typeorm_1.Column)({
|
|
38
|
-
length: 40,
|
|
39
|
-
nullable: true,
|
|
40
|
-
comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
41
|
-
}),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], Role.prototype, "description", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({
|
|
46
|
-
default: 1,
|
|
47
|
-
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
48
|
-
}),
|
|
49
|
-
__metadata("design:type", Number)
|
|
50
|
-
], Role.prototype, "status", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, typeorm_1.ManyToMany)(function () { return Permission_1.Permission; }),
|
|
53
|
-
(0, typeorm_1.JoinTable)({
|
|
54
|
-
name: 'role_permission',
|
|
55
|
-
joinColumn: {
|
|
56
|
-
name: 'permission',
|
|
57
|
-
referencedColumnName: 'id',
|
|
58
|
-
},
|
|
59
|
-
inverseJoinColumn: {
|
|
60
|
-
name: 'role',
|
|
61
|
-
referencedColumnName: 'id',
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
__metadata("design:type", Array)
|
|
65
|
-
], Role.prototype, "permissions", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.OneToMany)(function () { return RoleVisibleTo_1.RoleVisibleTo; }, function (roleVisibleTo) { return roleVisibleTo.role; }),
|
|
68
|
-
__metadata("design:type", Array)
|
|
69
|
-
], Role.prototype, "rolesVisibleTo", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
(0, typeorm_1.OneToMany)(function () { return RoleVisibleTo_1.RoleVisibleTo; }, function (roleVisibleTo) { return roleVisibleTo.visible_to; }),
|
|
72
|
-
__metadata("design:type", Array)
|
|
73
|
-
], Role.prototype, "visiblesTo", void 0);
|
|
74
|
-
Role = __decorate([
|
|
75
|
-
(0, typeorm_1.Entity)({
|
|
76
|
-
comment: 'Roles que se le pueden agregar a un usuario en la plataforma.',
|
|
77
|
-
})
|
|
78
|
-
], Role);
|
|
79
|
-
return Role;
|
|
80
|
-
}());
|
|
81
|
-
exports.Role = Role;
|
|
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.Role = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Permission_1 = require("./Permission");
|
|
15
|
+
var RoleVisibleTo_1 = require("./RoleVisibleTo");
|
|
16
|
+
var Role = /** @class */ (function () {
|
|
17
|
+
function Role() {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], Role.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ length: 10, comment: 'Código único del rol.' }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Role.prototype, "code", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
length: 40,
|
|
32
|
+
comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Role.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({
|
|
38
|
+
length: 40,
|
|
39
|
+
nullable: true,
|
|
40
|
+
comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Role.prototype, "description", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({
|
|
46
|
+
default: 1,
|
|
47
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], Role.prototype, "status", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.ManyToMany)(function () { return Permission_1.Permission; }),
|
|
53
|
+
(0, typeorm_1.JoinTable)({
|
|
54
|
+
name: 'role_permission',
|
|
55
|
+
joinColumn: {
|
|
56
|
+
name: 'permission',
|
|
57
|
+
referencedColumnName: 'id',
|
|
58
|
+
},
|
|
59
|
+
inverseJoinColumn: {
|
|
60
|
+
name: 'role',
|
|
61
|
+
referencedColumnName: 'id',
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Array)
|
|
65
|
+
], Role.prototype, "permissions", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.OneToMany)(function () { return RoleVisibleTo_1.RoleVisibleTo; }, function (roleVisibleTo) { return roleVisibleTo.role; }),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], Role.prototype, "rolesVisibleTo", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.OneToMany)(function () { return RoleVisibleTo_1.RoleVisibleTo; }, function (roleVisibleTo) { return roleVisibleTo.visible_to; }),
|
|
72
|
+
__metadata("design:type", Array)
|
|
73
|
+
], Role.prototype, "visiblesTo", void 0);
|
|
74
|
+
Role = __decorate([
|
|
75
|
+
(0, typeorm_1.Entity)({
|
|
76
|
+
comment: 'Roles que se le pueden agregar a un usuario en la plataforma.',
|
|
77
|
+
})
|
|
78
|
+
], Role);
|
|
79
|
+
return Role;
|
|
80
|
+
}());
|
|
81
|
+
exports.Role = Role;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Role } from './Role';
|
|
2
|
-
export declare class RoleVisibleTo {
|
|
3
|
-
id: number;
|
|
4
|
-
role: Role;
|
|
5
|
-
visible_to: Role;
|
|
6
|
-
}
|
|
1
|
+
import { Role } from './Role';
|
|
2
|
+
export declare class RoleVisibleTo {
|
|
3
|
+
id: number;
|
|
4
|
+
role: Role;
|
|
5
|
+
visible_to: Role;
|
|
6
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
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.RoleVisibleTo = void 0;
|
|
13
|
-
var typeorm_1 = require("typeorm");
|
|
14
|
-
var Role_1 = require("./Role");
|
|
15
|
-
var RoleVisibleTo = /** @class */ (function () {
|
|
16
|
-
function RoleVisibleTo() {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
-
}),
|
|
22
|
-
__metadata("design:type", Number)
|
|
23
|
-
], RoleVisibleTo.prototype, "id", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, typeorm_1.ManyToOne)(function () { return Role_1.Role; }, function (role) { return role.rolesVisibleTo; }, {
|
|
26
|
-
onDelete: 'CASCADE',
|
|
27
|
-
onUpdate: 'NO ACTION',
|
|
28
|
-
}),
|
|
29
|
-
(0, typeorm_1.JoinColumn)({ name: 'role' }),
|
|
30
|
-
__metadata("design:type", Role_1.Role)
|
|
31
|
-
], RoleVisibleTo.prototype, "role", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typeorm_1.ManyToOne)(function () { return Role_1.Role; }, function (role) { return role.visiblesTo; }, {
|
|
34
|
-
onDelete: 'CASCADE',
|
|
35
|
-
onUpdate: 'NO ACTION',
|
|
36
|
-
}),
|
|
37
|
-
(0, typeorm_1.JoinColumn)({ name: 'visible_to' }),
|
|
38
|
-
__metadata("design:type", Role_1.Role)
|
|
39
|
-
], RoleVisibleTo.prototype, "visible_to", void 0);
|
|
40
|
-
RoleVisibleTo = __decorate([
|
|
41
|
-
(0, typeorm_1.Entity)('role_visible_to', {
|
|
42
|
-
comment: 'Con esta tabla validamos cuales son los roles que puede agregar a otros usuarios qué roles',
|
|
43
|
-
})
|
|
44
|
-
], RoleVisibleTo);
|
|
45
|
-
return RoleVisibleTo;
|
|
46
|
-
}());
|
|
47
|
-
exports.RoleVisibleTo = RoleVisibleTo;
|
|
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.RoleVisibleTo = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Role_1 = require("./Role");
|
|
15
|
+
var RoleVisibleTo = /** @class */ (function () {
|
|
16
|
+
function RoleVisibleTo() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
+
}),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], RoleVisibleTo.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(function () { return Role_1.Role; }, function (role) { return role.rolesVisibleTo; }, {
|
|
26
|
+
onDelete: 'CASCADE',
|
|
27
|
+
onUpdate: 'NO ACTION',
|
|
28
|
+
}),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: 'role' }),
|
|
30
|
+
__metadata("design:type", Role_1.Role)
|
|
31
|
+
], RoleVisibleTo.prototype, "role", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.ManyToOne)(function () { return Role_1.Role; }, function (role) { return role.visiblesTo; }, {
|
|
34
|
+
onDelete: 'CASCADE',
|
|
35
|
+
onUpdate: 'NO ACTION',
|
|
36
|
+
}),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: 'visible_to' }),
|
|
38
|
+
__metadata("design:type", Role_1.Role)
|
|
39
|
+
], RoleVisibleTo.prototype, "visible_to", void 0);
|
|
40
|
+
RoleVisibleTo = __decorate([
|
|
41
|
+
(0, typeorm_1.Entity)('role_visible_to', {
|
|
42
|
+
comment: 'Con esta tabla validamos cuales son los roles que puede agregar a otros usuarios qué roles',
|
|
43
|
+
})
|
|
44
|
+
], RoleVisibleTo);
|
|
45
|
+
return RoleVisibleTo;
|
|
46
|
+
}());
|
|
47
|
+
exports.RoleVisibleTo = RoleVisibleTo;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Category } from './Category';
|
|
2
|
-
import { Day } from './Day';
|
|
3
|
-
export declare class ScheduleCategory {
|
|
4
|
-
id: number;
|
|
5
|
-
category: Category;
|
|
6
|
-
day: Day;
|
|
7
|
-
start_time: string;
|
|
8
|
-
end_time: string;
|
|
9
|
-
}
|
|
1
|
+
import { Category } from './Category';
|
|
2
|
+
import { Day } from './Day';
|
|
3
|
+
export declare class ScheduleCategory {
|
|
4
|
+
id: number;
|
|
5
|
+
category: Category;
|
|
6
|
+
day: Day;
|
|
7
|
+
start_time: string;
|
|
8
|
+
end_time: string;
|
|
9
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
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.ScheduleCategory = void 0;
|
|
13
|
-
var typeorm_1 = require("typeorm");
|
|
14
|
-
var Category_1 = require("./Category");
|
|
15
|
-
var Day_1 = require("./Day");
|
|
16
|
-
var ScheduleCategory = /** @class */ (function () {
|
|
17
|
-
function ScheduleCategory() {
|
|
18
|
-
}
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
|
-
__metadata("design:type", Number)
|
|
22
|
-
], ScheduleCategory.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
|
|
25
|
-
(0, typeorm_1.JoinColumn)({ name: 'category' }),
|
|
26
|
-
__metadata("design:type", Category_1.Category)
|
|
27
|
-
], ScheduleCategory.prototype, "category", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.ManyToOne)(function () { return Day_1.Day; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
|
|
30
|
-
(0, typeorm_1.JoinColumn)({ name: 'day' }),
|
|
31
|
-
__metadata("design:type", Day_1.Day)
|
|
32
|
-
], ScheduleCategory.prototype, "day", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)(),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], ScheduleCategory.prototype, "start_time", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], ScheduleCategory.prototype, "end_time", void 0);
|
|
41
|
-
ScheduleCategory = __decorate([
|
|
42
|
-
(0, typeorm_1.Entity)('schedule_category', {
|
|
43
|
-
comment: 'Acá podemos agregar los horarios para las categorías de los productos. O sea, si una categoría sólo está los miércoles, entonces podría agregar el día y los horarios.',
|
|
44
|
-
})
|
|
45
|
-
], ScheduleCategory);
|
|
46
|
-
return ScheduleCategory;
|
|
47
|
-
}());
|
|
48
|
-
exports.ScheduleCategory = ScheduleCategory;
|
|
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.ScheduleCategory = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Category_1 = require("./Category");
|
|
15
|
+
var Day_1 = require("./Day");
|
|
16
|
+
var ScheduleCategory = /** @class */ (function () {
|
|
17
|
+
function ScheduleCategory() {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], ScheduleCategory.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
|
|
25
|
+
(0, typeorm_1.JoinColumn)({ name: 'category' }),
|
|
26
|
+
__metadata("design:type", Category_1.Category)
|
|
27
|
+
], ScheduleCategory.prototype, "category", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return Day_1.Day; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: 'day' }),
|
|
31
|
+
__metadata("design:type", Day_1.Day)
|
|
32
|
+
], ScheduleCategory.prototype, "day", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ScheduleCategory.prototype, "start_time", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ScheduleCategory.prototype, "end_time", void 0);
|
|
41
|
+
ScheduleCategory = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)('schedule_category', {
|
|
43
|
+
comment: 'Acá podemos agregar los horarios para las categorías de los productos. O sea, si una categoría sólo está los miércoles, entonces podría agregar el día y los horarios.',
|
|
44
|
+
})
|
|
45
|
+
], ScheduleCategory);
|
|
46
|
+
return ScheduleCategory;
|
|
47
|
+
}());
|
|
48
|
+
exports.ScheduleCategory = ScheduleCategory;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Company } from './Company';
|
|
2
|
-
export declare class TypeFood {
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
photo: string;
|
|
6
|
-
status: number;
|
|
7
|
-
companies: Company[];
|
|
8
|
-
}
|
|
1
|
+
import { Company } from './Company';
|
|
2
|
+
export declare class TypeFood {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
photo: string;
|
|
6
|
+
status: number;
|
|
7
|
+
companies: Company[];
|
|
8
|
+
}
|
|
@@ -1,68 +1,68 @@
|
|
|
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.TypeFood = void 0;
|
|
13
|
-
var typeorm_1 = require("typeorm");
|
|
14
|
-
var Company_1 = require("./Company");
|
|
15
|
-
var TypeFood = /** @class */ (function () {
|
|
16
|
-
function TypeFood() {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
-
}),
|
|
22
|
-
__metadata("design:type", Number)
|
|
23
|
-
], TypeFood.prototype, "id", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, typeorm_1.Column)({
|
|
26
|
-
length: 40,
|
|
27
|
-
comment: 'ID de la variable que se encuentra en los archivos `locales` para el multilenguaje.',
|
|
28
|
-
}),
|
|
29
|
-
__metadata("design:type", String)
|
|
30
|
-
], TypeFood.prototype, "name", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, typeorm_1.Column)({
|
|
33
|
-
length: 500,
|
|
34
|
-
nullable: true,
|
|
35
|
-
comment: 'Imagen para el tipo de comida.',
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], TypeFood.prototype, "photo", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)({
|
|
41
|
-
default: 1,
|
|
42
|
-
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
43
|
-
}),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], TypeFood.prototype, "status", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.ManyToMany)(function () { return Company_1.Company; }),
|
|
48
|
-
(0, typeorm_1.JoinTable)({
|
|
49
|
-
name: 'type_food_company',
|
|
50
|
-
joinColumn: {
|
|
51
|
-
name: 'company',
|
|
52
|
-
referencedColumnName: 'id',
|
|
53
|
-
},
|
|
54
|
-
inverseJoinColumn: {
|
|
55
|
-
name: 'type_food',
|
|
56
|
-
referencedColumnName: 'id',
|
|
57
|
-
},
|
|
58
|
-
}),
|
|
59
|
-
__metadata("design:type", Array)
|
|
60
|
-
], TypeFood.prototype, "companies", void 0);
|
|
61
|
-
TypeFood = __decorate([
|
|
62
|
-
(0, typeorm_1.Entity)('type_food', {
|
|
63
|
-
comment: 'Tipo de comida que va a tener la plataforma.',
|
|
64
|
-
})
|
|
65
|
-
], TypeFood);
|
|
66
|
-
return TypeFood;
|
|
67
|
-
}());
|
|
68
|
-
exports.TypeFood = TypeFood;
|
|
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.TypeFood = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Company_1 = require("./Company");
|
|
15
|
+
var TypeFood = /** @class */ (function () {
|
|
16
|
+
function TypeFood() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
21
|
+
}),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], TypeFood.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({
|
|
26
|
+
length: 40,
|
|
27
|
+
comment: 'ID de la variable que se encuentra en los archivos `locales` para el multilenguaje.',
|
|
28
|
+
}),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], TypeFood.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({
|
|
33
|
+
length: 500,
|
|
34
|
+
nullable: true,
|
|
35
|
+
comment: 'Imagen para el tipo de comida.',
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], TypeFood.prototype, "photo", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({
|
|
41
|
+
default: 1,
|
|
42
|
+
comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], TypeFood.prototype, "status", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.ManyToMany)(function () { return Company_1.Company; }),
|
|
48
|
+
(0, typeorm_1.JoinTable)({
|
|
49
|
+
name: 'type_food_company',
|
|
50
|
+
joinColumn: {
|
|
51
|
+
name: 'company',
|
|
52
|
+
referencedColumnName: 'id',
|
|
53
|
+
},
|
|
54
|
+
inverseJoinColumn: {
|
|
55
|
+
name: 'type_food',
|
|
56
|
+
referencedColumnName: 'id',
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], TypeFood.prototype, "companies", void 0);
|
|
61
|
+
TypeFood = __decorate([
|
|
62
|
+
(0, typeorm_1.Entity)('type_food', {
|
|
63
|
+
comment: 'Tipo de comida que va a tener la plataforma.',
|
|
64
|
+
})
|
|
65
|
+
], TypeFood);
|
|
66
|
+
return TypeFood;
|
|
67
|
+
}());
|
|
68
|
+
exports.TypeFood = TypeFood;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NextFunction, Request, Response } from 'express';
|
|
2
|
-
export declare function timezoneMiddleware(req: Request, res: Response, next: NextFunction): void;
|
|
3
|
-
export declare function getTimeZone(): string;
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
2
|
+
export declare function timezoneMiddleware(req: Request, res: Response, next: NextFunction): void;
|
|
3
|
+
export declare function getTimeZone(): string;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimeZone = exports.timezoneMiddleware = void 0;
|
|
4
|
-
var async_hooks_1 = require("async_hooks");
|
|
5
|
-
var asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
|
|
6
|
-
function timezoneMiddleware(req, res, next) {
|
|
7
|
-
var userTimeZone = req.headers['user-timezone'];
|
|
8
|
-
if (Array.isArray(userTimeZone)) {
|
|
9
|
-
userTimeZone = userTimeZone[0];
|
|
10
|
-
}
|
|
11
|
-
userTimeZone = userTimeZone || 'UTC';
|
|
12
|
-
asyncLocalStorage.run(new Map([['timezone', userTimeZone]]), function () {
|
|
13
|
-
next();
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
exports.timezoneMiddleware = timezoneMiddleware;
|
|
17
|
-
function getTimeZone() {
|
|
18
|
-
var _a;
|
|
19
|
-
var store = asyncLocalStorage.getStore();
|
|
20
|
-
return (_a = store === null || store === void 0 ? void 0 : store.get('timezone')) !== null && _a !== void 0 ? _a : 'UTC';
|
|
21
|
-
}
|
|
22
|
-
exports.getTimeZone = getTimeZone;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimeZone = exports.timezoneMiddleware = void 0;
|
|
4
|
+
var async_hooks_1 = require("async_hooks");
|
|
5
|
+
var asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
|
|
6
|
+
function timezoneMiddleware(req, res, next) {
|
|
7
|
+
var userTimeZone = req.headers['user-timezone'];
|
|
8
|
+
if (Array.isArray(userTimeZone)) {
|
|
9
|
+
userTimeZone = userTimeZone[0];
|
|
10
|
+
}
|
|
11
|
+
userTimeZone = userTimeZone || 'UTC';
|
|
12
|
+
asyncLocalStorage.run(new Map([['timezone', userTimeZone]]), function () {
|
|
13
|
+
next();
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.timezoneMiddleware = timezoneMiddleware;
|
|
17
|
+
function getTimeZone() {
|
|
18
|
+
var _a;
|
|
19
|
+
var store = asyncLocalStorage.getStore();
|
|
20
|
+
return (_a = store === null || store === void 0 ? void 0 : store.get('timezone')) !== null && _a !== void 0 ? _a : 'UTC';
|
|
21
|
+
}
|
|
22
|
+
exports.getTimeZone = getTimeZone;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm';
|
|
2
|
-
export declare const createCustomRepository: <T extends ObjectLiteral>(entity: EntityTarget<T>, dataSource: DataSource) => Repository<T> & {
|
|
3
|
-
getVerifyLocals: Function;
|
|
4
|
-
};
|
|
1
|
+
import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm';
|
|
2
|
+
export declare const createCustomRepository: <T extends ObjectLiteral>(entity: EntityTarget<T>, dataSource: DataSource) => Repository<T> & {
|
|
3
|
+
getVerifyLocals: Function;
|
|
4
|
+
};
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.createCustomRepository = void 0;
|
|
55
|
-
var typeorm_1 = require("typeorm");
|
|
56
|
-
var CustomRepository = /** @class */ (function (_super) {
|
|
57
|
-
__extends(CustomRepository, _super);
|
|
58
|
-
function CustomRepository() {
|
|
59
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
-
}
|
|
61
|
-
CustomRepository.prototype.getVerifyLocals = function (status, page, pageSize, filters) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var queryBuilder, globalValue, _a, data, total;
|
|
64
|
-
return __generator(this, function (_b) {
|
|
65
|
-
switch (_b.label) {
|
|
66
|
-
case 0:
|
|
67
|
-
queryBuilder = this.createQueryBuilder('verifyLocal')
|
|
68
|
-
.skip((page - 1) * pageSize)
|
|
69
|
-
.take(pageSize);
|
|
70
|
-
// Filtro por estado si está definido
|
|
71
|
-
if (status !== null && status >= 0) {
|
|
72
|
-
queryBuilder.andWhere('verifyLocal.status = :status', { status: status });
|
|
73
|
-
}
|
|
74
|
-
// Filtro global que busca en múltiples campos
|
|
75
|
-
if (filters['global'] && filters['global'].value) {
|
|
76
|
-
globalValue = "%".concat(filters['global'].value, "%");
|
|
77
|
-
queryBuilder.andWhere('(JSON_EXTRACT(verifyLocal.local_information, "$.name") LIKE :globalValue ' +
|
|
78
|
-
'OR JSON_EXTRACT(verifyLocal.local_information, "$.square.address") LIKE :globalValue ' +
|
|
79
|
-
'OR JSON_EXTRACT(verifyLocal.local_information, "$.address.formatted_address") LIKE :globalValue ' +
|
|
80
|
-
'OR verifyLocal.status LIKE :globalValue)', { globalValue: globalValue });
|
|
81
|
-
}
|
|
82
|
-
// Filtros específicos de columnas
|
|
83
|
-
Object.keys(filters).forEach(function (key) {
|
|
84
|
-
var _a, _b, _c, _d;
|
|
85
|
-
if (key !== 'global' && filters[key].constraints) {
|
|
86
|
-
var filter = filters[key];
|
|
87
|
-
var value = filter.constraints[0].value;
|
|
88
|
-
var matchMode = filter.constraints[0].matchMode;
|
|
89
|
-
if (value !== null) {
|
|
90
|
-
var jsonPath = key
|
|
91
|
-
.split('.')
|
|
92
|
-
.map(function (segment) { return "$.".concat(segment); })
|
|
93
|
-
.join('');
|
|
94
|
-
switch (matchMode) {
|
|
95
|
-
case 'startsWith':
|
|
96
|
-
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_a = {},
|
|
97
|
-
_a[key] = "".concat(value, "%"),
|
|
98
|
-
_a));
|
|
99
|
-
break;
|
|
100
|
-
case 'contains':
|
|
101
|
-
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_b = {},
|
|
102
|
-
_b[key] = "%".concat(value, "%"),
|
|
103
|
-
_b));
|
|
104
|
-
break;
|
|
105
|
-
case 'equals':
|
|
106
|
-
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") = :").concat(key), (_c = {},
|
|
107
|
-
_c[key] = value,
|
|
108
|
-
_c));
|
|
109
|
-
break;
|
|
110
|
-
case 'dateIs':
|
|
111
|
-
queryBuilder.andWhere("DATE(JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\")) = :").concat(key), (_d = {},
|
|
112
|
-
_d[key] = value,
|
|
113
|
-
_d));
|
|
114
|
-
break;
|
|
115
|
-
// Agregar otros modos de coincidencia según sea necesario
|
|
116
|
-
default:
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return [4 /*yield*/, queryBuilder.getManyAndCount()];
|
|
123
|
-
case 1:
|
|
124
|
-
_a = _b.sent(), data = _a[0], total = _a[1];
|
|
125
|
-
return [2 /*return*/, {
|
|
126
|
-
data: data,
|
|
127
|
-
total: total,
|
|
128
|
-
page: page,
|
|
129
|
-
pageSize: pageSize,
|
|
130
|
-
totalPages: Math.ceil(total / pageSize),
|
|
131
|
-
}];
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
return CustomRepository;
|
|
137
|
-
}(typeorm_1.Repository));
|
|
138
|
-
var createCustomRepository = function (entity, dataSource) {
|
|
139
|
-
var baseRepository = dataSource.getRepository(entity);
|
|
140
|
-
return baseRepository.extend(CustomRepository.prototype);
|
|
141
|
-
};
|
|
142
|
-
exports.createCustomRepository = createCustomRepository;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports.createCustomRepository = void 0;
|
|
55
|
+
var typeorm_1 = require("typeorm");
|
|
56
|
+
var CustomRepository = /** @class */ (function (_super) {
|
|
57
|
+
__extends(CustomRepository, _super);
|
|
58
|
+
function CustomRepository() {
|
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
60
|
+
}
|
|
61
|
+
CustomRepository.prototype.getVerifyLocals = function (status, page, pageSize, filters) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var queryBuilder, globalValue, _a, data, total;
|
|
64
|
+
return __generator(this, function (_b) {
|
|
65
|
+
switch (_b.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
queryBuilder = this.createQueryBuilder('verifyLocal')
|
|
68
|
+
.skip((page - 1) * pageSize)
|
|
69
|
+
.take(pageSize);
|
|
70
|
+
// Filtro por estado si está definido
|
|
71
|
+
if (status !== null && status >= 0) {
|
|
72
|
+
queryBuilder.andWhere('verifyLocal.status = :status', { status: status });
|
|
73
|
+
}
|
|
74
|
+
// Filtro global que busca en múltiples campos
|
|
75
|
+
if (filters['global'] && filters['global'].value) {
|
|
76
|
+
globalValue = "%".concat(filters['global'].value, "%");
|
|
77
|
+
queryBuilder.andWhere('(JSON_EXTRACT(verifyLocal.local_information, "$.name") LIKE :globalValue ' +
|
|
78
|
+
'OR JSON_EXTRACT(verifyLocal.local_information, "$.square.address") LIKE :globalValue ' +
|
|
79
|
+
'OR JSON_EXTRACT(verifyLocal.local_information, "$.address.formatted_address") LIKE :globalValue ' +
|
|
80
|
+
'OR verifyLocal.status LIKE :globalValue)', { globalValue: globalValue });
|
|
81
|
+
}
|
|
82
|
+
// Filtros específicos de columnas
|
|
83
|
+
Object.keys(filters).forEach(function (key) {
|
|
84
|
+
var _a, _b, _c, _d;
|
|
85
|
+
if (key !== 'global' && filters[key].constraints) {
|
|
86
|
+
var filter = filters[key];
|
|
87
|
+
var value = filter.constraints[0].value;
|
|
88
|
+
var matchMode = filter.constraints[0].matchMode;
|
|
89
|
+
if (value !== null) {
|
|
90
|
+
var jsonPath = key
|
|
91
|
+
.split('.')
|
|
92
|
+
.map(function (segment) { return "$.".concat(segment); })
|
|
93
|
+
.join('');
|
|
94
|
+
switch (matchMode) {
|
|
95
|
+
case 'startsWith':
|
|
96
|
+
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_a = {},
|
|
97
|
+
_a[key] = "".concat(value, "%"),
|
|
98
|
+
_a));
|
|
99
|
+
break;
|
|
100
|
+
case 'contains':
|
|
101
|
+
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_b = {},
|
|
102
|
+
_b[key] = "%".concat(value, "%"),
|
|
103
|
+
_b));
|
|
104
|
+
break;
|
|
105
|
+
case 'equals':
|
|
106
|
+
queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") = :").concat(key), (_c = {},
|
|
107
|
+
_c[key] = value,
|
|
108
|
+
_c));
|
|
109
|
+
break;
|
|
110
|
+
case 'dateIs':
|
|
111
|
+
queryBuilder.andWhere("DATE(JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\")) = :").concat(key), (_d = {},
|
|
112
|
+
_d[key] = value,
|
|
113
|
+
_d));
|
|
114
|
+
break;
|
|
115
|
+
// Agregar otros modos de coincidencia según sea necesario
|
|
116
|
+
default:
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return [4 /*yield*/, queryBuilder.getManyAndCount()];
|
|
123
|
+
case 1:
|
|
124
|
+
_a = _b.sent(), data = _a[0], total = _a[1];
|
|
125
|
+
return [2 /*return*/, {
|
|
126
|
+
data: data,
|
|
127
|
+
total: total,
|
|
128
|
+
page: page,
|
|
129
|
+
pageSize: pageSize,
|
|
130
|
+
totalPages: Math.ceil(total / pageSize),
|
|
131
|
+
}];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
return CustomRepository;
|
|
137
|
+
}(typeorm_1.Repository));
|
|
138
|
+
var createCustomRepository = function (entity, dataSource) {
|
|
139
|
+
var baseRepository = dataSource.getRepository(entity);
|
|
140
|
+
return baseRepository.extend(CustomRepository.prototype);
|
|
141
|
+
};
|
|
142
|
+
exports.createCustomRepository = createCustomRepository;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const jsonTransformer: {
|
|
2
|
-
to: (value: any) => string;
|
|
3
|
-
from: (value: string) => any;
|
|
4
|
-
};
|
|
1
|
+
export declare const jsonTransformer: {
|
|
2
|
+
to: (value: any) => string;
|
|
3
|
+
from: (value: string) => any;
|
|
4
|
+
};
|
package/dist/transformations.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonTransformer = void 0;
|
|
4
|
-
// DOCUMENTATION: Variable creada para poder transformar los elementos a tipo objeto a los que están en la base de datos como strings que son objetos.
|
|
5
|
-
exports.jsonTransformer = {
|
|
6
|
-
to: function (value) { return JSON.stringify(value); },
|
|
7
|
-
from: function (value) {
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(value);
|
|
10
|
-
}
|
|
11
|
-
catch (error) {
|
|
12
|
-
console.error('Error parsing JSON:', error);
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonTransformer = void 0;
|
|
4
|
+
// DOCUMENTATION: Variable creada para poder transformar los elementos a tipo objeto a los que están en la base de datos como strings que son objetos.
|
|
5
|
+
exports.jsonTransformer = {
|
|
6
|
+
to: function (value) { return JSON.stringify(value); },
|
|
7
|
+
from: function (value) {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(value);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
console.error('Error parsing JSON:', error);
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -105,6 +105,14 @@ var MasterNotifications = /** @class */ (function () {
|
|
|
105
105
|
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
106
106
|
__metadata("design:type", Object)
|
|
107
107
|
], MasterNotifications.prototype, "company_profile", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.ViewColumn)(),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], MasterNotifications.prototype, "reassign_review_new_user", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], MasterNotifications.prototype, "reassign_review_settings", void 0);
|
|
108
116
|
MasterNotifications = __decorate([
|
|
109
117
|
(0, typeorm_1.ViewEntity)({
|
|
110
118
|
name: 'master_notifications',
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "test-entity-library-asm",
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"description": "Entidades de ejemplo para una base de datos",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
},
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "",
|
|
12
|
-
"license": "ISC",
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"dotenv": "^16.4.5",
|
|
15
|
-
"express": "^4.19.2",
|
|
16
|
-
"moment-timezone": "^0.5.45",
|
|
17
|
-
"typeorm": "^0.3.20"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/express": "^4.17.21",
|
|
21
|
-
"@types/node": "^20.12.7",
|
|
22
|
-
"typescript": "^5.4.5"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "https://github.com/jesusgomez461/test-entity-library-asm"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://github.com/jesusgomez461/test-entity-library-asm"
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "test-entity-library-asm",
|
|
3
|
+
"version": "2.6.3",
|
|
4
|
+
"description": "Entidades de ejemplo para una base de datos",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"dotenv": "^16.4.5",
|
|
15
|
+
"express": "^4.19.2",
|
|
16
|
+
"moment-timezone": "^0.5.45",
|
|
17
|
+
"typeorm": "^0.3.20"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/express": "^4.17.21",
|
|
21
|
+
"@types/node": "^20.12.7",
|
|
22
|
+
"typescript": "^5.4.5"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/jesusgomez461/test-entity-library-asm"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/jesusgomez461/test-entity-library-asm"
|
|
29
|
+
}
|