@steroidsjs/nest 3.0.3 → 3.2.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/infrastructure/adapters/QueryAdapterTypeORM.js +2 -2
- package/infrastructure/adapters/QueryAdapterTypeORM.js.map +1 -1
- package/infrastructure/applications/rest/RestApplication.js +1 -0
- package/infrastructure/applications/rest/RestApplication.js.map +1 -1
- package/infrastructure/base/ModelTableStorage.d.ts +4 -0
- package/infrastructure/base/ModelTableStorage.js +21 -0
- package/infrastructure/base/ModelTableStorage.js.map +1 -0
- package/infrastructure/commands/entity-generator/templates/TableTemplate.txt +2 -2
- package/infrastructure/decorators/fields/BaseField.d.ts +2 -2
- package/infrastructure/decorators/fields/BaseField.js +68 -80
- package/infrastructure/decorators/fields/BaseField.js.map +1 -1
- package/infrastructure/decorators/fields/BooleanField.js +1 -9
- package/infrastructure/decorators/fields/BooleanField.js.map +1 -1
- package/infrastructure/decorators/fields/ComputableField.js +1 -1
- package/infrastructure/decorators/fields/ComputableField.js.map +1 -1
- package/infrastructure/decorators/fields/CoordinateField.js +0 -8
- package/infrastructure/decorators/fields/CoordinateField.js.map +1 -1
- package/infrastructure/decorators/fields/CreateTimeField.js +1 -23
- package/infrastructure/decorators/fields/CreateTimeField.js.map +1 -1
- package/infrastructure/decorators/fields/DateField.js +0 -6
- package/infrastructure/decorators/fields/DateField.js.map +1 -1
- package/infrastructure/decorators/fields/DateTimeField.js +6 -16
- package/infrastructure/decorators/fields/DateTimeField.js.map +1 -1
- package/infrastructure/decorators/fields/DecimalField.js +0 -8
- package/infrastructure/decorators/fields/DecimalField.js.map +1 -1
- package/infrastructure/decorators/fields/DecimalNumberField.js +3 -12
- package/infrastructure/decorators/fields/DecimalNumberField.js.map +1 -1
- package/infrastructure/decorators/fields/DeleteDateField.js +0 -5
- package/infrastructure/decorators/fields/DeleteDateField.js.map +1 -1
- package/infrastructure/decorators/fields/EmailField.js +0 -7
- package/infrastructure/decorators/fields/EmailField.js.map +1 -1
- package/infrastructure/decorators/fields/EnumField.js +2 -9
- package/infrastructure/decorators/fields/EnumField.js.map +1 -1
- package/infrastructure/decorators/fields/ExtendField.d.ts +1 -1
- package/infrastructure/decorators/fields/ExtendField.js +3 -2
- package/infrastructure/decorators/fields/ExtendField.js.map +1 -1
- package/infrastructure/decorators/fields/FileField.js +0 -6
- package/infrastructure/decorators/fields/FileField.js.map +1 -1
- package/infrastructure/decorators/fields/HtmlField.js +0 -5
- package/infrastructure/decorators/fields/HtmlField.js.map +1 -1
- package/infrastructure/decorators/fields/ImageField.js.map +1 -1
- package/infrastructure/decorators/fields/IntegerField.js +0 -7
- package/infrastructure/decorators/fields/IntegerField.js.map +1 -1
- package/infrastructure/decorators/fields/JSONBField.d.ts +1 -2
- package/infrastructure/decorators/fields/JSONBField.js +0 -8
- package/infrastructure/decorators/fields/JSONBField.js.map +1 -1
- package/infrastructure/decorators/fields/PasswordField.js +0 -6
- package/infrastructure/decorators/fields/PasswordField.js.map +1 -1
- package/infrastructure/decorators/fields/PhoneField.js +0 -8
- package/infrastructure/decorators/fields/PhoneField.js.map +1 -1
- package/infrastructure/decorators/fields/PrimaryKeyField.js +1 -2
- package/infrastructure/decorators/fields/PrimaryKeyField.js.map +1 -1
- package/infrastructure/decorators/fields/RelationField.js +4 -51
- package/infrastructure/decorators/fields/RelationField.js.map +1 -1
- package/infrastructure/decorators/fields/RelationIdField.js +8 -16
- package/infrastructure/decorators/fields/RelationIdField.js.map +1 -1
- package/infrastructure/decorators/fields/StringField.js +0 -9
- package/infrastructure/decorators/fields/StringField.js.map +1 -1
- package/infrastructure/decorators/fields/TextField.js +0 -7
- package/infrastructure/decorators/fields/TextField.js.map +1 -1
- package/infrastructure/decorators/fields/TimeField.js +1 -8
- package/infrastructure/decorators/fields/TimeField.js.map +1 -1
- package/infrastructure/decorators/fields/UidField.d.ts +0 -1
- package/infrastructure/decorators/fields/UidField.js +2 -28
- package/infrastructure/decorators/fields/UidField.js.map +1 -1
- package/infrastructure/decorators/fields/UpdateTimeField.js +2 -26
- package/infrastructure/decorators/fields/UpdateTimeField.js.map +1 -1
- package/infrastructure/decorators/fields/index.d.ts +57 -16
- package/infrastructure/decorators/fields/index.js +110 -54
- package/infrastructure/decorators/fields/index.js.map +1 -1
- package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.d.ts +2 -0
- package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.js +65 -0
- package/infrastructure/decorators/typeorm/TypeOrmDecoratorFactory.js.map +1 -0
- package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.d.ts +6 -0
- package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.js +29 -0
- package/infrastructure/decorators/typeorm/TypeOrmTableFromModel.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.js +14 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.js +13 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.d.ts +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.js +22 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.js +17 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.js +11 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.js +13 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.js +13 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.d.ts +2 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.js +10 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.js +11 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.js +11 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.js +11 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.js +13 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.js +13 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.d.ts +2 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.js +7 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.d.ts +4 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.js +30 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.js +17 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.js +10 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.js +14 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.js +12 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.d.ts +2 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.js +26 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/TypeOrmUidBehaviour.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.js +14 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUidField/index.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.d.ts +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.js +24 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/TypeOrmUpdateTimeBehaviour.js.map +1 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.d.ts +3 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.js +17 -0
- package/infrastructure/decorators/typeorm/fields/TypeOrmUpdateTimeField/index.js.map +1 -0
- package/infrastructure/repositories/CrudRepository.d.ts +5 -0
- package/infrastructure/repositories/CrudRepository.js +13 -4
- package/infrastructure/repositories/CrudRepository.js.map +1 -1
- package/infrastructure/tests/app/tables/ArticleTable.js +2 -2
- package/infrastructure/tests/app/tables/ArticleTable.js.map +1 -1
- package/infrastructure/tests/app/tables/CommentTable.js +2 -2
- package/infrastructure/tests/app/tables/CommentTable.js.map +1 -1
- package/infrastructure/tests/app/tables/FileTable.js +2 -2
- package/infrastructure/tests/app/tables/FileTable.js.map +1 -1
- package/infrastructure/tests/app/tables/ImageTable.js +2 -2
- package/infrastructure/tests/app/tables/ImageTable.js.map +1 -1
- package/infrastructure/tests/app/tables/TagTable.js +2 -2
- package/infrastructure/tests/app/tables/TagTable.js.map +1 -1
- package/infrastructure/tests/app/tables/UserInfoTable.js +2 -2
- package/infrastructure/tests/app/tables/UserInfoTable.js.map +1 -1
- package/infrastructure/tests/app/tables/UserTable.js +2 -2
- package/infrastructure/tests/app/tables/UserTable.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/usecases/exceptions/ClassValidatorException.d.ts +5 -0
- package/usecases/exceptions/ClassValidatorException.js +10 -0
- package/usecases/exceptions/ClassValidatorException.js.map +1 -0
- package/usecases/helpers/DataMapper.js +2 -2
- package/usecases/helpers/DataMapper.js.map +1 -1
- package/usecases/helpers/ValidationHelper.d.ts +1 -0
- package/usecases/helpers/ValidationHelper.js +57 -6
- package/usecases/helpers/ValidationHelper.js.map +1 -1
- package/usecases/interfaces/ICrudRepository.d.ts +1 -0
- package/usecases/services/ReadService.d.ts +5 -0
- package/usecases/services/ReadService.js +7 -0
- package/usecases/services/ReadService.js.map +1 -1
- package/usecases/validators/Validator.d.ts +5 -5
- package/usecases/validators/Validator.js +16 -8
- package/usecases/validators/Validator.js.map +1 -1
- package/infrastructure/decorators/TableFromModel.d.ts +0 -9
- package/infrastructure/decorators/TableFromModel.js +0 -44
- package/infrastructure/decorators/TableFromModel.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
return [
|
|
7
|
+
(0, typeorm_1.Column)({
|
|
8
|
+
type: options.dbType || 'boolean',
|
|
9
|
+
default: (_a = options.defaultValue) !== null && _a !== void 0 ? _a : false,
|
|
10
|
+
nullable: (_b = options.nullable) !== null && _b !== void 0 ? _b : false,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmBooleanField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE;;IAAC,OAAA;QAC3C,IAAA,gBAAM,EAAC;YACH,IAAI,EAAE,OAAO,CAAC,MAAM,IAAI,SAAS;YACjC,OAAO,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,KAAK;YACtC,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK;SACtC,CAAC;KACL,CAAA;CAAA,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'decimal',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
precision: options.precision || 12,
|
|
10
|
+
scale: options.scale || 9,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCoordinateField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAgC,EAAE,EAAE,CAAC;IACjD,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TypeOrmCreateTimeBehaviour: (object: any, propertyName: any) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeOrmCreateTimeBehaviour = void 0;
|
|
4
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
5
|
+
const EventListenerTypes_1 = require("@steroidsjs/typeorm/metadata/types/EventListenerTypes");
|
|
6
|
+
const DateTimeField_1 = require("../../../fields/DateTimeField");
|
|
7
|
+
const TypeOrmCreateTimeBehaviour = (object, propertyName) => {
|
|
8
|
+
const methodName = propertyName + '__createTimeBehaviour';
|
|
9
|
+
if (!object[methodName]) {
|
|
10
|
+
// eslint-disable-next-line func-names
|
|
11
|
+
object[methodName] = function () {
|
|
12
|
+
this[propertyName] = (0, DateTimeField_1.normalizeDateTime)(new Date(), false);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
(0, typeorm_1.getMetadataArgsStorage)().entityListeners.push({
|
|
16
|
+
target: object.constructor,
|
|
17
|
+
propertyName: methodName,
|
|
18
|
+
type: EventListenerTypes_1.EventListenerTypes.BEFORE_INSERT,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.TypeOrmCreateTimeBehaviour = TypeOrmCreateTimeBehaviour;
|
|
22
|
+
//# sourceMappingURL=TypeOrmCreateTimeBehaviour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeOrmCreateTimeBehaviour.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/TypeOrmCreateTimeBehaviour.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,8FAAyF;AACzF,iEAAgE;AAEzD,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE;IAC/D,MAAM,UAAU,GAAG,YAAY,GAAG,uBAAuB,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACrB,sCAAsC;QACtC,MAAM,CAAC,UAAU,CAAC,GAAG;YACjB,IAAI,CAAC,YAAY,CAAC,GAAG,IAAA,iCAAiB,EAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAC;KACL;IAED,IAAA,gCAAsB,GAAE,CAAC,eAAe,CAAC,IAAI,CAAC;QAC1C,MAAM,EAAE,MAAM,CAAC,WAAW;QAC1B,YAAY,EAAE,UAAU;QACxB,IAAI,EAAE,uCAAkB,CAAC,aAAa;KACzC,CAAC,CAAC;AACP,CAAC,CAAC;AAdW,QAAA,0BAA0B,8BAcrC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
const TypeOrmCreateTimeBehaviour_1 = require("./TypeOrmCreateTimeBehaviour");
|
|
5
|
+
exports.default = (options) => {
|
|
6
|
+
var _a;
|
|
7
|
+
return [
|
|
8
|
+
(0, typeorm_1.Column)({
|
|
9
|
+
type: 'timestamp',
|
|
10
|
+
precision: options.precision || 0,
|
|
11
|
+
default: options.defaultValue,
|
|
12
|
+
nullable: (_a = options.nullable) !== null && _a !== void 0 ? _a : false,
|
|
13
|
+
}),
|
|
14
|
+
TypeOrmCreateTimeBehaviour_1.TypeOrmCreateTimeBehaviour,
|
|
15
|
+
];
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmCreateTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAC3C,6EAAwE;AAGxE,kBAAe,CAAC,OAAgC,EAAE,EAAE;;IAAC,OAAA;QACjD,IAAA,gBAAM,EAAC;YACH,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;YACjC,OAAO,EAAE,OAAO,CAAC,YAAY;YAC7B,QAAQ,EAAE,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK;SACtC,CAAC;QACF,uDAA0B;KAC7B,CAAA;CAAA,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'date',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
}),
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDateField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'timestamp',
|
|
7
|
+
precision: options.precision || 0,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDateTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAoC,EAAE,EAAE,CAAC;IACrD,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;QACjC,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'decimal',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
precision: options.precision || 10,
|
|
10
|
+
scale: options.scale || 2,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDecimalField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA6B,EAAE,EAAE,CAAC;IAC9C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'decimal',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
precision: options.precision || 10,
|
|
10
|
+
scale: options.scale || 2,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDecimalNumberField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA6B,EAAE,EAAE,CAAC;IAC9C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;KAC5B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = () => [
|
|
5
|
+
(0, typeorm_1.DeleteDateColumn)({
|
|
6
|
+
type: 'date',
|
|
7
|
+
nullable: true,
|
|
8
|
+
}),
|
|
9
|
+
];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmDeleteDateColumn/index.ts"],"names":[],"mappings":";;AAAA,iDAAqD;AAErD,kBAAe,GAAG,EAAE,CAAC;IACjB,IAAA,0BAAgB,EAAC;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACjB,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'varchar',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
unique: options.unique,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmEmailField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'varchar',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
array: options.isArray,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmEnumField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: options.multiple ? 'simple-array' : 'integer',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
}),
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmFileField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAmB,EAAE,EAAE,CAAC;IACpC,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;QACnD,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'text',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
}),
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmHtmlField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: options.multiple ? 'simple-array' : 'integer',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
nullable: options.nullable,
|
|
9
|
+
}),
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmImageField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAmB,EAAE,EAAE,CAAC;IACpC,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;QACnD,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'integer',
|
|
7
|
+
default: options.defaultValue,
|
|
8
|
+
unique: options.unique,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmIntegerField/index.ts"],"names":[],"mappings":";;AACA,iDAA2C;AAE3C,kBAAe,CAAC,OAAyB,EAAE,EAAE,CAAC;IAC1C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'jsonb',
|
|
7
|
+
length: options.max,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
array: options.isArray,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmJSONBField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'text',
|
|
7
|
+
length: options.max,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPasswordField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'varchar',
|
|
7
|
+
length: options.max || 16,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
unique: options.unique,
|
|
10
|
+
nullable: options.nullable,
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPhoneField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA2B,EAAE,EAAE,CAAC;IAC5C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACzB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmPrimaryKeyField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAE3D,kBAAe,GAAG,EAAE,CAAC;IACjB,IAAA,gCAAsB,EAAC,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC;CAC5C,CAAC"}
|
package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JoinTable } from '@steroidsjs/typeorm';
|
|
2
|
+
import { IRelationFieldManyToManyOptions, IRelationFieldOneToOneOptions } from '../../../fields/RelationField';
|
|
3
|
+
export declare const getRelationDecorator: (relation: any) => any;
|
|
4
|
+
export declare const getOwningDecorator: (options: IRelationFieldOneToOneOptions | IRelationFieldManyToManyOptions) => typeof JoinTable;
|
package/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOwningDecorator = exports.getRelationDecorator = void 0;
|
|
4
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
5
|
+
const getRelationDecorator = (relation) => {
|
|
6
|
+
switch (relation) {
|
|
7
|
+
case 'OneToOne':
|
|
8
|
+
return typeorm_1.OneToOne;
|
|
9
|
+
case 'ManyToMany':
|
|
10
|
+
return typeorm_1.ManyToMany;
|
|
11
|
+
case 'OneToMany':
|
|
12
|
+
return typeorm_1.OneToMany;
|
|
13
|
+
case 'ManyToOne':
|
|
14
|
+
return typeorm_1.ManyToOne;
|
|
15
|
+
default:
|
|
16
|
+
throw new Error('Wrong relation type: ' + relation);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.getRelationDecorator = getRelationDecorator;
|
|
20
|
+
const getOwningDecorator = (options) => {
|
|
21
|
+
if (options.type === 'ManyToMany' && options.isOwningSide) {
|
|
22
|
+
return typeorm_1.JoinTable;
|
|
23
|
+
}
|
|
24
|
+
if (options.type === 'OneToOne' && options.isOwningSide) {
|
|
25
|
+
return typeorm_1.JoinColumn;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
exports.getOwningDecorator = getOwningDecorator;
|
|
30
|
+
//# sourceMappingURL=TypeOrmRelationBehaviour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeOrmRelationBehaviour.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/TypeOrmRelationBehaviour.ts"],"names":[],"mappings":";;;AAAA,iDAAsG;AAG/F,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAO,EAAE;IAClD,QAAQ,QAAQ,EAAE;QACd,KAAK,UAAU;YACX,OAAO,kBAAQ,CAAC;QACpB,KAAK,YAAY;YACb,OAAO,oBAAU,CAAC;QACtB,KAAK,WAAW;YACZ,OAAO,mBAAS,CAAC;QACrB,KAAK,WAAW;YACZ,OAAO,mBAAS,CAAC;QACrB;YACI,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,QAAQ,CAAC,CAAC;KAC3D;AACL,CAAC,CAAC;AAbW,QAAA,oBAAoB,wBAa/B;AAEK,MAAM,kBAAkB,GAAG,CAAC,OAAwE,EAAE,EAAE;IAC3G,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE;QACvD,OAAO,mBAAS,CAAC;KACpB;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE;QACrD,OAAO,oBAAU,CAAC;KACrB;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const TypeOrmRelationBehaviour_1 = require("./TypeOrmRelationBehaviour");
|
|
4
|
+
const ModelTableStorage_1 = require("../../../../base/ModelTableStorage");
|
|
5
|
+
exports.default = (options) => {
|
|
6
|
+
const OwningDecorator = (0, TypeOrmRelationBehaviour_1.getOwningDecorator)(options);
|
|
7
|
+
let owningDecoratorOptions;
|
|
8
|
+
if ('tableName' in options) {
|
|
9
|
+
owningDecoratorOptions = { name: options.tableName };
|
|
10
|
+
}
|
|
11
|
+
return [
|
|
12
|
+
(0, TypeOrmRelationBehaviour_1.getRelationDecorator)(options.type)(() => (0, ModelTableStorage_1.getTableFromModel)(options.relationClass()), options.inverseSide, { cascade: ['insert', 'update'],
|
|
13
|
+
onUpdate: 'CASCADE' }),
|
|
14
|
+
OwningDecorator && OwningDecorator(owningDecoratorOptions),
|
|
15
|
+
].filter(Boolean);
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationField/index.ts"],"names":[],"mappings":";;AAAA,yEAAoF;AACpF,0EAAqE;AAGrE,kBAAe,CAAC,OAA8B,EAAE,EAAE;IAC9C,MAAM,eAAe,GAAG,IAAA,6CAAkB,EAAC,OAAc,CAAC,CAAC;IAC3D,IAAI,sBAAsB,CAAC;IAC3B,IAAI,WAAW,IAAI,OAAO,EAAE;QACxB,sBAAsB,GAAG,EAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAC,CAAC;KACtD;IACD,OAAO;QACH,IAAA,+CAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAC9B,GAAG,EAAE,CAAC,IAAA,qCAAiB,EAAC,OAAO,CAAC,aAAa,EAAE,CAAC,EAC/C,OAAe,CAAC,WAAW,EAC5B,EAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC1B,QAAQ,EAAE,SAAS,EAAC,CAC3B;QACD,eAAe,IAAI,eAAe,CAAC,sBAAsB,CAAC;KAC7D,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
!options.isArray && (0, typeorm_1.Column)({
|
|
6
|
+
type: 'int',
|
|
7
|
+
nullable: options.nullable,
|
|
8
|
+
}),
|
|
9
|
+
].filter(Boolean);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmRelationIdField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAAgC,EAAE,EAAE,CAAC;IACjD,CAAC,OAAO,CAAC,OAAO,IAAI,IAAA,gBAAM,EAAC;QACvB,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'varchar',
|
|
7
|
+
length: options.max,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
unique: options.unique,
|
|
10
|
+
nullable: options.nullable,
|
|
11
|
+
array: options.isArray,
|
|
12
|
+
}),
|
|
13
|
+
];
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmStringField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA4B,EAAE,EAAE,CAAC;IAC7C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'text',
|
|
7
|
+
length: options.max,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmTextField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typeorm_1 = require("@steroidsjs/typeorm");
|
|
4
|
+
exports.default = (options) => [
|
|
5
|
+
(0, typeorm_1.Column)({
|
|
6
|
+
type: 'varchar',
|
|
7
|
+
length: 5,
|
|
8
|
+
default: options.defaultValue,
|
|
9
|
+
nullable: options.nullable,
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/decorators/typeorm/fields/TypeOrmTimeField/index.ts"],"names":[],"mappings":";;AAAA,iDAA2C;AAG3C,kBAAe,CAAC,OAA0B,EAAE,EAAE,CAAC;IAC3C,IAAA,gBAAM,EAAC;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,OAAO,CAAC,YAAY;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC7B,CAAC;CACL,CAAC"}
|