@silexpert/core 1.3.30 → 1.3.31

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.
Files changed (51) hide show
  1. package/dist/cjs/api/resources/Ai.d.ts +2 -2
  2. package/dist/cjs/api/resources/Ai.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Ai.js +2 -2
  4. package/dist/cjs/api/resources/Ai.js.map +1 -1
  5. package/dist/cjs/types/Interface/api/ai/AskQuestionCollaborator.d.ts +6 -0
  6. package/dist/cjs/types/Interface/api/ai/AskQuestionCollaborator.d.ts.map +1 -1
  7. package/dist/cjs/types/Interface/api/ai/AskQuestionCollaborator.js +29 -1
  8. package/dist/cjs/types/Interface/api/ai/AskQuestionCollaborator.js.map +1 -1
  9. package/dist/cjs/types/Interface/api/promoCode/CreateDefaultPromoCode.d.ts.map +1 -1
  10. package/dist/cjs/types/Interface/api/promoCode/CreateDefaultPromoCode.js +3 -0
  11. package/dist/cjs/types/Interface/api/promoCode/CreateDefaultPromoCode.js.map +1 -1
  12. package/dist/cjs/types/Interface/models/IAIConversation.d.ts +11 -0
  13. package/dist/cjs/types/Interface/models/IAIConversation.d.ts.map +1 -0
  14. package/dist/cjs/types/Interface/models/IAIConversation.js +3 -0
  15. package/dist/cjs/types/Interface/models/IAIConversation.js.map +1 -0
  16. package/dist/cjs/types/Interface/models/IAIQuestion.d.ts +5 -5
  17. package/dist/cjs/types/Interface/models/IAIQuestion.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/models/IAIQuestion.js.map +1 -1
  19. package/dist/cjs/types/index.d.ts +1 -0
  20. package/dist/cjs/types/index.d.ts.map +1 -1
  21. package/dist/cjs/types/index.js +1 -0
  22. package/dist/cjs/types/index.js.map +1 -1
  23. package/dist/mjs/api/resources/Ai.d.ts +2 -2
  24. package/dist/mjs/api/resources/Ai.d.ts.map +1 -1
  25. package/dist/mjs/api/resources/Ai.js +2 -2
  26. package/dist/mjs/api/resources/Ai.js.map +1 -1
  27. package/dist/mjs/types/Interface/api/ai/AskQuestionCollaborator.d.ts +6 -0
  28. package/dist/mjs/types/Interface/api/ai/AskQuestionCollaborator.d.ts.map +1 -1
  29. package/dist/mjs/types/Interface/api/ai/AskQuestionCollaborator.js +33 -2
  30. package/dist/mjs/types/Interface/api/ai/AskQuestionCollaborator.js.map +1 -1
  31. package/dist/mjs/types/Interface/api/promoCode/CreateDefaultPromoCode.d.ts.map +1 -1
  32. package/dist/mjs/types/Interface/api/promoCode/CreateDefaultPromoCode.js +4 -1
  33. package/dist/mjs/types/Interface/api/promoCode/CreateDefaultPromoCode.js.map +1 -1
  34. package/dist/mjs/types/Interface/models/IAIConversation.d.ts +11 -0
  35. package/dist/mjs/types/Interface/models/IAIConversation.d.ts.map +1 -0
  36. package/dist/mjs/types/Interface/models/IAIConversation.js +2 -0
  37. package/dist/mjs/types/Interface/models/IAIConversation.js.map +1 -0
  38. package/dist/mjs/types/Interface/models/IAIQuestion.d.ts +5 -5
  39. package/dist/mjs/types/Interface/models/IAIQuestion.d.ts.map +1 -1
  40. package/dist/mjs/types/Interface/models/IAIQuestion.js.map +1 -1
  41. package/dist/mjs/types/index.d.ts +1 -0
  42. package/dist/mjs/types/index.d.ts.map +1 -1
  43. package/dist/mjs/types/index.js +1 -0
  44. package/dist/mjs/types/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/ts/api/resources/Ai.ts +3 -3
  47. package/ts/types/Interface/api/ai/AskQuestionCollaborator.ts +25 -2
  48. package/ts/types/Interface/api/promoCode/CreateDefaultPromoCode.ts +4 -1
  49. package/ts/types/Interface/models/IAIConversation.ts +13 -0
  50. package/ts/types/Interface/models/IAIQuestion.ts +5 -5
  51. package/ts/types/index.ts +1 -0
