app-tutor-ai-consumer 1.40.2 → 1.42.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [1.42.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.41.0...v1.42.0) (2025-12-02)
2
+
3
+ ### Features
4
+
5
+ - add filename and filetype ([2ed8939](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/2ed89398809d447be6cd29cec420dcf4cad2f7fe))
6
+
7
+ # [1.41.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.40.2...v1.41.0) (2025-11-25)
8
+
9
+ ### Features
10
+
11
+ - adding FR language ([6ab5466](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/6ab546617e88888c071020435e5701207e399e93))
12
+
1
13
  ## [1.40.2](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.40.1...v1.40.2) (2025-11-24)
2
14
 
3
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-tutor-ai-consumer",
3
- "version": "1.40.2",
3
+ "version": "1.42.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
@@ -8,6 +8,7 @@ export { default as ClickTutorOnboardingStartSchema } from './click-tutor-onboar
8
8
  export { default as ClickTutorTestKnowledgeSchema } from './click-tutor-test-knowledge'
9
9
  export { default as CloseTutorOnboardingSchema } from './close-tutor-onboarding'
10
10
  export * from './constants'
11
+ export type { TrySendMessageConstructorArgs } from './try-send-message'
11
12
  export { default as TrySendMessageSchema } from './try-send-message'
12
13
  export * from './types'
13
14
  export { default as ViewAnswerMessageSchema } from './view-answer-message'
@@ -12,6 +12,8 @@ export type TrySendMessageConstructorArgs = Partial<BaseTrySchemaConstructorArgs
12
12
  messageId?: string
13
13
  conversationId?: string
14
14
  agent: AgentType
15
+ fileName?: string
16
+ fileType?: string
15
17
  }
16
18
 
17
19
  class TrySendMessageSchema extends BaseTrySchema {
@@ -21,6 +23,8 @@ class TrySendMessageSchema extends BaseTrySchema {
21
23
  messageId?: string
22
24
  conversationId?: string
23
25
  agent?: AgentType
26
+ fileName?: string
27
+ fileType?: string
24
28
 
25
29
  constructor(args?: TrySendMessageConstructorArgs) {
26
30
  const {
@@ -28,6 +32,8 @@ class TrySendMessageSchema extends BaseTrySchema {
28
32
  messageId,
29
33
  conversationId,
30
34
  agent,
35
+ fileName,
36
+ fileType,
31
37
  componentSource = ComponentSource.HOTMART_TUTOR,
32
38
  componentName = ComponentNames.BUTTON_SEND_MESSAGE,
33
39
  failureDescription = 'NOT_FAILURE_RESULT_EVENT',
@@ -49,6 +55,8 @@ class TrySendMessageSchema extends BaseTrySchema {
49
55
  this.messageId = messageId
50
56
  this.conversationId = conversationId
51
57
  this.agent = agent
58
+ this.fileName = fileName
59
+ this.fileType = fileType
52
60
  }
53
61
 
54
62
  getDataHubEventData(): Record<string, unknown> {
@@ -57,7 +65,9 @@ class TrySendMessageSchema extends BaseTrySchema {
57
65
  questionType: this.questionType,
58
66
  messageId: this.messageId,
59
67
  conversationId: this.conversationId,
60
- agent: this.agent
68
+ agent: this.agent,
69
+ ...(this.fileName && { fileName: this.fileName }),
70
+ ...(this.fileType && { fileType: this.fileType })
61
71
  }
62
72
  }
63
73
  }
@@ -1,6 +1,7 @@
1
1
  export const LANGUAGES = {
2
2
  EN: 'en',
3
3
  ES: 'es',
4
+ FR: 'fr',
4
5
  PT_BR: 'pt_BR'
5
6
  } as const
6
7
 
@@ -4,6 +4,7 @@ import { UAParser } from 'ua-parser-js'
4
4
  import { v4 } from 'uuid'
5
5
 
6
6
  import { AgentType, ComponentSource, DataHubService } from '@/src/config/datahub'
7
+ import type { TrySendMessageConstructorArgs } from '@/src/config/datahub/schemas/tutor'
7
8
  import { TrySendMessageSchema } from '@/src/config/datahub/schemas/tutor'
8
9
  import { APP_VERSION, HttpCodes, PLATFORM } from '@/src/lib/utils'
9
10
  import { DirectMessagesService as MessagesService } from '@/src/modules/messages'
@@ -135,18 +136,25 @@ function useSendTextMessage() {
135
136
  setAttachedFileAtom(null)
136
137
  },
137
138
  onSettled(data, error) {
139
+ const fileName = attachedFileAtom?.name
140
+ const fileType = attachedFileAtom?.name?.split('.').pop()
141
+
142
+ const schemaArgs: TrySendMessageConstructorArgs = {
143
+ messageId: data?.id ?? '',
144
+ statusCode: error ? HttpCodes.BAD_REQUEST : HttpCodes.OK,
145
+ result: error ? 'FAILURE' : 'SUCCESSFUL',
146
+ failureDescription: error?.message,
147
+ componentSource: isAgentMode
148
+ ? ComponentSource.PRODUCT_AGENT
149
+ : ComponentSource.HOTMART_TUTOR,
150
+ agent: isAgentMode ? AgentType.PRODUCT_AGENT : AgentType.HOTMART_TUTOR,
151
+ conversationId: settings?.conversationId,
152
+ fileName,
153
+ fileType
154
+ }
155
+
138
156
  DataHubService.sendEvent({
139
- schema: new TrySendMessageSchema({
140
- messageId: data?.id ?? '',
141
- statusCode: error ? HttpCodes.BAD_REQUEST : HttpCodes.OK,
142
- result: error ? 'FAILURE' : 'SUCCESSFUL',
143
- failureDescription: error?.message,
144
- componentSource: isAgentMode
145
- ? ComponentSource.PRODUCT_AGENT
146
- : ComponentSource.HOTMART_TUTOR,
147
- agent: isAgentMode ? AgentType.PRODUCT_AGENT : AgentType.HOTMART_TUTOR,
148
- conversationId: settings?.conversationId
149
- })
157
+ schema: new TrySendMessageSchema(schemaArgs)
150
158
  })
151
159
  }
152
160
  })