@hawk.so/types 0.6.0-rc.1 → 0.6.1

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 CHANGED
@@ -19,6 +19,8 @@ export * from './src/dbScheme/notificationsChannelSettings';
19
19
  export * from './src/dbScheme/membership';
20
20
  export * from './src/dbScheme/userProjectsLastVisit';
21
21
  export * from './src/dbScheme/plan';
22
+ export * from './src/dbScheme/promoCode';
23
+ export * from './src/dbScheme/promoCodeUsage';
22
24
  export * from './src/dbScheme/project';
23
25
  export * from './src/dbScheme/projectNotificationsRule';
24
26
  export * from './src/dbScheme/release';
package/build/index.js CHANGED
@@ -35,6 +35,8 @@ __exportStar(require("./src/dbScheme/notificationsChannelSettings"), exports);
35
35
  __exportStar(require("./src/dbScheme/membership"), exports);
36
36
  __exportStar(require("./src/dbScheme/userProjectsLastVisit"), exports);
37
37
  __exportStar(require("./src/dbScheme/plan"), exports);
38
+ __exportStar(require("./src/dbScheme/promoCode"), exports);
39
+ __exportStar(require("./src/dbScheme/promoCodeUsage"), exports);
38
40
  __exportStar(require("./src/dbScheme/project"), exports);
39
41
  __exportStar(require("./src/dbScheme/projectNotificationsRule"), exports);
40
42
  __exportStar(require("./src/dbScheme/release"), exports);
@@ -69,9 +69,14 @@ export interface GitHubInstallation {
69
69
  */
70
70
  updatedAt: Date;
71
71
  /**
72
- * Delegate user for agent actions in Worker
72
+ * Delegate user whose GitHub OAuth token is used by the Worker
73
+ * for user-to-server actions (e.g. Copilot assignment).
74
+ *
75
+ * null right after installation is saved — at that point we only have
76
+ * the installation_id from GitHub but haven't exchanged the OAuth code yet.
77
+ * Gets populated in the same /oauth callback once the code exchange succeeds.
73
78
  */
74
- delegatedUser: GitHubInstallationDelegatedUser;
79
+ delegatedUser: GitHubInstallationDelegatedUser | null;
75
80
  }
