myorm_pg 1.0.0

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.
Files changed (82) hide show
  1. package/lib/Index.d.ts +29 -0
  2. package/lib/Index.d.ts.map +1 -0
  3. package/lib/Index.js +52 -0
  4. package/lib/Index.js.map +1 -0
  5. package/lib/core/decorators/SchemasDecorators.d.ts +42 -0
  6. package/lib/core/decorators/SchemasDecorators.d.ts.map +1 -0
  7. package/lib/core/decorators/SchemasDecorators.js +81 -0
  8. package/lib/core/decorators/SchemasDecorators.js.map +1 -0
  9. package/lib/core/design/Type.d.ts +37 -0
  10. package/lib/core/design/Type.d.ts.map +1 -0
  11. package/lib/core/design/Type.js +132 -0
  12. package/lib/core/design/Type.js.map +1 -0
  13. package/lib/core/enums/DBTypes.d.ts +19 -0
  14. package/lib/core/enums/DBTypes.d.ts.map +1 -0
  15. package/lib/core/enums/DBTypes.js +23 -0
  16. package/lib/core/enums/DBTypes.js.map +1 -0
  17. package/lib/core/enums/RelationType.d.ts +7 -0
  18. package/lib/core/enums/RelationType.d.ts.map +1 -0
  19. package/lib/core/enums/RelationType.js +11 -0
  20. package/lib/core/enums/RelationType.js.map +1 -0
  21. package/lib/core/exceptions/ConnectionFailException.d.ts +5 -0
  22. package/lib/core/exceptions/ConnectionFailException.d.ts.map +1 -0
  23. package/lib/core/exceptions/ConnectionFailException.js +13 -0
  24. package/lib/core/exceptions/ConnectionFailException.js.map +1 -0
  25. package/lib/core/exceptions/Exception.d.ts +5 -0
  26. package/lib/core/exceptions/Exception.d.ts.map +1 -0
  27. package/lib/core/exceptions/Exception.js +10 -0
  28. package/lib/core/exceptions/Exception.js.map +1 -0
  29. package/lib/core/exceptions/InvalidOperationException.d.ts +6 -0
  30. package/lib/core/exceptions/InvalidOperationException.d.ts.map +1 -0
  31. package/lib/core/exceptions/InvalidOperationException.js +14 -0
  32. package/lib/core/exceptions/InvalidOperationException.js.map +1 -0
  33. package/lib/core/exceptions/NotImplementedException.d.ts +5 -0
  34. package/lib/core/exceptions/NotImplementedException.d.ts.map +1 -0
  35. package/lib/core/exceptions/NotImplementedException.js +13 -0
  36. package/lib/core/exceptions/NotImplementedException.js.map +1 -0
  37. package/lib/core/exceptions/QueryFailException.d.ts +6 -0
  38. package/lib/core/exceptions/QueryFailException.d.ts.map +1 -0
  39. package/lib/core/exceptions/QueryFailException.js +14 -0
  40. package/lib/core/exceptions/QueryFailException.js.map +1 -0
  41. package/lib/core/exceptions/TypeNotSuportedException.d.ts +5 -0
  42. package/lib/core/exceptions/TypeNotSuportedException.d.ts.map +1 -0
  43. package/lib/core/exceptions/TypeNotSuportedException.js +13 -0
  44. package/lib/core/exceptions/TypeNotSuportedException.js.map +1 -0
  45. package/lib/core/objects/interfaces/IDBConnection.d.ts +13 -0
  46. package/lib/core/objects/interfaces/IDBConnection.d.ts.map +1 -0
  47. package/lib/core/objects/interfaces/IDBConnection.js +3 -0
  48. package/lib/core/objects/interfaces/IDBConnection.js.map +1 -0
  49. package/lib/core/objects/interfaces/IDBContext.d.ts +8 -0
  50. package/lib/core/objects/interfaces/IDBContext.d.ts.map +1 -0
  51. package/lib/core/objects/interfaces/IDBContext.js +3 -0
  52. package/lib/core/objects/interfaces/IDBContext.js.map +1 -0
  53. package/lib/core/objects/interfaces/IDBManager.d.ts +12 -0
  54. package/lib/core/objects/interfaces/IDBManager.d.ts.map +1 -0
  55. package/lib/core/objects/interfaces/IDBManager.js +3 -0
  56. package/lib/core/objects/interfaces/IDBManager.js.map +1 -0
  57. package/lib/core/objects/interfaces/IDBSet.d.ts +16 -0
  58. package/lib/core/objects/interfaces/IDBSet.d.ts.map +1 -0
  59. package/lib/core/objects/interfaces/IDBSet.js +3 -0
  60. package/lib/core/objects/interfaces/IDBSet.js.map +1 -0
  61. package/lib/core/objects/interfaces/IStatement.d.ts +15 -0
  62. package/lib/core/objects/interfaces/IStatement.d.ts.map +1 -0
  63. package/lib/core/objects/interfaces/IStatement.js +14 -0
  64. package/lib/core/objects/interfaces/IStatement.js.map +1 -0
  65. package/lib/implementations/PGDBConnection.d.ts +18 -0
  66. package/lib/implementations/PGDBConnection.d.ts.map +1 -0
  67. package/lib/implementations/PGDBConnection.js +98 -0
  68. package/lib/implementations/PGDBConnection.js.map +1 -0
  69. package/lib/implementations/PGDBContext.d.ts +17 -0
  70. package/lib/implementations/PGDBContext.d.ts.map +1 -0
  71. package/lib/implementations/PGDBContext.js +57 -0
  72. package/lib/implementations/PGDBContext.js.map +1 -0
  73. package/lib/implementations/PGDBManager.d.ts +26 -0
  74. package/lib/implementations/PGDBManager.d.ts.map +1 -0
  75. package/lib/implementations/PGDBManager.js +178 -0
  76. package/lib/implementations/PGDBManager.js.map +1 -0
  77. package/lib/implementations/PGDBSet.d.ts +37 -0
  78. package/lib/implementations/PGDBSet.d.ts.map +1 -0
  79. package/lib/implementations/PGDBSet.js +618 -0
  80. package/lib/implementations/PGDBSet.js.map +1 -0
  81. package/package.json +31 -0
  82. package/readme.md +316 -0
