@hawk.so/types 0.6.2 → 0.6.4
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/src/base/utm.d.ts +25 -0
- package/build/src/base/utm.js +2 -0
- package/build/src/catchers/catcher-message.d.ts +5 -0
- package/build/src/dbScheme/promoCodeUsage.d.ts +2 -22
- package/build/src/dbScheme/repetition.d.ts +6 -0
- package/build/src/dbScheme/user.d.ts +2 -22
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/base/utm.ts +29 -0
- package/src/catchers/catcher-message.ts +6 -0
- package/src/dbScheme/promoCodeUsage.ts +2 -26
- package/src/dbScheme/repetition.ts +7 -0
- package/src/dbScheme/user.ts +2 -26
package/build/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './src/base/event/taskManagerItem';
|
|
|
10
10
|
export * from './src/base/event/addons';
|
|
11
11
|
export * from './src/base/integrations/integrationToken';
|
|
12
12
|
export * from './src/base/project/ProjectTaskManager';
|
|
13
|
+
export * from './src/base/utm';
|
|
13
14
|
export * from './src/base/workspace/GitHubIntegration';
|
|
14
15
|
export * from './src/base/user/GitHubAuthorization';
|
|
15
16
|
export * from './src/dbScheme/businessOperation';
|
package/build/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./src/base/event/taskManagerItem"), exports);
|
|
|
26
26
|
__exportStar(require("./src/base/event/addons"), exports);
|
|
27
27
|
__exportStar(require("./src/base/integrations/integrationToken"), exports);
|
|
28
28
|
__exportStar(require("./src/base/project/ProjectTaskManager"), exports);
|
|
29
|
+
__exportStar(require("./src/base/utm"), exports);
|
|
29
30
|
__exportStar(require("./src/base/workspace/GitHubIntegration"), exports);
|
|
30
31
|
__exportStar(require("./src/base/user/GitHubAuthorization"), exports);
|
|
31
32
|
__exportStar(require("./src/dbScheme/businessOperation"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTM parameters captured for analytics.
|
|
3
|
+
*/
|
|
4
|
+
export interface Utm {
|
|
5
|
+
/**
|
|
6
|
+
* UTM source - identifies which site sent the traffic.
|
|
7
|
+
*/
|
|
8
|
+
source?: string;
|
|
9
|
+
/**
|
|
10
|
+
* UTM medium - identifies what type of link was used.
|
|
11
|
+
*/
|
|
12
|
+
medium?: string;
|
|
13
|
+
/**
|
|
14
|
+
* UTM campaign - identifies a specific product promotion or strategic campaign.
|
|
15
|
+
*/
|
|
16
|
+
campaign?: string;
|
|
17
|
+
/**
|
|
18
|
+
* UTM content - identifies what specifically was clicked to bring the user to the site.
|
|
19
|
+
*/
|
|
20
|
+
content?: string;
|
|
21
|
+
/**
|
|
22
|
+
* UTM term - identifies search terms.
|
|
23
|
+
*/
|
|
24
|
+
term?: string;
|
|
25
|
+
}
|
|
@@ -63,6 +63,11 @@ export interface CatcherMessage<Type extends CatcherMessageType> {
|
|
|
63
63
|
* All information about the event
|
|
64
64
|
*/
|
|
65
65
|
payload: CatcherMessagePayload<Type>;
|
|
66
|
+
/**
|
|
67
|
+
* Number of identical occurrences this message represents.
|
|
68
|
+
* Computed on Catcher side to dedupe similar events caused in the same time.
|
|
69
|
+
*/
|
|
70
|
+
count?: number;
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
68
73
|
* Type that represents a Catcher message accepted by the collector
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ObjectId } from 'bson';
|
|
2
2
|
import type { PromoCodeBenefitType } from './promoCode.ts';
|
|
3
|
+
import type { Utm } from '../base/utm.ts';
|
|
3
4
|
/**
|
|
4
5
|
* Promo code usage representation in DataBase
|
|
5
6
|
*/
|
|
@@ -43,28 +44,7 @@ export interface PromoCodeUsageDBScheme {
|
|
|
43
44
|
/**
|
|
44
45
|
* UTM parameters captured when promo code was applied. Used for analytics purposes
|
|
45
46
|
*/
|
|
46
|
-
utm?:
|
|
47
|
-
/**
|
|
48
|
-
* UTM source - identifies which site sent the traffic
|
|
49
|
-
*/
|
|
50
|
-
source?: string;
|
|
51
|
-
/**
|
|
52
|
-
* UTM medium - identifies what type of link was used
|
|
53
|
-
*/
|
|
54
|
-
medium?: string;
|
|
55
|
-
/**
|
|
56
|
-
* UTM campaign - identifies a specific product promotion or strategic campaign
|
|
57
|
-
*/
|
|
58
|
-
campaign?: string;
|
|
59
|
-
/**
|
|
60
|
-
* UTM content - identifies what specifically was clicked to bring the user to the site
|
|
61
|
-
*/
|
|
62
|
-
content?: string;
|
|
63
|
-
/**
|
|
64
|
-
* UTM term - identifies search terms
|
|
65
|
-
*/
|
|
66
|
-
term?: string;
|
|
67
|
-
};
|
|
47
|
+
utm?: Utm;
|
|
68
48
|
/**
|
|
69
49
|
* Date when promo code was successfully applied
|
|
70
50
|
* @example 2026-06-10T12:30:00.000Z
|
|
@@ -29,6 +29,12 @@ export interface RepetitionDBScheme {
|
|
|
29
29
|
* (created by the Collector)
|
|
30
30
|
*/
|
|
31
31
|
timestamp: number;
|
|
32
|
+
/**
|
|
33
|
+
* Number of real client-side occurrences merged into this single repetition
|
|
34
|
+
* by Catcher-side debounce (see CatcherMessage.count).
|
|
35
|
+
* Absent or 1 — this repetition represents a single occurrence.
|
|
36
|
+
*/
|
|
37
|
+
count?: number;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Repetition with decoded event data
|
|
@@ -4,6 +4,7 @@ import type { BankCard } from './bankCard.ts';
|
|
|
4
4
|
import type { MembershipDBScheme } from './membership.ts';
|
|
5
5
|
import type { UserProjectsLastVisitDBScheme } from './userProjectsLastVisit.ts';
|
|
6
6
|
import type { GitHubAuthorization } from '../base/user/GitHubAuthorization.ts';
|
|
7
|
+
import type { Utm } from '../base/utm.ts';
|
|
7
8
|
/**
|
|
8
9
|
* Interface representing how user is stored in DB
|
|
9
10
|
*/
|
|
@@ -57,28 +58,7 @@ export interface UserDBScheme {
|
|
|
57
58
|
/**
|
|
58
59
|
* UTM parameters from signup - Data form where user went to sign up. Used for analytics purposes
|
|
59
60
|
*/
|
|
60
|
-
utm?:
|
|
61
|
-
/**
|
|
62
|
-
* UTM source - identifies which site sent the traffic
|
|
63
|
-
*/
|
|
64
|
-
source?: string;
|
|
65
|
-
/**
|
|
66
|
-
* UTM medium - identifies what type of link was used
|
|
67
|
-
*/
|
|
68
|
-
medium?: string;
|
|
69
|
-
/**
|
|
70
|
-
* UTM campaign - identifies a specific product promotion or strategic campaign
|
|
71
|
-
*/
|
|
72
|
-
campaign?: string;
|
|
73
|
-
/**
|
|
74
|
-
* UTM content - identifies what specifically was clicked to bring the user to the site
|
|
75
|
-
*/
|
|
76
|
-
content?: string;
|
|
77
|
-
/**
|
|
78
|
-
* UTM term - identifies search terms
|
|
79
|
-
*/
|
|
80
|
-
term?: string;
|
|
81
|
-
};
|
|
61
|
+
utm?: Utm;
|
|
82
62
|
/**
|
|
83
63
|
* GitHub OAuth authorizations.
|
|
84
64
|
* Used for user-to-server operations (e.g. Copilot assignment).
|
package/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './src/base/event/addons';
|
|
|
14
14
|
|
|
15
15
|
export * from './src/base/integrations/integrationToken';
|
|
16
16
|
export * from './src/base/project/ProjectTaskManager';
|
|
17
|
+
export * from './src/base/utm';
|
|
17
18
|
export * from './src/base/workspace/GitHubIntegration';
|
|
18
19
|
export * from './src/base/user/GitHubAuthorization';
|
|
19
20
|
|
package/package.json
CHANGED
package/src/base/utm.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTM parameters captured for analytics.
|
|
3
|
+
*/
|
|
4
|
+
export interface Utm {
|
|
5
|
+
/**
|
|
6
|
+
* UTM source - identifies which site sent the traffic.
|
|
7
|
+
*/
|
|
8
|
+
source?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* UTM medium - identifies what type of link was used.
|
|
12
|
+
*/
|
|
13
|
+
medium?: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* UTM campaign - identifies a specific product promotion or strategic campaign.
|
|
17
|
+
*/
|
|
18
|
+
campaign?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* UTM content - identifies what specifically was clicked to bring the user to the site.
|
|
22
|
+
*/
|
|
23
|
+
content?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* UTM term - identifies search terms.
|
|
27
|
+
*/
|
|
28
|
+
term?: string;
|
|
29
|
+
}
|
|
@@ -83,6 +83,12 @@ export interface CatcherMessage<Type extends CatcherMessageType> {
|
|
|
83
83
|
* All information about the event
|
|
84
84
|
*/
|
|
85
85
|
payload: CatcherMessagePayload<Type>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Number of identical occurrences this message represents.
|
|
89
|
+
* Computed on Catcher side to dedupe similar events caused in the same time.
|
|
90
|
+
*/
|
|
91
|
+
count?: number;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ObjectId } from 'bson';
|
|
2
2
|
import type { PromoCodeBenefitType } from './promoCode.ts';
|
|
3
|
+
import type { Utm } from '../base/utm.ts';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Promo code usage representation in DataBase
|
|
@@ -53,32 +54,7 @@ export interface PromoCodeUsageDBScheme {
|
|
|
53
54
|
/**
|
|
54
55
|
* UTM parameters captured when promo code was applied. Used for analytics purposes
|
|
55
56
|
*/
|
|
56
|
-
utm?:
|
|
57
|
-
/**
|
|
58
|
-
* UTM source - identifies which site sent the traffic
|
|
59
|
-
*/
|
|
60
|
-
source?: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* UTM medium - identifies what type of link was used
|
|
64
|
-
*/
|
|
65
|
-
medium?: string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* UTM campaign - identifies a specific product promotion or strategic campaign
|
|
69
|
-
*/
|
|
70
|
-
campaign?: string;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* UTM content - identifies what specifically was clicked to bring the user to the site
|
|
74
|
-
*/
|
|
75
|
-
content?: string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* UTM term - identifies search terms
|
|
79
|
-
*/
|
|
80
|
-
term?: string;
|
|
81
|
-
};
|
|
57
|
+
utm?: Utm;
|
|
82
58
|
|
|
83
59
|
/**
|
|
84
60
|
* Date when promo code was successfully applied
|
|
@@ -34,6 +34,13 @@ export interface RepetitionDBScheme {
|
|
|
34
34
|
* (created by the Collector)
|
|
35
35
|
*/
|
|
36
36
|
timestamp: number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Number of real client-side occurrences merged into this single repetition
|
|
40
|
+
* by Catcher-side debounce (see CatcherMessage.count).
|
|
41
|
+
* Absent or 1 — this repetition represents a single occurrence.
|
|
42
|
+
*/
|
|
43
|
+
count?: number;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
/**
|
package/src/dbScheme/user.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { BankCard } from './bankCard.ts';
|
|
|
4
4
|
import type { MembershipDBScheme } from './membership.ts';
|
|
5
5
|
import type { UserProjectsLastVisitDBScheme } from './userProjectsLastVisit.ts';
|
|
6
6
|
import type { GitHubAuthorization } from '../base/user/GitHubAuthorization.ts';
|
|
7
|
+
import type { Utm } from '../base/utm.ts';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Interface representing how user is stored in DB
|
|
@@ -69,32 +70,7 @@ export interface UserDBScheme {
|
|
|
69
70
|
/**
|
|
70
71
|
* UTM parameters from signup - Data form where user went to sign up. Used for analytics purposes
|
|
71
72
|
*/
|
|
72
|
-
utm?:
|
|
73
|
-
/**
|
|
74
|
-
* UTM source - identifies which site sent the traffic
|
|
75
|
-
*/
|
|
76
|
-
source?: string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* UTM medium - identifies what type of link was used
|
|
80
|
-
*/
|
|
81
|
-
medium?: string;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* UTM campaign - identifies a specific product promotion or strategic campaign
|
|
85
|
-
*/
|
|
86
|
-
campaign?: string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* UTM content - identifies what specifically was clicked to bring the user to the site
|
|
90
|
-
*/
|
|
91
|
-
content?: string;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* UTM term - identifies search terms
|
|
95
|
-
*/
|
|
96
|
-
term?: string;
|
|
97
|
-
};
|
|
73
|
+
utm?: Utm;
|
|
98
74
|
|
|
99
75
|
/**
|
|
100
76
|
* GitHub OAuth authorizations.
|