@tsed/objection 7.70.1 → 7.71.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.
- package/jest.config.js +3 -1
- package/lib/cjs/components/createBooleanColumn.js +2 -2
- package/lib/cjs/components/createBooleanColumn.js.map +1 -1
- package/lib/cjs/components/createIdColumn.js +2 -2
- package/lib/cjs/components/createIdColumn.js.map +1 -1
- package/lib/cjs/components/createNumberColumn.js +2 -2
- package/lib/cjs/components/createNumberColumn.js.map +1 -1
- package/lib/cjs/components/createStringColumn.js +2 -2
- package/lib/cjs/components/createStringColumn.js.map +1 -1
- package/lib/cjs/decorators/belongsToOne.js +2 -2
- package/lib/cjs/decorators/belongsToOne.js.map +1 -1
- package/lib/cjs/decorators/decimal.js +2 -2
- package/lib/cjs/decorators/decimal.js.map +1 -1
- package/lib/cjs/decorators/entity.js +5 -5
- package/lib/cjs/decorators/entity.js.map +1 -1
- package/lib/cjs/decorators/hasMany.js +2 -2
- package/lib/cjs/decorators/hasMany.js.map +1 -1
- package/lib/cjs/decorators/hasOne.js +2 -2
- package/lib/cjs/decorators/hasOne.js.map +1 -1
- package/lib/cjs/decorators/hasOneThroughRelation.js +2 -2
- package/lib/cjs/decorators/hasOneThroughRelation.js.map +1 -1
- package/lib/cjs/decorators/idColumn.js +4 -4
- package/lib/cjs/decorators/idColumn.js.map +1 -1
- package/lib/cjs/decorators/manyToMany.js +2 -2
- package/lib/cjs/decorators/manyToMany.js.map +1 -1
- package/lib/cjs/decorators/relatesTo.js +5 -5
- package/lib/cjs/decorators/relatesTo.js.map +1 -1
- package/lib/cjs/index.js +29 -29
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/ObjectionConnection.js +2 -2
- package/lib/cjs/services/ObjectionConnection.js.map +1 -1
- package/lib/cjs/utils/createColumns.js +5 -5
- package/lib/cjs/utils/createColumns.js.map +1 -1
- package/lib/cjs/utils/createJoinKeys.js +2 -2
- package/lib/cjs/utils/createJoinKeys.js.map +1 -1
- package/lib/cjs/utils/createRelationshipMapping.js +2 -2
- package/lib/cjs/utils/createRelationshipMapping.js.map +1 -1
- package/lib/cjs/utils/getJsonEntityRelationships.js +2 -2
- package/lib/cjs/utils/getJsonEntityRelationships.js.map +1 -1
- package/lib/esm/components/createBooleanColumn.js.map +1 -1
- package/lib/esm/components/createIdColumn.js.map +1 -1
- package/lib/esm/components/createNumberColumn.js.map +1 -1
- package/lib/esm/components/createStringColumn.js.map +1 -1
- package/lib/esm/decorators/belongsToOne.js.map +1 -1
- package/lib/esm/decorators/decimal.js.map +1 -1
- package/lib/esm/decorators/entity.js.map +1 -1
- package/lib/esm/decorators/hasMany.js.map +1 -1
- package/lib/esm/decorators/hasOne.js.map +1 -1
- package/lib/esm/decorators/hasOneThroughRelation.js.map +1 -1
- package/lib/esm/decorators/idColumn.js.map +1 -1
- package/lib/esm/decorators/manyToMany.js.map +1 -1
- package/lib/esm/decorators/relatesTo.js.map +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/ObjectionConnection.js.map +1 -1
- package/lib/esm/utils/createColumns.js.map +1 -1
- package/lib/esm/utils/createJoinKeys.js.map +1 -1
- package/lib/esm/utils/createRelationshipMapping.js.map +1 -1
- package/lib/esm/utils/getJsonEntityRelationships.js.map +1 -1
- package/lib/types/components/createBooleanColumn.d.ts +1 -1
- package/lib/types/components/createIdColumn.d.ts +1 -1
- package/lib/types/components/createNumberColumn.d.ts +1 -1
- package/lib/types/components/createStringColumn.d.ts +1 -1
- package/lib/types/decorators/belongsToOne.d.ts +1 -1
- package/lib/types/decorators/columnOptions.d.ts +1 -1
- package/lib/types/decorators/hasMany.d.ts +1 -1
- package/lib/types/decorators/hasOne.d.ts +1 -1
- package/lib/types/decorators/hasOneThroughRelation.d.ts +1 -1
- package/lib/types/decorators/manyToMany.d.ts +1 -1
- package/lib/types/decorators/relatesTo.d.ts +1 -1
- package/lib/types/index.d.ts +27 -27
- package/lib/types/services/ColumnTypesContainer.d.ts +1 -1
- package/lib/types/utils/createJoinKeys.d.ts +1 -1
- package/lib/types/utils/createRelationshipMapping.d.ts +1 -1
- package/lib/types/utils/getColumnCtx.d.ts +1 -1
- package/package.json +14 -14
package/jest.config.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// For a detailed explanation regarding each configuration property, visit:
|
|
2
2
|
// https://jestjs.io/docs/en/configuration.html
|
|
3
|
+
const config = require("@tsed/jest-config");
|
|
3
4
|
|
|
4
5
|
module.exports = {
|
|
5
|
-
...
|
|
6
|
+
...config,
|
|
6
7
|
roots: ["<rootDir>/src", "<rootDir>/test"],
|
|
7
8
|
moduleNameMapper: {
|
|
9
|
+
...config.moduleNameMapper,
|
|
8
10
|
"@tsed/objection": "<rootDir>/src/index.ts"
|
|
9
11
|
},
|
|
10
12
|
coverageThreshold: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBooleanColumn = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ColumnTypesContainer_js_1 = require("../services/ColumnTypesContainer.js");
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
@@ -9,5 +9,5 @@ function createBooleanColumn(table, { entity }) {
|
|
|
9
9
|
table.boolean(entity.propertyName);
|
|
10
10
|
}
|
|
11
11
|
exports.createBooleanColumn = createBooleanColumn;
|
|
12
|
-
|
|
12
|
+
ColumnTypesContainer_js_1.ColumnTypesContainer.set("boolean", createBooleanColumn);
|
|
13
13
|
//# sourceMappingURL=createBooleanColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":";;;AACA,iFAAyE;AAEzE;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAFD,kDAEC;AAED,8CAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createIdColumn = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ColumnTypesContainer_js_1 = require("../services/ColumnTypesContainer.js");
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
@@ -19,5 +19,5 @@ function createIdColumn(table, { entity, options }) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.createIdColumn = createIdColumn;
|
|
22
|
-
|
|
22
|
+
ColumnTypesContainer_js_1.ColumnTypesContainer.set("idColumn", createIdColumn);
|
|
23
23
|
//# sourceMappingURL=createIdColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":";;;AACA,iFAAyE;AAEzE,mCAAkC;AAElC;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,IAAA,mBAAU,GAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAXD,wCAWC;AAED,8CAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNumberColumn = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ColumnTypesContainer_js_1 = require("../services/ColumnTypesContainer.js");
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
@@ -9,5 +9,5 @@ function createNumberColumn(table, { entity, options }) {
|
|
|
9
9
|
table.decimal(entity.propertyName, options.precision, options.scale);
|
|
10
10
|
}
|
|
11
11
|
exports.createNumberColumn = createNumberColumn;
|
|
12
|
-
|
|
12
|
+
ColumnTypesContainer_js_1.ColumnTypesContainer.set("number", createNumberColumn);
|
|
13
13
|
//# sourceMappingURL=createNumberColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":";;;AACA,iFAAyE;AAGzE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAFD,gDAEC;AAED,8CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createStringColumn = void 0;
|
|
4
|
-
const
|
|
4
|
+
const ColumnTypesContainer_js_1 = require("../services/ColumnTypesContainer.js");
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
@@ -9,5 +9,5 @@ function createStringColumn(table, { entity, schema }) {
|
|
|
9
9
|
table.string(entity.propertyName, schema.maxLength);
|
|
10
10
|
}
|
|
11
11
|
exports.createStringColumn = createStringColumn;
|
|
12
|
-
|
|
12
|
+
ColumnTypesContainer_js_1.ColumnTypesContainer.set("string", createStringColumn);
|
|
13
13
|
//# sourceMappingURL=createStringColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":";;;AACA,iFAAyE;AAGzE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAFD,gDAEC;AAED,8CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BelongsToOne = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const relatesTo_js_1 = require("./relatesTo.js");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param opts
|
|
@@ -10,7 +10,7 @@ const relatesTo_1 = require("./relatesTo");
|
|
|
10
10
|
* @objection
|
|
11
11
|
*/
|
|
12
12
|
function BelongsToOne(opts) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, relatesTo_js_1.RelatesTo)(objection_1.Model.BelongsToOneRelation, opts);
|
|
14
14
|
}
|
|
15
15
|
exports.BelongsToOne = BelongsToOne;
|
|
16
16
|
//# sourceMappingURL=belongsToOne.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,iDAAyC;AAGzC;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAqC;IAChE,OAAO,IAAA,wBAAS,EAAC,iBAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAFD,oCAEC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Decimal = void 0;
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
5
|
const schema_1 = require("@tsed/schema");
|
|
6
|
-
const
|
|
6
|
+
const columnOptions_js_1 = require("./columnOptions.js");
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* @param options
|
|
@@ -11,7 +11,7 @@ const columnOptions_1 = require("./columnOptions");
|
|
|
11
11
|
* @objection
|
|
12
12
|
*/
|
|
13
13
|
function Decimal(options = {}) {
|
|
14
|
-
return (0, core_1.useDecorators)((0, schema_1.Property)(), (0,
|
|
14
|
+
return (0, core_1.useDecorators)((0, schema_1.Property)(), (0, columnOptions_js_1.ColumnOptions)({
|
|
15
15
|
columnType: "number",
|
|
16
16
|
options: {
|
|
17
17
|
type: "decimal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AACtC,yDAAiD;AAOjD;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,gCAAa,EAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,IAAA,eAAQ,EAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAlBD,0BAkBC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Entity = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const defineStaticGetter_js_1 = require("../utils/defineStaticGetter.js");
|
|
5
|
+
const getJsonEntityRelationships_js_1 = require("../utils/getJsonEntityRelationships.js");
|
|
6
6
|
const schema_1 = require("@tsed/schema");
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -16,9 +16,9 @@ function Entity(tableName) {
|
|
|
16
16
|
}
|
|
17
17
|
return (target) => {
|
|
18
18
|
const originalRelationMappings = target["relationMappings"];
|
|
19
|
-
(0,
|
|
20
|
-
(0,
|
|
21
|
-
(0,
|
|
19
|
+
(0, defineStaticGetter_js_1.defineStaticGetter)(target, "tableName", () => tableName);
|
|
20
|
+
(0, defineStaticGetter_js_1.defineStaticGetter)(target, "jsonSchema", () => (0, schema_1.getJsonSchema)(target));
|
|
21
|
+
(0, defineStaticGetter_js_1.defineStaticGetter)(target, "relationMappings", () => originalRelationMappings || (0, getJsonEntityRelationships_js_1.getJsonEntityRelationships)(target));
|
|
22
22
|
return target;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":";;;AACA,0EAAkE;AAClE,0FAAkF;AAClF,yCAA2C;AAE3C;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,IAAA,0CAAkB,EAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,IAAA,0CAAkB,EAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;QACtE,IAAA,0CAAkB,EAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,IAAA,0DAA0B,EAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAZD,wBAYC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HasMany = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const relatesTo_js_1 = require("./relatesTo.js");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param opts
|
|
@@ -10,7 +10,7 @@ const relatesTo_1 = require("./relatesTo");
|
|
|
10
10
|
* @objection
|
|
11
11
|
*/
|
|
12
12
|
function HasMany(type, opts) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, relatesTo_js_1.RelatesTo)(objection_1.Model.HasManyRelation, { ...opts, type });
|
|
14
14
|
}
|
|
15
15
|
exports.HasMany = HasMany;
|
|
16
16
|
//# sourceMappingURL=hasMany.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,
|
|
1
|
+
{"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,iDAAyC;AAGzC;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,IAAA,wBAAS,EAAC,iBAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,0BAEC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HasOne = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const relatesTo_js_1 = require("./relatesTo.js");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param opts
|
|
@@ -10,7 +10,7 @@ const relatesTo_1 = require("./relatesTo");
|
|
|
10
10
|
* @objection
|
|
11
11
|
*/
|
|
12
12
|
function HasOne(opts) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, relatesTo_js_1.RelatesTo)(objection_1.Model.HasOneRelation, opts);
|
|
14
14
|
}
|
|
15
15
|
exports.HasOne = HasOne;
|
|
16
16
|
//# sourceMappingURL=hasOne.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,iDAAyC;AAGzC;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,IAAqC;IAC1D,OAAO,IAAA,wBAAS,EAAC,iBAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAFD,wBAEC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HasOneThroughRelation = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const relatesTo_js_1 = require("./relatesTo.js");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param opts
|
|
@@ -10,7 +10,7 @@ const relatesTo_1 = require("./relatesTo");
|
|
|
10
10
|
* @objection
|
|
11
11
|
*/
|
|
12
12
|
function HasOneThroughRelation(opts) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, relatesTo_js_1.RelatesTo)(objection_1.Model.HasOneThroughRelation, opts);
|
|
14
14
|
}
|
|
15
15
|
exports.HasOneThroughRelation = HasOneThroughRelation;
|
|
16
16
|
//# sourceMappingURL=hasOneThroughRelation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":";;;AAEA,yCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":";;;AAEA,yCAAgC;AAChC,iDAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAkC;IACtE,OAAO,IAAA,wBAAS,EAAC,iBAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC;AAFD,sDAEC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IdColumn = void 0;
|
|
4
|
-
const
|
|
4
|
+
const columnOptions_js_1 = require("./columnOptions.js");
|
|
5
5
|
const schema_1 = require("@tsed/schema");
|
|
6
|
-
const
|
|
6
|
+
const defineStaticGetter_js_1 = require("../utils/defineStaticGetter.js");
|
|
7
7
|
const core_1 = require("@tsed/core");
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
@@ -12,13 +12,13 @@ const core_1 = require("@tsed/core");
|
|
|
12
12
|
* @objection
|
|
13
13
|
*/
|
|
14
14
|
function IdColumn(type = "increments") {
|
|
15
|
-
return (0, core_1.useDecorators)((0, schema_1.Property)(), (0,
|
|
15
|
+
return (0, core_1.useDecorators)((0, schema_1.Property)(), (0, columnOptions_js_1.ColumnOptions)({
|
|
16
16
|
columnType: "idColumn",
|
|
17
17
|
options: {
|
|
18
18
|
type
|
|
19
19
|
}
|
|
20
20
|
}), (target, propertyKey) => {
|
|
21
|
-
(0,
|
|
21
|
+
(0, defineStaticGetter_js_1.defineStaticGetter)(target, "idColumn", () => propertyKey);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
exports.IdColumn = IdColumn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AACjD,yCAAsC;AACtC,0EAAkE;AAClE,qCAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,gCAAa,EAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,IAAA,0CAAkB,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC;AAbD,4BAaC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ManyToMany = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const relatesTo_js_1 = require("./relatesTo.js");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param opts
|
|
@@ -10,7 +10,7 @@ const relatesTo_1 = require("./relatesTo");
|
|
|
10
10
|
* @objection
|
|
11
11
|
*/
|
|
12
12
|
function ManyToMany(type, opts) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, relatesTo_js_1.RelatesTo)(objection_1.Model.ManyToManyRelation, { ...opts, type });
|
|
14
14
|
}
|
|
15
15
|
exports.ManyToMany = ManyToMany;
|
|
16
16
|
//# sourceMappingURL=manyToMany.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,
|
|
1
|
+
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,iDAAyC;AAGzC;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,IAAA,wBAAS,EAAC,iBAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,gCAEC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RelatesTo = void 0;
|
|
4
4
|
const schema_1 = require("@tsed/schema");
|
|
5
|
-
const
|
|
5
|
+
const RelationshipOpts_js_1 = require("../domain/RelationshipOpts.js");
|
|
6
6
|
const core_1 = require("@tsed/core");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const getJsonEntityRelationships_js_1 = require("../utils/getJsonEntityRelationships.js");
|
|
8
|
+
const createRelationshipMapping_js_1 = require("../utils/createRelationshipMapping.js");
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @param relation
|
|
@@ -15,10 +15,10 @@ const createRelationshipMapping_1 = require("../utils/createRelationshipMapping"
|
|
|
15
15
|
*/
|
|
16
16
|
function RelatesTo(relation, opts) {
|
|
17
17
|
return (0, core_1.useDecorators)(opts?.type ? (0, schema_1.CollectionOf)(opts.type) : (0, schema_1.Property)(), (0, core_1.StoreFn)((store, params) => {
|
|
18
|
-
if (opts && (0,
|
|
18
|
+
if (opts && (0, RelationshipOpts_js_1.isModelClassFactory)(opts.type)) {
|
|
19
19
|
opts.type = opts.type();
|
|
20
20
|
}
|
|
21
|
-
store.set(
|
|
21
|
+
store.set(getJsonEntityRelationships_js_1.OBJECTION_RELATIONSHIP_KEY, (0, createRelationshipMapping_js_1.createRelationshipMapping)(params, relation, opts));
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
24
|
exports.RelatesTo = RelatesTo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AACpD,uEAAoF;AACpF,qCAAkD;AAElD,0FAAkF;AAElF,wFAAgF;AAEhF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,IAAA,oBAAa,EAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAQ,GAAE,EACjD,IAAA,cAAO,EAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,IAAA,yCAAmB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,0DAA0B,EAAE,IAAA,wDAAyB,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAVD,8BAUC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file Automatically generated by barrelsby.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const tslib_1 = require("tslib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
tslib_1.__exportStar(require("./components/
|
|
11
|
-
tslib_1.__exportStar(require("./
|
|
12
|
-
tslib_1.__exportStar(require("./
|
|
13
|
-
tslib_1.__exportStar(require("./
|
|
14
|
-
tslib_1.__exportStar(require("./decorators/
|
|
15
|
-
tslib_1.__exportStar(require("./decorators/
|
|
16
|
-
tslib_1.__exportStar(require("./decorators/
|
|
17
|
-
tslib_1.__exportStar(require("./decorators/
|
|
18
|
-
tslib_1.__exportStar(require("./decorators/
|
|
19
|
-
tslib_1.__exportStar(require("./decorators/
|
|
20
|
-
tslib_1.__exportStar(require("./decorators/
|
|
21
|
-
tslib_1.__exportStar(require("./
|
|
22
|
-
tslib_1.__exportStar(require("./
|
|
23
|
-
tslib_1.__exportStar(require("./
|
|
24
|
-
tslib_1.__exportStar(require("./
|
|
25
|
-
tslib_1.__exportStar(require("./
|
|
26
|
-
tslib_1.__exportStar(require("./
|
|
27
|
-
tslib_1.__exportStar(require("./
|
|
28
|
-
tslib_1.__exportStar(require("./
|
|
29
|
-
tslib_1.__exportStar(require("./utils/
|
|
30
|
-
tslib_1.__exportStar(require("./utils/
|
|
31
|
-
tslib_1.__exportStar(require("./utils/
|
|
32
|
-
tslib_1.__exportStar(require("./utils/
|
|
4
|
+
/**
|
|
5
|
+
* @file Automatically generated by @tsed/barrels.
|
|
6
|
+
*/
|
|
7
|
+
tslib_1.__exportStar(require("./components/createBooleanColumn.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./components/createIdColumn.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./components/createNumberColumn.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./components/createStringColumn.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./decorators/belongsToOne.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./decorators/columnOptions.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./decorators/decimal.js"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./decorators/entity.js"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./decorators/hasMany.js"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./decorators/hasOne.js"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./decorators/hasOneThroughRelation.js"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./decorators/idColumn.js"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./decorators/manyToMany.js"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./decorators/relatesTo.js"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./domain/ColumnOpts.js"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./domain/interfaces.js"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./domain/RelationshipOpts.js"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./services/ColumnTypesContainer.js"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./services/ObjectionConnection.js"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./utils/connect.js"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./utils/createColumns.js"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./utils/createJoinKeys.js"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./utils/createRelationshipMapping.js"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./utils/defineStaticGetter.js"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./utils/getColumnCtx.js"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./utils/getJsonEntityRelationships.js"), exports);
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,8EAAoD;AACpD,yEAA+C;AAC/C,6EAAmD;AACnD,6EAAmD;AACnD,uEAA6C;AAC7C,wEAA8C;AAC9C,kEAAwC;AACxC,iEAAuC;AACvC,kEAAwC;AACxC,iEAAuC;AACvC,gFAAsD;AACtD,mEAAyC;AACzC,qEAA2C;AAC3C,oEAA0C;AAC1C,iEAAuC;AACvC,iEAAuC;AACvC,uEAA6C;AAC7C,6EAAmD;AACnD,4EAAkD;AAClD,6DAAmC;AACnC,mEAAyC;AACzC,oEAA0C;AAC1C,+EAAqD;AACrD,wEAA8C;AAC9C,kEAAwC;AACxC,gFAAsD"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OBJECTION_CONNECTION = void 0;
|
|
4
4
|
const di_1 = require("@tsed/di");
|
|
5
|
-
const
|
|
5
|
+
const connect_js_1 = require("../utils/connect.js");
|
|
6
6
|
exports.OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
|
|
7
7
|
(0, di_1.registerProvider)({
|
|
8
8
|
provide: exports.OBJECTION_CONNECTION,
|
|
@@ -11,7 +11,7 @@ exports.OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
|
|
|
11
11
|
const connectionOptions = configuration.get("knex");
|
|
12
12
|
if (connectionOptions) {
|
|
13
13
|
try {
|
|
14
|
-
return (0,
|
|
14
|
+
return (0, connect_js_1.createConnection)(connectionOptions);
|
|
15
15
|
}
|
|
16
16
|
catch (er) {
|
|
17
17
|
// istanbul ignore next
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAEzD,
|
|
1
|
+
{"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAEzD,oDAAqD;AAExC,QAAA,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,IAAA,qBAAgB,EAAC;IACf,OAAO,EAAE,4BAAoB;IAC7B,IAAI,EAAE,CAAC,kBAAa,CAAC;IACrB,eAAe,CAAC,aAA4B;QAC1C,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,IAAA,6BAAgB,EAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -6,17 +6,17 @@ require("../components/createBooleanColumn");
|
|
|
6
6
|
require("../components/createIdColumn");
|
|
7
7
|
require("../components/createNumberColumn");
|
|
8
8
|
require("../components/createStringColumn");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const ColumnTypesContainer_js_1 = require("../services/ColumnTypesContainer.js");
|
|
10
|
+
const getColumnCtx_js_1 = require("./getColumnCtx.js");
|
|
11
11
|
/**
|
|
12
12
|
* @ignore
|
|
13
13
|
*/
|
|
14
14
|
function createColumn(table, entity) {
|
|
15
|
-
const ctx = (0,
|
|
16
|
-
if (!
|
|
15
|
+
const ctx = (0, getColumnCtx_js_1.getColumnCtx)(entity);
|
|
16
|
+
if (!ColumnTypesContainer_js_1.ColumnTypesContainer.has(ctx.columnType)) {
|
|
17
17
|
throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
ColumnTypesContainer_js_1.ColumnTypesContainer.get(ctx.columnType)(table, ctx);
|
|
20
20
|
}
|
|
21
21
|
exports.createColumn = createColumn;
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAE5D,6CAA2C;AAC3C,wCAAsC;AACtC,4CAA0C;AAC1C,4CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAE5D,6CAA2C;AAC3C,wCAAsC;AACtC,4CAA0C;AAC1C,4CAA0C;AAC1C,iFAAyE;AACzE,uDAA+C;AAE/C;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,IAAA,8BAAY,EAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,8CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,8CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AARD,oCAQC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,IAAA,sBAAa,EAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sCAIC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createJoinKeys = void 0;
|
|
4
4
|
const objection_1 = require("objection");
|
|
5
|
-
const
|
|
5
|
+
const RelationshipOpts_js_1 = require("../domain/RelationshipOpts.js");
|
|
6
6
|
const core_1 = require("@tsed/core");
|
|
7
7
|
/**
|
|
8
8
|
* @ignore
|
|
@@ -22,7 +22,7 @@ function createJoinKeys(targetClass, targetSuper, propertyKey, relation, opts) {
|
|
|
22
22
|
case objection_1.Model.HasOneThroughRelation:
|
|
23
23
|
return {
|
|
24
24
|
from: SOURCE_MODEL_KEY,
|
|
25
|
-
through: ((0,
|
|
25
|
+
through: ((0, RelationshipOpts_js_1.isRelationshipOptsWithThrough)(opts) && opts.through) || {
|
|
26
26
|
from: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${targetClass.tableName}Id`,
|
|
27
27
|
to: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${FOREIGN_MODEL.tableName}Id`
|
|
28
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,uEAA8F;AAE9F,qCAAoC;AAEpC;;GAEG;AACH,SAAgB,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,iBAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,iBAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,iBAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,iBAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,IAAA,mDAA6B,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,iBAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC;AA7BD,wCA6BC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createRelationshipMapping = void 0;
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
|
-
const
|
|
5
|
+
const createJoinKeys_js_1 = require("./createJoinKeys.js");
|
|
6
6
|
/**
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
@@ -11,7 +11,7 @@ function createRelationshipMapping([target, propertyKey], relation, opts) {
|
|
|
11
11
|
[propertyKey]: {
|
|
12
12
|
relation,
|
|
13
13
|
modelClass: opts?.type || core_1.Metadata.getType(target, propertyKey),
|
|
14
|
-
join: (0,
|
|
14
|
+
join: (0, createJoinKeys_js_1.createJoinKeys)(targetClass, target, String(propertyKey), relation, opts),
|
|
15
15
|
modify: opts?.modify,
|
|
16
16
|
filter: opts?.filter,
|
|
17
17
|
beforeInsert: opts?.beforeInsert
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":";;;AAAA,qCAAmE;AAInE,
|
|
1
|
+
{"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":";;;AAAA,qCAAmE;AAInE,2DAAmD;AAEnD;;GAEG;AACH,SAAgB,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,IAAA,kCAAc,EAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC;AAXD,8DAWC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getJsonEntityRelationships = exports.OBJECTION_RELATIONSHIP_KEY = void 0;
|
|
4
|
-
const
|
|
4
|
+
const createColumns_js_1 = require("./createColumns.js");
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
@@ -10,7 +10,7 @@ exports.OBJECTION_RELATIONSHIP_KEY = "objectionRelationship";
|
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
12
12
|
function getJsonEntityRelationships(target) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, createColumns_js_1.getColumns)(target)
|
|
14
14
|
.filter((col) => col.store.get(exports.OBJECTION_RELATIONSHIP_KEY))
|
|
15
15
|
.map((col) => col.store.get(exports.OBJECTION_RELATIONSHIP_KEY)(target))
|
|
16
16
|
.reduce((dict, col) => ({ ...dict, ...col }), {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":";;;AAAA,yDAA8C;AAE9C;;GAEG;AACU,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,SAAgB,0BAA0B,CAAC,MAAW;IACpD,OAAO,IAAA,6BAAU,EAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AALD,gEAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAEzE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAGzE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAGzE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAqC;IAChE,OAAO,SAAS,CAAC,KAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAOjD;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,QAAQ,CAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QACtE,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,SAAS,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,IAAqC;IAC1D,OAAO,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAkC;IACtE,OAAO,SAAS,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,SAAS,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAmB,mBAAmB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAmB,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAC;AAElF,OAAO,EAAC,yBAAyB,EAAC,MAAM,uCAAuC,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,aAAa,CAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EACjD,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Automatically generated by
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
3
|
*/
|
|
4
4
|
export * from "./components/createBooleanColumn.js";
|
|
5
5
|
export * from "./components/createIdColumn.js";
|
|
@@ -16,8 +16,8 @@ export * from "./decorators/idColumn.js";
|
|
|
16
16
|
export * from "./decorators/manyToMany.js";
|
|
17
17
|
export * from "./decorators/relatesTo.js";
|
|
18
18
|
export * from "./domain/ColumnOpts.js";
|
|
19
|
-
export * from "./domain/RelationshipOpts.js";
|
|
20
19
|
export * from "./domain/interfaces.js";
|
|
20
|
+
export * from "./domain/RelationshipOpts.js";
|
|
21
21
|
export * from "./services/ColumnTypesContainer.js";
|
|
22
22
|
export * from "./services/ObjectionConnection.js";
|
|
23
23
|
export * from "./utils/connect.js";
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,gBAAgB,CAAC;IACf,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,CAAC,aAAa,CAAC;IACrB,eAAe,CAAC,aAA4B;QAC1C,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAkB,MAAM,cAAc,CAAC;AAE5D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAkB,MAAM,cAAc,CAAC;AAE5D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAe,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAmB,6BAA6B,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAe,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAmB,6BAA6B,EAAC,MAAM,+BAA+B,CAAC;AAE9F,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,KAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,KAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,KAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,KAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,KAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAW,MAAM,YAAY,CAAC;AAInE,OAAO,EAAC,cAAc,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAW,MAAM,YAAY,CAAC;AAInE,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAW;IACpD,OAAO,UAAU,CAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Automatically generated by
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
3
|
*/
|
|
4
|
-
export * from "./components/createBooleanColumn";
|
|
5
|
-
export * from "./components/createIdColumn";
|
|
6
|
-
export * from "./components/createNumberColumn";
|
|
7
|
-
export * from "./components/createStringColumn";
|
|
8
|
-
export * from "./decorators/belongsToOne";
|
|
9
|
-
export * from "./decorators/columnOptions";
|
|
10
|
-
export * from "./decorators/decimal";
|
|
11
|
-
export * from "./decorators/entity";
|
|
12
|
-
export * from "./decorators/hasMany";
|
|
13
|
-
export * from "./decorators/hasOne";
|
|
14
|
-
export * from "./decorators/hasOneThroughRelation";
|
|
15
|
-
export * from "./decorators/idColumn";
|
|
16
|
-
export * from "./decorators/manyToMany";
|
|
17
|
-
export * from "./decorators/relatesTo";
|
|
18
|
-
export * from "./domain/ColumnOpts";
|
|
19
|
-
export * from "./domain/
|
|
20
|
-
export * from "./domain/
|
|
21
|
-
export * from "./services/ColumnTypesContainer";
|
|
22
|
-
export * from "./services/ObjectionConnection";
|
|
23
|
-
export * from "./utils/connect";
|
|
24
|
-
export * from "./utils/createColumns";
|
|
25
|
-
export * from "./utils/createJoinKeys";
|
|
26
|
-
export * from "./utils/createRelationshipMapping";
|
|
27
|
-
export * from "./utils/defineStaticGetter";
|
|
28
|
-
export * from "./utils/getColumnCtx";
|
|
29
|
-
export * from "./utils/getJsonEntityRelationships";
|
|
4
|
+
export * from "./components/createBooleanColumn.js";
|
|
5
|
+
export * from "./components/createIdColumn.js";
|
|
6
|
+
export * from "./components/createNumberColumn.js";
|
|
7
|
+
export * from "./components/createStringColumn.js";
|
|
8
|
+
export * from "./decorators/belongsToOne.js";
|
|
9
|
+
export * from "./decorators/columnOptions.js";
|
|
10
|
+
export * from "./decorators/decimal.js";
|
|
11
|
+
export * from "./decorators/entity.js";
|
|
12
|
+
export * from "./decorators/hasMany.js";
|
|
13
|
+
export * from "./decorators/hasOne.js";
|
|
14
|
+
export * from "./decorators/hasOneThroughRelation.js";
|
|
15
|
+
export * from "./decorators/idColumn.js";
|
|
16
|
+
export * from "./decorators/manyToMany.js";
|
|
17
|
+
export * from "./decorators/relatesTo.js";
|
|
18
|
+
export * from "./domain/ColumnOpts.js";
|
|
19
|
+
export * from "./domain/interfaces.js";
|
|
20
|
+
export * from "./domain/RelationshipOpts.js";
|
|
21
|
+
export * from "./services/ColumnTypesContainer.js";
|
|
22
|
+
export * from "./services/ObjectionConnection.js";
|
|
23
|
+
export * from "./utils/connect.js";
|
|
24
|
+
export * from "./utils/createColumns.js";
|
|
25
|
+
export * from "./utils/createJoinKeys.js";
|
|
26
|
+
export * from "./utils/createRelationshipMapping.js";
|
|
27
|
+
export * from "./utils/defineStaticGetter.js";
|
|
28
|
+
export * from "./utils/getColumnCtx.js";
|
|
29
|
+
export * from "./utils/getJsonEntityRelationships.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/objection",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.71.0",
|
|
4
4
|
"description": "Objection.js package for Ts.ED framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "yarn barrels && yarn build:ts",
|
|
17
|
-
"barrels": "
|
|
17
|
+
"barrels": "barrels",
|
|
18
18
|
"test": "jest && jest-coverage-thresholds-bumper",
|
|
19
19
|
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json"
|
|
20
20
|
},
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"tslib": "2.6.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsed/ajv": "7.
|
|
26
|
-
"@tsed/
|
|
27
|
-
"@tsed/
|
|
28
|
-
"@tsed/
|
|
29
|
-
"@tsed/
|
|
30
|
-
"@tsed/
|
|
31
|
-
"
|
|
25
|
+
"@tsed/ajv": "7.71.0",
|
|
26
|
+
"@tsed/barrels": "7.71.0",
|
|
27
|
+
"@tsed/core": "7.71.0",
|
|
28
|
+
"@tsed/di": "7.71.0",
|
|
29
|
+
"@tsed/json-mapper": "7.71.0",
|
|
30
|
+
"@tsed/schema": "7.71.0",
|
|
31
|
+
"@tsed/typescript": "7.71.0",
|
|
32
32
|
"eslint": "^8.57.0",
|
|
33
33
|
"jest": "^29.7.0",
|
|
34
34
|
"knex": "^3.1.0",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"sqlite3": "^5.1.7"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@tsed/ajv": "7.
|
|
40
|
-
"@tsed/core": "7.
|
|
41
|
-
"@tsed/di": "7.
|
|
42
|
-
"@tsed/json-mapper": "7.
|
|
43
|
-
"@tsed/schema": "7.
|
|
39
|
+
"@tsed/ajv": "7.71.0",
|
|
40
|
+
"@tsed/core": "7.71.0",
|
|
41
|
+
"@tsed/di": "7.71.0",
|
|
42
|
+
"@tsed/json-mapper": "7.71.0",
|
|
43
|
+
"@tsed/schema": "7.71.0",
|
|
44
44
|
"knex": ">=0.94.0",
|
|
45
45
|
"objection": ">=2.0.0"
|
|
46
46
|
},
|