myorm_pg 6.1.4 → 6.2.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/lib/core/design/Type.d.ts.map +1 -1
- package/lib/core/design/Type.js +1 -0
- package/lib/core/design/Type.js.map +1 -1
- package/lib/implementations/PGDBContext.d.ts +5 -1
- package/lib/implementations/PGDBContext.d.ts.map +1 -1
- package/lib/implementations/PGDBContext.js +159 -118
- package/lib/implementations/PGDBContext.js.map +1 -1
- package/lib/implementations/PGDBManager.d.ts.map +1 -1
- package/lib/implementations/PGDBManager.js +2 -0
- package/lib/implementations/PGDBManager.js.map +1 -1
- package/lib/implementations/PGDBSet.d.ts +3 -1
- package/lib/implementations/PGDBSet.d.ts.map +1 -1
- package/lib/implementations/PGDBSet.js +280 -66
- package/lib/implementations/PGDBSet.js.map +1 -1
- package/package.json +2 -2
- package/lib/__tests__/classes/RawTypes.d.ts +0 -3
- package/lib/__tests__/classes/RawTypes.d.ts.map +0 -1
- package/lib/__tests__/classes/RawTypes.js +0 -16
- package/lib/__tests__/classes/RawTypes.js.map +0 -1
- package/lib/__tests__/classes/RelationEntity.d.ts +0 -12
- package/lib/__tests__/classes/RelationEntity.d.ts.map +0 -1
- package/lib/__tests__/classes/RelationEntity.js +0 -65
- package/lib/__tests__/classes/RelationEntity.js.map +0 -1
- package/lib/__tests__/classes/TestContext.d.ts +0 -9
- package/lib/__tests__/classes/TestContext.d.ts.map +0 -1
- package/lib/__tests__/classes/TestContext.js +0 -14
- package/lib/__tests__/classes/TestContext.js.map +0 -1
- package/lib/__tests__/classes/TestEntity.d.ts +0 -18
- package/lib/__tests__/classes/TestEntity.d.ts.map +0 -1
- package/lib/__tests__/classes/TestEntity.js +0 -99
- package/lib/__tests__/classes/TestEntity.js.map +0 -1
- package/lib/__tests__/functions/TestFunctions.d.ts +0 -11
- package/lib/__tests__/functions/TestFunctions.d.ts.map +0 -1
- package/lib/__tests__/functions/TestFunctions.js +0 -137
- package/lib/__tests__/functions/TestFunctions.js.map +0 -1
- package/lib/src/Index.d.ts +0 -41
- package/lib/src/Index.d.ts.map +0 -1
- package/lib/src/Index.js +0 -64
- package/lib/src/Index.js.map +0 -1
- package/lib/src/core/decorators/SchemasDecorators.d.ts +0 -45
- package/lib/src/core/decorators/SchemasDecorators.d.ts.map +0 -1
- package/lib/src/core/decorators/SchemasDecorators.js +0 -145
- package/lib/src/core/decorators/SchemasDecorators.js.map +0 -1
- package/lib/src/core/design/Type.d.ts +0 -39
- package/lib/src/core/design/Type.d.ts.map +0 -1
- package/lib/src/core/design/Type.js +0 -144
- package/lib/src/core/design/Type.js.map +0 -1
- package/lib/src/core/enums/DBTypes.d.ts +0 -19
- package/lib/src/core/enums/DBTypes.d.ts.map +0 -1
- package/lib/src/core/enums/DBTypes.js +0 -23
- package/lib/src/core/enums/DBTypes.js.map +0 -1
- package/lib/src/core/enums/RelationType.d.ts +0 -7
- package/lib/src/core/enums/RelationType.d.ts.map +0 -1
- package/lib/src/core/enums/RelationType.js +0 -11
- package/lib/src/core/enums/RelationType.js.map +0 -1
- package/lib/src/core/exceptions/ConnectionFailException.d.ts +0 -5
- package/lib/src/core/exceptions/ConnectionFailException.d.ts.map +0 -1
- package/lib/src/core/exceptions/ConnectionFailException.js +0 -13
- package/lib/src/core/exceptions/ConnectionFailException.js.map +0 -1
- package/lib/src/core/exceptions/ConstraintFailException.d.ts +0 -5
- package/lib/src/core/exceptions/ConstraintFailException.d.ts.map +0 -1
- package/lib/src/core/exceptions/ConstraintFailException.js +0 -13
- package/lib/src/core/exceptions/ConstraintFailException.js.map +0 -1
- package/lib/src/core/exceptions/Exception.d.ts +0 -5
- package/lib/src/core/exceptions/Exception.d.ts.map +0 -1
- package/lib/src/core/exceptions/Exception.js +0 -10
- package/lib/src/core/exceptions/Exception.js.map +0 -1
- package/lib/src/core/exceptions/InvalidOperationException.d.ts +0 -6
- package/lib/src/core/exceptions/InvalidOperationException.d.ts.map +0 -1
- package/lib/src/core/exceptions/InvalidOperationException.js +0 -14
- package/lib/src/core/exceptions/InvalidOperationException.js.map +0 -1
- package/lib/src/core/exceptions/NotImplementedException.d.ts +0 -5
- package/lib/src/core/exceptions/NotImplementedException.d.ts.map +0 -1
- package/lib/src/core/exceptions/NotImplementedException.js +0 -13
- package/lib/src/core/exceptions/NotImplementedException.js.map +0 -1
- package/lib/src/core/exceptions/QueryFailException.d.ts +0 -6
- package/lib/src/core/exceptions/QueryFailException.d.ts.map +0 -1
- package/lib/src/core/exceptions/QueryFailException.js +0 -14
- package/lib/src/core/exceptions/QueryFailException.js.map +0 -1
- package/lib/src/core/exceptions/TypeNotMappedException.d.ts +0 -5
- package/lib/src/core/exceptions/TypeNotMappedException.d.ts.map +0 -1
- package/lib/src/core/exceptions/TypeNotMappedException.js +0 -13
- package/lib/src/core/exceptions/TypeNotMappedException.js.map +0 -1
- package/lib/src/core/exceptions/TypeNotSuportedException.d.ts +0 -5
- package/lib/src/core/exceptions/TypeNotSuportedException.d.ts.map +0 -1
- package/lib/src/core/exceptions/TypeNotSuportedException.js +0 -13
- package/lib/src/core/exceptions/TypeNotSuportedException.js.map +0 -1
- package/lib/src/core/handlers/DBOperationLogHandler.d.ts +0 -17
- package/lib/src/core/handlers/DBOperationLogHandler.d.ts.map +0 -1
- package/lib/src/core/handlers/DBOperationLogHandler.js +0 -18
- package/lib/src/core/handlers/DBOperationLogHandler.js.map +0 -1
- package/lib/src/implementations/PGDBConnection.d.ts +0 -19
- package/lib/src/implementations/PGDBConnection.d.ts.map +0 -1
- package/lib/src/implementations/PGDBConnection.js +0 -105
- package/lib/src/implementations/PGDBConnection.js.map +0 -1
- package/lib/src/implementations/PGDBContext.d.ts +0 -54
- package/lib/src/implementations/PGDBContext.d.ts.map +0 -1
- package/lib/src/implementations/PGDBContext.js +0 -302
- package/lib/src/implementations/PGDBContext.js.map +0 -1
- package/lib/src/implementations/PGDBManager.d.ts +0 -37
- package/lib/src/implementations/PGDBManager.d.ts.map +0 -1
- package/lib/src/implementations/PGDBManager.js +0 -296
- package/lib/src/implementations/PGDBManager.js.map +0 -1
- package/lib/src/implementations/PGDBSet.d.ts +0 -60
- package/lib/src/implementations/PGDBSet.d.ts.map +0 -1
- package/lib/src/implementations/PGDBSet.js +0 -1385
- package/lib/src/implementations/PGDBSet.js.map +0 -1
- package/lib/src/implementations/PGFluentField.d.ts +0 -18
- package/lib/src/implementations/PGFluentField.d.ts.map +0 -1
- package/lib/src/implementations/PGFluentField.js +0 -155
- package/lib/src/implementations/PGFluentField.js.map +0 -1
- package/lib/src/implementations/PGSetHelper.d.ts +0 -19
- package/lib/src/implementations/PGSetHelper.d.ts.map +0 -1
- package/lib/src/implementations/PGSetHelper.js +0 -48
- package/lib/src/implementations/PGSetHelper.js.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TruncateTablesAsync = exports.TruncatePersonTableAsync = exports.CompleteSeedAsync = exports.SeedAsync = exports.CreateContext = exports.CreateConnection = exports.TryAsync = exports.Try = void 0;
|
|
16
|
-
const PGDBConnection_1 = __importDefault(require("../../src/implementations/PGDBConnection"));
|
|
17
|
-
const TestContext_1 = __importDefault(require("../classes/TestContext"));
|
|
18
|
-
const PGDBManager_1 = __importDefault(require("../../src/implementations/PGDBManager"));
|
|
19
|
-
const TestEntity_1 = require("../classes/TestEntity");
|
|
20
|
-
const Type_1 = __importDefault(require("../../src/core/design/Type"));
|
|
21
|
-
const RelationEntity_1 = require("../classes/RelationEntity");
|
|
22
|
-
function Try(action, onError) {
|
|
23
|
-
try {
|
|
24
|
-
action();
|
|
25
|
-
}
|
|
26
|
-
catch (ex) {
|
|
27
|
-
if (onError)
|
|
28
|
-
onError(ex);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.Try = Try;
|
|
32
|
-
function TryAsync(action, onError) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
try {
|
|
35
|
-
yield action();
|
|
36
|
-
}
|
|
37
|
-
catch (ex) {
|
|
38
|
-
if (onError)
|
|
39
|
-
onError(ex);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
exports.TryAsync = TryAsync;
|
|
44
|
-
function CreateConnection() {
|
|
45
|
-
return new PGDBConnection_1.default("localhost", 5434, "test_db", "supervisor", "sup");
|
|
46
|
-
}
|
|
47
|
-
exports.CreateConnection = CreateConnection;
|
|
48
|
-
function CreateContext() {
|
|
49
|
-
return new TestContext_1.default(new PGDBManager_1.default(CreateConnection()));
|
|
50
|
-
}
|
|
51
|
-
exports.CreateContext = CreateContext;
|
|
52
|
-
function SeedAsync() {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield TruncateTablesAsync();
|
|
55
|
-
let context = CreateContext();
|
|
56
|
-
let adriano = new TestEntity_1.Person("Adriano", "adriano@test.com");
|
|
57
|
-
adriano.Birth = new Date(1992, 4, 23);
|
|
58
|
-
adriano.Documents = [123, 4, 5, 678, 9];
|
|
59
|
-
adriano.PhoneNumbers = ['+55(12)98206-8255'];
|
|
60
|
-
yield context.Persons.AddAsync(adriano);
|
|
61
|
-
let camila = new TestEntity_1.Person("Camila", "camila@test.com");
|
|
62
|
-
camila.Documents = [];
|
|
63
|
-
yield context.Persons.AddAsync(camila);
|
|
64
|
-
yield context.Persons.AddAsync(new TestEntity_1.Person("Juliana", "juliana@test.com"));
|
|
65
|
-
yield context.Persons.AddAsync(new TestEntity_1.Person("Andre", "andre@test.com"));
|
|
66
|
-
return context;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
exports.SeedAsync = SeedAsync;
|
|
70
|
-
function CompleteSeedAsync() {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
let context = CreateContext();
|
|
73
|
-
yield TruncateTablesAsync();
|
|
74
|
-
let adriano = new TestEntity_1.Person("adriano", "adriano@test.com");
|
|
75
|
-
adriano.Birth = new Date(1992, 4, 23);
|
|
76
|
-
adriano.Documents = [1234432, 443224, 4324322, 32142132, 432432545];
|
|
77
|
-
adriano.LinkTestValueInPerson = 1;
|
|
78
|
-
adriano.LinkTestArrayInPerson = [1, 2, 3, 4, 5];
|
|
79
|
-
yield context.Persons.AddAsync(adriano);
|
|
80
|
-
let camila = new TestEntity_1.Person("camila", "camila@test.com");
|
|
81
|
-
camila.Birth = new Date(1992, 6, 21);
|
|
82
|
-
camila.Documents = [5435436, 76576523, 43256778];
|
|
83
|
-
camila.LinkTestValueInPerson = 2;
|
|
84
|
-
camila.LinkTestArrayInPerson = [1, 2, 3, 4, 5];
|
|
85
|
-
yield context.Persons.AddAsync(camila);
|
|
86
|
-
let juliana = new TestEntity_1.Person("juliana", "juliana@test.com");
|
|
87
|
-
juliana.Birth = new Date(1993, 4, 30);
|
|
88
|
-
juliana.Documents = [1232323, 42321, 51211, 321321, 932432];
|
|
89
|
-
juliana.LinkTestValueInPerson = 3;
|
|
90
|
-
juliana.LinkTestArrayInPerson = [2, 3, 4];
|
|
91
|
-
yield context.Persons.AddAsync(juliana);
|
|
92
|
-
let andre = new TestEntity_1.Person("andre", "andre@test.com");
|
|
93
|
-
andre.Birth = new Date(1995, 4, 18);
|
|
94
|
-
andre.Documents = [4324543, 5543543, 543543543, 954351];
|
|
95
|
-
andre.LinkTestValueInPerson = 4;
|
|
96
|
-
andre.LinkTestArrayInPerson = [1, 2, 3];
|
|
97
|
-
yield context.Persons.AddAsync(andre);
|
|
98
|
-
let msg = new RelationEntity_1.Message('Some message from Adriano', adriano, [camila, juliana, andre]);
|
|
99
|
-
msg.LinkTestValueInMessage = 1;
|
|
100
|
-
msg.LinkTestArrayInMessage = [1, 2, 3, 4, 5];
|
|
101
|
-
yield context.Messages.AddAsync(msg);
|
|
102
|
-
msg = new RelationEntity_1.Message('Some private message from Adriano', adriano, [camila]);
|
|
103
|
-
msg.LinkTestValueInMessage = 2;
|
|
104
|
-
msg.LinkTestArrayInMessage = [1];
|
|
105
|
-
yield context.Messages.AddAsync(msg);
|
|
106
|
-
msg = new RelationEntity_1.Message('Some message from Camila', camila, [adriano, juliana, andre]);
|
|
107
|
-
msg.LinkTestValueInMessage = undefined;
|
|
108
|
-
msg.LinkTestArrayInMessage = [1, 2, 3, 4, 5, 5, 6, 7];
|
|
109
|
-
yield context.Messages.AddAsync(msg);
|
|
110
|
-
msg = new RelationEntity_1.Message('Some message from Adriano to nobody', adriano, []);
|
|
111
|
-
msg.LinkTestValueInMessage = 7;
|
|
112
|
-
msg.LinkTestArrayInMessage = undefined;
|
|
113
|
-
yield context.Messages.AddAsync(msg);
|
|
114
|
-
return context;
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
exports.CompleteSeedAsync = CompleteSeedAsync;
|
|
118
|
-
function TruncatePersonTableAsync() {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
let conn = CreateConnection();
|
|
121
|
-
yield conn.OpenAsync();
|
|
122
|
-
yield conn.ExecuteNonQueryAsync(`truncate table ${Type_1.default.GetTableName(TestEntity_1.Person)}`);
|
|
123
|
-
yield conn.CloseAsync();
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
exports.TruncatePersonTableAsync = TruncatePersonTableAsync;
|
|
127
|
-
function TruncateTablesAsync() {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
let conn = CreateConnection();
|
|
130
|
-
yield conn.OpenAsync();
|
|
131
|
-
yield conn.ExecuteNonQueryAsync(`truncate table ${Type_1.default.GetTableName(TestEntity_1.Person)}`);
|
|
132
|
-
yield conn.ExecuteNonQueryAsync(`truncate table ${Type_1.default.GetTableName(RelationEntity_1.Message)}`);
|
|
133
|
-
yield conn.CloseAsync();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
exports.TruncateTablesAsync = TruncateTablesAsync;
|
|
137
|
-
//# sourceMappingURL=TestFunctions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestFunctions.js","sourceRoot":"","sources":["../../../__tests__/functions/TestFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8FAAsE;AACtE,yEAA6C;AAC7C,wFAAgE;AAChE,sDAA+C;AAC/C,sEAA8C;AAC9C,8DAAoD;AAEpD,SAAgB,GAAG,CAAC,MAAkB,EAAE,OAA4B;IAClE,IAAI;QACF,MAAM,EAAE,CAAC;KACV;IAAC,OAAO,EAAE,EAAE;QACX,IAAI,OAAO;YAAE,OAAO,CAAC,EAAW,CAAC,CAAC;KACnC;AACH,CAAC;AAND,kBAMC;AAED,SAAsB,QAAQ,CAC5B,MAA2B,EAC3B,OAA4B;;QAE5B,IAAI;YACF,MAAM,MAAM,EAAE,CAAC;SAChB;QAAC,OAAO,EAAE,EAAE;YACX,IAAI,OAAO;gBAAE,OAAO,CAAC,EAAW,CAAC,CAAC;SACnC;IACH,CAAC;CAAA;AATD,4BASC;AAED,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,wBAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,C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wBAAO,CAAC,EAAE,CAAC,CAAC;QAChF,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;CAAA;AAND,kDAMC"}
|
package/lib/src/Index.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { DBTypes } from "./core/enums/DBTypes";
|
|
2
|
-
import PGDBConnection from "./implementations/PGDBConnection";
|
|
3
|
-
import PGDBContext from "./implementations/PGDBContext";
|
|
4
|
-
import PGDBManager from "./implementations/PGDBManager";
|
|
5
|
-
import PGDBSet from "./implementations/PGDBSet";
|
|
6
|
-
import QueryFailException from "./core/exceptions/QueryFailException";
|
|
7
|
-
import NotImpletedException from "./core/exceptions/NotImplementedException";
|
|
8
|
-
import TypeNotMappedException from "./core/exceptions/TypeNotMappedException";
|
|
9
|
-
import ConnectionFailException from "./core/exceptions/ConnectionFailException";
|
|
10
|
-
import ConstraintFailException from "./core/exceptions/ConstraintFailException";
|
|
11
|
-
import TypeNotSuportedException from "./core/exceptions/TypeNotSuportedException";
|
|
12
|
-
import InvalidOperationException from "./core/exceptions/InvalidOperationException";
|
|
13
|
-
export { ConnectionFailException };
|
|
14
|
-
export { ConstraintFailException };
|
|
15
|
-
export { InvalidOperationException };
|
|
16
|
-
export { NotImpletedException };
|
|
17
|
-
export { QueryFailException };
|
|
18
|
-
export { TypeNotMappedException };
|
|
19
|
-
export { TypeNotSuportedException };
|
|
20
|
-
export { DBTypes };
|
|
21
|
-
export { PGDBConnection };
|
|
22
|
-
export { PGDBContext };
|
|
23
|
-
export { PGDBManager };
|
|
24
|
-
export { PGDBSet };
|
|
25
|
-
export declare function Column(name?: string): (target: Object, propertyName: string) => void;
|
|
26
|
-
export declare function Table(name?: string): (target: Object) => void;
|
|
27
|
-
export declare function DataType(dbType: DBTypes): (target: Object, propertyName: string) => void;
|
|
28
|
-
export declare function PrimaryKey(): (target: Object, propertyName: string) => void;
|
|
29
|
-
export declare function OneToMany<T>(typeBuilder: () => {
|
|
30
|
-
new (...args: any[]): T;
|
|
31
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
32
|
-
export declare function OneToOne<T>(typeBuilder: () => {
|
|
33
|
-
new (...args: any[]): T;
|
|
34
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
35
|
-
export declare function ManyToMany<T>(typeBuilder: () => {
|
|
36
|
-
new (...args: any[]): T;
|
|
37
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
38
|
-
export declare function ManyToOne<T>(typeBuilder: () => {
|
|
39
|
-
new (...args: any[]): T;
|
|
40
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
41
|
-
//# sourceMappingURL=Index.d.ts.map
|
package/lib/src/Index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../../src/Index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,WAAW,MAAM,+BAA+B,CAAC;AACxD,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAEhD,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,oBAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,sBAAsB,MAAM,0CAA0C,CAAC;AAC9E,OAAO,uBAAuB,MAAM,2CAA2C,CAAC;AAChF,OAAO,uBAAuB,MAAM,2CAA2C,CAAC;AAChF,OAAO,wBAAwB,MAAM,4CAA4C,CAAC;AAClF,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAGpF,OAAO,EAAC,uBAAuB,EAAC,CAAA;AAChC,OAAO,EAAC,uBAAuB,EAAC,CAAA;AAChC,OAAO,EAAC,yBAAyB,EAAC,CAAA;AAClC,OAAO,EAAC,oBAAoB,EAAC,CAAA;AAC7B,OAAO,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@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ManyToOne = exports.ManyToMany = exports.OneToOne = exports.OneToMany = exports.PrimaryKey = exports.DataType = exports.Table = exports.Column = exports.PGDBSet = exports.PGDBManager = exports.PGDBContext = exports.PGDBConnection = exports.DBTypes = exports.TypeNotSuportedException = exports.TypeNotMappedException = exports.QueryFailException = exports.NotImpletedException = exports.InvalidOperationException = exports.ConstraintFailException = exports.ConnectionFailException = void 0;
|
|
7
|
-
const DBTypes_1 = require("./core/enums/DBTypes");
|
|
8
|
-
Object.defineProperty(exports, "DBTypes", { enumerable: true, get: function () { return DBTypes_1.DBTypes; } });
|
|
9
|
-
const SchemasDecorators_1 = __importDefault(require("./core/decorators/SchemasDecorators"));
|
|
10
|
-
const PGDBConnection_1 = __importDefault(require("./implementations/PGDBConnection"));
|
|
11
|
-
exports.PGDBConnection = PGDBConnection_1.default;
|
|
12
|
-
const PGDBContext_1 = __importDefault(require("./implementations/PGDBContext"));
|
|
13
|
-
exports.PGDBContext = PGDBContext_1.default;
|
|
14
|
-
const PGDBManager_1 = __importDefault(require("./implementations/PGDBManager"));
|
|
15
|
-
exports.PGDBManager = PGDBManager_1.default;
|
|
16
|
-
const PGDBSet_1 = __importDefault(require("./implementations/PGDBSet"));
|
|
17
|
-
exports.PGDBSet = PGDBSet_1.default;
|
|
18
|
-
const QueryFailException_1 = __importDefault(require("./core/exceptions/QueryFailException"));
|
|
19
|
-
exports.QueryFailException = QueryFailException_1.default;
|
|
20
|
-
const NotImplementedException_1 = __importDefault(require("./core/exceptions/NotImplementedException"));
|
|
21
|
-
exports.NotImpletedException = NotImplementedException_1.default;
|
|
22
|
-
const TypeNotMappedException_1 = __importDefault(require("./core/exceptions/TypeNotMappedException"));
|
|
23
|
-
exports.TypeNotMappedException = TypeNotMappedException_1.default;
|
|
24
|
-
const ConnectionFailException_1 = __importDefault(require("./core/exceptions/ConnectionFailException"));
|
|
25
|
-
exports.ConnectionFailException = ConnectionFailException_1.default;
|
|
26
|
-
const ConstraintFailException_1 = __importDefault(require("./core/exceptions/ConstraintFailException"));
|
|
27
|
-
exports.ConstraintFailException = ConstraintFailException_1.default;
|
|
28
|
-
const TypeNotSuportedException_1 = __importDefault(require("./core/exceptions/TypeNotSuportedException"));
|
|
29
|
-
exports.TypeNotSuportedException = TypeNotSuportedException_1.default;
|
|
30
|
-
const InvalidOperationException_1 = __importDefault(require("./core/exceptions/InvalidOperationException"));
|
|
31
|
-
exports.InvalidOperationException = InvalidOperationException_1.default;
|
|
32
|
-
function Column(name) {
|
|
33
|
-
return SchemasDecorators_1.default.Column(name);
|
|
34
|
-
}
|
|
35
|
-
exports.Column = Column;
|
|
36
|
-
function Table(name) {
|
|
37
|
-
return SchemasDecorators_1.default.Table(name);
|
|
38
|
-
}
|
|
39
|
-
exports.Table = Table;
|
|
40
|
-
function DataType(dbType) {
|
|
41
|
-
return SchemasDecorators_1.default.DataType(dbType);
|
|
42
|
-
}
|
|
43
|
-
exports.DataType = DataType;
|
|
44
|
-
function PrimaryKey() {
|
|
45
|
-
return SchemasDecorators_1.default.PrimaryKey();
|
|
46
|
-
}
|
|
47
|
-
exports.PrimaryKey = PrimaryKey;
|
|
48
|
-
function OneToMany(typeBuilder, property) {
|
|
49
|
-
return SchemasDecorators_1.default.OneToMany(typeBuilder, property);
|
|
50
|
-
}
|
|
51
|
-
exports.OneToMany = OneToMany;
|
|
52
|
-
function OneToOne(typeBuilder, property) {
|
|
53
|
-
return SchemasDecorators_1.default.OneToOne(typeBuilder, property);
|
|
54
|
-
}
|
|
55
|
-
exports.OneToOne = OneToOne;
|
|
56
|
-
function ManyToMany(typeBuilder, property) {
|
|
57
|
-
return SchemasDecorators_1.default.ManyToMany(typeBuilder, property);
|
|
58
|
-
}
|
|
59
|
-
exports.ManyToMany = ManyToMany;
|
|
60
|
-
function ManyToOne(typeBuilder, property) {
|
|
61
|
-
return SchemasDecorators_1.default.ManyToOne(typeBuilder, property);
|
|
62
|
-
}
|
|
63
|
-
exports.ManyToOne = ManyToOne;
|
|
64
|
-
//# sourceMappingURL=Index.js.map
|
package/lib/src/Index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/Index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA+C;AAyBvC,wFAzBC,iBAAO,OAyBD;AAxBf,4FAAoE;AACpE,sFAA8D;AAwBtD,yBAxBD,wBAAc,CAwBC;AAvBtB,gFAAwD;AAwBhD,sBAxBD,qBAAW,CAwBC;AAvBnB,gFAAwD;AAwBhD,sBAxBD,qBAAW,CAwBC;AAvBnB,wEAAgD;AAwBxC,kBAxBD,iBAAO,CAwBC;AAtBf,8FAAsE;AAa9D,6BAbD,4BAAkB,CAaC;AAZ1B,wGAA6E;AAWrE,+BAXD,iCAAoB,CAWC;AAV5B,sGAA8E;AAYtE,iCAZD,gCAAsB,CAYC;AAX9B,wGAAgF;AAMxE,kCAND,iCAAuB,CAMC;AAL/B,wGAAgF;AAMxE,kCAND,iCAAuB,CAMC;AAL/B,0GAAkF;AAU1E,mCAVD,kCAAwB,CAUC;AAThC,4GAAoF;AAK5E,oCALD,mCAAyB,CAKC;AAajC,SAAgB,MAAM,CAAC,IAAc;IAEjC,OAAO,2BAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAHD,wBAGC;AAED,SAAgB,KAAK,CAAC,IAAc;IAEhC,OAAO,2BAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAHD,sBAGC;AAED,SAAgB,QAAQ,CAAC,MAAgB;IAErC,OAAO,2BAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC;AAHD,4BAGC;AAED,SAAgB,UAAU;IAEtB,OAAO,2BAAiB,CAAC,UAAU,EAAE,CAAC;AAC1C,CAAC;AAHD,gCAGC;AAED,SAAgB,SAAS,CAAI,WAAgD,EAAE,QAA4B;IAEvG,OAAO,2BAAiB,CAAC,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAHD,8BAGC;AAED,SAAgB,QAAQ,CAAI,WAAgD,EAAE,QAA4B;IAEtG,OAAO,2BAAiB,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAHD,4BAGC;AAED,SAAgB,UAAU,CAAI,WAAgD,EAAE,QAA4B;IAExG,OAAO,2BAAiB,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAHD,gCAGC;AAED,SAAgB,SAAS,CAAI,WAAgD,EAAE,QAA4B;IAEvG,OAAO,2BAAiB,CAAC,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAHD,8BAGC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { DBTypes } from '../enums/DBTypes';
|
|
3
|
-
import { RelationType } from '../enums/RelationType';
|
|
4
|
-
export default class SchemasDecorators {
|
|
5
|
-
private static _tableAttribute;
|
|
6
|
-
private static _columnAttribute;
|
|
7
|
-
private static _dataTypeAttribute;
|
|
8
|
-
private static _primaryKeyAttribute;
|
|
9
|
-
private static _relationAttribute;
|
|
10
|
-
private static _notNullAttribute;
|
|
11
|
-
static Table(name?: string): (target: Object) => void;
|
|
12
|
-
static GetTableAttribute(target: Object): string | undefined;
|
|
13
|
-
static Column(name?: string): (target: Object, propertyName: string) => void;
|
|
14
|
-
static GetColumnAttribute(cTor: Function, propertyName: string): string | undefined;
|
|
15
|
-
static NotNull(): (target: Object, propertyName: string) => void;
|
|
16
|
-
static AllowNullValue(cTor: Function, propertyName: string): boolean;
|
|
17
|
-
static OneToOne<T>(lazyBuilder: () => {
|
|
18
|
-
new (...args: any[]): T;
|
|
19
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
20
|
-
static OneToMany<T>(lazyBuilder: () => {
|
|
21
|
-
new (...args: any[]): T;
|
|
22
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
23
|
-
static ManyToOne<T>(lazyBuilder: () => {
|
|
24
|
-
new (...args: any[]): T;
|
|
25
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
26
|
-
static ManyToMany<T>(lazyBuilder: () => {
|
|
27
|
-
new (...args: any[]): T;
|
|
28
|
-
}, property?: keyof T & string): (target: Object, propertyName: string) => void;
|
|
29
|
-
private static Relation;
|
|
30
|
-
static GetRelationAttribute(cTor: Function, propertyName: string): {
|
|
31
|
-
TypeBuilder: () => {
|
|
32
|
-
new (...args: any[]): unknown;
|
|
33
|
-
};
|
|
34
|
-
Relation: RelationType;
|
|
35
|
-
Field?: string;
|
|
36
|
-
} | undefined;
|
|
37
|
-
static PrimaryKey(): (target: Object, propertyName: string) => void;
|
|
38
|
-
static IsPrimaryKey(cTor: Function, propertyName: string): boolean;
|
|
39
|
-
static ExtractPrimaryKey(cTor: {
|
|
40
|
-
new (...args: any[]): unknown;
|
|
41
|
-
}): string | undefined;
|
|
42
|
-
static DataType(type: DBTypes): (target: Object, propertyName: string) => void;
|
|
43
|
-
static GetDataTypeAttribute(cTor: Function, propertyName: string): DBTypes | undefined;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=SchemasDecorators.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SchemasDecorators.d.ts","sourceRoot":"","sources":["../../../../src/core/decorators/SchemasDecorators.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,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AU,CAAC,CAAC,EAAE,WAAW,EAAG,MAAO;QAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,CAAC,CAAA;KAAC,EAAE,QAAQ,CAAC,EAAG,MAAM,CAAC,GAAG,MAAM;IAKzG,OAAO,CAAC,MAAM,CAAC,QAAQ;WAST,oBAAoB,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI;QAAE,WAAW,EAAE,MAAM;YAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,OAAO,CAAA;SAAC,CAAC;QAAC,QAAQ,EAAG,YAAY,CAAC;QAAC,KAAK,CAAC,EAAG,MAAM,CAAA;KAAE,GAAG,SAAS;WAY5K,UAAU,aAEM,MAAM,gBAAiB,MAAM;WAO7C,YAAY,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI,OAAO;WAgB9D,iBAAiB,CAAC,IAAI,EAAG;QAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,OAAO,CAAA;KAAC,GAAI,MAAM,GAAG,SAAS;WAY/E,QAAQ,CAAC,IAAI,EAAG,OAAO,YAEP,MAAM,gBAAiB,MAAM;WAO7C,oBAAoB,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI,OAAO,GAAG,SAAS;CAcnG"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
require("reflect-metadata");
|
|
7
|
-
const Type_1 = __importDefault(require("../design/Type"));
|
|
8
|
-
const RelationType_1 = require("../enums/RelationType");
|
|
9
|
-
class SchemasDecorators {
|
|
10
|
-
static Table(name) {
|
|
11
|
-
return function (target) {
|
|
12
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._tableAttribute, undefined, name !== null && name !== void 0 ? name : target.name.toLocaleLowerCase());
|
|
13
|
-
Reflect.defineMetadata(SchemasDecorators._tableAttribute, name !== null && name !== void 0 ? name : target.name.toLocaleLowerCase(), target);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
static GetTableAttribute(target) {
|
|
17
|
-
var _a;
|
|
18
|
-
let meta = Reflect.getMetadata(SchemasDecorators._tableAttribute, target);
|
|
19
|
-
if (!meta)
|
|
20
|
-
meta = (_a = OwnMetaDataContainer.Get(target.constructor, SchemasDecorators._tableAttribute, undefined)) === null || _a === void 0 ? void 0 : _a.Value;
|
|
21
|
-
return meta;
|
|
22
|
-
}
|
|
23
|
-
static Column(name) {
|
|
24
|
-
return function (target, propertyName) {
|
|
25
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._columnAttribute, propertyName, name !== null && name !== void 0 ? name : propertyName.toLocaleLowerCase());
|
|
26
|
-
Reflect.defineMetadata(SchemasDecorators._columnAttribute, name !== null && name !== void 0 ? name : propertyName.toLocaleLowerCase(), target.constructor, propertyName);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
static GetColumnAttribute(cTor, propertyName) {
|
|
30
|
-
var _a;
|
|
31
|
-
let meta = Reflect.getMetadata(SchemasDecorators._columnAttribute, cTor, propertyName);
|
|
32
|
-
if (!meta)
|
|
33
|
-
meta = (_a = OwnMetaDataContainer.Get(cTor, SchemasDecorators._columnAttribute, propertyName)) === null || _a === void 0 ? void 0 : _a.Value;
|
|
34
|
-
return meta;
|
|
35
|
-
}
|
|
36
|
-
static NotNull() {
|
|
37
|
-
return function (target, propertyName) {
|
|
38
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._notNullAttribute, propertyName, true);
|
|
39
|
-
Reflect.defineMetadata(SchemasDecorators._notNullAttribute, true, target.constructor, propertyName);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
static AllowNullValue(cTor, propertyName) {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
let meta = Reflect.getMetadata(SchemasDecorators._notNullAttribute, cTor, propertyName);
|
|
45
|
-
if (meta == undefined)
|
|
46
|
-
meta = (_b = (_a = OwnMetaDataContainer.Get(cTor, SchemasDecorators._notNullAttribute, propertyName)) === null || _a === void 0 ? void 0 : _a.Value) !== null && _b !== void 0 ? _b : false;
|
|
47
|
-
return !meta;
|
|
48
|
-
}
|
|
49
|
-
static OneToOne(lazyBuilder, property) {
|
|
50
|
-
return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.ONE_TO_ONE, property);
|
|
51
|
-
}
|
|
52
|
-
static OneToMany(lazyBuilder, property) {
|
|
53
|
-
return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.ONE_TO_MANY, property);
|
|
54
|
-
}
|
|
55
|
-
static ManyToOne(lazyBuilder, property) {
|
|
56
|
-
return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.MANY_TO_ONE, property);
|
|
57
|
-
}
|
|
58
|
-
static ManyToMany(lazyBuilder, property) {
|
|
59
|
-
return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.MANY_TO_MANY, property);
|
|
60
|
-
}
|
|
61
|
-
static Relation(lazyBuilder, relation, property) {
|
|
62
|
-
return function (target, propertyName) {
|
|
63
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._relationAttribute, propertyName, { TypeBuilder: lazyBuilder, Relation: relation, Field: property });
|
|
64
|
-
Reflect.defineMetadata(SchemasDecorators._relationAttribute, { TypeBuilder: lazyBuilder, Relation: relation, Field: property }, target.constructor, propertyName);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
static GetRelationAttribute(cTor, propertyName) {
|
|
68
|
-
var _a;
|
|
69
|
-
let meta = Reflect.getMetadata(SchemasDecorators._relationAttribute, cTor, propertyName);
|
|
70
|
-
if (!meta)
|
|
71
|
-
meta = (_a = OwnMetaDataContainer.Get(cTor, SchemasDecorators._relationAttribute, propertyName)) === null || _a === void 0 ? void 0 : _a.Value;
|
|
72
|
-
return meta;
|
|
73
|
-
}
|
|
74
|
-
static PrimaryKey() {
|
|
75
|
-
return function (target, propertyName) {
|
|
76
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._primaryKeyAttribute, propertyName, true);
|
|
77
|
-
Reflect.defineMetadata(SchemasDecorators._primaryKeyAttribute, true, target.constructor, propertyName);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
static IsPrimaryKey(cTor, propertyName) {
|
|
81
|
-
var _a, _b;
|
|
82
|
-
let meta = Reflect.getMetadata(SchemasDecorators._primaryKeyAttribute, cTor, propertyName);
|
|
83
|
-
if (!meta)
|
|
84
|
-
meta = Reflect.getMetadata(SchemasDecorators._primaryKeyAttribute, cTor.prototype, propertyName);
|
|
85
|
-
if (!meta)
|
|
86
|
-
meta = Reflect.getMetadata(SchemasDecorators._primaryKeyAttribute, Reflect.construct(cTor, []), propertyName);
|
|
87
|
-
if (!meta)
|
|
88
|
-
meta = (_b = (_a = OwnMetaDataContainer.Get(cTor, SchemasDecorators._primaryKeyAttribute, propertyName)) === null || _a === void 0 ? void 0 : _a.Value) !== null && _b !== void 0 ? _b : false;
|
|
89
|
-
return meta;
|
|
90
|
-
}
|
|
91
|
-
static ExtractPrimaryKey(cTor) {
|
|
92
|
-
for (let prop of Type_1.default.GetProperties(cTor)) {
|
|
93
|
-
if (SchemasDecorators.IsPrimaryKey(cTor, prop))
|
|
94
|
-
return prop;
|
|
95
|
-
}
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
static DataType(type) {
|
|
99
|
-
return function (target, propertyName) {
|
|
100
|
-
OwnMetaDataContainer.Set(target.constructor, SchemasDecorators._dataTypeAttribute, propertyName, type);
|
|
101
|
-
Reflect.defineMetadata(SchemasDecorators._dataTypeAttribute, type, target.constructor, propertyName);
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
static GetDataTypeAttribute(cTor, propertyName) {
|
|
105
|
-
var _a;
|
|
106
|
-
let value = Reflect.getMetadata(SchemasDecorators._dataTypeAttribute, cTor, propertyName);
|
|
107
|
-
if (!value)
|
|
108
|
-
value = (_a = OwnMetaDataContainer.Get(cTor, SchemasDecorators._dataTypeAttribute, propertyName)) === null || _a === void 0 ? void 0 : _a.Value;
|
|
109
|
-
if (value === undefined)
|
|
110
|
-
return undefined;
|
|
111
|
-
else
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
SchemasDecorators._tableAttribute = "compile:schema-table";
|
|
116
|
-
SchemasDecorators._columnAttribute = "compile:schema-column";
|
|
117
|
-
SchemasDecorators._dataTypeAttribute = "compile:schema-dataType";
|
|
118
|
-
SchemasDecorators._primaryKeyAttribute = "compile:schema-primarykey";
|
|
119
|
-
SchemasDecorators._relationAttribute = "compile:schema-relationWith";
|
|
120
|
-
SchemasDecorators._notNullAttribute = "compile:schema-notNull";
|
|
121
|
-
exports.default = SchemasDecorators;
|
|
122
|
-
class OwnMetaDataContainer {
|
|
123
|
-
static Get(target, key, member) {
|
|
124
|
-
let meta = this._metadas.filter(s => s.Key == key && (s.CTor == target || s.CTor == target.prototype) && s.Member == member);
|
|
125
|
-
if (meta && meta.length > 0)
|
|
126
|
-
return meta[0];
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
static Set(target, key, member, value) {
|
|
130
|
-
let meta = this.Get(target, key, member);
|
|
131
|
-
if (meta) {
|
|
132
|
-
meta.Value = value;
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
this._metadas.push({
|
|
136
|
-
CTor: target,
|
|
137
|
-
Key: key,
|
|
138
|
-
Member: member,
|
|
139
|
-
Value: value
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
OwnMetaDataContainer._metadas = [];
|
|
145
|
-
//# sourceMappingURL=SchemasDecorators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1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C,GAAG,CAAC,MAAiB,EAAE,GAAY,EAAE,MAAgB;QAE/D,IAAI,IAAI,GAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;QAE9H,IAAG,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YACtB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;QAEnB,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,GAAG,CAAC,MAAiB,EAAE,GAAY,EAAE,MAAgB,EAAE,KAAY;QAE7E,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAG,IAAI,EACP;YACI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACtB;aAED;YACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CACd;gBACI,IAAI,EAAG,MAAM;gBACb,GAAG,EAAG,GAAG;gBACT,MAAM,EAAG,MAAM;gBACf,KAAK,EAAG,KAAK;aAChB,CAAC,CAAC;SACV;IACL,CAAC;;AA9Be,6BAAQ,GAAiB,EAAE,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { DBTypes } from '../enums/DBTypes';
|
|
3
|
-
export default class Type {
|
|
4
|
-
static GetProperties(cTor: Function): string[];
|
|
5
|
-
static GetDesingType(cTor: Function, propertyName: string): {
|
|
6
|
-
new (...args: any[]): unknown;
|
|
7
|
-
} | undefined;
|
|
8
|
-
static GetDesingTimeTypeName(cTor: Function, propertyName: string): string | undefined;
|
|
9
|
-
static AsArray(type: string): string;
|
|
10
|
-
static InjectMetadata(object: any, metadata: {
|
|
11
|
-
Field: string;
|
|
12
|
-
Type: DBTypes;
|
|
13
|
-
Value: any;
|
|
14
|
-
Loaded: boolean;
|
|
15
|
-
}): void;
|
|
16
|
-
static ExtractMetadata(object: any): Parameters<typeof Type.InjectMetadata>[1][];
|
|
17
|
-
static DeleteMetadata(object: any): void;
|
|
18
|
-
static GetTableName(cTor: Function): string;
|
|
19
|
-
static GetColumnName(cTor: Function, key: string): string;
|
|
20
|
-
static HasValue(obj: any): boolean;
|
|
21
|
-
static GetColumnNameAndType(cTor: Function): {
|
|
22
|
-
Field: string;
|
|
23
|
-
Column: string;
|
|
24
|
-
Type: string;
|
|
25
|
-
}[];
|
|
26
|
-
static IsArray(dbType: string): boolean;
|
|
27
|
-
static ExtractElementType(dbType: string): DBTypes;
|
|
28
|
-
static IsDate(dbType: string): boolean;
|
|
29
|
-
static IsNumber(dbType: string): boolean;
|
|
30
|
-
static IsText(dbType: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @method
|
|
34
|
-
* @param {string} type the type from desing type to be converted to a DBTypes enum
|
|
35
|
-
* @returns the DBTypes correspondent
|
|
36
|
-
*/
|
|
37
|
-
static CastType(type: string): DBTypes;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=Type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../../../src/core/design/Type.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,CAAC,OAAO,OAAO,IAAI;WAEP,aAAa,CAAC,IAAI,EAAG,QAAQ;WAO7B,aAAa,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI;QAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,OAAO,CAAA;KAAC,GAAG,SAAS;WAKpG,qBAAqB,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