@hichchi/nest-crud 0.0.2 → 0.0.4
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/CHANGELOG.md +36 -12
- package/README.md +2475 -2085
- package/base/base-entity-extension.js +10 -6
- package/base/base-entity-extension.js.map +1 -1
- package/base/base-entity.js +47 -43
- package/base/base-entity.js.map +1 -1
- package/base/base-repository.js +16 -12
- package/base/base-repository.js.map +1 -1
- package/base/base-user.entity.js +85 -81
- package/base/base-user.entity.js.map +1 -1
- package/base/index.js +7 -4
- package/base/index.js.map +1 -1
- package/constants.js +10 -7
- package/constants.js.map +1 -1
- package/crud.module.js +29 -26
- package/crud.module.js.map +1 -1
- package/decorators/entity-extension.decorator.js +20 -17
- package/decorators/entity-extension.decorator.js.map +1 -1
- package/decorators/entity.decorator.js +30 -27
- package/decorators/entity.decorator.js.map +1 -1
- package/decorators/filter.decorator.js +8 -5
- package/decorators/filter.decorator.js.map +1 -1
- package/decorators/index.js +11 -8
- package/decorators/index.js.map +1 -1
- package/decorators/join-column.decorator.js +11 -8
- package/decorators/join-column.decorator.js.map +1 -1
- package/decorators/page.decorator.js +8 -5
- package/decorators/page.decorator.js.map +1 -1
- package/decorators/repository.decorator.js +14 -11
- package/decorators/repository.decorator.js.map +1 -1
- package/decorators/search.decorator.js +8 -5
- package/decorators/search.decorator.js.map +1 -1
- package/decorators/sort.decorator.js +8 -5
- package/decorators/sort.decorator.js.map +1 -1
- package/dtos/bulk-delete.dto.js +15 -12
- package/dtos/bulk-delete.dto.js.map +1 -1
- package/dtos/bulk-update.dto.js +18 -15
- package/dtos/bulk-update.dto.js.map +1 -1
- package/dtos/ids.dto.js +15 -12
- package/dtos/ids.dto.js.map +1 -1
- package/dtos/index.js +5 -2
- package/dtos/index.js.map +1 -1
- package/enums/crud.enums.js +7 -4
- package/enums/crud.enums.js.map +1 -1
- package/enums/index.js +4 -1
- package/enums/index.js.map +1 -1
- package/enums/metadata-keys.enum.js +5 -2
- package/enums/metadata-keys.enum.js.map +1 -1
- package/exceptions/index.js +4 -1
- package/exceptions/index.js.map +1 -1
- package/exceptions/typeorm.exception.js +9 -4
- package/exceptions/typeorm.exception.js.map +1 -1
- package/index.js +19 -12
- package/index.js.map +1 -1
- package/interfaces/connection-options.interface.js +2 -1
- package/interfaces/crud-options.interfaces.js +2 -1
- package/interfaces/index.js +5 -2
- package/interfaces/index.js.map +1 -1
- package/package.json +7 -6
- package/readme-top.md +1 -5
- package/responses/crud.error.responses.js +31 -28
- package/responses/crud.error.responses.js.map +1 -1
- package/responses/crud.success.responses.js +24 -21
- package/responses/crud.success.responses.js.map +1 -1
- package/responses/index.js +5 -2
- package/responses/index.js.map +1 -1
- package/services/crud.service.js +43 -39
- package/services/crud.service.js.map +1 -1
- package/services/index.js +4 -1
- package/services/index.js.map +1 -1
- package/tokens.js +5 -2
- package/tokens.js.map +1 -1
- package/types/database.types.d.ts +1 -1
- package/types/database.types.js +2 -1
- package/types/decorator.types.js +2 -1
- package/types/decorator.types.js.map +1 -1
- package/types/entity-option-unique.js +2 -1
- package/types/error-handler.type.js +2 -1
- package/types/filter-options.type.js +2 -1
- package/types/find-conditions.type.js +2 -1
- package/types/index.js +11 -8
- package/types/index.js.map +1 -1
- package/types/repository-decorator.type.js +2 -1
- package/types/sort-options.type.js +2 -1
- package/utils/entity.utils.js +46 -42
- package/utils/entity.utils.js.map +1 -1
- package/utils/http.utils.js +11 -6
- package/utils/http.utils.js.map +1 -1
- package/utils/index.js +5 -2
- package/utils/index.js.map +1 -1
- package/utils/repository.utils.js +12 -7
- package/utils/repository.utils.js.map +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// noinspection JSUnusedGlobalSymbols
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BaseEntityExtension = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
4
7
|
/**
|
|
5
8
|
* Base entity extension class that provides a minimal entity structure
|
|
6
9
|
*
|
|
@@ -38,7 +41,7 @@ import { PrimaryGeneratedColumn } from "typeorm";
|
|
|
38
41
|
* @see {@link HichchiEntityExtension} The decorator required for entity extensions
|
|
39
42
|
* @see {@link HichchiJoinColumn} The decorator required for entity relationships
|
|
40
43
|
*/
|
|
41
|
-
|
|
44
|
+
class BaseEntityExtension {
|
|
42
45
|
/**
|
|
43
46
|
* Unique identifier for the entity extension
|
|
44
47
|
*
|
|
@@ -47,8 +50,9 @@ export class BaseEntityExtension {
|
|
|
47
50
|
*/
|
|
48
51
|
id;
|
|
49
52
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
exports.BaseEntityExtension = BaseEntityExtension;
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
53
57
|
], BaseEntityExtension.prototype, "id", void 0);
|
|
54
58
|
//# sourceMappingURL=base-entity-extension.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-entity-extension.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-entity-extension.ts"],"names":[],"mappings":"AAAA,qCAAqC
|
|
1
|
+
{"version":3,"file":"base-entity-extension.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-entity-extension.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;;AAErC,qCAAiD;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,mBAAmB;IAC5B;;;;;OAKG;IAEH,EAAE,CAAW;CAChB;AATD,kDASC;AADG;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;+CAClB"}
|
package/base/base-entity.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseEntity = exports.BaseEntityTemplateRelations = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const tokens_1 = require("../tokens");
|
|
4
7
|
/**
|
|
5
8
|
* List of standard relation properties in the BaseEntity
|
|
6
9
|
*
|
|
@@ -14,7 +17,7 @@ import { USER_ENTITY_TABLE_NAME } from "../tokens";
|
|
|
14
17
|
* @see {@link BaseEntity} The base entity class that uses these relations
|
|
15
18
|
* @see {@link HichchiEntity} The entity decorator that uses this constant
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
exports.BaseEntityTemplateRelations = ["createdBy", "updatedBy", "deletedBy"];
|
|
18
21
|
/**
|
|
19
22
|
* Base entity class that provides common fields and functionality for all entities
|
|
20
23
|
*
|
|
@@ -45,7 +48,7 @@ export const BaseEntityTemplateRelations = ["createdBy", "updatedBy", "deletedBy
|
|
|
45
48
|
* @implements {Model} Interface from @hichchi/nest-connector/crud
|
|
46
49
|
* @see {@link HichchiEntity} Decorator used to define entities
|
|
47
50
|
*/
|
|
48
|
-
|
|
51
|
+
class BaseEntity {
|
|
49
52
|
/**
|
|
50
53
|
* Unique identifier for the entity
|
|
51
54
|
*
|
|
@@ -157,53 +160,54 @@ export class BaseEntity {
|
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
exports.BaseEntity = BaseEntity;
|
|
164
|
+
tslib_1.__decorate([
|
|
165
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
166
|
+
tslib_1.__metadata("design:type", String)
|
|
163
167
|
], BaseEntity.prototype, "id", void 0);
|
|
164
|
-
__decorate([
|
|
165
|
-
Column({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
166
|
-
__metadata("design:type", Date)
|
|
168
|
+
tslib_1.__decorate([
|
|
169
|
+
(0, typeorm_1.Column)({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
170
|
+
tslib_1.__metadata("design:type", Date)
|
|
167
171
|
], BaseEntity.prototype, "createdAt", void 0);
|
|
168
|
-
__decorate([
|
|
169
|
-
Column({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
170
|
-
__metadata("design:type", Date)
|
|
172
|
+
tslib_1.__decorate([
|
|
173
|
+
(0, typeorm_1.Column)({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
174
|
+
tslib_1.__metadata("design:type", Date)
|
|
171
175
|
], BaseEntity.prototype, "updatedAt", void 0);
|
|
172
|
-
__decorate([
|
|
173
|
-
DeleteDateColumn({ type: "timestamp", nullable: true }),
|
|
174
|
-
__metadata("design:type", Object)
|
|
176
|
+
tslib_1.__decorate([
|
|
177
|
+
(0, typeorm_1.DeleteDateColumn)({ type: "timestamp", nullable: true }),
|
|
178
|
+
tslib_1.__metadata("design:type", Object)
|
|
175
179
|
], BaseEntity.prototype, "deletedAt", void 0);
|
|
176
|
-
__decorate([
|
|
177
|
-
Column({ nullable: true }),
|
|
178
|
-
__metadata("design:type", Object)
|
|
180
|
+
tslib_1.__decorate([
|
|
181
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
182
|
+
tslib_1.__metadata("design:type", Object)
|
|
179
183
|
], BaseEntity.prototype, "createdById", void 0);
|
|
180
|
-
__decorate([
|
|
181
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
182
|
-
JoinColumn(),
|
|
183
|
-
__metadata("design:type", Object)
|
|
184
|
+
tslib_1.__decorate([
|
|
185
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
186
|
+
(0, typeorm_1.JoinColumn)(),
|
|
187
|
+
tslib_1.__metadata("design:type", Object)
|
|
184
188
|
], BaseEntity.prototype, "createdBy", void 0);
|
|
185
|
-
__decorate([
|
|
186
|
-
Column({ nullable: true }),
|
|
187
|
-
__metadata("design:type", Object)
|
|
189
|
+
tslib_1.__decorate([
|
|
190
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
191
|
+
tslib_1.__metadata("design:type", Object)
|
|
188
192
|
], BaseEntity.prototype, "updatedById", void 0);
|
|
189
|
-
__decorate([
|
|
190
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
191
|
-
JoinColumn(),
|
|
192
|
-
__metadata("design:type", Object)
|
|
193
|
+
tslib_1.__decorate([
|
|
194
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
195
|
+
(0, typeorm_1.JoinColumn)(),
|
|
196
|
+
tslib_1.__metadata("design:type", Object)
|
|
193
197
|
], BaseEntity.prototype, "updatedBy", void 0);
|
|
194
|
-
__decorate([
|
|
195
|
-
Column({ nullable: true }),
|
|
196
|
-
__metadata("design:type", Object)
|
|
198
|
+
tslib_1.__decorate([
|
|
199
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
200
|
+
tslib_1.__metadata("design:type", Object)
|
|
197
201
|
], BaseEntity.prototype, "deletedById", void 0);
|
|
198
|
-
__decorate([
|
|
199
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
200
|
-
JoinColumn(),
|
|
201
|
-
__metadata("design:type", Object)
|
|
202
|
+
tslib_1.__decorate([
|
|
203
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true, eager: true }),
|
|
204
|
+
(0, typeorm_1.JoinColumn)(),
|
|
205
|
+
tslib_1.__metadata("design:type", Object)
|
|
202
206
|
], BaseEntity.prototype, "deletedBy", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
AfterLoad(),
|
|
205
|
-
__metadata("design:type", Function),
|
|
206
|
-
__metadata("design:paramtypes", []),
|
|
207
|
-
__metadata("design:returntype", void 0)
|
|
207
|
+
tslib_1.__decorate([
|
|
208
|
+
(0, typeorm_1.AfterLoad)(),
|
|
209
|
+
tslib_1.__metadata("design:type", Function),
|
|
210
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
211
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
208
212
|
], BaseEntity.prototype, "afterLoad", null);
|
|
209
213
|
//# sourceMappingURL=base-entity.js.map
|
package/base/base-entity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-entity.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-entity.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA6G;AAG7G,sCAAmD;AAEnD;;;;;;;;;;;;GAYG;AACU,QAAA,2BAA2B,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,UAAU;IACnB;;;;;OAKG;IAEH,EAAE,CAAW;IAEb;;;;;OAKG;IAEH,SAAS,CAAO;IAEhB;;;;;OAKG;IAEH,SAAS,CAAO;IAEhB;;;;;OAKG;IAEH,SAAS,CAAc;IAEvB;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;;;;;OASG;IAEO,SAAS;QACf,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC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;AAS3B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACE;AAU7B;IAFC,IAAA,mBAAS,EAAC,+BAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAClE,IAAA,oBAAU,GAAE;;6CACc;AAS3B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACE;AAU7B;IAFC,IAAA,mBAAS,EAAC,+BAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAClE,IAAA,oBAAU,GAAE;;6CACc;AAajB;IADT,IAAA,mBAAS,GAAE;;;;2CAWX"}
|
package/base/base-repository.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// noinspection JSUnusedGlobalSymbols
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BaseRepository = void 0;
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const repository_utils_1 = require("../utils/repository.utils");
|
|
4
7
|
/**
|
|
5
8
|
* Base Repository Class that extends TypeORM's Repository with enhanced functionality
|
|
6
9
|
*
|
|
@@ -67,7 +70,7 @@ import { toDeepPartial, toFindOptionsWhere } from "../utils/repository.utils";
|
|
|
67
70
|
* @see {@link BaseEntity} The base class for entities with full audit tracking
|
|
68
71
|
* @see {@link BaseEntityExtension} The base class for lightweight entity extensions
|
|
69
72
|
*/
|
|
70
|
-
|
|
73
|
+
class BaseRepository extends typeorm_1.Repository {
|
|
71
74
|
/**
|
|
72
75
|
* Static property to store the current transaction manager
|
|
73
76
|
* Used to ensure all operations within a transaction use the same manager
|
|
@@ -109,8 +112,8 @@ export class BaseRepository extends Repository {
|
|
|
109
112
|
*/
|
|
110
113
|
create(entityLike) {
|
|
111
114
|
return super.create((Array.isArray(entityLike)
|
|
112
|
-
? entityLike.map(e => toDeepPartial(e))
|
|
113
|
-
: toDeepPartial(entityLike)));
|
|
115
|
+
? entityLike.map(e => (0, repository_utils_1.toDeepPartial)(e))
|
|
116
|
+
: (0, repository_utils_1.toDeepPartial)(entityLike)));
|
|
114
117
|
}
|
|
115
118
|
/**
|
|
116
119
|
* Save an entity to the database
|
|
@@ -326,7 +329,7 @@ export class BaseRepository extends Repository {
|
|
|
326
329
|
* @see {@link UpdateResult} TypeORM's result type for update operations
|
|
327
330
|
*/
|
|
328
331
|
updateOne(where, partialEntity) {
|
|
329
|
-
return this.entityRepository.update(toFindOptionsWhere(where), partialEntity);
|
|
332
|
+
return this.entityRepository.update((0, repository_utils_1.toFindOptionsWhere)(where), partialEntity);
|
|
330
333
|
}
|
|
331
334
|
/**
|
|
332
335
|
* Update multiple entities matching the specified criteria
|
|
@@ -355,11 +358,11 @@ export class BaseRepository extends Repository {
|
|
|
355
358
|
* @see {@link UpdateResult} TypeORM's result type for update operations
|
|
356
359
|
*/
|
|
357
360
|
updateMany(where, partialEntity) {
|
|
358
|
-
return this.entityRepository.update(!(where instanceof ObjectId) &&
|
|
361
|
+
return this.entityRepository.update(!(where instanceof typeorm_1.ObjectId) &&
|
|
359
362
|
!(where instanceof Date) &&
|
|
360
363
|
typeof where === "object" &&
|
|
361
364
|
!Array.isArray(where)
|
|
362
|
-
? toFindOptionsWhere(where)
|
|
365
|
+
? (0, repository_utils_1.toFindOptionsWhere)(where)
|
|
363
366
|
: where, partialEntity);
|
|
364
367
|
}
|
|
365
368
|
/**
|
|
@@ -705,7 +708,7 @@ export class BaseRepository extends Repository {
|
|
|
705
708
|
generateOptions(getOptions) {
|
|
706
709
|
const { options, relations, pagination, sort } = getOptions ?? {};
|
|
707
710
|
const opt = { ...(options || {}) };
|
|
708
|
-
opt.where = toFindOptionsWhere(getOptions.where || getOptions.filters);
|
|
711
|
+
opt.where = (0, repository_utils_1.toFindOptionsWhere)(getOptions.where || getOptions.filters);
|
|
709
712
|
const { search, not } = getOptions;
|
|
710
713
|
// if (not) {
|
|
711
714
|
// opt.where = this.orWhere(opt.where as FindOptionsWhere<Entity>, not, Not);
|
|
@@ -713,10 +716,10 @@ export class BaseRepository extends Repository {
|
|
|
713
716
|
// opt.where = this.orWhere(opt.where as FindOptionsWhere<Entity>, search, ILike);
|
|
714
717
|
// }
|
|
715
718
|
if (not) {
|
|
716
|
-
opt.where = this.mapAndWhere(opt.where, not, Not);
|
|
719
|
+
opt.where = this.mapAndWhere(opt.where, not, typeorm_1.Not);
|
|
717
720
|
}
|
|
718
721
|
if (search) {
|
|
719
|
-
opt.where = this.mapAndWhere(opt.where, search, ILike);
|
|
722
|
+
opt.where = this.mapAndWhere(opt.where, search, typeorm_1.ILike);
|
|
720
723
|
}
|
|
721
724
|
if (relations) {
|
|
722
725
|
opt.relations = relations;
|
|
@@ -778,7 +781,7 @@ export class BaseRepository extends Repository {
|
|
|
778
781
|
* @see {@link Not} Example of a FindOperator
|
|
779
782
|
*/
|
|
780
783
|
isFindOperator(value) {
|
|
781
|
-
return value instanceof FindOperator;
|
|
784
|
+
return value instanceof typeorm_1.FindOperator;
|
|
782
785
|
}
|
|
783
786
|
/**
|
|
784
787
|
* Map and transform where conditions with operators
|
|
@@ -850,4 +853,5 @@ export class BaseRepository extends Repository {
|
|
|
850
853
|
return whr;
|
|
851
854
|
}
|
|
852
855
|
}
|
|
856
|
+
exports.BaseRepository = BaseRepository;
|
|
853
857
|
//# sourceMappingURL=base-repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-repository.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-repository.ts"],"names":[],"mappings":"AAAA,qCAAqC
|
|
1
|
+
{"version":3,"file":"base-repository.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-repository.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;AAWrC,qCAciB;AAGjB,gEAA8E;AAE9E;;;;;;;;;;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;AAx5BD,wCAw5BC"}
|
package/base/base-user.entity.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HichchiUserEntity = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const tokens_1 = require("../tokens");
|
|
7
|
+
const auth_1 = require("@hichchi/nest-connector/auth");
|
|
8
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
9
|
/**
|
|
7
10
|
* Base user entity class that provides common user fields and functionality
|
|
8
11
|
*
|
|
@@ -37,7 +40,7 @@ import { Exclude } from "class-transformer";
|
|
|
37
40
|
* @implements {UserInfo} Provides the core user identification properties
|
|
38
41
|
* @see {@link UserInfo} The interface that defines the required user properties
|
|
39
42
|
*/
|
|
40
|
-
|
|
43
|
+
class HichchiUserEntity {
|
|
41
44
|
/**
|
|
42
45
|
* Unique identifier for the entity
|
|
43
46
|
*
|
|
@@ -203,101 +206,102 @@ export class HichchiUserEntity {
|
|
|
203
206
|
};
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
exports.HichchiUserEntity = HichchiUserEntity;
|
|
210
|
+
tslib_1.__decorate([
|
|
211
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
212
|
+
tslib_1.__metadata("design:type", String)
|
|
209
213
|
], HichchiUserEntity.prototype, "id", void 0);
|
|
210
|
-
__decorate([
|
|
211
|
-
Column({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
212
|
-
__metadata("design:type", Date)
|
|
214
|
+
tslib_1.__decorate([
|
|
215
|
+
(0, typeorm_1.Column)({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
216
|
+
tslib_1.__metadata("design:type", Date)
|
|
213
217
|
], HichchiUserEntity.prototype, "createdAt", void 0);
|
|
214
|
-
__decorate([
|
|
215
|
-
Column({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
216
|
-
__metadata("design:type", Date)
|
|
218
|
+
tslib_1.__decorate([
|
|
219
|
+
(0, typeorm_1.Column)({ nullable: false, default: () => "CURRENT_TIMESTAMP" }),
|
|
220
|
+
tslib_1.__metadata("design:type", Date)
|
|
217
221
|
], HichchiUserEntity.prototype, "updatedAt", void 0);
|
|
218
|
-
__decorate([
|
|
219
|
-
DeleteDateColumn({ type: "timestamp", nullable: true }),
|
|
220
|
-
__metadata("design:type", Object)
|
|
222
|
+
tslib_1.__decorate([
|
|
223
|
+
(0, typeorm_1.DeleteDateColumn)({ type: "timestamp", nullable: true }),
|
|
224
|
+
tslib_1.__metadata("design:type", Object)
|
|
221
225
|
], HichchiUserEntity.prototype, "deletedAt", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
Column({ nullable: true }),
|
|
224
|
-
__metadata("design:type", Object)
|
|
226
|
+
tslib_1.__decorate([
|
|
227
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
228
|
+
tslib_1.__metadata("design:type", Object)
|
|
225
229
|
], HichchiUserEntity.prototype, "createdById", void 0);
|
|
226
|
-
__decorate([
|
|
227
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
228
|
-
JoinColumn(),
|
|
229
|
-
__metadata("design:type", Object)
|
|
230
|
+
tslib_1.__decorate([
|
|
231
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
232
|
+
(0, typeorm_1.JoinColumn)(),
|
|
233
|
+
tslib_1.__metadata("design:type", Object)
|
|
230
234
|
], HichchiUserEntity.prototype, "createdBy", void 0);
|
|
231
|
-
__decorate([
|
|
232
|
-
Column({ nullable: true }),
|
|
233
|
-
__metadata("design:type", Object)
|
|
235
|
+
tslib_1.__decorate([
|
|
236
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
237
|
+
tslib_1.__metadata("design:type", Object)
|
|
234
238
|
], HichchiUserEntity.prototype, "updatedById", void 0);
|
|
235
|
-
__decorate([
|
|
236
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
237
|
-
JoinColumn(),
|
|
238
|
-
__metadata("design:type", Object)
|
|
239
|
+
tslib_1.__decorate([
|
|
240
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
241
|
+
(0, typeorm_1.JoinColumn)(),
|
|
242
|
+
tslib_1.__metadata("design:type", Object)
|
|
239
243
|
], HichchiUserEntity.prototype, "updatedBy", void 0);
|
|
240
|
-
__decorate([
|
|
241
|
-
Column({ nullable: true }),
|
|
242
|
-
__metadata("design:type", Object)
|
|
244
|
+
tslib_1.__decorate([
|
|
245
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
246
|
+
tslib_1.__metadata("design:type", Object)
|
|
243
247
|
], HichchiUserEntity.prototype, "deletedById", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
ManyToOne(USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
246
|
-
JoinColumn(),
|
|
247
|
-
__metadata("design:type", Object)
|
|
248
|
+
tslib_1.__decorate([
|
|
249
|
+
(0, typeorm_1.ManyToOne)(tokens_1.USER_ENTITY_TABLE_NAME, { nullable: true }),
|
|
250
|
+
(0, typeorm_1.JoinColumn)(),
|
|
251
|
+
tslib_1.__metadata("design:type", Object)
|
|
248
252
|
], HichchiUserEntity.prototype, "deletedBy", void 0);
|
|
249
|
-
__decorate([
|
|
250
|
-
Column({ nullable: false }),
|
|
251
|
-
__metadata("design:type", String)
|
|
253
|
+
tslib_1.__decorate([
|
|
254
|
+
(0, typeorm_1.Column)({ nullable: false }),
|
|
255
|
+
tslib_1.__metadata("design:type", String)
|
|
252
256
|
], HichchiUserEntity.prototype, "firstName", void 0);
|
|
253
|
-
__decorate([
|
|
254
|
-
Column({ nullable: false }),
|
|
255
|
-
__metadata("design:type", String)
|
|
257
|
+
tslib_1.__decorate([
|
|
258
|
+
(0, typeorm_1.Column)({ nullable: false }),
|
|
259
|
+
tslib_1.__metadata("design:type", String)
|
|
256
260
|
], HichchiUserEntity.prototype, "lastName", void 0);
|
|
257
|
-
__decorate([
|
|
258
|
-
Column({ nullable: false }),
|
|
259
|
-
__metadata("design:type", String)
|
|
261
|
+
tslib_1.__decorate([
|
|
262
|
+
(0, typeorm_1.Column)({ nullable: false }),
|
|
263
|
+
tslib_1.__metadata("design:type", String)
|
|
260
264
|
], HichchiUserEntity.prototype, "fullName", void 0);
|
|
261
|
-
__decorate([
|
|
262
|
-
Column("varchar", { nullable: true }),
|
|
263
|
-
__metadata("design:type", Object)
|
|
265
|
+
tslib_1.__decorate([
|
|
266
|
+
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
267
|
+
tslib_1.__metadata("design:type", Object)
|
|
264
268
|
], HichchiUserEntity.prototype, "email", void 0);
|
|
265
|
-
__decorate([
|
|
266
|
-
Column("varchar", { nullable: true }),
|
|
267
|
-
__metadata("design:type", Object)
|
|
269
|
+
tslib_1.__decorate([
|
|
270
|
+
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
271
|
+
tslib_1.__metadata("design:type", Object)
|
|
268
272
|
], HichchiUserEntity.prototype, "username", void 0);
|
|
269
|
-
__decorate([
|
|
270
|
-
Exclude(),
|
|
271
|
-
Column("varchar", { nullable: true }),
|
|
272
|
-
__metadata("design:type", Object)
|
|
273
|
+
tslib_1.__decorate([
|
|
274
|
+
(0, class_transformer_1.Exclude)(),
|
|
275
|
+
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
276
|
+
tslib_1.__metadata("design:type", Object)
|
|
273
277
|
], HichchiUserEntity.prototype, "password", void 0);
|
|
274
|
-
__decorate([
|
|
275
|
-
Column({ default: false }),
|
|
276
|
-
__metadata("design:type", Boolean)
|
|
278
|
+
tslib_1.__decorate([
|
|
279
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
280
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
277
281
|
], HichchiUserEntity.prototype, "emailVerified", void 0);
|
|
278
|
-
__decorate([
|
|
279
|
-
Column("varchar", { nullable: true }),
|
|
280
|
-
__metadata("design:type", Object)
|
|
282
|
+
tslib_1.__decorate([
|
|
283
|
+
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
284
|
+
tslib_1.__metadata("design:type", Object)
|
|
281
285
|
], HichchiUserEntity.prototype, "avatar", void 0);
|
|
282
|
-
__decorate([
|
|
283
|
-
Column("json", { nullable: true }),
|
|
284
|
-
__metadata("design:type", Object)
|
|
286
|
+
tslib_1.__decorate([
|
|
287
|
+
(0, typeorm_1.Column)("json", { nullable: true }),
|
|
288
|
+
tslib_1.__metadata("design:type", Object)
|
|
285
289
|
], HichchiUserEntity.prototype, "profileData", void 0);
|
|
286
|
-
__decorate([
|
|
287
|
-
Column("enum", { enum: AuthProvider, nullable: false }),
|
|
288
|
-
__metadata("design:type", String)
|
|
290
|
+
tslib_1.__decorate([
|
|
291
|
+
(0, typeorm_1.Column)("enum", { enum: auth_1.AuthProvider, nullable: false }),
|
|
292
|
+
tslib_1.__metadata("design:type", String)
|
|
289
293
|
], HichchiUserEntity.prototype, "signUpType", void 0);
|
|
290
|
-
__decorate([
|
|
291
|
-
BeforeInsert(),
|
|
292
|
-
BeforeUpdate(),
|
|
293
|
-
__metadata("design:type", Function),
|
|
294
|
-
__metadata("design:paramtypes", []),
|
|
295
|
-
__metadata("design:returntype", void 0)
|
|
294
|
+
tslib_1.__decorate([
|
|
295
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
296
|
+
(0, typeorm_1.BeforeUpdate)(),
|
|
297
|
+
tslib_1.__metadata("design:type", Function),
|
|
298
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
299
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
296
300
|
], HichchiUserEntity.prototype, "beforeInsert", null);
|
|
297
|
-
__decorate([
|
|
298
|
-
AfterLoad(),
|
|
299
|
-
__metadata("design:type", Function),
|
|
300
|
-
__metadata("design:paramtypes", []),
|
|
301
|
-
__metadata("design:returntype", void 0)
|
|
301
|
+
tslib_1.__decorate([
|
|
302
|
+
(0, typeorm_1.AfterLoad)(),
|
|
303
|
+
tslib_1.__metadata("design:type", Function),
|
|
304
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
305
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
302
306
|
], HichchiUserEntity.prototype, "afterLoad", null);
|
|
303
307
|
//# sourceMappingURL=base-user.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-user.entity.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-user.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-user.entity.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/base-user.entity.ts"],"names":[],"mappings":";;;;AAAA,qCASiB;AAGjB,sCAAmD;AACnD,uDAA2E;AAC3E,yDAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAa,iBAAiB;IAC1B;;;;;OAKG;IAEH,EAAE,CAAW;IAEb;;;;;OAKG;IAEH,SAAS,CAAO;IAEhB;;;;;OAKG;IAEH,SAAS,CAAO;IAEhB;;;;;OAKG;IAEH,SAAS,CAAc;IAEvB;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;OAKG;IAEH,WAAW,CAAkB;IAE7B;;;;;OAKG;IAGH,SAAS,CAAkB;IAE3B;;;;;;OAMG;IAEH,SAAS,CAAS;IAElB;;;;;OAKG;IAEH,QAAQ,CAAS;IAEjB;;;;;;OAMG;IAEH,QAAQ,CAAS;I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;AAIxB;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACd;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wDACJ;AAGvB;IADC,IAAA,gBAAM,EAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAChB;AAGtB;IADC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACD;AAGlC;IADC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qDAC/B;AAWf;IAFT,IAAA,sBAAY,GAAE;IACd,IAAA,sBAAY,GAAE;;;;qDAGd;AAaS;IADT,IAAA,mBAAS,GAAE;;;;kDAWX"}
|
package/base/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./base-entity"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./base-entity-extension"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./base-repository"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./base-user.entity"), exports);
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
package/base/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/nest-crud/src/base/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,kEAAwC;AACxC,4DAAkC;AAClC,6DAAmC"}
|
package/constants.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ID_PATH_VAR = exports.ID_PATH = exports.EXTRACT_INVALID_COLUMN_REGEX = exports.EXTRACT_INVALID_QUERY_FIELD_REGEX = exports.FK_CONSTRAINT_REGEX = exports.UNIQUE_CONSTRAINT_REGEX = exports.DEFAULT_MAX_RECURSION_DEPTH = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Default maximum recursion depth for deep object operations
|
|
3
6
|
*
|
|
@@ -18,7 +21,7 @@
|
|
|
18
21
|
*
|
|
19
22
|
* @see {@link toQueryDeepPartialEntity} Function that uses this constant to limit recursion depth
|
|
20
23
|
*/
|
|
21
|
-
|
|
24
|
+
exports.DEFAULT_MAX_RECURSION_DEPTH = 10;
|
|
22
25
|
/**
|
|
23
26
|
* Regular expression for validating unique constraint naming convention
|
|
24
27
|
*
|
|
@@ -39,7 +42,7 @@ export const DEFAULT_MAX_RECURSION_DEPTH = 10;
|
|
|
39
42
|
*
|
|
40
43
|
* @see {@link HichchiEntity} Decorator that validates unique constraint names
|
|
41
44
|
*/
|
|
42
|
-
|
|
45
|
+
exports.UNIQUE_CONSTRAINT_REGEX = /^UNIQUE_[a-zA-Z]\w+_[a-zA-Z]\w+$/;
|
|
43
46
|
/**
|
|
44
47
|
* Regular expression for validating foreign key constraint naming convention
|
|
45
48
|
*
|
|
@@ -61,7 +64,7 @@ export const UNIQUE_CONSTRAINT_REGEX = /^UNIQUE_[a-zA-Z]\w+_[a-zA-Z]\w+$/;
|
|
|
61
64
|
* @see {@link HichchiEntity} Decorator that validates foreign key constraint names
|
|
62
65
|
* @see {@link HichchiJoinColumn} Decorator that uses this pattern for foreign key constraints
|
|
63
66
|
*/
|
|
64
|
-
|
|
67
|
+
exports.FK_CONSTRAINT_REGEX = /^FK_[a-zA-Z]\w+_[a-zA-Z]\w+$/;
|
|
65
68
|
/**
|
|
66
69
|
* Regular expression for extracting field names from TypeORM property not found errors
|
|
67
70
|
*
|
|
@@ -80,7 +83,7 @@ export const FK_CONSTRAINT_REGEX = /^FK_[a-zA-Z]\w+_[a-zA-Z]\w+$/;
|
|
|
80
83
|
*
|
|
81
84
|
* @see {@link EntityUtils.handleError} Method that uses this pattern to extract field names from errors
|
|
82
85
|
*/
|
|
83
|
-
|
|
86
|
+
exports.EXTRACT_INVALID_QUERY_FIELD_REGEX = /Property "|" was/;
|
|
84
87
|
/**
|
|
85
88
|
* Regular expression for extracting column names from database column not found errors
|
|
86
89
|
*
|
|
@@ -99,7 +102,7 @@ export const EXTRACT_INVALID_QUERY_FIELD_REGEX = /Property "|" was/;
|
|
|
99
102
|
*
|
|
100
103
|
* @see {@link EntityUtils.handleError} Method that uses this pattern to extract column names from errors
|
|
101
104
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
exports.EXTRACT_INVALID_COLUMN_REGEX = /Unknown column '|' in 'where clause'/;
|
|
106
|
+
exports.ID_PATH = "id";
|
|
107
|
+
exports.ID_PATH_VAR = `:${exports.ID_PATH}`;
|
|
105
108
|
//# sourceMappingURL=constants.js.map
|
package/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../libs/nest-crud/src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../libs/nest-crud/src/constants.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,2BAA2B,GAAG,EAAE,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,uBAAuB,GAAG,kCAAkC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,mBAAmB,GAAG,8BAA8B,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,iCAAiC,GAAG,kBAAkB,CAAC;AAEpE;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,4BAA4B,GAAG,sCAAsC,CAAC;AAEtE,QAAA,OAAO,GAAG,IAAI,CAAC;AAEf,QAAA,WAAW,GAAG,IAAI,eAAO,EAAE,CAAC"}
|