@@ -1,9 +1,32 @@
1
- import { IsNotEmpty, IsString } from 'class-validator';
2
- import { ApiProperty } from '../../../../utils';
1
+ import { IsArray, IsIn, IsInt, IsNotEmpty, IsOptional, IsString, ValidateNested } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+
4
+ export class AskHistoryCollaborator {
5
+ @ApiProperty()
6
+ @IsString()
7
+ @IsIn(['assistant', 'user'])
8
+ role: 'assistant' | 'user';
9
+
10
+ @ApiProperty()
11
+ @IsString()
12
+ @IsNotEmpty()
13
+ content: string;
14
+ }
3
15
 
4
16
  export class AskQuestionCollaborator {
5
17
  @ApiProperty()
6
18
  @IsString()
7
19
  @IsNotEmpty()
8
20
  question: string;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ @IsArray()
25
+ @ValidateNested({ each: true })
26
+ history?: AskHistoryCollaborator[];
27
+
28
+ @ApiPropertyOptional()
29
+ @IsOptional()
30
+ @IsInt()
31
+ idConversation?: number;
9
32
  }
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsDate, IsJSON, IsString } from 'class-validator';
1
+ import { IsBoolean, IsDate, IsJSON, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
4
 
@@ -8,10 +8,12 @@ export class CreateDefaultPromoCode {
8
8
  label: string;
9
9
 
10
10
  @ApiPropertyOptional()
11
+ @IsOptional()
11
12
  @IsDate()
12
13
  startDate?: Date | null;
13
14
 
14
15
  @ApiPropertyOptional()
16
+ @IsOptional()
15
17
  @IsDate()
16
18
  endDate?: Date | null;
17
19
 
@@ -46,6 +48,7 @@ export class CreateDefaultPromoCode {
46
48
  isTest: boolean;
47
49
 
48
50
  @ApiPropertyOptional()
51
+ @IsOptional()
49
52
  @IsJSON()
50
53
  // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
51
54
  metadata?: any | null;
@@ -0,0 +1,13 @@
1
+ import { IAIQuestion } from './IAIQuestion';
2
+ import { IUser } from './IUser';
3
+
4
+ export interface IAIConversation {
5
+ id: number;
6
+ idUser: number;
7
+ createdAt?: Date;
8
+ updatedAt?: Date;
9
+
10
+ // Associations
11
+ user?: IUser;
12
+ questions?: IAIQuestion[];
13
+ }
@@ -1,4 +1,4 @@
1
- import { IUser } from './IUser';
1
+ import { IAIConversation } from './IAIConversation';
2
2
 
3
3
  export interface IAIQuestion {
4
4
  id: number;
@@ -8,10 +8,10 @@ export interface IAIQuestion {
8
8
  category: string;
9
9
  subCategory: string;
10
10
  totalTokens: number;
11
- idUser: number;
12
- createdAt?: Date | string;
13
- updatedAt?: Date | string;
11
+ idConversation: number | null; // Nullable for the first questions generated by the AI without conversation
12
+ createdAt?: Date;
13
+ updatedAt?: Date;
14
14
 
15
15
  // Associations
16
- user?: IUser;
16
+ conversation?: IAIConversation;
17
17
  }
package/ts/types/index.ts CHANGED
@@ -325,6 +325,7 @@ export * from './Interface/models/IScheduledReminder';
325
325
  export * from './Interface/models/IReminderAttachment';
326
326
  export * from './Interface/models/IStateBankAccount';
327
327
  export * from './Interface/models/IAIQuestion';
328
+ export * from './Interface/models/IAIConversation';
328
329
 
329
330
  // Schemas
330
331
  export * from './Interface/schemas/IRegistrationDetail';