package/lib/Index.d.ts ADDED
@@ -0,0 +1,29 @@
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 { Operation } from './core/objects/interfaces/IStatement';
7
+ export { DBTypes };
8
+ export { PGDBConnection };
9
+ export { PGDBContext };
10
+ export { PGDBManager };
11
+ export { PGDBSet };
12
+ export { Operation };
13
+ export declare function Column(name?: string): (target: Object, propertyName: string) => void;
14
+ export declare function Table(name?: string): (target: Object) => void;
15
+ export declare function DataType(dbType: DBTypes): (target: Object, propertyName: string) => void;
16
+ export declare function PrimaryKey(): (target: Object, propertyName: string) => void;
17
+ export declare function OneToMany<T>(typeBuilder: () => {
18
+ new (...args: any[]): T;
19
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
20
+ export declare function OneToOne<T>(typeBuilder: () => {
21
+ new (...args: any[]): T;
22
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
23
+ export declare function ManyToMany<T>(typeBuilder: () => {
24
+ new (...args: any[]): T;
25
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
26
+ export declare function ManyToOne<T>(typeBuilder: () => {
27
+ new (...args: any[]): T;
28
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
29
+ //# sourceMappingURL=Index.d.ts.map
@@ -0,0 +1 @@
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;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAC,OAAO,EAAC,CAAC;AACjB,OAAO,EAAC,cAAc,EAAC,CAAA;AACvB,OAAO,EAAC,WAAW,EAAC,CAAA;AACpB,OAAO,EAAC,WAAW,EAAC,CAAA;AACpB,OAAO,EAAC,OAAO,EAAC,CAAA;AAChB,OAAO,EAAC,SAAS,EAAC,CAAA;AAGlB,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAG,MAAM,kDAGpC;AAED,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAG,MAAM,4BAGnC;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAG,OAAO,kDAGxC;AAED,wBAAgB,UAAU,mDAGzB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,WAAW,EAAI,MAAO;IAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,CAAC,CAAA;CAAC,EAAE,QAAQ,CAAC,EAAG,MAAM,CAAC,GAAG,MAAM,kDAG1G;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAI,MAAO;IAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,CAAC,CAAA;CAAC,EAAE,QAAQ,CAAC,EAAG,MAAM,CAAC,GAAG,MAAM,kDAGzG;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,WAAW,EAAI,MAAO;IAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,CAAC,CAAA;CAAC,EAAE,QAAQ,CAAC,EAAG,MAAM,CAAC,GAAG,MAAM,kDAG3G;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,WAAW,EAAI,MAAO;IAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,CAAC,CAAA;CAAC,EAAE,QAAQ,CAAC,EAAG,MAAM,CAAC,GAAG,MAAM,kDAG1G"}
package/lib/Index.js ADDED
@@ -0,0 +1,52 @@
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.Operation = exports.PGDBSet = exports.PGDBManager = exports.PGDBContext = exports.PGDBConnection = exports.DBTypes = 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 IStatement_1 = require("./core/objects/interfaces/IStatement");
19
+ Object.defineProperty(exports, "Operation", { enumerable: true, get: function () { return IStatement_1.Operation; } });
20
+ function Column(name) {
21
+ return SchemasDecorators_1.default.Column(name);
22
+ }
23
+ exports.Column = Column;
24
+ function Table(name) {
25
+ return SchemasDecorators_1.default.Table(name);
26
+ }
27
+ exports.Table = Table;
28
+ function DataType(dbType) {
29
+ return SchemasDecorators_1.default.DataType(dbType);
30
+ }
31
+ exports.DataType = DataType;
32
+ function PrimaryKey() {
33
+ return SchemasDecorators_1.default.PrimaryKey();
34
+ }
35
+ exports.PrimaryKey = PrimaryKey;
36
+ function OneToMany(typeBuilder, property) {
37
+ return SchemasDecorators_1.default.OneToMany(typeBuilder, property);
38
+ }
39
+ exports.OneToMany = OneToMany;
40
+ function OneToOne(typeBuilder, property) {
41
+ return SchemasDecorators_1.default.OneToOne(typeBuilder, property);
42
+ }
43
+ exports.OneToOne = OneToOne;
44
+ function ManyToMany(typeBuilder, property) {
45
+ return SchemasDecorators_1.default.ManyToMany(typeBuilder, property);
46
+ }
47
+ exports.ManyToMany = ManyToMany;
48
+ function ManyToOne(typeBuilder, property) {
49
+ return SchemasDecorators_1.default.ManyToOne(typeBuilder, property);
50
+ }
51
+ exports.ManyToOne = ManyToOne;
52
+ //# sourceMappingURL=Index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.js","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA+C;AAUvC,wFAVC,iBAAO,OAUD;AATf,4FAAoE;AACpE,sFAA8D;AAStD,yBATD,wBAAc,CASC;AARtB,gFAAwD;AAShD,sBATD,qBAAW,CASC;AARnB,gFAAwD;AAShD,sBATD,qBAAW,CASC;AARnB,wEAAgD;AASxC,kBATD,iBAAO,CASC;AARf,qEAAiE;AASzD,0FATC,sBAAS,OASD;AAGjB,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"}
@@ -0,0 +1,42 @@
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
+ static Table(name?: string): (target: Object) => void;
11
+ static GetTableAttribute(target: Object): string | undefined;
12
+ static Column(name?: string): (target: Object, propertyName: string) => void;
13
+ static GetColumnAttribute(cTor: Function, propertyName: string): string | undefined;
14
+ static OneToOne<T>(lazyBuilder: () => {
15
+ new (...args: any[]): T;
16
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
17
+ static OneToMany<T>(lazyBuilder: () => {
18
+ new (...args: any[]): T;
19
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
20
+ static ManyToOne<T>(lazyBuilder: () => {
21
+ new (...args: any[]): T;
22
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
23
+ static ManyToMany<T>(lazyBuilder: () => {
24
+ new (...args: any[]): T;
25
+ }, property?: keyof T & string): (target: Object, propertyName: string) => void;
26
+ private static Relation;
27
+ static GetRelationAttribute(cTor: Function, propertyName: string): {
28
+ TypeBuilder: () => {
29
+ new (...args: any[]): unknown;
30
+ };
31
+ Relation: RelationType;
32
+ Field?: string;
33
+ } | undefined;
34
+ static PrimaryKey(): (target: Object, propertyName: string) => void;
35
+ static IsPrimaryKey(cTor: Function, propertyName: string): boolean;
36
+ static ExtractPrimaryKey(cTor: {
37
+ new (...args: any[]): unknown;
38
+ }): string | undefined;
39
+ static DataType(type: DBTypes): (target: Object, propertyName: string) => void;
40
+ static GetDataTypeAttribute(cTor: Function, propertyName: string): DBTypes | undefined;
41
+ }
42
+ //# sourceMappingURL=SchemasDecorators.d.ts.map
@@ -0,0 +1 @@
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,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAElC,OAAO,CAAC,MAAM,CAAC,eAA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AM,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;WAO5K,UAAU,aAEM,MAAM,gBAAiB,MAAM;WAM7C,YAAY,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI,OAAO;WAK9D,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;WAM7C,oBAAoB,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI,OAAO,GAAG,SAAS;CAWnG"}
@@ -0,0 +1,81 @@
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
+ Reflect.defineMetadata(SchemasDecorators._tableAttribute, name !== null && name !== void 0 ? name : target.constructor.name.toLocaleLowerCase(), target);
13
+ };
14
+ }
15
+ static GetTableAttribute(target) {
16
+ return Reflect.getMetadata(SchemasDecorators._tableAttribute, target);
17
+ }
18
+ static Column(name) {
19
+ return function (target, propertyName) {
20
+ Reflect.defineMetadata(SchemasDecorators._columnAttribute, name !== null && name !== void 0 ? name : propertyName.toLocaleLowerCase(), target.constructor, propertyName);
21
+ };
22
+ }
23
+ static GetColumnAttribute(cTor, propertyName) {
24
+ return Reflect.getMetadata(SchemasDecorators._columnAttribute, cTor, propertyName);
25
+ }
26
+ static OneToOne(lazyBuilder, property) {
27
+ return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.ONE_TO_ONE, property);
28
+ }
29
+ static OneToMany(lazyBuilder, property) {
30
+ return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.ONE_TO_MANY, property);
31
+ }
32
+ static ManyToOne(lazyBuilder, property) {
33
+ return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.MANY_TO_ONE, property);
34
+ }
35
+ static ManyToMany(lazyBuilder, property) {
36
+ return SchemasDecorators.Relation(lazyBuilder, RelationType_1.RelationType.MANY_TO_MANY, property);
37
+ }
38
+ static Relation(lazyBuilder, relation, property) {
39
+ return function (target, propertyName) {
40
+ Reflect.defineMetadata(SchemasDecorators._relationAttribute, { TypeBuilder: lazyBuilder, Relation: relation, Field: property }, target.constructor, propertyName);
41
+ };
42
+ }
43
+ static GetRelationAttribute(cTor, propertyName) {
44
+ return Reflect.getMetadata(SchemasDecorators._relationAttribute, cTor, propertyName);
45
+ }
46
+ static PrimaryKey() {
47
+ return function (target, propertyName) {
48
+ Reflect.defineMetadata(SchemasDecorators._primaryKeyAttribute, true, target.constructor, propertyName);
49
+ };
50
+ }
51
+ static IsPrimaryKey(cTor, propertyName) {
52
+ var _a;
53
+ return (_a = Reflect.getMetadata(SchemasDecorators._primaryKeyAttribute, cTor, propertyName)) !== null && _a !== void 0 ? _a : false;
54
+ }
55
+ static ExtractPrimaryKey(cTor) {
56
+ for (let prop of Type_1.default.GetProperties(cTor)) {
57
+ if (SchemasDecorators.IsPrimaryKey(cTor, prop))
58
+ return prop;
59
+ }
60
+ return undefined;
61
+ }
62
+ static DataType(type) {
63
+ return function (target, propertyName) {
64
+ Reflect.defineMetadata(SchemasDecorators._dataTypeAttribute, type, target.constructor, propertyName);
65
+ };
66
+ }
67
+ static GetDataTypeAttribute(cTor, propertyName) {
68
+ let value = Reflect.getMetadata(SchemasDecorators._dataTypeAttribute, cTor, propertyName);
69
+ if (value === undefined)
70
+ return undefined;
71
+ else
72
+ return value;
73
+ }
74
+ }
75
+ exports.default = SchemasDecorators;
76
+ SchemasDecorators._tableAttribute = "compile:schema-table";
77
+ SchemasDecorators._columnAttribute = "compile:schema-column";
78
+ SchemasDecorators._dataTypeAttribute = "compile:schema-dataType";
79
+ SchemasDecorators._primaryKeyAttribute = "compile:schema-primarykey";
80
+ SchemasDecorators._relationAttribute = "compile:schema-relationWith";
81
+ //# sourceMappingURL=SchemasDecorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemasDecorators.js","sourceRoot":"","sources":["../../../src/core/decorators/SchemasDecorators.ts"],"names":[],"mappings":";;;;;AACA,4BAA0B;AAE1B,0DAAkC;AAClC,wDAAqD;AAErD,MAAqB,iBAAiB;IAU3B,MAAM,CAAC,KAAK,CAAC,IAAc;QAE9B,OAAO,UAAU,MAAe;YAE5B,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,CAAC;QAC3H,CAAC,CAAA;IACL,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,MAAe;QAE3C,OAAO,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IAGM,MAAM,CAAC,MAAM,CAAC,IAAc;QAE/B,OAAO,UAAU,MAAe,EAAE,YAAqB;YAEnD,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,YAAY,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAC3I,CAAC,CAAA;IACL,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,IAAe,EAAE,YAAqB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AAoB,GAAY,2BAA2B,CAAC;AAC5D,oCAAkB,GAAY,6BAA6B,CAAC"}
@@ -0,0 +1,37 @@
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 GetTableName(cTor: Function): string;
18
+ static GetColumnName(cTor: Function, key: string): string;
19
+ static HasValue(obj: any): boolean;
20
+ static GetColumnNameAndType(cTor: Function): {
21
+ Field: string;
22
+ Column: string;
23
+ Type: string;
24
+ }[];
25
+ static IsArray(dbType: string): boolean;
26
+ static ExtractElementType(dbType: string): DBTypes;
27
+ static IsDate(dbType: string): boolean;
28
+ static IsNumber(dbType: string): boolean;
29
+ /**
30
+ *
31
+ * @method
32
+ * @param {string} type the type from desing type to be converted to a DBTypes enum
33
+ * @returns the DBTypes correspondent
34
+ */
35
+ static CastType(type: string): DBTypes;
36
+ }
37
+ //# sourceMappingURL=Type.d.ts.map
@@ -0,0 +1 @@
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,CAAC,IAAI,EAAG,QAAQ,EAAE,YAAY,EAAG,MAAM,GAAI,MAAM,GAAG,SAAS;WAelF,OAAO,CAAC,IAAI,EAAG,MAAM,GAAI,MAAM;WAa/B,cAAc,CAAC,MAAM,EAAG,GAAG,EAAE,QAAQ,EAAG;QAAC,KAAK,EAAG,MAAM,CAAC;QAAC,IAAI,EAAG,OAAO,CAAC;QAAC,KAAK,EAAG,GAAG,CAAC;QAAC,MAAM,EAAG,OAAO,CAAA;KAAC;WASvG,eAAe,CAAC,MAAM,EAAG,GAAG,GAAI,UAAU,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;WAM3E,YAAY,CAAC,IAAI,EAAG,QAAQ,GAAI,MAAM;WAKtC,aAAa,CAAC,IAAI,EAAG,QAAQ,EAAE,GAAG,EAAG,MAAM,GAAI,MAAM;WAKrD,QAAQ,CAAC,GAAG,EAAG,GAAG,GAAI,OAAO;WAoB7B,oBAAoB,CAAC,IAAI,EAAG,QAAQ,GAAI;QAAE,KAAK,EAAG,MAAM,CAAC;QAAC,MAAM,EAAG,MAAM,CAAC;QAAC,IAAI,EAAG,MAAM,CAAA;KAAE,EAAE;WA8B5F,OAAO,CAAC,MAAM,EAAG,MAAM;WAevB,kBAAkB,CAAC,MAAM,EAAG,MAAM;WAKlC,MAAM,CAAC,MAAM,EAAG,MAAM;WAWtB,QAAQ,CAAC,MAAM,EAAG,MAAM;IAatC;;;;;OAKG;WACW,QAAQ,CAAC,IAAI,EAAG,MAAM,GAAI,OAAO;CAkBlD"}
@@ -0,0 +1,132 @@
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 SchemasDecorators_1 = __importDefault(require("../decorators/SchemasDecorators"));
8
+ const DBTypes_1 = require("../enums/DBTypes");
9
+ const TypeNotSuportedException_1 = __importDefault(require("../exceptions/TypeNotSuportedException"));
10
+ class Type {
11
+ static GetProperties(cTor) {
12
+ let empty = Reflect.construct(cTor, []);
13
+ return Object.keys(empty);
14
+ }
15
+ static GetDesingType(cTor, propertyName) {
16
+ return Reflect.getMetadata("design:type", cTor.prototype, propertyName);
17
+ }
18
+ static GetDesingTimeTypeName(cTor, propertyName) {
19
+ let type = SchemasDecorators_1.default.GetDataTypeAttribute(cTor, propertyName);
20
+ if (type == undefined)
21
+ type = Reflect.getMetadata("design:type", cTor.prototype, propertyName);
22
+ if (typeof type === "function")
23
+ type = type.name;
24
+ return type === null || type === void 0 ? void 0 : type.toString();
25
+ }
26
+ static AsArray(type) {
27
+ if (type == "serial")
28
+ return DBTypes_1.DBTypes.LONGARRAY;
29
+ if (type.endsWith("[]"))
30
+ return type;
31
+ else
32
+ return `${type}[]`;
33
+ }
34
+ static InjectMetadata(object, metadata) {
35
+ let meta = Type.ExtractMetadata(object);
36
+ meta.push(metadata);
37
+ Reflect.set(object, '_orm_metadata_', meta);
38
+ }
39
+ static ExtractMetadata(object) {
40
+ var _a;
41
+ return (_a = Reflect.get(object, '_orm_metadata_')) !== null && _a !== void 0 ? _a : [];
42
+ }
43
+ static GetTableName(cTor) {
44
+ var _a;
45
+ return (_a = SchemasDecorators_1.default.GetTableAttribute(cTor)) !== null && _a !== void 0 ? _a : cTor.name;
46
+ }
47
+ static GetColumnName(cTor, key) {
48
+ return SchemasDecorators_1.default.GetColumnAttribute(cTor, key);
49
+ }
50
+ static HasValue(obj) {
51
+ if (typeof obj == "string") {
52
+ return obj.length > 0;
53
+ }
54
+ if (typeof obj == "number") {
55
+ return obj > 0;
56
+ }
57
+ if (typeof obj == "object") {
58
+ return obj != undefined;
59
+ }
60
+ return false;
61
+ }
62
+ static GetColumnNameAndType(cTor) {
63
+ let keys = Type.GetProperties(cTor).filter(s => SchemasDecorators_1.default.GetColumnAttribute(cTor, s) != undefined);
64
+ let values = [];
65
+ for (let key of keys) {
66
+ let meta = Type.GetColumnName(cTor, key);
67
+ let type = Type.GetDesingTimeTypeName(cTor, key);
68
+ let relation = SchemasDecorators_1.default.GetRelationAttribute(cTor, key);
69
+ if (!type && relation)
70
+ type = relation.TypeBuilder().name;
71
+ if (meta != undefined && type) {
72
+ values.push({
73
+ Field: key.toString(),
74
+ Column: meta,
75
+ Type: type
76
+ });
77
+ }
78
+ }
79
+ return values;
80
+ }
81
+ static IsArray(dbType) {
82
+ switch (dbType.toLocaleLowerCase()) {
83
+ case DBTypes_1.DBTypes.INTEGERARRAY: return true;
84
+ case DBTypes_1.DBTypes.TEXTARRAY: return true;
85
+ case DBTypes_1.DBTypes.BOOLEANARRAY: return true;
86
+ case DBTypes_1.DBTypes.DATEARRAY: return true;
87
+ case DBTypes_1.DBTypes.DATETIMEARRAY: return true;
88
+ case DBTypes_1.DBTypes.LONGARRAY: return true;
89
+ case DBTypes_1.DBTypes.DOUBLEARRAY: return true;
90
+ }
91
+ return false;
92
+ }
93
+ static ExtractElementType(dbType) {
94
+ return dbType.toLocaleLowerCase().toString().replace('[]', '');
95
+ }
96
+ static IsDate(dbType) {
97
+ switch (dbType.toLocaleLowerCase()) {
98
+ case DBTypes_1.DBTypes.DATE: return true;
99
+ case DBTypes_1.DBTypes.DATETIME: return true;
100
+ }
101
+ return false;
102
+ }
103
+ static IsNumber(dbType) {
104
+ switch (dbType.toLocaleLowerCase()) {
105
+ case DBTypes_1.DBTypes.LONG: return true;
106
+ case DBTypes_1.DBTypes.SERIAL: return true;
107
+ case DBTypes_1.DBTypes.INTEGER: return true;
108
+ case DBTypes_1.DBTypes.DOUBLE: return true;
109
+ }
110
+ return false;
111
+ }
112
+ /**
113
+ *
114
+ * @method
115
+ * @param {string} type the type from desing type to be converted to a DBTypes enum
116
+ * @returns the DBTypes correspondent
117
+ */
118
+ static CastType(type) {
119
+ for (let k in DBTypes_1.DBTypes) {
120
+ if (DBTypes_1.DBTypes[k] == type.toLocaleLowerCase().trim())
121
+ return DBTypes_1.DBTypes[k];
122
+ }
123
+ switch (type.toLowerCase()) {
124
+ case "number": return DBTypes_1.DBTypes.DOUBLE;
125
+ case "string": return DBTypes_1.DBTypes.TEXT;
126
+ case "object": return DBTypes_1.DBTypes.CLASS;
127
+ default: throw new TypeNotSuportedException_1.default(`The type ${type} is not suported`);
128
+ }
129
+ }
130
+ }
131
+ exports.default = Type;
132
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.js","sourceRoot":"","sources":["../../../src/core/design/Type.ts"],"names":[],"mappings":";;;;;AACA,4BAA0B;AAE1B,wFAAgE;AAChE,8CAA2C;AAC3C,sGAA8E;AAE9E,MAAqB,IAAI;IAEd,MAAM,CAAC,aAAa,CAAC,IAAe;QAEvC,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAExC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,IAAe,EAAE,YAAqB;QAE9D,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,CAAqC,CAAC;IAChH,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,IAAe,EAAE,YAAqB;QAGtE,IAAI,IAAI,GAAG,2BAAiB,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEtE,IAAG,IAAI,IAAI,SAAS;YAChB,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAExE,IAAG,OAAO,IAAI,KAAK,UAAU;YACzB,IAAI,GAAI,IAAY,CAAC,IAAI,CAAC;QAElC,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,EAAE,CAAC;IAE5B,C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AAC,WAAW,EAAE,EACzB;YACI,KAAK,QAAS,CAAC,CAAC,OAAO,iBAAO,CAAC,MAAM,CAAC;YACtC,KAAK,QAAS,CAAC,CAAC,OAAO,iBAAO,CAAC,IAAI,CAAC;YACpC,KAAK,QAAS,CAAC,CAAC,OAAO,iBAAO,CAAC,KAAK,CAAC;YAErC,OAAO,CAAC,CAAC,MAAM,IAAI,kCAAwB,CAAC,YAAY,IAAI,kBAAkB,CAAC,CAAC;SACnF;IACL,CAAC;CACJ;AAzLD,uBAyLC"}
@@ -0,0 +1,19 @@
1
+ export declare enum DBTypes {
2
+ INTEGER = "integer",
3
+ LONG = "long",
4
+ DOUBLE = "double",
5
+ TEXT = "text",
6
+ DATE = "date",
7
+ DATETIME = "datetime",
8
+ BOOLEAN = "boolean",
9
+ INTEGERARRAY = "integer[]",
10
+ LONGARRAY = "long[]",
11
+ DOUBLEARRAY = "double[]",
12
+ TEXTARRAY = "text[]",
13
+ DATEARRAY = "date[]",
14
+ DATETIMEARRAY = "datetime[]",
15
+ BOOLEANARRAY = "boolean[]",
16
+ SERIAL = "serial",
17
+ CLASS = "object"
18
+ }
19
+ //# sourceMappingURL=DBTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DBTypes.d.ts","sourceRoot":"","sources":["../../../src/core/enums/DBTypes.ts"],"names":[],"mappings":"AACA,oBAAY,OAAO;IAEf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,YAAY,cAAc;IAC1B,SAAS,WAAW;IACpB,WAAW,aAAa;IACxB,SAAS,WAAW;IACpB,SAAS,WAAW;IACpB,aAAa,eAAe;IAC5B,YAAY,cAAc;IAC1B,MAAM,WAAW;IACjB,KAAK,WAAW;CACnB"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DBTypes = void 0;
4
+ var DBTypes;
5
+ (function (DBTypes) {
6
+ DBTypes["INTEGER"] = "integer";
7
+ DBTypes["LONG"] = "long";
8
+ DBTypes["DOUBLE"] = "double";
9
+ DBTypes["TEXT"] = "text";
10
+ DBTypes["DATE"] = "date";
11
+ DBTypes["DATETIME"] = "datetime";
12
+ DBTypes["BOOLEAN"] = "boolean";
13
+ DBTypes["INTEGERARRAY"] = "integer[]";
14
+ DBTypes["LONGARRAY"] = "long[]";
15
+ DBTypes["DOUBLEARRAY"] = "double[]";
16
+ DBTypes["TEXTARRAY"] = "text[]";
17
+ DBTypes["DATEARRAY"] = "date[]";
18
+ DBTypes["DATETIMEARRAY"] = "datetime[]";
19
+ DBTypes["BOOLEANARRAY"] = "boolean[]";
20
+ DBTypes["SERIAL"] = "serial";
21
+ DBTypes["CLASS"] = "object";
22
+ })(DBTypes = exports.DBTypes || (exports.DBTypes = {}));
23
+ //# sourceMappingURL=DBTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DBTypes.js","sourceRoot":"","sources":["../../../src/core/enums/DBTypes.ts"],"names":[],"mappings":";;;AACA,IAAY,OAkBX;AAlBD,WAAY,OAAO;IAEf,8BAAmB,CAAA;IACnB,wBAAa,CAAA;IACb,4BAAiB,CAAA;IACjB,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,gCAAqB,CAAA;IACrB,8BAAmB,CAAA;IACnB,qCAA0B,CAAA;IAC1B,+BAAoB,CAAA;IACpB,mCAAwB,CAAA;IACxB,+BAAoB,CAAA;IACpB,+BAAoB,CAAA;IACpB,uCAA4B,CAAA;IAC5B,qCAA0B,CAAA;IAC1B,4BAAiB,CAAA;IACjB,2BAAgB,CAAA;AACpB,CAAC,EAlBW,OAAO,GAAP,eAAO,KAAP,eAAO,QAkBlB"}
@@ -0,0 +1,7 @@
1
+ export declare enum RelationType {
2
+ ONE_TO_ONE = "oneToOne",
3
+ ONE_TO_MANY = "oneToMany",
4
+ MANY_TO_ONE = "ManyToOne",
5
+ MANY_TO_MANY = "ManyToMany"
6
+ }
7
+ //# sourceMappingURL=RelationType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationType.d.ts","sourceRoot":"","sources":["../../../src/core/enums/RelationType.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IAEpB,UAAU,aAAa;IACvB,WAAW,cAAc;IACzB,WAAW,cAAc;IACzB,YAAY,eAAe;CAC9B"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationType = void 0;
4
+ var RelationType;
5
+ (function (RelationType) {
6
+ RelationType["ONE_TO_ONE"] = "oneToOne";
7
+ RelationType["ONE_TO_MANY"] = "oneToMany";
8
+ RelationType["MANY_TO_ONE"] = "ManyToOne";
9
+ RelationType["MANY_TO_MANY"] = "ManyToMany";
10
+ })(RelationType = exports.RelationType || (exports.RelationType = {}));
11
+ //# sourceMappingURL=RelationType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationType.js","sourceRoot":"","sources":["../../../src/core/enums/RelationType.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAMX;AAND,WAAY,YAAY;IAEpB,uCAAuB,CAAA;IACvB,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;IACzB,2CAA2B,CAAA;AAC/B,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB"}
@@ -0,0 +1,5 @@
1
+ import Exception from "./Exception";
2
+ export default class ConnectionFailException extends Exception {
3
+ constructor(message: string);
4
+ }
5
+ //# sourceMappingURL=ConnectionFailException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionFailException.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/ConnectionFailException.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,SAAS;gBAE9C,OAAO,EAAG,MAAM;CAI/B"}
@@ -0,0 +1,13 @@
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
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class ConnectionFailException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ }
11
+ }
12
+ exports.default = ConnectionFailException;
13
+ //# sourceMappingURL=ConnectionFailException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionFailException.js","sourceRoot":"","sources":["../../../src/core/exceptions/ConnectionFailException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAEpC,MAAqB,uBAAwB,SAAQ,mBAAS;IAE1D,YAAY,OAAgB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CACJ;AAND,0CAMC"}
@@ -0,0 +1,5 @@
1
+ export default class Exception extends Error {
2
+ Message: string;
3
+ constructor(message: string);
4
+ }
5
+ //# sourceMappingURL=Exception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exception.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/Exception.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,KAAK;IAEjC,OAAO,EAAI,MAAM,CAAA;gBAEZ,OAAO,EAAG,MAAM;CAK/B"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Exception extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.Message = message;
7
+ }
8
+ }
9
+ exports.default = Exception;
10
+ //# sourceMappingURL=Exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/core/exceptions/Exception.ts"],"names":[],"mappings":";;AAAA,MAAqB,SAAU,SAAQ,KAAK;IAIxC,YAAY,OAAgB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AATD,4BASC"}
@@ -0,0 +1,6 @@
1
+ import Exception from "./Exception";
2
+ export default class InvalidOperationException extends Exception {
3
+ Message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=InvalidOperationException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidOperationException.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/InvalidOperationException.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,SAAS;IAErD,OAAO,EAAI,MAAM,CAAA;gBAEZ,OAAO,EAAG,MAAM;CAK/B"}
@@ -0,0 +1,14 @@
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
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class InvalidOperationException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ this.Message = message;
11
+ }
12
+ }
13
+ exports.default = InvalidOperationException;
14
+ //# sourceMappingURL=InvalidOperationException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidOperationException.js","sourceRoot":"","sources":["../../../src/core/exceptions/InvalidOperationException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAEpC,MAAqB,yBAA0B,SAAQ,mBAAS;IAI5D,YAAY,OAAgB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AATD,4CASC"}
@@ -0,0 +1,5 @@
1
+ import Exception from "./Exception";
2
+ export default class NotImpletedException extends Exception {
3
+ constructor(message: string);
4
+ }
5
+ //# sourceMappingURL=NotImplementedException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotImplementedException.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/NotImplementedException.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,SAAS;gBAE3C,OAAO,EAAG,MAAM;CAI/B"}
@@ -0,0 +1,13 @@
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
+ const Exception_1 = __importDefault(require("./Exception"));
7
+ class NotImpletedException extends Exception_1.default {
8
+ constructor(message) {
9
+ super(message);
10
+ }
11
+ }
12
+ exports.default = NotImpletedException;
13
+ //# sourceMappingURL=NotImplementedException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotImplementedException.js","sourceRoot":"","sources":["../../../src/core/exceptions/NotImplementedException.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AAEpC,MAAqB,oBAAqB,SAAQ,mBAAS;IAEvD,YAAY,OAAgB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CACJ;AAND,uCAMC"}
@@ -0,0 +1,6 @@
1
+ import Exception from "./Exception";
2
+ export default class QueryFailException extends Exception {
3
+ Query: string;
4
+ constructor(message: string, query: string);
5
+ }
6
+ //# sourceMappingURL=QueryFailException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryFailException.d.ts","sourceRoot":"","sources":["../../../src/core/exceptions/QueryFailException.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,SAAS;IAE9C,KAAK,EAAI,MAAM,CAAC;gBAEX,OAAO,EAAG,MAAM,EAAE,KAAK,EAAG,MAAM;CAK/C"}