@solidstarters/solid-core 1.2.153 → 1.2.155
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/config/iam.config.d.ts +6 -0
- package/dist/config/iam.config.d.ts.map +1 -1
- package/dist/config/iam.config.js +3 -0
- package/dist/config/iam.config.js.map +1 -1
- package/dist/constants/error-messages.js +1 -1
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/controllers/ai-interaction.controller.d.ts +2 -1
- package/dist/controllers/ai-interaction.controller.d.ts.map +1 -1
- package/dist/controllers/ai-interaction.controller.js +5 -3
- package/dist/controllers/ai-interaction.controller.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +6 -6
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +15 -7
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/controllers/email-template.controller.d.ts.map +1 -1
- package/dist/controllers/email-template.controller.js +3 -0
- package/dist/controllers/email-template.controller.js.map +1 -1
- package/dist/controllers/google-authentication.controller.d.ts.map +1 -1
- package/dist/controllers/google-authentication.controller.js +3 -0
- package/dist/controllers/google-authentication.controller.js.map +1 -1
- package/dist/controllers/media.controller.d.ts.map +1 -1
- package/dist/controllers/media.controller.js +4 -0
- package/dist/controllers/media.controller.js.map +1 -1
- package/dist/controllers/model-metadata.controller.d.ts.map +1 -1
- package/dist/controllers/model-metadata.controller.js +5 -0
- package/dist/controllers/model-metadata.controller.js.map +1 -1
- package/dist/controllers/otp-authentication.controller.d.ts.map +1 -1
- package/dist/controllers/otp-authentication.controller.js +3 -0
- package/dist/controllers/otp-authentication.controller.js.map +1 -1
- package/dist/controllers/service.controller.d.ts.map +1 -1
- package/dist/controllers/service.controller.js +4 -0
- package/dist/controllers/service.controller.js.map +1 -1
- package/dist/controllers/sms-template.controller.d.ts +1 -1
- package/dist/controllers/sms-template.controller.d.ts.map +1 -1
- package/dist/controllers/sms-template.controller.js +6 -3
- package/dist/controllers/sms-template.controller.js.map +1 -1
- package/dist/decorators/solid-password.decorator.d.ts +12 -0
- package/dist/decorators/solid-password.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-password.decorator.js +43 -0
- package/dist/decorators/solid-password.decorator.js.map +1 -0
- package/dist/dtos/change-password.dto.d.ts.map +1 -1
- package/dist/dtos/change-password.dto.js +2 -0
- package/dist/dtos/change-password.dto.js.map +1 -1
- package/dist/dtos/confirm-forgot-password.dto.d.ts.map +1 -1
- package/dist/dtos/confirm-forgot-password.dto.js +2 -0
- package/dist/dtos/confirm-forgot-password.dto.js.map +1 -1
- package/dist/helpers/cors.helper.d.ts +4 -0
- package/dist/helpers/cors.helper.d.ts.map +1 -0
- package/dist/helpers/cors.helper.js +33 -0
- package/dist/helpers/cors.helper.js.map +1 -0
- package/dist/helpers/security.helper.d.ts +9 -0
- package/dist/helpers/security.helper.d.ts.map +1 -0
- package/dist/helpers/security.helper.js +46 -0
- package/dist/helpers/security.helper.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/repository/chatter-message-details.repository.d.ts +16 -0
- package/dist/repository/chatter-message-details.repository.d.ts.map +1 -0
- package/dist/repository/chatter-message-details.repository.js +62 -0
- package/dist/repository/chatter-message-details.repository.js.map +1 -0
- package/dist/repository/chatter-message.repository.d.ts +16 -0
- package/dist/repository/chatter-message.repository.d.ts.map +1 -0
- package/dist/repository/chatter-message.repository.js +61 -0
- package/dist/repository/chatter-message.repository.js.map +1 -0
- package/dist/repository/security-rule.repository.d.ts +1 -1
- package/dist/repository/security-rule.repository.d.ts.map +1 -1
- package/dist/repository/security-rule.repository.js +2 -2
- package/dist/repository/security-rule.repository.js.map +1 -1
- package/dist/repository/solid-base.repository.d.ts +6 -1
- package/dist/repository/solid-base.repository.d.ts.map +1 -1
- package/dist/repository/solid-base.repository.js +35 -0
- package/dist/repository/solid-base.repository.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +9 -0
- package/dist/services/ai-interaction.service.d.ts +2 -4
- package/dist/services/ai-interaction.service.d.ts.map +1 -1
- package/dist/services/ai-interaction.service.js +4 -8
- package/dist/services/ai-interaction.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +6 -2
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +94 -43
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message-details.service.d.ts +4 -3
- package/dist/services/chatter-message-details.service.d.ts.map +1 -1
- package/dist/services/chatter-message-details.service.js +2 -3
- package/dist/services/chatter-message-details.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +3 -2
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +2 -2
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +4 -1
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +4 -1
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/request-context.service.d.ts +3 -0
- package/dist/services/request-context.service.d.ts.map +1 -1
- package/dist/services/request-context.service.js +6 -0
- package/dist/services/request-context.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +23 -5
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/src/config/iam.config.ts +3 -0
- package/src/constants/error-messages.ts +1 -1
- package/src/controllers/ai-interaction.controller.ts +4 -2
- package/src/controllers/authentication.controller.ts +16 -10
- package/src/controllers/email-template.controller.ts +4 -1
- package/src/controllers/google-authentication.controller.ts +4 -0
- package/src/controllers/media.controller.ts +5 -1
- package/src/controllers/model-metadata.controller.ts +7 -2
- package/src/controllers/otp-authentication.controller.ts +4 -1
- package/src/controllers/service.controller.ts +5 -1
- package/src/controllers/sms-template.controller.ts +8 -7
- package/src/decorators/solid-password.decorator.ts +51 -0
- package/src/dtos/change-password.dto.ts +2 -0
- package/src/dtos/confirm-forgot-password.dto.ts +2 -0
- package/src/helpers/cors.helper.ts +34 -0
- package/src/helpers/security.helper.ts +53 -0
- package/src/index.ts +3 -0
- package/src/repository/chatter-message-details.repository.ts +109 -0
- package/src/repository/chatter-message.repository.ts +68 -0
- package/src/repository/security-rule.repository.ts +2 -2
- package/src/repository/solid-base.repository.ts +66 -0
- package/src/seeders/seed-data/email-templates/password-changed.handlebars.html +158 -0
- package/src/seeders/seed-data/solid-core-metadata.json +9 -0
- package/src/services/ai-interaction.service.ts +5 -5
- package/src/services/authentication.service.ts +181 -56
- package/src/services/chatter-message-details.service.ts +3 -2
- package/src/services/chatter-message.service.ts +3 -2
- package/src/services/crud.service.ts +7 -2
- package/src/services/model-metadata.service.ts +15 -1
- package/src/services/request-context.service.ts +9 -0
- package/src/solid-core.module.ts +29 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { camelize, classify } from "@angular-devkit/core/src/utils/strings";
|
|
2
|
+
import { Injectable } from "@nestjs/common";
|
|
3
|
+
import { ChatterMessage } from "src/entities/chatter-message.entity";
|
|
4
|
+
import { ActiveUserData } from "src/interfaces/active-user-data.interface";
|
|
5
|
+
import { RequestContextService } from "src/services/request-context.service";
|
|
6
|
+
import { DataSource, QueryRunner, SelectQueryBuilder } from "typeorm";
|
|
7
|
+
import { SecurityRuleRepository } from "./security-rule.repository";
|
|
8
|
+
import { SolidBaseRepository } from "./solid-base.repository";
|
|
9
|
+
import {get} from "lodash"
|
|
10
|
+
|
|
11
|
+
@Injectable()
|
|
12
|
+
export class ChatterMessageRepository extends SolidBaseRepository<ChatterMessage> {
|
|
13
|
+
constructor(
|
|
14
|
+
readonly dataSource: DataSource,
|
|
15
|
+
readonly requestContextService: RequestContextService,
|
|
16
|
+
readonly securityRuleRepository: SecurityRuleRepository,
|
|
17
|
+
) {
|
|
18
|
+
super(ChatterMessage, dataSource, requestContextService, securityRuleRepository);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private readonly CO_MODEL_NAME_PATH = 'filters.coModelName.$eq';
|
|
22
|
+
override createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<ChatterMessage> {
|
|
23
|
+
const activeUserOrUndefined = this.requestContextService.getActiveUser();
|
|
24
|
+
let qb = super.createQueryBuilder(alias, queryRunner);
|
|
25
|
+
if (!activeUserOrUndefined) return qb;
|
|
26
|
+
|
|
27
|
+
//Left join on the associated chatter model entity
|
|
28
|
+
const [coModelName, coModelAlias] = this.getCoModelNameAndAlias();
|
|
29
|
+
qb = this.leftJoinCoModel(qb, coModelName);
|
|
30
|
+
|
|
31
|
+
return this.securityRuleRepository.applySecurityRules(
|
|
32
|
+
qb,
|
|
33
|
+
coModelName,
|
|
34
|
+
activeUserOrUndefined as ActiveUserData,
|
|
35
|
+
coModelAlias
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private leftJoinCoModel<ChatterMessage>(
|
|
40
|
+
qb: SelectQueryBuilder<ChatterMessage>,
|
|
41
|
+
coModelName: string
|
|
42
|
+
) {
|
|
43
|
+
// const Target = resolveEntityFromCoModelName(coModelName); // your mapping
|
|
44
|
+
const entityName = classify(coModelName)
|
|
45
|
+
const meta = this.dataSource.getMetadata(entityName);
|
|
46
|
+
const alias = camelize(meta.name);
|
|
47
|
+
qb.leftJoin(
|
|
48
|
+
entityName,
|
|
49
|
+
alias,
|
|
50
|
+
// `${alias}.id = entity.co_model_entity_id`,
|
|
51
|
+
`${alias}.id = entity.co_model_entity_id AND entity.co_model_name = :model`,
|
|
52
|
+
{ model: coModelName }
|
|
53
|
+
);
|
|
54
|
+
return qb;
|
|
55
|
+
// return qb.leftJoin(Target, alias, `${alias}.id = entity.co_model_entity_id`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// This uses the requestContextService.getRequestFilter method and extracts the coModelName and creates the alias and returns the name and alias tuple
|
|
59
|
+
private getCoModelNameAndAlias() {
|
|
60
|
+
const requestFilter = this.requestContextService.getRequestFilter();
|
|
61
|
+
if (!requestFilter) return [undefined, undefined];
|
|
62
|
+
|
|
63
|
+
const coModelName = get(requestFilter, this.CO_MODEL_NAME_PATH);
|
|
64
|
+
const alias = camelize(coModelName);
|
|
65
|
+
return [coModelName, alias];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
@@ -22,7 +22,7 @@ export class SecurityRuleRepository extends Repository<SecurityRule> {
|
|
|
22
22
|
super(SecurityRule, dataSource.createEntityManager());
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
applySecurityRules<T extends CommonEntity>(qb: SelectQueryBuilder<T>, modelSingularName: string, activeUser: ActiveUserData,): SelectQueryBuilder<T> {
|
|
25
|
+
applySecurityRules<T extends CommonEntity>(qb: SelectQueryBuilder<T>, modelSingularName: string, activeUser: ActiveUserData, securityRuleAlias: string = qb.alias): SelectQueryBuilder<T> {
|
|
26
26
|
// Fetch the security rules for the model and roles
|
|
27
27
|
const securityRules = this.solidRegistry.getSecurityRules(modelSingularName, activeUser.roles);
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ export class SecurityRuleRepository extends Repository<SecurityRule> {
|
|
|
32
32
|
// Parse the security rule and call the buildFilter method to build the query from the security rule
|
|
33
33
|
const parsedRule = JSON.parse(this.resolveSecurityRuleConfig(rule.securityRuleConfig, activeUser)) as SecurityRuleConfig;
|
|
34
34
|
if (parsedRule && parsedRule.filters) {
|
|
35
|
-
this.crudHelperService.buildFilterQuery(qb, parsedRule,
|
|
35
|
+
this.crudHelperService.buildFilterQuery(qb, parsedRule, securityRuleAlias);
|
|
36
36
|
}
|
|
37
37
|
} catch (error) {
|
|
38
38
|
this.logger.warn(`Error parsing security rule: ${rule.securityRuleConfig}`, error);
|
|
@@ -5,7 +5,11 @@ import { ActiveUserData } from 'src/interfaces/active-user-data.interface';
|
|
|
5
5
|
import { RequestContextService } from 'src/services/request-context.service';
|
|
6
6
|
import {
|
|
7
7
|
DataSource,
|
|
8
|
+
EntityNotFoundError,
|
|
8
9
|
EntityTarget,
|
|
10
|
+
FindManyOptions,
|
|
11
|
+
FindOneOptions,
|
|
12
|
+
FindOptionsWhere,
|
|
9
13
|
QueryRunner,
|
|
10
14
|
Repository,
|
|
11
15
|
SelectQueryBuilder
|
|
@@ -41,5 +45,67 @@ export class SolidBaseRepository<T extends CommonEntity> extends Repository<T> {
|
|
|
41
45
|
);
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Security-aware findOne: applies FindOneOptions via FindOptionsUtils,
|
|
50
|
+
* but builds from our security-wrapped QueryBuilder.
|
|
51
|
+
*/
|
|
52
|
+
override async findOne(options?: FindOneOptions<T>): Promise<T | null> {
|
|
53
|
+
const alias = this.modelSingularName();
|
|
54
|
+
const qb = this.createQueryBuilder(alias);
|
|
44
55
|
|
|
56
|
+
if (options) {
|
|
57
|
+
// Apply all standard find options (relations, selects, order, where, etc.)
|
|
58
|
+
if (options) qb.setFindOptions(options); // <- applies where, relations, select, order, etc.
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return qb.getOne();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Convenience: route findOneBy through the same path so rules apply.
|
|
66
|
+
*/
|
|
67
|
+
override async findOneBy(where: FindOptionsWhere<T> | FindOptionsWhere<T>[]): Promise<T | null> {
|
|
68
|
+
return this.findOne({ where });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Optional: an OrFail that still honors security rules.
|
|
73
|
+
*/
|
|
74
|
+
override async findOneOrFail(options?: FindOneOptions<T>): Promise<T> {
|
|
75
|
+
const entity = await this.findOne(options);
|
|
76
|
+
if (!entity) {
|
|
77
|
+
throw new EntityNotFoundError(this.metadata.target, options?.where ?? {});
|
|
78
|
+
}
|
|
79
|
+
return entity;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Security-aware find(): builds from our secured QB and preserves all FindManyOptions
|
|
84
|
+
* (where, relations, select, order, take/skip, withDeleted, etc.).
|
|
85
|
+
*/
|
|
86
|
+
override async find(options?: FindManyOptions<T>): Promise<T[]> {
|
|
87
|
+
const alias = this.modelSingularName();
|
|
88
|
+
const qb = this.createQueryBuilder(alias);
|
|
89
|
+
|
|
90
|
+
if (options) {
|
|
91
|
+
qb.setFindOptions(options);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return qb.getMany();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* (Optional) Security-aware findAndCount(): same as find(), plus a total count.
|
|
99
|
+
* Mirrors Repository.findAndCount semantics.
|
|
100
|
+
*/
|
|
101
|
+
override async findAndCount(options?: FindManyOptions<T>): Promise<[T[], number]> {
|
|
102
|
+
const alias = this.modelSingularName();
|
|
103
|
+
const qb = this.createQueryBuilder(alias);
|
|
104
|
+
|
|
105
|
+
if (options) {
|
|
106
|
+
qb.setFindOptions(options);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return qb.getManyAndCount();
|
|
110
|
+
}
|
|
45
111
|
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<title>Welcome Email</title>
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
@import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
background-color: #f4f4f7;
|
|
16
|
+
font-family: "Nunito Sans", Helvetica, Arial, sans-serif;
|
|
17
|
+
color: #333;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.email-wrapper {
|
|
21
|
+
max-width: 600px;
|
|
22
|
+
margin: 0 auto;
|
|
23
|
+
padding: 20px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.logo {
|
|
27
|
+
text-align: center;
|
|
28
|
+
margin-bottom: 20px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.logo img {
|
|
32
|
+
height: 50px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.content-box {
|
|
36
|
+
background-color: #ffffff;
|
|
37
|
+
padding: 40px;
|
|
38
|
+
border-radius: 8px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.title {
|
|
42
|
+
font-size: 22px;
|
|
43
|
+
margin-bottom: 10px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.intro {
|
|
47
|
+
font-size: 16px;
|
|
48
|
+
line-height: 1.6;
|
|
49
|
+
margin: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.credentials {
|
|
53
|
+
background-color: #f9f9f9;
|
|
54
|
+
padding: 15px;
|
|
55
|
+
border-radius: 5px;
|
|
56
|
+
margin-top: 20px;
|
|
57
|
+
margin-bottom: 30px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.credentials p {
|
|
61
|
+
margin: 0 0 10px;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.button-container {
|
|
66
|
+
text-align: center;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.button {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
padding: 12px 24px;
|
|
73
|
+
background-color: #722ED1;
|
|
74
|
+
color: #ffffff;
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
font-weight: bold;
|
|
77
|
+
border-radius: 5px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.footer-text {
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
line-height: 1.6;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.footer {
|
|
86
|
+
text-align: center;
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
color: #6b6e76;
|
|
89
|
+
margin-top: 40px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media only screen and (max-width: 600px) {
|
|
93
|
+
.email-wrapper {
|
|
94
|
+
width: 100% !important;
|
|
95
|
+
padding: 20px 0 !important;
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.content-box {
|
|
100
|
+
padding: 20px !important;
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.title {
|
|
105
|
+
font-size: 18px !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.button {
|
|
109
|
+
/* width: 100% !important; */
|
|
110
|
+
padding: 10px !important;
|
|
111
|
+
font-size: 14px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
115
|
+
</head>
|
|
116
|
+
|
|
117
|
+
<body>
|
|
118
|
+
<div class="email-wrapper">
|
|
119
|
+
{{#if companyLogoUrl}}
|
|
120
|
+
<div class="logo">
|
|
121
|
+
<img src="{{companyLogoUrl}}" alt="Company Logo" />
|
|
122
|
+
</div>
|
|
123
|
+
{{/if}}
|
|
124
|
+
|
|
125
|
+
<div class="content-box">
|
|
126
|
+
<h2 class="title">Hi {{ fullName }},</h2>
|
|
127
|
+
<p class="intro">
|
|
128
|
+
Your password for <strong>{{ solidAppName }}</strong> has been successfully reset.
|
|
129
|
+
</p>
|
|
130
|
+
<p class="intro" style="margin-top: 10px;">
|
|
131
|
+
If you made this change, no further action is required.
|
|
132
|
+
If you did <em>not</em> change your password, please reset it immediately or contact our support team.
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
<div class="credentials">
|
|
136
|
+
<p><strong>Email:</strong> {{ email }}</p>
|
|
137
|
+
<!-- <p><strong>Temporary Password:</strong> {{ password }}</p> -->
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<!-- <div class="button-container">
|
|
141
|
+
<a href="{{ frontendLoginPageUrl }}" class="button" target="_blank">
|
|
142
|
+
Login to Your Account
|
|
143
|
+
</a>
|
|
144
|
+
</div> -->
|
|
145
|
+
<p class="intro">
|
|
146
|
+
Regards,
|
|
147
|
+
<br/ >
|
|
148
|
+
The {{ solidAppName }} Team.
|
|
149
|
+
</p>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<div class="footer">
|
|
153
|
+
© 2025 <a href="{{ solidAppWebsiteUrl }}" target="_blank">{{ solidAppName }}</a>. All rights reserved.
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</body>
|
|
157
|
+
|
|
158
|
+
</html>
|
|
@@ -12318,6 +12318,15 @@
|
|
|
12318
12318
|
"description": "This template is used to send the verification token required by users to reset their password.",
|
|
12319
12319
|
"active": true,
|
|
12320
12320
|
"type": "text"
|
|
12321
|
+
},
|
|
12322
|
+
{
|
|
12323
|
+
"name": "password-changed",
|
|
12324
|
+
"displayName": "Default: Password Changed",
|
|
12325
|
+
"body": "password-changed.handlebars.html",
|
|
12326
|
+
"subject": "Your {{solidAppName}} Password Has Been Updated",
|
|
12327
|
+
"description": "This template notifies users that their account password was successfully changed.",
|
|
12328
|
+
"active": true,
|
|
12329
|
+
"type": "text"
|
|
12321
12330
|
}
|
|
12322
12331
|
],
|
|
12323
12332
|
"smsTemplates": [
|
|
@@ -36,19 +36,19 @@ export class AiInteractionService extends CRUDService<AiInteraction> {
|
|
|
36
36
|
readonly repo: Repository<AiInteraction>,
|
|
37
37
|
readonly moduleRef: ModuleRef,
|
|
38
38
|
readonly publisherFactory: PublisherFactory<TriggerMcpClientOptions>,
|
|
39
|
-
readonly requestContextService: RequestContextService,
|
|
39
|
+
// readonly requestContextService: RequestContextService,
|
|
40
40
|
readonly mcpToolResponseHandlerFactory: McpToolResponseHandlerFactory,
|
|
41
41
|
|
|
42
42
|
) {
|
|
43
43
|
super(modelMetadataService, moduleMetadataService, configService, fileService, discoveryService, crudHelperService, entityManager, repo, 'aiInteraction', 'solid-core', moduleRef);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async triggerMcpClientJob(prompt: string, isAutoApply: boolean = false, threadId: string = null): Promise<any> {
|
|
47
|
-
const activeUser: ActiveUserData = this.requestContextService.getActiveUser();
|
|
46
|
+
async triggerMcpClientJob(prompt: string, userId: number, isAutoApply: boolean = false, threadId: string = null): Promise<any> {
|
|
47
|
+
// const activeUser: ActiveUserData = this.requestContextService.getActiveUser();
|
|
48
48
|
|
|
49
49
|
const aiInteraction = await this.create({
|
|
50
|
-
userId:
|
|
51
|
-
threadId: threadId ? threadId : `thread-${
|
|
50
|
+
userId: userId,
|
|
51
|
+
threadId: threadId ? threadId : `thread-${userId}`,
|
|
52
52
|
role: 'human',
|
|
53
53
|
message: prompt,
|
|
54
54
|
contentType: '',
|