app-tutor-ai-consumer 1.32.1 → 1.32.2

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,9 @@
1
+ ## [1.32.2](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.32.1...v1.32.2) (2025-10-08)
2
+
3
+ ### Bug Fixes
4
+
5
+ - missing fields on datahub events ([0f0508a](https://github.com/Hotmart-Org/app-tutor-ai-consumer/commit/0f0508ab7ce113027dea9bf34b45bc431823b3a3))
6
+
1
7
  ## [1.32.1](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.32.0...v1.32.1) (2025-10-06)
2
8
 
3
9
  # [1.32.0](https://github.com/Hotmart-Org/app-tutor-ai-consumer/compare/v1.31.1...v1.32.0) (2025-10-03)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-tutor-ai-consumer",
3
- "version": "1.32.1",
3
+ "version": "1.32.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "dev": "rspack serve --env=development --config config/rspack/rspack.config.js",
@@ -1,9 +1,9 @@
1
1
  import { HttpCodes } from '@/src/lib/utils'
2
- import { Result } from '../constants'
2
+ import { Result, ScreenNames } from '../constants'
3
3
  import { DataHubEntities } from '../entities'
4
- import type { DataHubEntityTypes, ResultType } from '../types'
4
+ import type { DataHubEntityTypes, ResultType, ScreenNamesType } from '../types'
5
5
 
6
- import BaseSchema from './base-schema'
6
+ import BaseProductSchema from './base-product-schema'
7
7
 
8
8
  export type BaseTrySchemaConstructorArgs = {
9
9
  componentName: string
@@ -13,14 +13,16 @@ export type BaseTrySchemaConstructorArgs = {
13
13
  result?: ResultType
14
14
  statusCode?: number
15
15
  failureDescription?: string
16
+ screenName?: ScreenNamesType
16
17
  }
17
18
 
18
- abstract class BaseTrySchema extends BaseSchema {
19
+ abstract class BaseTrySchema extends BaseProductSchema {
19
20
  private componentName: string
20
21
  private componentSource: string
21
22
  private failureDescription: string
22
23
  private result: ResultType
23
24
  private statusCode: number
25
+ private screenName: ScreenNamesType
24
26
 
25
27
  entity: DataHubEntityTypes
26
28
  isLogged: boolean
@@ -33,7 +35,8 @@ abstract class BaseTrySchema extends BaseSchema {
33
35
  failureDescription = Result.FAILURE_DESCRIPTION,
34
36
  isLogged = true,
35
37
  result = Result.SUCCESS,
36
- statusCode = HttpCodes.OK
38
+ statusCode = HttpCodes.OK,
39
+ screenName = ScreenNames.HOME_CONSUMER
37
40
  } = args
38
41
 
39
42
  super()
@@ -45,9 +48,10 @@ abstract class BaseTrySchema extends BaseSchema {
45
48
  this.isLogged = isLogged
46
49
  this.result = result
47
50
  this.statusCode = statusCode
51
+ this.screenName = screenName
48
52
  }
49
53
 
50
- prepare(): Record<string, unknown> {
54
+ prepare() {
51
55
  return {
52
56
  ...super.prepare(),
53
57
  componentName: this.componentName,
@@ -56,7 +60,8 @@ abstract class BaseTrySchema extends BaseSchema {
56
60
  failureDescription: this.failureDescription,
57
61
  isLogged: this.isLogged,
58
62
  result: this.result,
59
- statusCode: this.statusCode
63
+ statusCode: this.statusCode,
64
+ screenName: this.screenName
60
65
  }
61
66
  }
62
67
  }
@@ -1,7 +1,13 @@
1
+ import { ScreenNames } from '../constants'
1
2
  import { DataHubEntities } from '../entities'
2
- import type { ComponentNamesType, ComponentSourceType, DataHubEntityTypes } from '../types'
3
+ import type {
4
+ ComponentNamesType,
5
+ ComponentSourceType,
6
+ DataHubEntityTypes,
7
+ ScreenNamesType
8
+ } from '../types'
3
9
 
4
- import BaseSchema from './base-schema'
10
+ import BaseProductSchema from './base-product-schema'
5
11
  import { ProductCategories } from './constants'
6
12
  import type { ProductCategoriesType } from './types'
7
13
 
@@ -12,13 +18,17 @@ export type BaseViewSchemaConstructorArgs = {
12
18
  entity?: DataHubEntityTypes
13
19
  isLogged?: boolean
14
20
  productType?: ProductCategoriesType
21
+ pushKind?: string
22
+ screenName?: ScreenNamesType
15
23
  }
16
24
 
17
- abstract class BaseViewSchema extends BaseSchema {
25
+ abstract class BaseViewSchema extends BaseProductSchema {
18
26
  private arrivedFrom: string
19
27
  private componentName: string
20
28
  private componentSource: string
21
29
  private productType: ProductCategoriesType
30
+ private pushKind: string
31
+ private screenName: ScreenNamesType
22
32
 
23
33
  entity: DataHubEntityTypes
24
34
  isLogged: boolean
@@ -30,7 +40,9 @@ abstract class BaseViewSchema extends BaseSchema {
30
40
  arrivedFrom = 'HOME_CLASS_CONSUMER',
31
41
  entity = DataHubEntities.PRODUCT_CONSUME,
32
42
  isLogged = true,
33
- productType = ProductCategories.OnlineServices
43
+ productType = ProductCategories.OnlineServices,
44
+ pushKind = 'NOT_PUSH_EVENT',
45
+ screenName = ScreenNames.HOME_CONSUMER
34
46
  } = args
35
47
 
36
48
  super()
@@ -41,9 +53,11 @@ abstract class BaseViewSchema extends BaseSchema {
41
53
  this.entity = entity
42
54
  this.isLogged = isLogged
43
55
  this.productType = productType
56
+ this.pushKind = pushKind
57
+ this.screenName = screenName
44
58
  }
45
59
 
46
- prepare(): Record<string, unknown> {
60
+ prepare() {
47
61
  return {
48
62
  ...super.prepare(),
49
63
  arrivedFrom: this.arrivedFrom,
@@ -51,7 +65,9 @@ abstract class BaseViewSchema extends BaseSchema {
51
65
  componentSource: this.componentSource,
52
66
  entity: this.entity,
53
67
  isLogged: this.isLogged,
54
- productType: this.productType
68
+ productType: this.productType,
69
+ pushKind: this.pushKind,
70
+ screenName: this.screenName
55
71
  }
56
72
  }
57
73
  }