@asumano/worklip-typeorm-db 1.1.2 → 1.1.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/AssociatePermission.d.ts +2 -2
- package/dist/entities/AssociatePermission.js +4 -4
- package/dist/entities/AssociatePlatform.d.ts +2 -2
- package/dist/entities/AssociatePlatform.js +13 -2
- package/dist/entities/AssociateSection.d.ts +8 -0
- package/dist/entities/AssociateSection.js +62 -0
- package/dist/entities.index.d.ts +1 -0
- package/dist/entities.index.js +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Associate,
|
|
1
|
+
import { Associate, AssociateRole, AssociateSection } from "../entities.views.routes";
|
|
2
2
|
export declare class AssociatePermission {
|
|
3
3
|
id: number;
|
|
4
|
-
|
|
4
|
+
section: AssociateSection;
|
|
5
5
|
name: string;
|
|
6
6
|
status: number;
|
|
7
7
|
roles: AssociateRole[];
|
|
@@ -23,13 +23,13 @@ __decorate([
|
|
|
23
23
|
__metadata("design:type", Number)
|
|
24
24
|
], AssociatePermission.prototype, "id", void 0);
|
|
25
25
|
__decorate([
|
|
26
|
-
(0, typeorm_1.ManyToOne)(() => entities_views_routes_1.
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => entities_views_routes_1.AssociateSection, (section) => section.permissions, {
|
|
27
27
|
onDelete: "CASCADE",
|
|
28
28
|
onUpdate: "NO ACTION",
|
|
29
29
|
}),
|
|
30
|
-
(0, typeorm_1.JoinColumn)({ name: "
|
|
31
|
-
__metadata("design:type", entities_views_routes_1.
|
|
32
|
-
], AssociatePermission.prototype, "
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "section" }),
|
|
31
|
+
__metadata("design:type", entities_views_routes_1.AssociateSection)
|
|
32
|
+
], AssociatePermission.prototype, "section", void 0);
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre del permiso." }),
|
|
35
35
|
__metadata("design:type", String)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssociateRole, AssociateSection } from "../entities.views.routes";
|
|
2
2
|
export declare class AssociatePlatform {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
5
5
|
status: number;
|
|
6
6
|
roles: AssociateRole[];
|
|
7
|
-
|
|
7
|
+
sections: AssociateSection[];
|
|
8
8
|
}
|
|
@@ -40,9 +40,20 @@ __decorate([
|
|
|
40
40
|
__metadata("design:type", Array)
|
|
41
41
|
], AssociatePlatform.prototype, "roles", void 0);
|
|
42
42
|
__decorate([
|
|
43
|
-
(0, typeorm_1.
|
|
43
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociateSection, (associate) => associate.platforms),
|
|
44
|
+
(0, typeorm_1.JoinTable)({
|
|
45
|
+
name: "associate_platform_section",
|
|
46
|
+
joinColumn: {
|
|
47
|
+
name: "platform",
|
|
48
|
+
referencedColumnName: "id",
|
|
49
|
+
},
|
|
50
|
+
inverseJoinColumn: {
|
|
51
|
+
name: "section",
|
|
52
|
+
referencedColumnName: "id",
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
44
55
|
__metadata("design:type", Array)
|
|
45
|
-
], AssociatePlatform.prototype, "
|
|
56
|
+
], AssociatePlatform.prototype, "sections", void 0);
|
|
46
57
|
exports.AssociatePlatform = AssociatePlatform = __decorate([
|
|
47
58
|
(0, typeorm_1.Entity)({
|
|
48
59
|
comment: "Plataformas que va a tener los concesionarios/talleres.",
|
|
@@ -0,0 +1,62 @@
|
|
|
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.AssociateSection = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const entities_views_routes_1 = require("../entities.views.routes");
|
|
15
|
+
let AssociateSection = class AssociateSection {
|
|
16
|
+
};
|
|
17
|
+
exports.AssociateSection = AssociateSection;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
+
type: "int",
|
|
21
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], AssociateSection.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ length: 50, type: "varchar", comment: "Nombre de la sección." }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AssociateSection.prototype, "name", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
default: 1,
|
|
32
|
+
type: "int",
|
|
33
|
+
width: 1,
|
|
34
|
+
comment: "Estado del registro.\r\n1: Activo.\r\n0: Inactivo.",
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], AssociateSection.prototype, "status", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.ManyToMany)(() => entities_views_routes_1.AssociatePlatform, (associate) => associate.sections),
|
|
40
|
+
(0, typeorm_1.JoinTable)({
|
|
41
|
+
name: "associate_platform_section",
|
|
42
|
+
joinColumn: {
|
|
43
|
+
name: "section",
|
|
44
|
+
referencedColumnName: "id",
|
|
45
|
+
},
|
|
46
|
+
inverseJoinColumn: {
|
|
47
|
+
name: "platform",
|
|
48
|
+
referencedColumnName: "id",
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Array)
|
|
52
|
+
], AssociateSection.prototype, "platforms", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(() => entities_views_routes_1.AssociatePermission, (permission) => permission.section),
|
|
55
|
+
__metadata("design:type", Array)
|
|
56
|
+
], AssociateSection.prototype, "permissions", void 0);
|
|
57
|
+
exports.AssociateSection = AssociateSection = __decorate([
|
|
58
|
+
(0, typeorm_1.Entity)({
|
|
59
|
+
comment: "Secciones que va a tener los concesionarios/talleres.",
|
|
60
|
+
name: "associate_section",
|
|
61
|
+
})
|
|
62
|
+
], AssociateSection);
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export { Reminder } from "./entities/Reminder";
|
|
|
22
22
|
export { AssociatePlatform } from "./entities/AssociatePlatform";
|
|
23
23
|
export { AssociateRole } from "./entities/AssociateRole";
|
|
24
24
|
export { AssociatePermission } from "./entities/AssociatePermission";
|
|
25
|
+
export { AssociateSection } from "./entities/AssociateSection";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSectionItem = exports.TemplateSection = exports.Template = exports.Workshop = exports.GlobalTemplateSectionItem = exports.GlobalTemplateSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.Country = void 0;
|
|
3
|
+
exports.AssociateSection = exports.AssociatePermission = exports.AssociateRole = exports.AssociatePlatform = exports.Reminder = exports.ServiceOrderHistory = exports.ServiceOrder = exports.TemplateSectionItem = exports.TemplateSection = exports.Template = exports.Workshop = exports.GlobalTemplateSectionItem = exports.GlobalTemplateSection = exports.GlobalTemplate = exports.AssociateSession = exports.MasterSession = exports.Associate = exports.Client = exports.Master = exports.Vehicle = exports.Brand = exports.Company = exports.City = exports.Region = exports.Country = void 0;
|
|
4
4
|
var Country_1 = require("./entities/Country");
|
|
5
5
|
Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
|
|
6
6
|
var Region_1 = require("./entities/Region");
|
|
@@ -49,3 +49,5 @@ var AssociateRole_1 = require("./entities/AssociateRole");
|
|
|
49
49
|
Object.defineProperty(exports, "AssociateRole", { enumerable: true, get: function () { return AssociateRole_1.AssociateRole; } });
|
|
50
50
|
var AssociatePermission_1 = require("./entities/AssociatePermission");
|
|
51
51
|
Object.defineProperty(exports, "AssociatePermission", { enumerable: true, get: function () { return AssociatePermission_1.AssociatePermission; } });
|
|
52
|
+
var AssociateSection_1 = require("./entities/AssociateSection");
|
|
53
|
+
Object.defineProperty(exports, "AssociateSection", { enumerable: true, get: function () { return AssociateSection_1.AssociateSection; } });
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare function createDataBaseSource(): DataSource;
|
|
|
4
4
|
export declare function showEntityName<T extends ObjectLiteral>(entity: EntityTarget<T>): Promise<Repository<T>>;
|
|
5
5
|
export declare function callStoredProcedureName(storedProcedure: any, elements: any): Promise<any>;
|
|
6
6
|
export declare function getDataSource(): Promise<DataSource>;
|
|
7
|
+
export declare function executeQuery(query: string, params?: any[]): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.createDataBaseSource = createDataBaseSource;
|
|
|
40
40
|
exports.showEntityName = showEntityName;
|
|
41
41
|
exports.callStoredProcedureName = callStoredProcedureName;
|
|
42
42
|
exports.getDataSource = getDataSource;
|
|
43
|
+
exports.executeQuery = executeQuery;
|
|
43
44
|
const dotenv_1 = require("dotenv");
|
|
44
45
|
const path_1 = require("path");
|
|
45
46
|
const typeorm_1 = require("typeorm");
|
|
@@ -109,3 +110,7 @@ async function getDataSource() {
|
|
|
109
110
|
}
|
|
110
111
|
return connection;
|
|
111
112
|
}
|
|
113
|
+
async function executeQuery(query, params = []) {
|
|
114
|
+
const ds = await getDataSource();
|
|
115
|
+
return ds.query(query, params);
|
|
116
|
+
}
|