76
81
  /**
77
82
  * GitHub integration data stored at workspace level
@@ -0,0 +1,44 @@
1
+ import type { ObjectId } from 'bson';
2
+ /**
3
+ * Promo code representation in DataBase
4
+ */
5
+ export interface PromoCodeDBScheme {
6
+ /**
7
+ * Promo code id
8
+ */
9
+ _id: ObjectId;
10
+ /**
11
+ * Normalized promo code value
12
+ * @example HAWK-2026
13
+ */
14
+ code: string;
15
+ /**
16
+ * Tariff plan assigned by this promo code
17
+ */
18
+ planId: ObjectId;
19
+ /**
20
+ * Maximum total usages count
21
+ * @example 100
22
+ */
23
+ limit?: number;
24
+ /**
25
+ * Date after which promo code cannot be used
26
+ * @example 2026-12-31T23:59:59.000Z
27
+ */
28
+ expiresAt?: Date;
29
+ /**
30
+ * Date when promo code was created
31
+ * @example 2026-06-10T12:00:00.000Z
32
+ */
33
+ createdAt: Date;
34
+ /**
35
+ * Date when promo code was updated
36
+ * @example 2026-06-10T12:00:00.000Z
37
+ */
38
+ updatedAt: Date;
39
+ /**
40
+ * User or system id that created promo code
41
+ * @example 507f1f77bcf86cd799439013
42
+ */
43
+ createdBy: string;
44
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ import type { ObjectId } from 'bson';
2
+ /**
3
+ * Promo code usage representation in DataBase
4
+ */
5
+ export interface PromoCodeUsageDBScheme {
6
+ /**
7
+ * Promo code usage id
8
+ */
9
+ _id: ObjectId;
10
+ /**
11
+ * Applied promo code id
12
+ */
13
+ promoCodeId: ObjectId;
14
+ /**
15
+ * User who applied promo code
16
+ */
17
+ userId: string;
18
+ /**
19
+ * Workspace where promo code was applied
20
+ */
21
+ workspaceId: ObjectId;
22
+ /**
23
+ * Date when promo code was applied
24
+ * @example 2026-06-10T12:30:00.000Z
25
+ */
26
+ appliedAt: Date;
27
+ /**
28
+ * UTM parameters captured when promo code was applied. Used for analytics purposes
29
+ */
30
+ utm?: {
31
+ /**
32
+ * UTM source - identifies which site sent the traffic
33
+ */
34
+ source?: string;
35
+ /**
36
+ * UTM medium - identifies what type of link was used
37
+ */
38
+ medium?: string;
39
+ /**
40
+ * UTM campaign - identifies a specific product promotion or strategic campaign
41
+ */
42
+ campaign?: string;
43
+ /**
44
+ * UTM content - identifies what specifically was clicked to bring the user to the site
45
+ */
46
+ content?: string;
47
+ /**
48
+ * UTM term - identifies search terms
49
+ */
50
+ term?: string;
51
+ };
52
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.ts CHANGED
@@ -24,6 +24,8 @@ export * from './src/dbScheme/notificationsChannelSettings';
24
24
  export * from './src/dbScheme/membership';
25
25
  export * from './src/dbScheme/userProjectsLastVisit';
26
26
  export * from './src/dbScheme/plan';
27
+ export * from './src/dbScheme/promoCode';
28
+ export * from './src/dbScheme/promoCodeUsage';
27
29
  export * from './src/dbScheme/project';
28
30
  export * from './src/dbScheme/projectNotificationsRule';
29
31
  export * from './src/dbScheme/release';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawk.so/types",
3
- "version": "0.6.0-rc.1",
3
+ "version": "0.6.1",
4
4
  "description": "TypeScript definitions for Hawk",
5
5
  "types": "build/index.d.ts",
6
6
  "main": "build/index.js",
@@ -81,9 +81,14 @@ export interface GitHubInstallation {
81
81
  updatedAt: Date;
82
82
 
83
83
  /**
84
- * Delegate user for agent actions in Worker
84
+ * Delegate user whose GitHub OAuth token is used by the Worker
85
+ * for user-to-server actions (e.g. Copilot assignment).
86
+ *
87
+ * null right after installation is saved — at that point we only have
88
+ * the installation_id from GitHub but haven't exchanged the OAuth code yet.
89
+ * Gets populated in the same /oauth callback once the code exchange succeeds.
85
90
  */
86
- delegatedUser: GitHubInstallationDelegatedUser;
91
+ delegatedUser: GitHubInstallationDelegatedUser | null;
87
92
  }
88
93
 
89
94
  /**
@@ -0,0 +1,52 @@
1
+ import type { ObjectId } from 'bson';
2
+
3
+ /**
4
+ * Promo code representation in DataBase
5
+ */
6
+ export interface PromoCodeDBScheme {
7
+ /**
8
+ * Promo code id
9
+ */
10
+ _id: ObjectId;
11
+
12
+ /**
13
+ * Normalized promo code value
14
+ * @example HAWK-2026
15
+ */
16
+ code: string;
17
+
18
+ /**
19
+ * Tariff plan assigned by this promo code
20
+ */
21
+ planId: ObjectId;
22
+
23
+ /**
24
+ * Maximum total usages count
25
+ * @example 100
26
+ */
27
+ limit?: number;
28
+
29
+ /**
30
+ * Date after which promo code cannot be used
31
+ * @example 2026-12-31T23:59:59.000Z
32
+ */
33
+ expiresAt?: Date;
34
+
35
+ /**
36
+ * Date when promo code was created
37
+ * @example 2026-06-10T12:00:00.000Z
38
+ */
39
+ createdAt: Date;
40
+
41
+ /**
42
+ * Date when promo code was updated
43
+ * @example 2026-06-10T12:00:00.000Z
44
+ */
45
+ updatedAt: Date;
46
+
47
+ /**
48
+ * User or system id that created promo code
49
+ * @example 507f1f77bcf86cd799439013
50
+ */
51
+ createdBy: string;
52
+ }
@@ -0,0 +1,62 @@
1
+ import type { ObjectId } from 'bson';
2
+
3
+ /**
4
+ * Promo code usage representation in DataBase
5
+ */
6
+ export interface PromoCodeUsageDBScheme {
7
+ /**
8
+ * Promo code usage id
9
+ */
10
+ _id: ObjectId;
11
+
12
+ /**
13
+ * Applied promo code id
14
+ */
15
+ promoCodeId: ObjectId;
16
+
17
+ /**
18
+ * User who applied promo code
19
+ */
20
+ userId: string;
21
+
22
+ /**
23
+ * Workspace where promo code was applied
24
+ */
25
+ workspaceId: ObjectId;
26
+
27
+ /**
28
+ * Date when promo code was applied
29
+ * @example 2026-06-10T12:30:00.000Z
30
+ */
31
+ appliedAt: Date;
32
+
33
+ /**
34
+ * UTM parameters captured when promo code was applied. Used for analytics purposes
35
+ */
36
+ utm?: {
37
+ /**
38
+ * UTM source - identifies which site sent the traffic
39
+ */
40
+ source?: string;
41
+
42
+ /**
43
+ * UTM medium - identifies what type of link was used
44
+ */
45
+ medium?: string;
46
+
47
+ /**
48
+ * UTM campaign - identifies a specific product promotion or strategic campaign
49
+ */
50
+ campaign?: string;
51
+
52
+ /**
53
+ * UTM content - identifies what specifically was clicked to bring the user to the site
54
+ */
55
+ content?: string;
56
+
57
+ /**
58
+ * UTM term - identifies search terms
59
+ */
60
+ term?: string;
61
+ };
62
+ }