test-entity-library-asm 1.9.9 → 2.0.2
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.views.routes.d.ts +39 -0
- package/dist/entities.views.routes.js +81 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +34 -2
- package/package.json +1 -1
- package/src/entities.views.routes.ts +39 -0
- package/src/index.ts +11 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Category } from './entities/Category';
|
|
2
|
+
export { ScheduleCategory } from './entities/CategorySchedule';
|
|
3
|
+
export { City } from './entities/City';
|
|
4
|
+
export { Company } from './entities/Company';
|
|
5
|
+
export { Country } from './entities/Country';
|
|
6
|
+
export { CodeRedemptionHistoryCompany } from './entities/CodeRedemptionHistoryCompany';
|
|
7
|
+
export { DiscountCodeUser } from './entities/DiscountCodeUser';
|
|
8
|
+
export { Local } from './entities/Local';
|
|
9
|
+
export { Partner } from './entities/Partner';
|
|
10
|
+
export { PartnerRole } from './entities/PartnerRole';
|
|
11
|
+
export { CodeRedemptionHistoryUser } from './entities/CodeRedemptionHistoryUser';
|
|
12
|
+
export { Configuration } from './entities/Configuration';
|
|
13
|
+
export { Day } from './entities/Day';
|
|
14
|
+
export { DiscountCodeCompany } from './entities/DiscountCodeCompany';
|
|
15
|
+
export { LocalQualification } from './entities/LocalQualification';
|
|
16
|
+
export { Plan } from './entities/Plan';
|
|
17
|
+
export { Product } from './entities/Product';
|
|
18
|
+
export { ProductTopping } from './entities/ProductTopping';
|
|
19
|
+
export { Region } from './entities/Region';
|
|
20
|
+
export { Master } from './entities/Master';
|
|
21
|
+
export { TypeFood } from './entities/TypeFood';
|
|
22
|
+
export { User } from './entities/User';
|
|
23
|
+
export { MasterPermission } from './entities/MasterPermission';
|
|
24
|
+
export { MasterRole } from './entities/MasterRole';
|
|
25
|
+
export { PartnerPermission } from './entities/PartnerPermission';
|
|
26
|
+
export { PaymentMethod } from './entities/PaymentMethod';
|
|
27
|
+
export { Terminal } from './entities/Terminal';
|
|
28
|
+
export { TerminalSession } from './entities/TerminalSession';
|
|
29
|
+
export { ProductGroup } from './entities/ProductGroup';
|
|
30
|
+
export { ProductIngredient } from './entities/ProductIngredient';
|
|
31
|
+
export { Request } from './entities/Request';
|
|
32
|
+
export { RequestProduct } from './entities/RequestProduct';
|
|
33
|
+
export { RequestProductGroupComplement } from './entities/RequestProductGroupComplement';
|
|
34
|
+
export { RequestStatus } from './entities/RequestStatus';
|
|
35
|
+
export { Square } from './entities/Square';
|
|
36
|
+
export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient';
|
|
37
|
+
export { UserAddress } from './entities/UserAddress';
|
|
38
|
+
export { ProductGroupComplement } from './entities/productGroupComplement';
|
|
39
|
+
export { LocalsCompany } from './views/LocalsCompany';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalsCompany = exports.ProductGroupComplement = exports.UserAddress = exports.TypeMeasureIngredient = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.ProductIngredient = exports.ProductGroup = exports.TerminalSession = exports.Terminal = exports.PaymentMethod = exports.PartnerPermission = exports.MasterRole = exports.MasterPermission = exports.User = exports.TypeFood = exports.Master = exports.Region = exports.ProductTopping = exports.Product = exports.Plan = exports.LocalQualification = exports.DiscountCodeCompany = exports.Day = exports.Configuration = exports.CodeRedemptionHistoryUser = exports.PartnerRole = exports.Partner = exports.Local = exports.DiscountCodeUser = exports.CodeRedemptionHistoryCompany = exports.Country = exports.Company = exports.City = exports.ScheduleCategory = exports.Category = void 0;
|
|
4
|
+
var Category_1 = require("./entities/Category");
|
|
5
|
+
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return Category_1.Category; } });
|
|
6
|
+
var CategorySchedule_1 = require("./entities/CategorySchedule");
|
|
7
|
+
Object.defineProperty(exports, "ScheduleCategory", { enumerable: true, get: function () { return CategorySchedule_1.ScheduleCategory; } });
|
|
8
|
+
var City_1 = require("./entities/City");
|
|
9
|
+
Object.defineProperty(exports, "City", { enumerable: true, get: function () { return City_1.City; } });
|
|
10
|
+
var Company_1 = require("./entities/Company");
|
|
11
|
+
Object.defineProperty(exports, "Company", { enumerable: true, get: function () { return Company_1.Company; } });
|
|
12
|
+
var Country_1 = require("./entities/Country");
|
|
13
|
+
Object.defineProperty(exports, "Country", { enumerable: true, get: function () { return Country_1.Country; } });
|
|
14
|
+
var CodeRedemptionHistoryCompany_1 = require("./entities/CodeRedemptionHistoryCompany");
|
|
15
|
+
Object.defineProperty(exports, "CodeRedemptionHistoryCompany", { enumerable: true, get: function () { return CodeRedemptionHistoryCompany_1.CodeRedemptionHistoryCompany; } });
|
|
16
|
+
var DiscountCodeUser_1 = require("./entities/DiscountCodeUser");
|
|
17
|
+
Object.defineProperty(exports, "DiscountCodeUser", { enumerable: true, get: function () { return DiscountCodeUser_1.DiscountCodeUser; } });
|
|
18
|
+
var Local_1 = require("./entities/Local");
|
|
19
|
+
Object.defineProperty(exports, "Local", { enumerable: true, get: function () { return Local_1.Local; } });
|
|
20
|
+
var Partner_1 = require("./entities/Partner");
|
|
21
|
+
Object.defineProperty(exports, "Partner", { enumerable: true, get: function () { return Partner_1.Partner; } });
|
|
22
|
+
var PartnerRole_1 = require("./entities/PartnerRole");
|
|
23
|
+
Object.defineProperty(exports, "PartnerRole", { enumerable: true, get: function () { return PartnerRole_1.PartnerRole; } });
|
|
24
|
+
var CodeRedemptionHistoryUser_1 = require("./entities/CodeRedemptionHistoryUser");
|
|
25
|
+
Object.defineProperty(exports, "CodeRedemptionHistoryUser", { enumerable: true, get: function () { return CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser; } });
|
|
26
|
+
var Configuration_1 = require("./entities/Configuration");
|
|
27
|
+
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return Configuration_1.Configuration; } });
|
|
28
|
+
var Day_1 = require("./entities/Day");
|
|
29
|
+
Object.defineProperty(exports, "Day", { enumerable: true, get: function () { return Day_1.Day; } });
|
|
30
|
+
var DiscountCodeCompany_1 = require("./entities/DiscountCodeCompany");
|
|
31
|
+
Object.defineProperty(exports, "DiscountCodeCompany", { enumerable: true, get: function () { return DiscountCodeCompany_1.DiscountCodeCompany; } });
|
|
32
|
+
var LocalQualification_1 = require("./entities/LocalQualification");
|
|
33
|
+
Object.defineProperty(exports, "LocalQualification", { enumerable: true, get: function () { return LocalQualification_1.LocalQualification; } });
|
|
34
|
+
var Plan_1 = require("./entities/Plan");
|
|
35
|
+
Object.defineProperty(exports, "Plan", { enumerable: true, get: function () { return Plan_1.Plan; } });
|
|
36
|
+
var Product_1 = require("./entities/Product");
|
|
37
|
+
Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return Product_1.Product; } });
|
|
38
|
+
var ProductTopping_1 = require("./entities/ProductTopping");
|
|
39
|
+
Object.defineProperty(exports, "ProductTopping", { enumerable: true, get: function () { return ProductTopping_1.ProductTopping; } });
|
|
40
|
+
var Region_1 = require("./entities/Region");
|
|
41
|
+
Object.defineProperty(exports, "Region", { enumerable: true, get: function () { return Region_1.Region; } });
|
|
42
|
+
var Master_1 = require("./entities/Master");
|
|
43
|
+
Object.defineProperty(exports, "Master", { enumerable: true, get: function () { return Master_1.Master; } });
|
|
44
|
+
var TypeFood_1 = require("./entities/TypeFood");
|
|
45
|
+
Object.defineProperty(exports, "TypeFood", { enumerable: true, get: function () { return TypeFood_1.TypeFood; } });
|
|
46
|
+
var User_1 = require("./entities/User");
|
|
47
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
48
|
+
var MasterPermission_1 = require("./entities/MasterPermission");
|
|
49
|
+
Object.defineProperty(exports, "MasterPermission", { enumerable: true, get: function () { return MasterPermission_1.MasterPermission; } });
|
|
50
|
+
var MasterRole_1 = require("./entities/MasterRole");
|
|
51
|
+
Object.defineProperty(exports, "MasterRole", { enumerable: true, get: function () { return MasterRole_1.MasterRole; } });
|
|
52
|
+
var PartnerPermission_1 = require("./entities/PartnerPermission");
|
|
53
|
+
Object.defineProperty(exports, "PartnerPermission", { enumerable: true, get: function () { return PartnerPermission_1.PartnerPermission; } });
|
|
54
|
+
var PaymentMethod_1 = require("./entities/PaymentMethod");
|
|
55
|
+
Object.defineProperty(exports, "PaymentMethod", { enumerable: true, get: function () { return PaymentMethod_1.PaymentMethod; } });
|
|
56
|
+
var Terminal_1 = require("./entities/Terminal");
|
|
57
|
+
Object.defineProperty(exports, "Terminal", { enumerable: true, get: function () { return Terminal_1.Terminal; } });
|
|
58
|
+
var TerminalSession_1 = require("./entities/TerminalSession");
|
|
59
|
+
Object.defineProperty(exports, "TerminalSession", { enumerable: true, get: function () { return TerminalSession_1.TerminalSession; } });
|
|
60
|
+
var ProductGroup_1 = require("./entities/ProductGroup");
|
|
61
|
+
Object.defineProperty(exports, "ProductGroup", { enumerable: true, get: function () { return ProductGroup_1.ProductGroup; } });
|
|
62
|
+
var ProductIngredient_1 = require("./entities/ProductIngredient");
|
|
63
|
+
Object.defineProperty(exports, "ProductIngredient", { enumerable: true, get: function () { return ProductIngredient_1.ProductIngredient; } });
|
|
64
|
+
var Request_1 = require("./entities/Request");
|
|
65
|
+
Object.defineProperty(exports, "Request", { enumerable: true, get: function () { return Request_1.Request; } });
|
|
66
|
+
var RequestProduct_1 = require("./entities/RequestProduct");
|
|
67
|
+
Object.defineProperty(exports, "RequestProduct", { enumerable: true, get: function () { return RequestProduct_1.RequestProduct; } });
|
|
68
|
+
var RequestProductGroupComplement_1 = require("./entities/RequestProductGroupComplement");
|
|
69
|
+
Object.defineProperty(exports, "RequestProductGroupComplement", { enumerable: true, get: function () { return RequestProductGroupComplement_1.RequestProductGroupComplement; } });
|
|
70
|
+
var RequestStatus_1 = require("./entities/RequestStatus");
|
|
71
|
+
Object.defineProperty(exports, "RequestStatus", { enumerable: true, get: function () { return RequestStatus_1.RequestStatus; } });
|
|
72
|
+
var Square_1 = require("./entities/Square");
|
|
73
|
+
Object.defineProperty(exports, "Square", { enumerable: true, get: function () { return Square_1.Square; } });
|
|
74
|
+
var TypeMeasureIngredient_1 = require("./entities/TypeMeasureIngredient");
|
|
75
|
+
Object.defineProperty(exports, "TypeMeasureIngredient", { enumerable: true, get: function () { return TypeMeasureIngredient_1.TypeMeasureIngredient; } });
|
|
76
|
+
var UserAddress_1 = require("./entities/UserAddress");
|
|
77
|
+
Object.defineProperty(exports, "UserAddress", { enumerable: true, get: function () { return UserAddress_1.UserAddress; } });
|
|
78
|
+
var productGroupComplement_1 = require("./entities/productGroupComplement");
|
|
79
|
+
Object.defineProperty(exports, "ProductGroupComplement", { enumerable: true, get: function () { return productGroupComplement_1.ProductGroupComplement; } });
|
|
80
|
+
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
81
|
+
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from 'express';
|
|
2
2
|
import { DataSource, EntityTarget, ObjectLiteral, Repository } from 'typeorm';
|
|
3
|
+
export * from './entities.views.routes';
|
|
3
4
|
export declare function createDataBaseSource(): DataSource;
|
|
4
|
-
export declare function
|
|
5
|
+
export declare function showEntityNameEntity<T extends ObjectLiteral>(entity: EntityTarget<T>): Promise<Repository<T>>;
|
|
6
|
+
export declare function showEntity(entityName: string): Promise<any>;
|
|
5
7
|
export declare function callStoredProcedure(storedProcedure: any, elements: any): Promise<any>;
|
|
6
8
|
export declare function timezoneMiddleware(req: Request, res: Response, next: NextFunction): void;
|
|
7
9
|
export declare function getTimeZone(): string;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
17
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
18
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -36,11 +50,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
50
|
}
|
|
37
51
|
};
|
|
38
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getTimeZone = exports.timezoneMiddleware = exports.callStoredProcedure = exports.showEntity = exports.createDataBaseSource = void 0;
|
|
53
|
+
exports.getTimeZone = exports.timezoneMiddleware = exports.callStoredProcedure = exports.showEntity = exports.showEntityNameEntity = exports.createDataBaseSource = void 0;
|
|
40
54
|
var async_hooks_1 = require("async_hooks");
|
|
41
55
|
var dotenv_1 = require("dotenv");
|
|
42
56
|
var path_1 = require("path");
|
|
43
57
|
var typeorm_1 = require("typeorm");
|
|
58
|
+
__exportStar(require("./entities.views.routes"), exports);
|
|
44
59
|
var asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
|
|
45
60
|
var connection = null;
|
|
46
61
|
// DOCUMENTATION: Función para crear la conexión de la base de datos
|
|
@@ -77,7 +92,7 @@ function createDataBaseSource() {
|
|
|
77
92
|
exports.createDataBaseSource = createDataBaseSource;
|
|
78
93
|
// DOCUMENTATION: Función para retornar la entidad de una base de datos en específico por medio de un DataSource
|
|
79
94
|
// AUTHOR: jgomezp97@gmail.com
|
|
80
|
-
function
|
|
95
|
+
function showEntityNameEntity(entity) {
|
|
81
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
97
|
return __generator(this, function (_a) {
|
|
83
98
|
switch (_a.label) {
|
|
@@ -93,6 +108,23 @@ function showEntity(entity) {
|
|
|
93
108
|
});
|
|
94
109
|
});
|
|
95
110
|
}
|
|
111
|
+
exports.showEntityNameEntity = showEntityNameEntity;
|
|
112
|
+
function showEntity(entityName) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
return __generator(this, function (_a) {
|
|
115
|
+
switch (_a.label) {
|
|
116
|
+
case 0:
|
|
117
|
+
if (!!connection) return [3 /*break*/, 2];
|
|
118
|
+
connection = createDataBaseSource();
|
|
119
|
+
return [4 /*yield*/, connection.initialize()];
|
|
120
|
+
case 1:
|
|
121
|
+
_a.sent();
|
|
122
|
+
_a.label = 2;
|
|
123
|
+
case 2: return [2 /*return*/, connection.getRepository(entityName)];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
96
128
|
exports.showEntity = showEntity;
|
|
97
129
|
function callStoredProcedure(storedProcedure, elements) {
|
|
98
130
|
return __awaiter(this, void 0, void 0, function () {
|
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export { Category } from './entities/Category'
|
|
2
|
+
export { ScheduleCategory } from './entities/CategorySchedule'
|
|
3
|
+
export { City } from './entities/City'
|
|
4
|
+
export { Company } from './entities/Company'
|
|
5
|
+
export { Country } from './entities/Country'
|
|
6
|
+
export { CodeRedemptionHistoryCompany } from './entities/CodeRedemptionHistoryCompany'
|
|
7
|
+
export { DiscountCodeUser } from './entities/DiscountCodeUser'
|
|
8
|
+
export { Local } from './entities/Local'
|
|
9
|
+
export { Partner } from './entities/Partner'
|
|
10
|
+
export { PartnerRole } from './entities/PartnerRole'
|
|
11
|
+
export { CodeRedemptionHistoryUser } from './entities/CodeRedemptionHistoryUser'
|
|
12
|
+
export { Configuration } from './entities/Configuration'
|
|
13
|
+
export { Day } from './entities/Day'
|
|
14
|
+
export { DiscountCodeCompany } from './entities/DiscountCodeCompany'
|
|
15
|
+
export { LocalQualification } from './entities/LocalQualification'
|
|
16
|
+
export { Plan } from './entities/Plan'
|
|
17
|
+
export { Product } from './entities/Product'
|
|
18
|
+
export { ProductTopping } from './entities/ProductTopping'
|
|
19
|
+
export { Region } from './entities/Region'
|
|
20
|
+
export { Master } from './entities/Master'
|
|
21
|
+
export { TypeFood } from './entities/TypeFood'
|
|
22
|
+
export { User } from './entities/User'
|
|
23
|
+
export { MasterPermission } from './entities/MasterPermission'
|
|
24
|
+
export { MasterRole } from './entities/MasterRole'
|
|
25
|
+
export { PartnerPermission } from './entities/PartnerPermission'
|
|
26
|
+
export { PaymentMethod } from './entities/PaymentMethod'
|
|
27
|
+
export { Terminal } from './entities/Terminal'
|
|
28
|
+
export { TerminalSession } from './entities/TerminalSession'
|
|
29
|
+
export { ProductGroup } from './entities/ProductGroup'
|
|
30
|
+
export { ProductIngredient } from './entities/ProductIngredient'
|
|
31
|
+
export { Request } from './entities/Request'
|
|
32
|
+
export { RequestProduct } from './entities/RequestProduct'
|
|
33
|
+
export { RequestProductGroupComplement } from './entities/RequestProductGroupComplement'
|
|
34
|
+
export { RequestStatus } from './entities/RequestStatus'
|
|
35
|
+
export { Square } from './entities/Square'
|
|
36
|
+
export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient'
|
|
37
|
+
export { UserAddress } from './entities/UserAddress'
|
|
38
|
+
export { ProductGroupComplement } from './entities/productGroupComplement'
|
|
39
|
+
export { LocalsCompany } from './views/LocalsCompany'
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { NextFunction, Request, Response } from 'express'
|
|
|
4
4
|
import { resolve } from 'path'
|
|
5
5
|
import { DataSource, EntityTarget, ObjectLiteral, Repository } from 'typeorm'
|
|
6
6
|
import { IType } from './interfaces'
|
|
7
|
+
export * from './entities.views.routes'
|
|
7
8
|
|
|
8
9
|
const asyncLocalStorage = new AsyncLocalStorage<Map<string, string>>()
|
|
9
10
|
|
|
@@ -46,7 +47,7 @@ export function createDataBaseSource(): DataSource {
|
|
|
46
47
|
|
|
47
48
|
// DOCUMENTATION: Función para retornar la entidad de una base de datos en específico por medio de un DataSource
|
|
48
49
|
// AUTHOR: jgomezp97@gmail.com
|
|
49
|
-
export async function
|
|
50
|
+
export async function showEntityNameEntity<T extends ObjectLiteral>(
|
|
50
51
|
entity: EntityTarget<T>
|
|
51
52
|
): Promise<Repository<T>> {
|
|
52
53
|
if (!connection) {
|
|
@@ -57,6 +58,15 @@ export async function showEntity<T extends ObjectLiteral>(
|
|
|
57
58
|
return connection.getRepository(entity)
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
export async function showEntity(entityName: string): Promise<any> {
|
|
62
|
+
if (!connection) {
|
|
63
|
+
connection = createDataBaseSource()
|
|
64
|
+
await connection.initialize()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return connection.getRepository(entityName)
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
export async function callStoredProcedure(storedProcedure: any, elements: any) {
|
|
61
71
|
try {
|
|
62
72
|
if (!connection) {
|