@solidstarters/solid-core 1.2.52 → 1.2.54
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/dist/dtos/create-field-metadata.dto.d.ts +1 -0
- package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-field-metadata.dto.js +6 -1
- package/dist/dtos/create-field-metadata.dto.js.map +1 -1
- package/dist/entities/field-metadata.entity.d.ts +1 -0
- package/dist/entities/field-metadata.entity.d.ts.map +1 -1
- package/dist/entities/field-metadata.entity.js +5 -1
- package/dist/entities/field-metadata.entity.js.map +1 -1
- package/dist/helpers/schematic.service.d.ts +1 -0
- package/dist/helpers/schematic.service.d.ts.map +1 -1
- package/dist/helpers/schematic.service.js +3 -0
- package/dist/helpers/schematic.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +17 -5
- package/dist/services/authentication.service.d.ts +4 -0
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +58 -35
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/field-metadata.service.d.ts.map +1 -1
- package/dist/services/field-metadata.service.js +1 -0
- package/dist/services/field-metadata.service.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +18 -4
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/dtos/create-field-metadata.dto.ts +6 -1
- package/src/entities/field-metadata.entity.ts +6 -0
- package/src/helpers/schematic.service.ts +5 -0
- package/src/seeders/seed-data/solid-core-metadata.json +18 -6
- package/src/services/authentication.service.ts +78 -44
- package/src/services/field-metadata.service.ts +9 -8
- package/src/services/model-metadata.service.ts +19 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.54",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -321,10 +321,15 @@ export class CreateFieldMetadataDto {
|
|
|
321
321
|
@IsOptional()
|
|
322
322
|
relationCoModelFieldName: string;
|
|
323
323
|
|
|
324
|
-
@ApiProperty({description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation'})
|
|
324
|
+
@ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to set the owner of the many-to-many relation' })
|
|
325
325
|
@IsOptional()
|
|
326
326
|
isRelationManyToManyOwner: boolean;
|
|
327
327
|
|
|
328
|
+
|
|
329
|
+
@ApiProperty({ description: 'Only for type=relation, many-to-many. This field is used to store fixed filters that needs to applied on related model' })
|
|
330
|
+
@IsOptional()
|
|
331
|
+
relationFieldFixedFilter: string;
|
|
332
|
+
|
|
328
333
|
@ApiProperty({
|
|
329
334
|
description:
|
|
330
335
|
'Dynamic provider for selection. Only for type=selectionDynamic',
|
|
@@ -102,6 +102,12 @@ export class FieldMetadata extends CommonEntity {
|
|
|
102
102
|
@Column({ name: 'is_relation_many_to_many_owner', nullable: true })
|
|
103
103
|
isRelationManyToManyOwner: boolean;
|
|
104
104
|
|
|
105
|
+
// We can store a filter json like this {"fieldName": ${someVarWhichWillComeFromParentModel... or can be hard coded...}}
|
|
106
|
+
// {"type": "INDUSTRY"} .... Eg. static fixedFilter
|
|
107
|
+
// {"country_id", "${country}"} ... Eg. dynamic fixedFilter
|
|
108
|
+
@Column({ name: 'relation_Field_Fixed_Filter', nullable: true })
|
|
109
|
+
relationFieldFixedFilter: string;
|
|
110
|
+
|
|
105
111
|
@Column({ name: 'selection_dynamic_provider', nullable: true })
|
|
106
112
|
selectionDynamicProvider: string;
|
|
107
113
|
|
|
@@ -14,6 +14,7 @@ type FieldOptions = {
|
|
|
14
14
|
dataSource: string;
|
|
15
15
|
fields: any[]; //FIXME This type can be improved
|
|
16
16
|
modelEnableSoftDelete?: boolean;
|
|
17
|
+
parentModel?: string;
|
|
17
18
|
};
|
|
18
19
|
export const REMOVE_FIELDS_COMMAND = 'remove-fields';
|
|
19
20
|
export const REFRESH_MODEL_COMMAND = 'refresh-model';
|
|
@@ -70,6 +71,10 @@ export class SchematicService {
|
|
|
70
71
|
modelCommand += ` --model-enable-soft-delete=${fieldOptions.modelEnableSoftDelete}`;
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
if (fieldOptions.parentModel) {
|
|
75
|
+
modelCommand += ` --parent-model=${fieldOptions.parentModel}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
73
78
|
let fieldCommand = fieldOptions.fields
|
|
74
79
|
.filter((field) => {
|
|
75
80
|
return !Object.values(SYSTEM_FIELDS_TO_IGNORE_FOR_CODE_GENERATION).includes(field.name);
|
|
@@ -726,6 +726,18 @@
|
|
|
726
726
|
"columnName": "relation_model_field_name",
|
|
727
727
|
"isSystem": true
|
|
728
728
|
},
|
|
729
|
+
{
|
|
730
|
+
"name": "relationFieldFixedFilter",
|
|
731
|
+
"displayName": "App Description",
|
|
732
|
+
"type": "longText",
|
|
733
|
+
"ormType": "varchar",
|
|
734
|
+
"required": false,
|
|
735
|
+
"unique": false,
|
|
736
|
+
"index": false,
|
|
737
|
+
"private": false,
|
|
738
|
+
"encrypt": false,
|
|
739
|
+
"isSystem": true
|
|
740
|
+
},
|
|
729
741
|
{
|
|
730
742
|
"name": "selectionDynamicProvider",
|
|
731
743
|
"displayName": "Selection Dynamic Provider",
|
|
@@ -3874,7 +3886,7 @@
|
|
|
3874
3886
|
"body": "",
|
|
3875
3887
|
"confirmBtnLabel": "Generate Code",
|
|
3876
3888
|
"cancelBtnLabel": "Cancel",
|
|
3877
|
-
"customComponent": "
|
|
3889
|
+
"customComponent": "GenerateModuleCodeRowAction",
|
|
3878
3890
|
"customComponentIsSystem": true,
|
|
3879
3891
|
"endpoint": ""
|
|
3880
3892
|
}
|
|
@@ -4066,7 +4078,7 @@
|
|
|
4066
4078
|
"body": "",
|
|
4067
4079
|
"confirmBtnLabel": "Generate Code",
|
|
4068
4080
|
"cancelBtnLabel": "Cancel",
|
|
4069
|
-
"customComponent": "
|
|
4081
|
+
"customComponent": "GenerateModelCodeRowAction",
|
|
4070
4082
|
"customComponentIsSystem": true,
|
|
4071
4083
|
"endpoint": ""
|
|
4072
4084
|
}
|
|
@@ -5684,9 +5696,8 @@
|
|
|
5684
5696
|
"type": "field",
|
|
5685
5697
|
"attrs": {
|
|
5686
5698
|
"name": "name",
|
|
5687
|
-
"isSearchable": true
|
|
5688
|
-
|
|
5689
|
-
}
|
|
5699
|
+
"isSearchable": true
|
|
5700
|
+
}
|
|
5690
5701
|
},
|
|
5691
5702
|
{
|
|
5692
5703
|
"type": "field",
|
|
@@ -6675,7 +6686,8 @@
|
|
|
6675
6686
|
"type": "field",
|
|
6676
6687
|
"attrs": {
|
|
6677
6688
|
"name": "username",
|
|
6678
|
-
"isSearchable": true
|
|
6689
|
+
"isSearchable": true,
|
|
6690
|
+
"widget": "SolidUserNameAvatarWidget"
|
|
6679
6691
|
}
|
|
6680
6692
|
},
|
|
6681
6693
|
{
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
RegistrationValidationSource,
|
|
40
40
|
TransactionalRegistrationValidationSource
|
|
41
41
|
} from "../constants";
|
|
42
|
+
import { CreateUserDto } from 'src/dtos/create-user.dto';
|
|
42
43
|
|
|
43
44
|
enum LoginProvider {
|
|
44
45
|
LOCAL = 'local',
|
|
@@ -112,55 +113,15 @@ export class AuthenticationService {
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
try {
|
|
115
|
-
|
|
116
|
-
user.username = signUpDto.username;
|
|
117
|
-
user.email = signUpDto.email;
|
|
118
|
-
user.fullName = signUpDto.fullName;
|
|
119
|
-
if (signUpDto.mobile) {
|
|
120
|
-
user.mobile = signUpDto.mobile;
|
|
121
|
-
}
|
|
122
|
-
// If password has been specified by the user, then we simply create & activate the user based on the configuration parameter "activateUserOnRegistration".
|
|
123
|
-
let pwd = '';
|
|
124
|
-
let autoGeneratedPwd = '';
|
|
125
|
-
if (signUpDto.password) {
|
|
126
|
-
pwd = await this.hashingService.hash(signUpDto.password);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// TODO: If password is not specified then auto-generate a random password, trigger this password over an email to the user.
|
|
130
|
-
// TODO: Also track if the user has to force reset / change their password, and then activate the user.
|
|
131
|
-
autoGeneratedPwd = this.generatePassword();
|
|
132
|
-
pwd = await this.hashingService.hash(autoGeneratedPwd);
|
|
133
|
-
user.forcePasswordChange = true;
|
|
134
|
-
}
|
|
135
|
-
user.password = pwd;
|
|
136
|
-
user.active = this.iamConfiguration.activateUserOnRegistration;
|
|
116
|
+
var { user, pwd, autoGeneratedPwd } = await this.populateForSignup(new User(), signUpDto, this.iamConfiguration.activateUserOnRegistration);
|
|
137
117
|
const savedUser = await this.userRepository.save(user);
|
|
138
118
|
|
|
139
119
|
// Also assign a default role to the newly created user.
|
|
140
|
-
|
|
120
|
+
const userRoles = signUpDto.roles ?? [];
|
|
141
121
|
if (this.iamConfiguration.defaultRole) {
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
// Default Internal user role assigned
|
|
145
|
-
roles.push("Internal User");
|
|
146
|
-
if (signUpDto.roles) {
|
|
147
|
-
roles = [...roles, ...signUpDto.roles];
|
|
148
|
-
}
|
|
149
|
-
roles = Array.from(new Set([...roles]));
|
|
150
|
-
if (roles.length > 0) {
|
|
151
|
-
this.userService.addRolesToUser(user.username, roles);
|
|
152
|
-
}
|
|
153
|
-
// Tanay: Adding user password to history table
|
|
154
|
-
const userPasswordHistory = new UserPasswordHistory();
|
|
155
|
-
userPasswordHistory.passwordHash = pwd;
|
|
156
|
-
userPasswordHistory.user = savedUser;
|
|
157
|
-
await this.userPasswordHistoryRepository.save(userPasswordHistory);
|
|
158
|
-
|
|
159
|
-
// if forcePasswordChange is true, then we trigger an email to the user to change the password, this needs to be done using a queue.
|
|
160
|
-
// Create a new method like notifyUserOnForcePasswordChange, create a new email template we can call it on-force-password-change this template to include the random password
|
|
161
|
-
if (user.forcePasswordChange && autoGeneratedPwd) {
|
|
162
|
-
this.notifyUserOnForcePasswordChange(user, autoGeneratedPwd);
|
|
122
|
+
userRoles.push(this.iamConfiguration.defaultRole);
|
|
163
123
|
}
|
|
124
|
+
await this.handlePostSignup(savedUser, userRoles, pwd, autoGeneratedPwd);
|
|
164
125
|
|
|
165
126
|
// TODO: make provision to trigger a welcome email also.
|
|
166
127
|
|
|
@@ -174,6 +135,79 @@ export class AuthenticationService {
|
|
|
174
135
|
}
|
|
175
136
|
}
|
|
176
137
|
|
|
138
|
+
async signupForExtensionUser<T extends User, U extends CreateUserDto>(signUpDto: SignUpDto, extensionUserDto: U, extensionUserRepo: Repository<T>): Promise<T> {
|
|
139
|
+
try {
|
|
140
|
+
// Merge the extended signUpDto attributes into the user entity
|
|
141
|
+
//@ts-ignore
|
|
142
|
+
const extensionUser = extensionUserRepo.merge(extensionUserRepo.create() as T, extensionUserDto);
|
|
143
|
+
var { user, pwd, autoGeneratedPwd } = await this.populateForSignup<T>(extensionUser, signUpDto);
|
|
144
|
+
const savedUser = await extensionUserRepo.save(user);
|
|
145
|
+
|
|
146
|
+
await this.handlePostSignup(savedUser, signUpDto.roles, pwd, autoGeneratedPwd);
|
|
147
|
+
|
|
148
|
+
return savedUser;
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
const pgUniqueViolationErrorCode = '23505';
|
|
152
|
+
if (err.code === pgUniqueViolationErrorCode) {
|
|
153
|
+
throw new ConflictException();
|
|
154
|
+
}
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
private async populateForSignup<T extends User>(user: T, signUpDto: SignUpDto, isUserActive: boolean = true) {
|
|
161
|
+
// const user = new User();
|
|
162
|
+
user.username = signUpDto.username;
|
|
163
|
+
user.email = signUpDto.email;
|
|
164
|
+
user.fullName = signUpDto.fullName;
|
|
165
|
+
if (signUpDto.mobile) {
|
|
166
|
+
user.mobile = signUpDto.mobile;
|
|
167
|
+
}
|
|
168
|
+
// If password has been specified by the user, then we simply create & activate the user based on the configuration parameter "activateUserOnRegistration".
|
|
169
|
+
let pwd = '';
|
|
170
|
+
let autoGeneratedPwd = '';
|
|
171
|
+
if (signUpDto.password) {
|
|
172
|
+
pwd = await this.hashingService.hash(signUpDto.password);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// TODO: If password is not specified then auto-generate a random password, trigger this password over an email to the user.
|
|
176
|
+
// TODO: Also track if the user has to force reset / change their password, and then activate the user.
|
|
177
|
+
autoGeneratedPwd = this.generatePassword();
|
|
178
|
+
pwd = await this.hashingService.hash(autoGeneratedPwd);
|
|
179
|
+
user.forcePasswordChange = true;
|
|
180
|
+
}
|
|
181
|
+
user.password = pwd;
|
|
182
|
+
// user.active = this.iamConfiguration.activateUserOnRegistration;
|
|
183
|
+
user.active = isUserActive;
|
|
184
|
+
return { user, pwd, autoGeneratedPwd };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private async handlePostSignup(user: User, roles: string[]=[], pwd: string, autoGeneratedPwd: string) {
|
|
188
|
+
let userRoles = [];
|
|
189
|
+
// Default Internal user role assigned
|
|
190
|
+
userRoles.push("Internal User");
|
|
191
|
+
if (roles) {
|
|
192
|
+
userRoles = [...userRoles, ...roles];
|
|
193
|
+
}
|
|
194
|
+
userRoles = Array.from(new Set([...userRoles]));
|
|
195
|
+
if (userRoles.length > 0) {
|
|
196
|
+
this.userService.addRolesToUser(user.username, userRoles);
|
|
197
|
+
}
|
|
198
|
+
// Tanay: Adding user password to history table
|
|
199
|
+
const userPasswordHistory = new UserPasswordHistory();
|
|
200
|
+
userPasswordHistory.passwordHash = pwd;
|
|
201
|
+
userPasswordHistory.user = user;
|
|
202
|
+
await this.userPasswordHistoryRepository.save(userPasswordHistory);
|
|
203
|
+
|
|
204
|
+
// if forcePasswordChange is true, then we trigger an email to the user to change the password, this needs to be done using a queue.
|
|
205
|
+
// Create a new method like notifyUserOnForcePasswordChange, create a new email template we can call it on-force-password-change this template to include the random password
|
|
206
|
+
if (user.forcePasswordChange && autoGeneratedPwd) {
|
|
207
|
+
this.notifyUserOnForcePasswordChange(user, autoGeneratedPwd);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
177
211
|
generatePassword(length: number = 8): string {
|
|
178
212
|
const upperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
179
213
|
const lowerCase = "abcdefghijklmnopqrstuvwxyz";
|
|
@@ -68,9 +68,9 @@ export class FieldMetadataService {
|
|
|
68
68
|
private: false,
|
|
69
69
|
encrypt: false,
|
|
70
70
|
model: relationModel,
|
|
71
|
-
columnName:null,
|
|
71
|
+
columnName: null,
|
|
72
72
|
relationJoinTableName: null,
|
|
73
|
-
id
|
|
73
|
+
id: null,
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Load the inverse field,
|
|
@@ -98,9 +98,9 @@ export class FieldMetadataService {
|
|
|
98
98
|
private: false,
|
|
99
99
|
encrypt: false,
|
|
100
100
|
model: relationModel,
|
|
101
|
-
columnName:null,
|
|
101
|
+
columnName: null,
|
|
102
102
|
relationJoinTableName: null,
|
|
103
|
-
id
|
|
103
|
+
id: null,
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// Load the inverse field,
|
|
@@ -129,10 +129,10 @@ export class FieldMetadataService {
|
|
|
129
129
|
private: false,
|
|
130
130
|
encrypt: false,
|
|
131
131
|
model: relationModel,
|
|
132
|
-
columnName:null,
|
|
132
|
+
columnName: null,
|
|
133
133
|
relationJoinTableName: null,
|
|
134
134
|
isRelationManyToManyOwner: false,
|
|
135
|
-
id
|
|
135
|
+
id: null,
|
|
136
136
|
}
|
|
137
137
|
const savedField = await this.saveInverseField(fieldRepository, relationModel, inverseFieldManyToMany);
|
|
138
138
|
return savedField;
|
|
@@ -141,7 +141,7 @@ export class FieldMetadataService {
|
|
|
141
141
|
throw new Error(`Invalid relation type for field ${field.name} with relation type ${field.relationType}`);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
|
|
145
145
|
private async getRelationModel(modelRepository: Repository<ModelMetadata>, field: FieldMetadata, moduleName: string) {
|
|
146
146
|
return await modelRepository.findOne({
|
|
147
147
|
where: {
|
|
@@ -750,6 +750,7 @@ export class FieldMetadataService {
|
|
|
750
750
|
"columnName",
|
|
751
751
|
"relationJoinTableName",
|
|
752
752
|
"isRelationManyToManyOwner",
|
|
753
|
+
"relationFieldFixedFilter"
|
|
753
754
|
];
|
|
754
755
|
|
|
755
756
|
case SolidFieldType.mediaSingle:
|
|
@@ -1080,7 +1081,7 @@ export class FieldMetadataService {
|
|
|
1080
1081
|
fieldsRequiredBasedOnType.forEach((requiredField) => {
|
|
1081
1082
|
fieldObject[requiredField] = field[requiredField];
|
|
1082
1083
|
});
|
|
1083
|
-
|
|
1084
|
+
|
|
1084
1085
|
if (field.type == "mediaSingle" || field.type == "mediaMultiple") {
|
|
1085
1086
|
if (field.mediaStorageProvider) {
|
|
1086
1087
|
delete fieldObject.mediaStorageProviderId
|
|
@@ -184,6 +184,16 @@ export class ModelMetadataService {
|
|
|
184
184
|
relations: {},
|
|
185
185
|
});
|
|
186
186
|
createDto['module'] = resolvedModule;
|
|
187
|
+
|
|
188
|
+
const resolvedParentModel = await this.dataSource
|
|
189
|
+
.getRepository(ModelMetadata)
|
|
190
|
+
.findOne({
|
|
191
|
+
where: {
|
|
192
|
+
id: createDto['parentModelId'],
|
|
193
|
+
},
|
|
194
|
+
relations: {},
|
|
195
|
+
});
|
|
196
|
+
createDto['parentModel'] = resolvedParentModel;
|
|
187
197
|
const { fields: fieldsMetadata, ...modelMetaDataWithoutFields } = createDto;
|
|
188
198
|
const modelMetadata = this.modelMetadataRepo.create(modelMetaDataWithoutFields);
|
|
189
199
|
let model = await manager.save(modelMetadata);
|
|
@@ -330,7 +340,7 @@ export class ModelMetadataService {
|
|
|
330
340
|
where: {
|
|
331
341
|
id: modelId,
|
|
332
342
|
},
|
|
333
|
-
relations: ["fields", "fields.mediaStorageProvider", "module"], //FIXME: Check with jenender and change to relations to avoid confusion
|
|
343
|
+
relations: ["fields", "fields.mediaStorageProvider", "module", "parentModel"], //FIXME: Check with jenender and change to relations to avoid confusion
|
|
334
344
|
});
|
|
335
345
|
|
|
336
346
|
const filePath = this.moduleMetadataHelperService.getModuleMetadataFilePath(model.module.name);
|
|
@@ -345,6 +355,8 @@ export class ModelMetadataService {
|
|
|
345
355
|
dataSourceType: model.dataSourceType,
|
|
346
356
|
tableName: model.tableName,
|
|
347
357
|
userKeyFieldUserKey: model.fields.find(field => field.isUserKey)?.name,
|
|
358
|
+
isChild: model?.isChild,
|
|
359
|
+
parentModelUserKey: model?.parentModel?.singularName,
|
|
348
360
|
fields: []
|
|
349
361
|
}
|
|
350
362
|
|
|
@@ -595,7 +607,7 @@ export class ModelMetadataService {
|
|
|
595
607
|
where: {
|
|
596
608
|
id: modelId,
|
|
597
609
|
},
|
|
598
|
-
relations: ["fields", "fields.mediaStorageProvider", "module"], //FIXME: Check with jenender and change to relations to avoid confusion
|
|
610
|
+
relations: ["fields", "fields.mediaStorageProvider", "module", "parentModel"], //FIXME: Check with jenender and change to relations to avoid confusion
|
|
599
611
|
});
|
|
600
612
|
|
|
601
613
|
const filePath = this.moduleMetadataHelperService.getModuleMetadataFilePath(model.module.name);
|
|
@@ -610,6 +622,8 @@ export class ModelMetadataService {
|
|
|
610
622
|
dataSourceType: model.dataSourceType,
|
|
611
623
|
tableName: model.tableName,
|
|
612
624
|
userKeyFieldUserKey: model.fields.find(field => field.isUserKey)?.name,
|
|
625
|
+
isChild: model.isChild,
|
|
626
|
+
parentModelUserKey: model.parentModel.singularName,
|
|
613
627
|
fields: []
|
|
614
628
|
}
|
|
615
629
|
|
|
@@ -895,7 +909,7 @@ export class ModelMetadataService {
|
|
|
895
909
|
}
|
|
896
910
|
|
|
897
911
|
const query = {
|
|
898
|
-
populate: ["module", "fields"]
|
|
912
|
+
populate: ["module", "fields", "parentModel"]
|
|
899
913
|
};
|
|
900
914
|
const model = options.modelId ? await this.findOne(options.modelId, query) : await this.findOneByUserKey(options.modelUserKey, query.populate);
|
|
901
915
|
|
|
@@ -917,7 +931,8 @@ export class ModelMetadataService {
|
|
|
917
931
|
dataSource: model.dataSource,
|
|
918
932
|
table: model.tableName,
|
|
919
933
|
fields: fieldsForRefresh,
|
|
920
|
-
modelEnableSoftDelete: model.enableSoftDelete
|
|
934
|
+
modelEnableSoftDelete: model.enableSoftDelete,
|
|
935
|
+
parentModel: model.parentModel?.singularName
|
|
921
936
|
},
|
|
922
937
|
dryRun
|
|
923
938
|
);
|