@solidstarters/solid-core 1.2.143 → 1.2.145
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/common.config.d.ts +2 -0
- package/dist/config/common.config.d.ts.map +1 -1
- package/dist/config/common.config.js +3 -2
- package/dist/config/common.config.js.map +1 -1
- package/dist/constants/error-messages.d.ts +83 -0
- package/dist/constants/error-messages.d.ts.map +1 -0
- package/dist/constants/error-messages.js +86 -0
- package/dist/constants/error-messages.js.map +1 -0
- package/dist/constants/success-messages.d.ts +11 -0
- package/dist/constants/success-messages.d.ts.map +1 -0
- package/dist/constants/success-messages.js +14 -0
- package/dist/constants/success-messages.js.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/jobs/api-email-subscriber.service.d.ts +1 -1
- package/dist/jobs/api-email-subscriber.service.d.ts.map +1 -1
- package/dist/jobs/api-email-subscriber.service.js +2 -2
- package/dist/jobs/api-email-subscriber.service.js.map +1 -1
- package/dist/jobs/database/api-email-subscriber-database.service.d.ts +1 -1
- package/dist/jobs/database/api-email-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/api-email-subscriber-database.service.js +2 -2
- package/dist/jobs/database/api-email-subscriber-database.service.js.map +1 -1
- package/dist/jobs/database/email-subscriber-database.service.d.ts +1 -1
- package/dist/jobs/database/email-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/email-subscriber-database.service.js +2 -2
- package/dist/jobs/database/email-subscriber-database.service.js.map +1 -1
- package/dist/jobs/email-subscriber.service.d.ts +1 -1
- package/dist/jobs/email-subscriber.service.d.ts.map +1 -1
- package/dist/jobs/email-subscriber.service.js +2 -2
- package/dist/jobs/email-subscriber.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +12 -12
- package/dist/services/ai-interaction.service.d.ts.map +1 -1
- package/dist/services/ai-interaction.service.js +4 -3
- package/dist/services/ai-interaction.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +1 -1
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +68 -66
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +3 -2
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +23 -21
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/csv.service.d.ts.map +1 -1
- package/dist/services/csv.service.js +3 -2
- package/dist/services/csv.service.js.map +1 -1
- package/dist/services/excel.service.d.ts.map +1 -1
- package/dist/services/excel.service.js +3 -2
- package/dist/services/excel.service.js.map +1 -1
- package/dist/services/export-transaction.service.d.ts.map +1 -1
- package/dist/services/export-transaction.service.js +2 -1
- package/dist/services/export-transaction.service.js.map +1 -1
- package/dist/services/field-metadata.service.d.ts.map +1 -1
- package/dist/services/field-metadata.service.js +9 -8
- package/dist/services/field-metadata.service.js.map +1 -1
- package/dist/services/file.service.d.ts.map +1 -1
- package/dist/services/file.service.js +5 -4
- package/dist/services/file.service.js.map +1 -1
- package/dist/services/import-transaction.service.d.ts.map +1 -1
- package/dist/services/import-transaction.service.js +11 -9
- package/dist/services/import-transaction.service.js.map +1 -1
- package/dist/services/mail/{ElasticEmailService.d.ts → elastic-email.service.d.ts} +1 -1
- package/dist/services/mail/elastic-email.service.d.ts.map +1 -0
- package/dist/services/mail/{ElasticEmailService.js → elastic-email.service.js} +1 -1
- package/dist/services/mail/elastic-email.service.js.map +1 -0
- package/dist/services/mail/{SMTPEmailService.d.ts → smtp-email.service.d.ts} +3 -3
- package/dist/services/mail/smtp-email.service.d.ts.map +1 -0
- package/dist/services/mail/{SMTPEmailService.js → smtp-email.service.js} +8 -6
- package/dist/services/mail/smtp-email.service.js.map +1 -0
- package/dist/services/media-storage-provider-metadata.service.d.ts.map +1 -1
- package/dist/services/media-storage-provider-metadata.service.js +4 -3
- package/dist/services/media-storage-provider-metadata.service.js.map +1 -1
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +2 -1
- package/dist/services/media.service.js.map +1 -1
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +11 -10
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/module-metadata.service.d.ts.map +1 -1
- package/dist/services/module-metadata.service.js +11 -10
- package/dist/services/module-metadata.service.js.map +1 -1
- package/dist/services/role-metadata.service.d.ts.map +1 -1
- package/dist/services/role-metadata.service.js +3 -2
- package/dist/services/role-metadata.service.js.map +1 -1
- package/dist/services/sql-expression-resolver.service.d.ts.map +1 -1
- package/dist/services/sql-expression-resolver.service.js +2 -1
- package/dist/services/sql-expression-resolver.service.js.map +1 -1
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/services/user.service.js +11 -10
- package/dist/services/user.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +9 -7
- package/dist/solid-core.module.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/config/common.config.ts +3 -2
- package/src/constants/error-messages.ts +123 -0
- package/src/constants/success-messages.ts +13 -0
- package/src/index.ts +10 -4
- package/src/interfaces.ts +3 -3
- package/src/jobs/api-email-subscriber.service.ts +1 -1
- package/src/jobs/database/api-email-subscriber-database.service.ts +1 -1
- package/src/jobs/database/email-subscriber-database.service.ts +1 -1
- package/src/jobs/email-subscriber.service.ts +1 -1
- package/src/seeders/seed-data/solid-core-metadata.json +12 -12
- package/src/services/ai-interaction.service.ts +4 -3
- package/src/services/authentication.service.ts +67 -65
- package/src/services/crud-helper.service.ts +3 -2
- package/src/services/crud.service.ts +23 -23
- package/src/services/csv.service.ts +3 -2
- package/src/services/excel.service.ts +3 -2
- package/src/services/export-transaction.service.ts +2 -1
- package/src/services/field-metadata.service.ts +9 -8
- package/src/services/file.service.ts +5 -4
- package/src/services/import-transaction.service.ts +11 -9
- package/src/services/mail/{SMTPEmailService.ts → smtp-email.service.ts} +7 -5
- package/src/services/media-storage-provider-metadata.service.ts +4 -3
- package/src/services/media.service.ts +2 -1
- package/src/services/model-metadata.service.ts +11 -10
- package/src/services/module-metadata.service.ts +11 -10
- package/src/services/role-metadata.service.ts +3 -2
- package/src/services/sql-expression-resolver.service.ts +2 -1
- package/src/services/user.service.ts +11 -10
- package/src/solid-core.module.ts +5 -3
- package/dist/services/mail/ElasticEmailService.d.ts.map +0 -1
- package/dist/services/mail/ElasticEmailService.js.map +0 -1
- package/dist/services/mail/SMTPEmailService.d.ts.map +0 -1
- package/dist/services/mail/SMTPEmailService.js.map +0 -1
- /package/src/services/mail/{ElasticEmailService.ts → elastic-email.service.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.145",
|
|
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",
|
|
@@ -13,10 +13,11 @@ export default registerAs('common', () => {
|
|
|
13
13
|
port: +(process.env.COMMON_SMTP_EMAIL_SMTP_PORT ?? 587),
|
|
14
14
|
username: process.env.COMMON_SMTP_EMAIL_USERNAME,
|
|
15
15
|
password: process.env.COMMON_SMTP_EMAIL_PASSWORD,
|
|
16
|
-
from: process.env.COMMON_SMTP_EMAIL_FROM,
|
|
16
|
+
from: process.env.COMMON_SMTP_EMAIL_FROM ?? process.env.COMMON_EMAIL_FROM,
|
|
17
17
|
},
|
|
18
18
|
apiMail: {
|
|
19
|
-
key: process.env.COMMON_API_EMAIL_KEY
|
|
19
|
+
key: process.env.COMMON_API_EMAIL_KEY,
|
|
20
|
+
from: process.env.COMMON_EMAIL_FROM
|
|
20
21
|
},
|
|
21
22
|
msg91Sms: {
|
|
22
23
|
url: process.env.COMMON_MSG91_SMS_URL,
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// backend/common/constants/error-messages.ts
|
|
2
|
+
|
|
3
|
+
export const ERROR_MESSAGES = {
|
|
4
|
+
//authentication errors
|
|
5
|
+
USER_NOT_FOUND: 'User does not exist.',
|
|
6
|
+
USER_NOT_ACTIVE: 'User profile is not activated.',
|
|
7
|
+
USER_INACTIVE: 'User is inactive.',
|
|
8
|
+
PASSWORD_INCORRECT: 'Password does not match.',
|
|
9
|
+
PUBLIC_REGISTRATION_DISABLED: 'Public registrations are disabled.',
|
|
10
|
+
UNIQUE_CONSTRAINT_VIOLATION: 'A unique constraint violation occurred.',
|
|
11
|
+
PASSWORDLESS_REGISTRATION_DISABLED: 'Passwordless registration is not enabled.',
|
|
12
|
+
REGISTRATION_REQUIRES_CONTACT: 'Either mobile or email is required for initiating registration.',
|
|
13
|
+
EMAIL_REQUIRED_FOR_VALIDATION: 'Email is required for email validation source.',
|
|
14
|
+
MOBILE_REQUIRED_FOR_VALIDATION: 'Mobile is required for mobile validation source.',
|
|
15
|
+
USER_ALREADY_EXISTS: 'User already exists. Please sign in.',
|
|
16
|
+
VALIDATION_SOURCE_REQUIRED: 'At least one validation source is required.',
|
|
17
|
+
INVALID_OTP: 'Invalid OTP.',
|
|
18
|
+
OTP_EXPIRED: 'OTP has expired.',
|
|
19
|
+
INVALID_VERIFICATION_TYPE: 'Invalid type. Must be either email or mobile.',
|
|
20
|
+
NON_LOCAL_PROVIDER: 'User seems to have used a passwordless mode to authenticate.',
|
|
21
|
+
USER_ID_MISMATCH: "User ID's do not match.",
|
|
22
|
+
USERNAME_MISMATCH: "User username's do not match.",
|
|
23
|
+
INCORRECT_CURRENT_PASSWORD: 'Incorrect current password specified.',
|
|
24
|
+
PASSWORD_REUSED: 'This password was previously used, please use a different password.',
|
|
25
|
+
INVALID_VERIFICATION_TOKEN: 'Invalid verification token',
|
|
26
|
+
ACCESS_DENIED: 'Access denied',
|
|
27
|
+
INVALID_USER_PROFILE: 'Invalid user profile',
|
|
28
|
+
GOOGLE_OAUTH_PROFILE_FETCH_FAILED: 'Failed to fetch user profile from Google OAuth service',
|
|
29
|
+
LOGOUT_FAILED: 'Logout failed due to an unexpected error.',
|
|
30
|
+
|
|
31
|
+
INVALID_CREDENTIALS: 'Invalid username or password specified.',
|
|
32
|
+
LOGIN_FAILED: 'Login Failed',
|
|
33
|
+
OLD_PASSWORD_INCORRECT: 'You have specified an incorrect old password.',
|
|
34
|
+
INVALID_NEW_PASSWORD: 'Invalid new password.',
|
|
35
|
+
PASSWORDS_DO_NOT_MATCH: 'New passwords are not matching.',
|
|
36
|
+
|
|
37
|
+
// user management errors
|
|
38
|
+
DELETE_SELF_NOT_ALLOWED: 'Deleting logged-in user is not allowed.',
|
|
39
|
+
DELETE_IDS_REQUIRED: 'At least one ID is required for deletion.',
|
|
40
|
+
USER_MISSING_ID: 'User must exist before initializing roles.',
|
|
41
|
+
ROLES_NOT_FOUND: (roles: string[]) => `The following roles were not found: ${roles.join(', ')}`,
|
|
42
|
+
USER_NOT_FOUND_BY_USERNAME: (username: string) => `User with username '${username}' not found.`,
|
|
43
|
+
ROLE_NOT_FOUND: (roleName: string) => `Role '${roleName}' not found.`,
|
|
44
|
+
PERMISSION_NOT_EXIST: (permission: string) => `Permission '${permission}' does not exist.`,
|
|
45
|
+
|
|
46
|
+
// session errors
|
|
47
|
+
SESSION_INVALID: 'Your session is no longer valid. Please log in again.',
|
|
48
|
+
SESSION_EXPIRED: 'Your session has expired. Please log in again.',
|
|
49
|
+
|
|
50
|
+
// filter errors
|
|
51
|
+
GROUP_BY_LIMIT: 'buildFilterQuery: Only 1 Group by field is supported currently.',
|
|
52
|
+
INVALID_GROUP_BY_COUNT: 'Exactly one groupBy field is required to count grouped records.',
|
|
53
|
+
|
|
54
|
+
// general errors
|
|
55
|
+
FORBIDDEN: 'Forbidden',
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// database errors
|
|
59
|
+
DUPLICATE_ENTRY: 'Duplicate entry. A record with similar unique fields already exists.',
|
|
60
|
+
|
|
61
|
+
// validation errors
|
|
62
|
+
ID_REQUIRED_FOR_UPDATE: 'Id is required for update.',
|
|
63
|
+
ID_REQUIRED_FOR_DELETE: 'Id is required for deletion.',
|
|
64
|
+
|
|
65
|
+
// CRUD service errors
|
|
66
|
+
RELATION_TYPE_NOT_SUPPORTED: 'Relation type not supported in CRUD service.',
|
|
67
|
+
NO_SOFT_DELETED_RECORD_FOUND: 'No soft-deleted record found with the given ID.',
|
|
68
|
+
CONFLICTING_RECORD_ON_UNARCHIVE: 'Another record is conflicting with the record you are attempting to Un-Archive, either delete or change the other record so as to avoid this conflict.',
|
|
69
|
+
NO_SOFT_DELETED_RECORDS_FOUND: 'No matching soft-deleted records found.',
|
|
70
|
+
EMPTY_PATH_PARTS: 'Path parts cannot be empty',
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// CSV/Excel service errors
|
|
74
|
+
MISSING_HEADERS_OR_FUNCTION: 'Either headers or data records function must be provided.',
|
|
75
|
+
INVALID_CHUNK_SIZE: 'Chunk size must be greater than 0 when data records function is provided.',
|
|
76
|
+
INVALID_FORMAT: (format: string) => `Invalid ${format} format`,
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
//field errors
|
|
80
|
+
INVALID_INVERSE_FIELD_TYPE: 'Only relation fields can have inverse fields.',
|
|
81
|
+
MODEL_AND_MODULE_REQUIRED_TO_UPDATE_INVERSE_FIELD: 'Model and module are required to update inverse field.',
|
|
82
|
+
MODEL_NAME_AND_MODULE_NAME_REQUIRED_TO_CREATE_INVERSE_FIELD: 'Model name and module name are required to create inverse field.',
|
|
83
|
+
FIELD_NOT_FOUND: (id: number | string) => `No field with id #${id} exists`,
|
|
84
|
+
PROVIDER_NOT_FOUND: (provider: string) => `Field incorrectly configured. No provider with name ${provider} registered in backend.`,
|
|
85
|
+
FILE_WRITE_FAILED: 'File creation failed, rolling back transaction',
|
|
86
|
+
|
|
87
|
+
// file service errors
|
|
88
|
+
FILE_NOT_FOUND: 'File not found',
|
|
89
|
+
FILE_COPY_ERROR: 'Error copying file',
|
|
90
|
+
S3_CLIENT_NOT_INITIALIZED: 'S3 Client not initialized. Please check the S3 configuration.',
|
|
91
|
+
|
|
92
|
+
// model errors
|
|
93
|
+
MODEL_METADATA_NOT_FOUND: (id: string | number) => `Model metadata with ID ${id} not found.`,
|
|
94
|
+
MODEL_SERVICE_NOT_FOUND: (model: string) => `Model service for ${model} not found.`,
|
|
95
|
+
RELATION_CO_MODEL_NOT_DEFINED_FOR_FIELD: (fieldName: string) => `Relation coModelSingularName is not defined for relation field ${fieldName}`,
|
|
96
|
+
MODEL_NOT_FOUND: (singularName?: string) => `Model${singularName ? ` with singular name "${singularName}"` : ''} not found.`,
|
|
97
|
+
MODEL_REQUIRED_FOR_CODE_GENERATION: 'Model ID or Model Name is required for generating code.',
|
|
98
|
+
|
|
99
|
+
//module errors
|
|
100
|
+
MODULE_NOT_FOUND: (moduleName: string) => `Module with name ${moduleName} not found.`,
|
|
101
|
+
MODULE_ID_NOT_FOUND: (id: string | number) => `Module with ID ${id} not found.`,
|
|
102
|
+
|
|
103
|
+
//entity errors
|
|
104
|
+
ENTITY_NOT_FOUND: (entity?: string | number) => `Entity${entity ? ' ' + entity : ''} not found.`,
|
|
105
|
+
ENTITY_NAME_REQUIRED: 'Entity name is required to find the entity.',
|
|
106
|
+
ENTITY_ID_REQUIRED: 'Entity ID is required to find the entity.',
|
|
107
|
+
|
|
108
|
+
// import errors
|
|
109
|
+
NO_ERROR_LOG_FOR_IMPORT: (id: string | number) => `No error log entries found for import transaction ID ${id}.`,
|
|
110
|
+
FILE_READ_FAILED_FROM_URL: (url: string) => `Failed to read file from URL: ${url}`,
|
|
111
|
+
|
|
112
|
+
// media storage provider errors
|
|
113
|
+
MEDIA_STORAGE_PROVIDER_ID_NOT_FOUND: (id: number | string) => `Media Storage Provider with #${id} not found.`,
|
|
114
|
+
MEDIA_STORAGE_PROVIDER_NOT_FOUND: 'Media Storage Provider not found',
|
|
115
|
+
|
|
116
|
+
// SQL errors
|
|
117
|
+
UNSUPPORTED_SQL_OPERATOR: (operator: string) => `Unsupported SQL operator: ${operator}`,
|
|
118
|
+
|
|
119
|
+
// AI interaction errors
|
|
120
|
+
PYTHON_EXECUTABLE_NOT_CONFIGURED: 'SolidX AI MCP python executable or client path not configured.',
|
|
121
|
+
UNABLE_TO_RESOLVE_SOLID_COMMAND: 'Unable to resolve a solid_ command that was used to come up with this response.',
|
|
122
|
+
UNABLE_TO_RESOLVE_MCP_HANDLER: 'Unable to resolve a mcp tool handler.',
|
|
123
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const SUCCESS_MESSAGES = {
|
|
2
|
+
OTP_SENT_SUCCESS_REGISTRATION: 'User registration initiated. OTP sent to the user.',
|
|
3
|
+
OTP_SENT_SUCCESS_LOGIN: 'User login initiated. OTP sent to the user.',
|
|
4
|
+
FORGOT_PASSWORD_TOKEN_SENT: 'Forgot password - token generated and sent.',
|
|
5
|
+
FORGOT_PASSWORD_CONFIRMED: 'Forgot password confirmed.',
|
|
6
|
+
LOGOUT_SUCCESS: 'Logged out successfully',
|
|
7
|
+
USER_REGISTERED: 'User registered successfully.',
|
|
8
|
+
|
|
9
|
+
// CRUD service messages
|
|
10
|
+
RECORD_RECOVERED: 'Record successfully recovered',
|
|
11
|
+
SELECTED_RECORDS_RECOVERED: 'Selected records successfully recovered',
|
|
12
|
+
|
|
13
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './commands/remove-fields.command'
|
|
|
5
5
|
export * from './commands/seed.command'
|
|
6
6
|
|
|
7
7
|
export * from './config/app-builder.config'
|
|
8
|
-
export
|
|
8
|
+
export {default as commonConfig} from './config/common.config'
|
|
9
9
|
export * from './config/iam.config'
|
|
10
10
|
export * from './config/cache.options'
|
|
11
11
|
|
|
@@ -216,8 +216,8 @@ export * from './services/field-metadata.service'
|
|
|
216
216
|
export * from './services/file.service'
|
|
217
217
|
export * from './services/hashing.service'
|
|
218
218
|
export * from './services/list-of-values.service'
|
|
219
|
-
export * from './services/mail/
|
|
220
|
-
export * from './services/mail/
|
|
219
|
+
export * from './services/mail/elastic-email.service'
|
|
220
|
+
export * from './services/mail/smtp-email.service'
|
|
221
221
|
export * from './services/media-storage-provider-metadata-seeder.service'
|
|
222
222
|
export * from './services/media-storage-provider-metadata.service'
|
|
223
223
|
export * from './services/media.service'
|
|
@@ -257,6 +257,10 @@ export * from './services/import-transaction.service'
|
|
|
257
257
|
export * from './services/import-transaction-error-log.service'
|
|
258
258
|
export * from './services/excel.service'
|
|
259
259
|
export * from './services/csv.service'
|
|
260
|
+
export * from './services/queues/publisher-factory.service'
|
|
261
|
+
export * from './services/queues/database-publisher.service'
|
|
262
|
+
export * from './services/queues/database-subscriber.service'
|
|
263
|
+
|
|
260
264
|
// Repositories
|
|
261
265
|
export * from './repository/solid-base.repository'
|
|
262
266
|
export * from './repository/security-rule.repository'
|
|
@@ -282,4 +286,6 @@ export * from './interfaces'
|
|
|
282
286
|
export * from './solid-core.module'
|
|
283
287
|
|
|
284
288
|
export * from './winston.logger'
|
|
285
|
-
export { default as datetimeTransformer } from './transformers/datetime-transformer'
|
|
289
|
+
export { default as datetimeTransformer } from './transformers/datetime-transformer'
|
|
290
|
+
|
|
291
|
+
export { ERROR_MESSAGES } from './constants/error-messages'
|
package/src/interfaces.ts
CHANGED
|
@@ -201,11 +201,11 @@ export interface MailAttachmentWrapper {
|
|
|
201
201
|
|
|
202
202
|
export interface MailAttachment {
|
|
203
203
|
filename: string;
|
|
204
|
-
templatePath?: string;
|
|
205
|
-
templateParams?: any;
|
|
204
|
+
templatePath?: string; // deprecated
|
|
205
|
+
templateParams?: any; // deprecated
|
|
206
206
|
content?: string | Buffer;
|
|
207
207
|
contentType?: string;
|
|
208
|
-
path?: string;
|
|
208
|
+
path?: string; //Filesystem absolute path or URL.
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
export enum BrokerType {
|
|
@@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
|
|
|
3
3
|
import mailQueueOptions from './api-email-queue-options';
|
|
4
4
|
import { RabbitMqSubscriber } from 'src/services/queues/rabbitmq-subscriber.service';
|
|
5
5
|
import { QueueMessage } from 'src/interfaces/mq';
|
|
6
|
-
import { ElasticEmailService } from '../services/mail/
|
|
6
|
+
import { ElasticEmailService } from '../services/mail/elastic-email.service';
|
|
7
7
|
import { MqMessageService } from 'src/services/mq-message.service';
|
|
8
8
|
import { MqMessageQueueService } from 'src/services/mq-message-queue.service';
|
|
9
9
|
import { QueuesModuleOptions } from "../interfaces";
|
|
@@ -4,7 +4,7 @@ import mailQueueOptions from './api-email-queue-options-database';
|
|
|
4
4
|
import { QueueMessage } from 'src/interfaces/mq';
|
|
5
5
|
import { MqMessageService } from 'src/services/mq-message.service';
|
|
6
6
|
import { MqMessageQueueService } from 'src/services/mq-message-queue.service';
|
|
7
|
-
import { ElasticEmailService } from 'src/services/mail/
|
|
7
|
+
import { ElasticEmailService } from 'src/services/mail/elastic-email.service';
|
|
8
8
|
import { QueuesModuleOptions } from 'src/interfaces';
|
|
9
9
|
import { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';
|
|
10
10
|
|
|
@@ -5,7 +5,7 @@ import { QueueMessage } from 'src/interfaces/mq';
|
|
|
5
5
|
import { MqMessageService } from 'src/services/mq-message.service';
|
|
6
6
|
import { MqMessageQueueService } from 'src/services/mq-message-queue.service';
|
|
7
7
|
import { DatabaseSubscriber } from 'src/services/queues/database-subscriber.service';
|
|
8
|
-
import { SMTPEMailService } from 'src/services/mail/
|
|
8
|
+
import { SMTPEMailService } from 'src/services/mail/smtp-email.service';
|
|
9
9
|
import { QueuesModuleOptions } from 'src/interfaces';
|
|
10
10
|
|
|
11
11
|
@Injectable()
|
|
@@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
|
|
|
3
3
|
import mailQueueOptions from './email-queue-options';
|
|
4
4
|
import { RabbitMqSubscriber } from 'src/services/queues/rabbitmq-subscriber.service';
|
|
5
5
|
import { QueueMessage } from 'src/interfaces/mq';
|
|
6
|
-
import { SMTPEMailService } from '../services/mail/
|
|
6
|
+
import { SMTPEMailService } from '../services/mail/smtp-email.service';
|
|
7
7
|
import { MqMessageService } from 'src/services/mq-message.service';
|
|
8
8
|
import { MqMessageQueueService } from 'src/services/mq-message-queue.service';
|
|
9
9
|
import { QueuesModuleOptions } from "../interfaces";
|
|
@@ -5387,27 +5387,27 @@
|
|
|
5387
5387
|
},
|
|
5388
5388
|
{
|
|
5389
5389
|
"displayName": "Email list action",
|
|
5390
|
-
"name": "
|
|
5390
|
+
"name": "emailTemplate-list-action",
|
|
5391
5391
|
"type": "solid",
|
|
5392
5392
|
"domain": "",
|
|
5393
5393
|
"context": "",
|
|
5394
5394
|
"customComponent": "",
|
|
5395
5395
|
"customIsModal": true,
|
|
5396
5396
|
"serverEndpoint": "",
|
|
5397
|
-
"viewUserKey": "
|
|
5397
|
+
"viewUserKey": "emailTemplate-list-view",
|
|
5398
5398
|
"moduleUserKey": "solid-core",
|
|
5399
5399
|
"modelUserKey": "emailTemplate"
|
|
5400
5400
|
},
|
|
5401
5401
|
{
|
|
5402
5402
|
"displayName": "SMS list action",
|
|
5403
|
-
"name": "
|
|
5403
|
+
"name": "smsTemplate-list-action",
|
|
5404
5404
|
"type": "solid",
|
|
5405
5405
|
"domain": "",
|
|
5406
5406
|
"context": "",
|
|
5407
5407
|
"customComponent": "",
|
|
5408
5408
|
"customIsModal": true,
|
|
5409
5409
|
"serverEndpoint": "",
|
|
5410
|
-
"viewUserKey": "
|
|
5410
|
+
"viewUserKey": "smsTemplate-list-view",
|
|
5411
5411
|
"moduleUserKey": "solid-core",
|
|
5412
5412
|
"modelUserKey": "smsTemplate"
|
|
5413
5413
|
},
|
|
@@ -5755,17 +5755,17 @@
|
|
|
5755
5755
|
},
|
|
5756
5756
|
{
|
|
5757
5757
|
"displayName": "Email",
|
|
5758
|
-
"name": "
|
|
5758
|
+
"name": "emailTemplate-menu-item",
|
|
5759
5759
|
"sequenceNumber": 1,
|
|
5760
|
-
"actionUserKey": "
|
|
5760
|
+
"actionUserKey": "emailTemplate-list-action",
|
|
5761
5761
|
"moduleUserKey": "solid-core",
|
|
5762
5762
|
"parentMenuItemUserKey": "notification-menu-item"
|
|
5763
5763
|
},
|
|
5764
5764
|
{
|
|
5765
5765
|
"displayName": "SMS",
|
|
5766
|
-
"name": "
|
|
5766
|
+
"name": "smsTemplate-menu-item",
|
|
5767
5767
|
"sequenceNumber": 1,
|
|
5768
|
-
"actionUserKey": "
|
|
5768
|
+
"actionUserKey": "smsTemplate-list-action",
|
|
5769
5769
|
"moduleUserKey": "solid-core",
|
|
5770
5770
|
"parentMenuItemUserKey": "notification-menu-item"
|
|
5771
5771
|
},
|
|
@@ -10672,7 +10672,7 @@
|
|
|
10672
10672
|
}
|
|
10673
10673
|
},
|
|
10674
10674
|
{
|
|
10675
|
-
"name": "
|
|
10675
|
+
"name": "emailTemplate-list-view",
|
|
10676
10676
|
"displayName": "Email",
|
|
10677
10677
|
"type": "list",
|
|
10678
10678
|
"context": "{}",
|
|
@@ -10706,7 +10706,7 @@
|
|
|
10706
10706
|
}
|
|
10707
10707
|
},
|
|
10708
10708
|
{
|
|
10709
|
-
"name": "
|
|
10709
|
+
"name": "emailTemplate-form-view",
|
|
10710
10710
|
"displayName": "Email",
|
|
10711
10711
|
"type": "form",
|
|
10712
10712
|
"context": "{}",
|
|
@@ -10805,7 +10805,7 @@
|
|
|
10805
10805
|
}
|
|
10806
10806
|
},
|
|
10807
10807
|
{
|
|
10808
|
-
"name": "
|
|
10808
|
+
"name": "smsTemplate-list-view",
|
|
10809
10809
|
"displayName": "SMS Template",
|
|
10810
10810
|
"type": "list",
|
|
10811
10811
|
"context": "{}",
|
|
@@ -10839,7 +10839,7 @@
|
|
|
10839
10839
|
}
|
|
10840
10840
|
},
|
|
10841
10841
|
{
|
|
10842
|
-
"name": "
|
|
10842
|
+
"name": "smsTemplate-form-view",
|
|
10843
10843
|
"displayName": "SMS Template",
|
|
10844
10844
|
"type": "form",
|
|
10845
10845
|
"context": "{}",
|
|
@@ -17,6 +17,7 @@ import { PublisherFactory } from './queues/publisher-factory.service';
|
|
|
17
17
|
import { RequestContextService } from './request-context.service';
|
|
18
18
|
import { ActiveUserData } from 'src/interfaces/active-user-data.interface';
|
|
19
19
|
import { McpToolResponseHandlerFactory } from './mcp-tool-response-handlers/mcp-tool-response-handler-factory.service';
|
|
20
|
+
import { ERROR_MESSAGES } from 'src/constants/error-messages';
|
|
20
21
|
|
|
21
22
|
@Injectable()
|
|
22
23
|
export class AiInteractionService extends CRUDService<AiInteraction> {
|
|
@@ -78,7 +79,7 @@ export class AiInteractionService extends CRUDService<AiInteraction> {
|
|
|
78
79
|
|
|
79
80
|
// TODO: We can return an error if the above env variables are not properly setup...
|
|
80
81
|
if (!pythonExecutable || !mcpClient) {
|
|
81
|
-
throw new BadRequestException(
|
|
82
|
+
throw new BadRequestException(ERROR_MESSAGES.PYTHON_EXECUTABLE_NOT_CONFIGURED);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
// Check if both paths are valid and accessible
|
|
@@ -187,7 +188,7 @@ export class AiInteractionService extends CRUDService<AiInteraction> {
|
|
|
187
188
|
const toolsInvoked = metadata['tools_invoked'];
|
|
188
189
|
if (!toolsInvoked) {
|
|
189
190
|
// TODO: RESPONSE SHAPE ALERT Check if we want to control the shape of the response....
|
|
190
|
-
throw new Error(
|
|
191
|
+
throw new Error(ERROR_MESSAGES.UNABLE_TO_RESOLVE_SOLID_COMMAND);
|
|
191
192
|
}
|
|
192
193
|
|
|
193
194
|
// TODO: OPTIMISATION for chained tool invocation, for now we are assuming only 1 tool was used.
|
|
@@ -198,7 +199,7 @@ export class AiInteractionService extends CRUDService<AiInteraction> {
|
|
|
198
199
|
const mcpToolHandler = this.mcpToolResponseHandlerFactory.getInstance(toolInvoked);
|
|
199
200
|
if (!mcpToolHandler) {
|
|
200
201
|
// TODO: RESPONSE SHAPE ALERT Check if we want to control the shape of the response....
|
|
201
|
-
throw new Error(
|
|
202
|
+
throw new Error(ERROR_MESSAGES.UNABLE_TO_RESOLVE_MCP_HANDLER);
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
const handlerApplicationResponse = await mcpToolHandler.apply(aiInteraction);
|