@solidstarters/solid-core 1.2.168 → 1.2.170
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-ai-interaction.dto.d.ts +3 -0
- package/dist/dtos/create-ai-interaction.dto.d.ts.map +1 -1
- package/dist/dtos/create-ai-interaction.dto.js +19 -1
- package/dist/dtos/create-ai-interaction.dto.js.map +1 -1
- package/dist/dtos/update-ai-interaction.dto.d.ts +3 -0
- package/dist/dtos/update-ai-interaction.dto.d.ts.map +1 -1
- package/dist/dtos/update-ai-interaction.dto.js +19 -1
- package/dist/dtos/update-ai-interaction.dto.js.map +1 -1
- package/dist/entities/ai-interaction.entity.d.ts +3 -0
- package/dist/entities/ai-interaction.entity.d.ts.map +1 -1
- package/dist/entities/ai-interaction.entity.js +13 -1
- package/dist/entities/ai-interaction.entity.js.map +1 -1
- package/dist/filters/http-exception.filter.d.ts.map +1 -1
- package/dist/filters/http-exception.filter.js +2 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/helpers/error-mapper.service.d.ts.map +1 -1
- package/dist/helpers/error-mapper.service.js +1 -1
- package/dist/helpers/error-mapper.service.js.map +1 -1
- package/dist/helpers/model-metadata-helper.service.js.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.js +3 -3
- package/dist/helpers/solid-core-error-codes-provider.service.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +0 -1
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +0 -1
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +2 -2
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +33 -0
- package/dist/services/authentication.service.d.ts +1 -5
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +22 -64
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/export-transaction.service.d.ts +3 -1
- package/dist/services/export-transaction.service.d.ts.map +1 -1
- package/dist/services/export-transaction.service.js +70 -16
- package/dist/services/export-transaction.service.js.map +1 -1
- package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js +1 -1
- package/dist/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +0 -2
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/dtos/create-ai-interaction.dto.ts +15 -0
- package/src/dtos/update-ai-interaction.dto.ts +15 -0
- package/src/entities/ai-interaction.entity.ts +9 -0
- package/src/filters/http-exception.filter.ts +5 -2
- package/src/helpers/error-mapper.service.ts +1 -35
- package/src/helpers/model-metadata-helper.service.ts +1 -1
- package/src/helpers/solid-core-error-codes-provider.service.ts +4 -4
- package/src/helpers/solid-registry.ts +0 -1
- package/src/index.ts +0 -1
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +2 -2
- package/src/seeders/seed-data/solid-core-metadata.json +35 -2
- package/src/services/authentication.service.ts +31 -142
- package/src/services/export-transaction.service.ts +118 -55
- package/src/services/mcp-tool-response-handlers/solid-create-module-mcp-tool-response-handler.service.ts +1 -1
- package/src/solid-core.module.ts +0 -8
- package/dist/entities/user-password-history.entity.d.ts +0 -7
- package/dist/entities/user-password-history.entity.d.ts.map +0 -1
- package/dist/entities/user-password-history.entity.js +0 -35
- package/dist/entities/user-password-history.entity.js.map +0 -1
- package/src/entities/user-password-history.entity.ts +0 -14
|
@@ -29,6 +29,7 @@ import { SolidIntrospectService } from './solid-introspect.service';
|
|
|
29
29
|
import { ModelMetadata } from 'src/entities/model-metadata.entity';
|
|
30
30
|
import { UpdateExportTemplateDto } from 'src/dtos/update-export-template.dto';
|
|
31
31
|
import { ERROR_MESSAGES } from 'src/constants/error-messages';
|
|
32
|
+
import { ModelMetadataHelperService } from 'src/helpers/model-metadata-helper.service';
|
|
32
33
|
|
|
33
34
|
const EXPORT_CHUNK_SIZE = 100;
|
|
34
35
|
enum ExportStatus {
|
|
@@ -71,20 +72,22 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
71
72
|
@InjectRepository(FieldMetadata, 'default')
|
|
72
73
|
readonly fieldRepo: Repository<FieldMetadata>,
|
|
73
74
|
@InjectRepository(ModelMetadata, 'default')
|
|
74
|
-
readonly ModelMetadataRepo
|
|
75
|
-
readonly moduleRef: ModuleRef
|
|
75
|
+
readonly ModelMetadataRepo: Repository<ModelMetadata>,
|
|
76
|
+
readonly moduleRef: ModuleRef,
|
|
77
|
+
private readonly modelMetadataHelperService: ModelMetadataHelperService,
|
|
78
|
+
|
|
76
79
|
) {
|
|
77
|
-
super(modelMetadataService, moduleMetadataService, configService, fileService, discoveryService, crudHelperService, entityManager, repo, 'exportTransaction', 'solid-core',moduleRef);
|
|
80
|
+
super(modelMetadataService, moduleMetadataService, configService, fileService, discoveryService, crudHelperService, entityManager, repo, 'exportTransaction', 'solid-core', moduleRef);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
// Return the export stream
|
|
81
|
-
async triggerExportSync(id: number, exportTransactionEntity: any, updateDto: UpdateExportTemplateDto
|
|
84
|
+
async triggerExportSync(id: number, exportTransactionEntity: any, updateDto: UpdateExportTemplateDto, filters: any): Promise<ExportTransactionFileInfo> {
|
|
82
85
|
try {
|
|
83
86
|
// const loadedExportTransaction = await this.loadExportTransaction(id);
|
|
84
87
|
// from updateDto, get modelId and get modelMetadata
|
|
85
88
|
const modeldata = await this.ModelMetadataRepo.findOne({
|
|
86
|
-
where: { id:
|
|
87
|
-
relations: { fields: true},
|
|
89
|
+
where: { id: updateDto?.modelMetadataId },
|
|
90
|
+
relations: { fields: true },
|
|
88
91
|
})
|
|
89
92
|
const modelName = modeldata?.singularName;
|
|
90
93
|
const modelTemplateName = modelName;
|
|
@@ -102,13 +105,13 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
// Store the export stream using the appropriate storage provider
|
|
105
|
-
async triggerExportAsync(id: number, exportTransactionEntity: any, updateDto: UpdateExportTemplateDto, filters:any): Promise<void> {
|
|
108
|
+
async triggerExportAsync(id: number, exportTransactionEntity: any, updateDto: UpdateExportTemplateDto, filters: any): Promise<void> {
|
|
106
109
|
try {
|
|
107
110
|
// const loadedExportTransaction = await this.loadExportTransaction(id)
|
|
108
111
|
// from updateDto, get modelId and get modelMetadata
|
|
109
112
|
const modeldata = await this.ModelMetadataRepo.findOne({
|
|
110
|
-
where: { id:
|
|
111
|
-
relations: { fields: true},
|
|
113
|
+
where: { id: updateDto?.modelMetadataId },
|
|
114
|
+
relations: { fields: true },
|
|
112
115
|
})
|
|
113
116
|
const modelName = modeldata?.singularName;
|
|
114
117
|
const modelTemplateName = modelName;
|
|
@@ -129,7 +132,7 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
129
132
|
private async loadExportTransaction(id: number) {
|
|
130
133
|
return await this.repo.findOne({
|
|
131
134
|
where: { id: id },
|
|
132
|
-
relations: { exportTemplate: { modelMetadata: {fields: true} }},
|
|
135
|
+
relations: { exportTemplate: { modelMetadata: { fields: true } } },
|
|
133
136
|
}
|
|
134
137
|
);
|
|
135
138
|
}
|
|
@@ -138,15 +141,15 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
138
141
|
await this.repo.update(id, { status, error });
|
|
139
142
|
}
|
|
140
143
|
|
|
141
|
-
private async getExportStreamDetails(modelName: string, templateName: string, fields:any, modelData:any, templateFormat:string, id:number, exportTransaction: any, filters: any) {
|
|
144
|
+
private async getExportStreamDetails(modelName: string, templateName: string, fields: any, modelData: any, templateFormat: string, id: number, exportTransaction: any, filters: any) {
|
|
142
145
|
// Get the columns which need to be exported & the model id
|
|
143
146
|
// const fields = JSON.parse(exportTransaction.exportTemplate.fields);
|
|
144
147
|
|
|
145
148
|
// // Get the appropriate service for the model by trying to fetch a model service matching a particular name
|
|
146
149
|
// const modelName = exportTransaction.exportTemplate.modelMetadata.singularName;
|
|
147
|
-
|
|
150
|
+
const modelService = this.introspectService.getProvider(`${classify(modelName)}Service`);
|
|
148
151
|
// const templateName = exportTransaction.exportTemplate.templateName;
|
|
149
|
-
|
|
152
|
+
const uuid = String(id); //TODO can be renamed to exportTransactionUUID
|
|
150
153
|
// const modelData = exportTransaction.exportTemplate.modelMetadata;
|
|
151
154
|
|
|
152
155
|
// Get the data records function
|
|
@@ -208,17 +211,21 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
208
211
|
return (fileFormat === ExportFormat.EXCEL) ? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' : 'text/csv';
|
|
209
212
|
}
|
|
210
213
|
|
|
211
|
-
private async getDataRecordsFunc(fields: any, modelService: InstanceWrapper<any>, modelMetadata: any, filters:any): Promise<(chunkIndex: number, chunkSize: number) => Promise<any[]>> {
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
private async getDataRecordsFunc(fields: any, modelService: InstanceWrapper<any>, modelMetadata: any, filters: any): Promise<(chunkIndex: number, chunkSize: number) => Promise<any[]>> {
|
|
215
|
+
//Load all possible fields for the model
|
|
216
|
+
const allModelFields = await this.modelMetadataHelperService.loadFieldHierarchy(
|
|
217
|
+
modelMetadata.singularName,
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
// Filter only the fields requested in the export payload
|
|
221
|
+
const modelFields = allModelFields.filter((f: any) =>
|
|
222
|
+
fields.includes(f.name),
|
|
223
|
+
);
|
|
217
224
|
|
|
218
225
|
//Get the model metadata of relation field with userKey details
|
|
219
226
|
const relatedModelsUserKeyMap = new Map<string, string>();
|
|
220
|
-
for (const field of
|
|
221
|
-
if (field.relationType && field.relationCoModelSingularName
|
|
227
|
+
for (const field of modelFields) {
|
|
228
|
+
if (field.relationType && field.relationCoModelSingularName) {
|
|
222
229
|
const relatedModelMetadata = await this.ModelMetadataRepo.findOne({
|
|
223
230
|
where: { singularName: field.relationCoModelSingularName },
|
|
224
231
|
relations: ['userKeyField'],
|
|
@@ -230,12 +237,24 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
230
237
|
}
|
|
231
238
|
}
|
|
232
239
|
|
|
240
|
+
// Build fieldName -> displayName map
|
|
241
|
+
const fieldNameToDisplayName = new Map<string, string>();
|
|
242
|
+
for (const field of modelFields || []) {
|
|
243
|
+
if (field.name) {
|
|
244
|
+
fieldNameToDisplayName.set(field.name, field.displayName ?? field.name);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
233
249
|
return async (chunkIndex: number, chunkSize: number) => {
|
|
234
250
|
const offset = chunkIndex * chunkSize;
|
|
235
251
|
const recordFilterDto: BasicFilterDto = {
|
|
236
252
|
limit: chunkSize,
|
|
237
253
|
offset,
|
|
238
|
-
|
|
254
|
+
//only contains relational fields (so TypeORM includes relations in the result).
|
|
255
|
+
populate: modelFields
|
|
256
|
+
.filter((f: any) => f.relationType !== null)
|
|
257
|
+
.map((f: any) => f.name),
|
|
239
258
|
};
|
|
240
259
|
const cleanedFilters = cleanNullsFromObject(filters);
|
|
241
260
|
|
|
@@ -243,43 +262,87 @@ export class ExportTransactionService extends CRUDService<ExportTransaction> {
|
|
|
243
262
|
recordFilterDto.filters = cleanedFilters;
|
|
244
263
|
}
|
|
245
264
|
|
|
246
|
-
//Get the non relation fields which are in fields array passed to this function
|
|
247
|
-
const nonRelationalFieldSet = new Set(
|
|
248
|
-
modelMetadata?.fields
|
|
249
|
-
.filter((field: { name: any; relationType: any; }) => fields.includes(field.name) && field.relationType === null)
|
|
250
|
-
.map((field: { name: any; }) => field.name)
|
|
251
|
-
);
|
|
252
265
|
const data = await modelService.instance.find(recordFilterDto);
|
|
253
266
|
const records = data.records ?? [];
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
} else if (relatedData && typeof relatedData === 'object') {
|
|
271
|
-
// For many-to-one or one-to-one
|
|
272
|
-
newRecord[relatedFieldName] = relatedData?.[userKeyFieldName] ?? null;
|
|
273
|
-
} else {
|
|
274
|
-
newRecord[relatedFieldName] = null;
|
|
267
|
+
const cleanedRecords = records.map((record: Record<string, any>) => {
|
|
268
|
+
const newRecord: Record<string, any> = {};
|
|
269
|
+
|
|
270
|
+
// Include non-relational fields
|
|
271
|
+
for (const field of modelFields) {
|
|
272
|
+
if (!field.relationType) {
|
|
273
|
+
// newRecord[field.name] = record[field.name];
|
|
274
|
+
const displayKey = fieldNameToDisplayName.get(field.name) ?? field.name;
|
|
275
|
+
const fieldMeta = modelFields.find(f => f.name === field.name);
|
|
276
|
+
|
|
277
|
+
if ((fieldMeta?.type === 'datetime' || fieldMeta?.type === 'date') && record[field.name]) {
|
|
278
|
+
newRecord[displayKey] = new Date(record[field.name]).toISOString();
|
|
279
|
+
} else {
|
|
280
|
+
newRecord[displayKey] = record[field.name];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
275
283
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
|
|
285
|
+
// Include userKey from each related field
|
|
286
|
+
for (const [relatedFieldName, userKeyFieldName] of relatedModelsUserKeyMap.entries()) {
|
|
287
|
+
const relatedData = record[relatedFieldName];
|
|
288
|
+
const displayKey = fieldNameToDisplayName.get(relatedFieldName) ?? relatedFieldName;
|
|
289
|
+
|
|
290
|
+
if (Array.isArray(relatedData)) {
|
|
291
|
+
// For many-to-many or one-to-many
|
|
292
|
+
const values = relatedData
|
|
293
|
+
.map(item => {
|
|
294
|
+
let val = item?.[userKeyFieldName];
|
|
295
|
+
const relatedFieldMeta = modelFields.find(f => f.name === relatedFieldName);
|
|
296
|
+
if ((relatedFieldMeta?.type === 'datetime' || relatedFieldMeta?.type === 'date') && val) {
|
|
297
|
+
val = new Date(val).toISOString();
|
|
298
|
+
}
|
|
299
|
+
return val;
|
|
300
|
+
})
|
|
301
|
+
.filter(Boolean);
|
|
302
|
+
newRecord[displayKey] = values.join(', ');
|
|
303
|
+
} else if (relatedData && typeof relatedData === 'object') {
|
|
304
|
+
// For many-to-one or one-to-one
|
|
305
|
+
newRecord[relatedFieldName] = relatedData?.[userKeyFieldName] ?? null;
|
|
306
|
+
} else {
|
|
307
|
+
newRecord[displayKey] = null;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Include userKey from each related field (with displayName)
|
|
312
|
+
for (const [relatedFieldName, userKeyFieldName] of relatedModelsUserKeyMap.entries()) {
|
|
313
|
+
const relatedData = record[relatedFieldName];
|
|
314
|
+
const displayKey = fieldNameToDisplayName.get(relatedFieldName) ?? relatedFieldName;
|
|
315
|
+
|
|
316
|
+
if (Array.isArray(relatedData)) {
|
|
317
|
+
// For many-to-many or one-to-many
|
|
318
|
+
const values = relatedData
|
|
319
|
+
.map(item => {
|
|
320
|
+
const val = item?.[userKeyFieldName];
|
|
321
|
+
// Convert datetime to ISO if needed
|
|
322
|
+
const relatedFieldMeta = modelFields.find(f => f.name === relatedFieldName);
|
|
323
|
+
if ((relatedFieldMeta?.type === 'datetime' || relatedFieldMeta?.type === 'date') && val) {
|
|
324
|
+
return new Date(val).toISOString();
|
|
325
|
+
}
|
|
326
|
+
return val;
|
|
327
|
+
})
|
|
328
|
+
.filter(Boolean);
|
|
329
|
+
newRecord[displayKey] = values.join(', ');
|
|
330
|
+
} else if (relatedData && typeof relatedData === 'object') {
|
|
331
|
+
let val = relatedData?.[userKeyFieldName] ?? null;
|
|
332
|
+
const relatedFieldMeta = modelFields.find(f => f.name === relatedFieldName);
|
|
333
|
+
if ((relatedFieldMeta?.type === 'datetime' || relatedFieldMeta?.type === 'date') && val) {
|
|
334
|
+
val = new Date(val).toISOString();
|
|
335
|
+
}
|
|
336
|
+
newRecord[displayKey] = val;
|
|
337
|
+
} else {
|
|
338
|
+
newRecord[displayKey] = null;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return newRecord;
|
|
342
|
+
});
|
|
343
|
+
return cleanedRecords
|
|
344
|
+
}
|
|
281
345
|
}
|
|
282
|
-
}
|
|
283
346
|
|
|
284
347
|
async toDto(data: Partial<CreateExportTransactionDto>): Promise<CreateExportTransactionDto> {
|
|
285
348
|
const dto = new CreateExportTransactionDto(data);
|
|
@@ -18,7 +18,7 @@ export class SolidCreateModuleMcpToolResponseHandler implements IMcpToolResponse
|
|
|
18
18
|
async apply(aiInteraction: AiInteraction) {
|
|
19
19
|
const aiResponse = JSON.parse(aiInteraction.message);
|
|
20
20
|
|
|
21
|
-
const moduleMetadata = aiResponse
|
|
21
|
+
const moduleMetadata = aiResponse?.data?.moduleMetadata ?? {};
|
|
22
22
|
|
|
23
23
|
// TODO: Validate if another module with same name exists, if it does then raise an error...
|
|
24
24
|
|
package/src/solid-core.module.ts
CHANGED
|
@@ -68,15 +68,12 @@ import { OTPAuthenticationController } from './controllers/otp-authentication.co
|
|
|
68
68
|
import { ServiceController } from './controllers/service.controller';
|
|
69
69
|
import { SmsTemplateController } from './controllers/sms-template.controller';
|
|
70
70
|
import { TestQueueController } from './controllers/test-queue.controller';
|
|
71
|
-
// import { UserController } from './controllers/user.controller';
|
|
72
71
|
import { EmailAttachment } from './entities/email-attachment.entity';
|
|
73
72
|
import { EmailTemplate } from './entities/email-template.entity';
|
|
74
73
|
import { MenuItemMetadata } from './entities/menu-item-metadata.entity';
|
|
75
74
|
import { MqMessageQueue } from './entities/mq-message-queue.entity';
|
|
76
75
|
import { MqMessage } from './entities/mq-message.entity';
|
|
77
76
|
import { SmsTemplate } from './entities/sms-template.entity';
|
|
78
|
-
import { UserPasswordHistory } from './entities/user-password-history.entity';
|
|
79
|
-
// import { User } from './entities/user.entity';
|
|
80
77
|
import { AccessTokenGuard } from './guards/access-token.guard';
|
|
81
78
|
import { AuthenticationGuard } from './guards/authentication.guard';
|
|
82
79
|
import { PermissionsGuard } from './guards/permissions.guard';
|
|
@@ -94,10 +91,6 @@ import { SmsQueuePublisher } from './jobs/sms-publisher.service';
|
|
|
94
91
|
import { SmsQueueSubscriber } from './jobs/sms-subscriber.service';
|
|
95
92
|
import { TestQueuePublisher } from './jobs/test-queue-publisher.service';
|
|
96
93
|
import { TestQueueSubscriber } from './jobs/test-queue-subscriber.service';
|
|
97
|
-
|
|
98
|
-
// import { ChatterQueuePublisher } from './jobs/chatter-queue-publisher.service';
|
|
99
|
-
// import { ChatterQueueSubscriber } from './jobs/chatter-queue-subscriber.service';
|
|
100
|
-
|
|
101
94
|
import { Msg91WhatsappQueuePublisher } from './jobs/msg91-whatsapp-publisher.service';
|
|
102
95
|
import { Msg91WhatsappQueueSubscriber } from './jobs/msg91-whatsapp-subscriber.service';
|
|
103
96
|
import { UserRegistrationListener } from './listeners/user-registration.listener';
|
|
@@ -317,7 +310,6 @@ import { SolidCoreErrorCodesProvider } from './helpers/solid-core-error-codes-pr
|
|
|
317
310
|
SmsTemplate,
|
|
318
311
|
EmailAttachment,
|
|
319
312
|
User,
|
|
320
|
-
UserPasswordHistory,
|
|
321
313
|
ViewMetadata,
|
|
322
314
|
ActionMetadata,
|
|
323
315
|
MenuItemMetadata,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CommonEntity } from 'src/entities/common.entity';
|
|
2
|
-
import { User } from 'src/entities/user.entity';
|
|
3
|
-
export declare class UserPasswordHistory extends CommonEntity {
|
|
4
|
-
passwordHash: string;
|
|
5
|
-
user: User;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=user-password-history.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-password-history.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user-password-history.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,qBACa,mBAAoB,SAAQ,YAAY;IAEjD,YAAY,EAAE,MAAM,CAAC;IAIrB,IAAI,EAAE,IAAI,CAAC;CAEd"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UserPasswordHistory = void 0;
|
|
13
|
-
const openapi = require("@nestjs/swagger");
|
|
14
|
-
const common_entity_1 = require("./common.entity");
|
|
15
|
-
const user_entity_1 = require("./user.entity");
|
|
16
|
-
const typeorm_1 = require("typeorm");
|
|
17
|
-
let UserPasswordHistory = class UserPasswordHistory extends common_entity_1.CommonEntity {
|
|
18
|
-
static _OPENAPI_METADATA_FACTORY() {
|
|
19
|
-
return { passwordHash: { required: true, type: () => String }, user: { required: true, type: () => require("./user.entity").User } };
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.UserPasswordHistory = UserPasswordHistory;
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)({ unique: true }),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], UserPasswordHistory.prototype, "passwordHash", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, typeorm_1.Index)(),
|
|
29
|
-
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "CASCADE" }),
|
|
30
|
-
__metadata("design:type", user_entity_1.User)
|
|
31
|
-
], UserPasswordHistory.prototype, "user", void 0);
|
|
32
|
-
exports.UserPasswordHistory = UserPasswordHistory = __decorate([
|
|
33
|
-
(0, typeorm_1.Entity)("ss_user_password_history")
|
|
34
|
-
], UserPasswordHistory);
|
|
35
|
-
//# sourceMappingURL=user-password-history.entity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-password-history.entity.js","sourceRoot":"","sources":["../../src/entities/user-password-history.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,+CAAgD;AAChD,qCAA2D;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;;;;CAQpD,CAAA;AARY,kDAAmB;AAE5B;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;yDACJ;AAIrB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BACzC,kBAAI;iDAAC;8BANF,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,0BAA0B,CAAC;GACtB,mBAAmB,CAQ/B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { User } from 'src/entities/user.entity';\nimport { Column, Entity, Index, ManyToOne } from 'typeorm';\n\n@Entity(\"ss_user_password_history\")\nexport class UserPasswordHistory extends CommonEntity {\n @Column({ unique: true })\n passwordHash: string;\n\n @Index()\n @ManyToOne(() => User, { onDelete: \"CASCADE\" })\n user: User;\n\n}"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CommonEntity } from 'src/entities/common.entity';
|
|
2
|
-
import { User } from 'src/entities/user.entity';
|
|
3
|
-
import { Column, Entity, Index, ManyToOne } from 'typeorm';
|
|
4
|
-
|
|
5
|
-
@Entity("ss_user_password_history")
|
|
6
|
-
export class UserPasswordHistory extends CommonEntity {
|
|
7
|
-
@Column({ unique: true })
|
|
8
|
-
passwordHash: string;
|
|
9
|
-
|
|
10
|
-
@Index()
|
|
11
|
-
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
|
12
|
-
user: User;
|
|
13
|
-
|
|
14
|
-
}
|