diff --git a/build/index.d.ts b/build/index.d.ts index fd335d1..69b99d6 100644 --- a/build/index.d.ts +++ b/build/index.d.ts @@ -10,6 +10,7 @@ export * from './src/base/event/taskManagerItem'; export * from './src/base/event/addons'; export * from './src/base/integrations/integrationToken'; export * from './src/base/project/ProjectTaskManager'; +export * from './src/base/utm'; export * from './src/base/workspace/GitHubIntegration'; export * from './src/base/user/GitHubAuthorization'; export * from './src/dbScheme/businessOperation'; diff --git a/build/index.js b/build/index.js index 9a50d79..d28d535 100644 --- a/build/index.js +++ b/build/index.js @@ -26,6 +26,7 @@ __exportStar(require("./src/base/event/taskManagerItem"), exports); __exportStar(require("./src/base/event/addons"), exports); __exportStar(require("./src/base/integrations/integrationToken"), exports); __exportStar(require("./src/base/project/ProjectTaskManager"), exports); +__exportStar(require("./src/base/utm"), exports); __exportStar(require("./src/base/workspace/GitHubIntegration"), exports); __exportStar(require("./src/base/user/GitHubAuthorization"), exports); __exportStar(require("./src/dbScheme/businessOperation"), exports); diff --git a/build/src/base/utm.d.ts b/build/src/base/utm.d.ts new file mode 100644 index 0000000..0e1a1e4 --- /dev/null +++ b/build/src/base/utm.d.ts @@ -0,0 +1,25 @@ +/** + * UTM parameters captured for analytics. + */ +export interface Utm { + /** + * UTM source - identifies which site sent the traffic. + */ + source?: string; + /** + * UTM medium - identifies what type of link was used. + */ + medium?: string; + /** + * UTM campaign - identifies a specific product promotion or strategic campaign. + */ + campaign?: string; + /** + * UTM content - identifies what specifically was clicked to bring the user to the site. + */ + content?: string; + /** + * UTM term - identifies search terms. + */ + term?: string; +} diff --git a/build/src/base/utm.js b/build/src/base/utm.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/build/src/base/utm.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/build/src/dbScheme/promoCodeUsage.d.ts b/build/src/dbScheme/promoCodeUsage.d.ts index a460f2d..ea041e3 100644 --- a/build/src/dbScheme/promoCodeUsage.d.ts +++ b/build/src/dbScheme/promoCodeUsage.d.ts @@ -1,5 +1,6 @@ import type { ObjectId } from 'bson'; import type { PromoCodeBenefitType } from './promoCode.ts'; +import type { Utm } from '../base/utm.ts'; /** * Promo code usage representation in DataBase */ @@ -43,28 +44,7 @@ export interface PromoCodeUsageDBScheme { /** * UTM parameters captured when promo code was applied. Used for analytics purposes */ - utm?: { - /** - * UTM source - identifies which site sent the traffic - */ - source?: string; - /** - * UTM medium - identifies what type of link was used - */ - medium?: string; - /** - * UTM campaign - identifies a specific product promotion or strategic campaign - */ - campaign?: string; - /** - * UTM content - identifies what specifically was clicked to bring the user to the site - */ - content?: string; - /** - * UTM term - identifies search terms - */ - term?: string; - }; + utm?: Utm; /** * Date when promo code was successfully applied * @example 2026-06-10T12:30:00.000Z diff --git a/build/src/dbScheme/user.d.ts b/build/src/dbScheme/user.d.ts index 564885e..15a7bf4 100644 --- a/build/src/dbScheme/user.d.ts +++ b/build/src/dbScheme/user.d.ts @@ -4,6 +4,7 @@ import type { BankCard } from './bankCard.ts'; import type { MembershipDBScheme } from './membership.ts'; import type { UserProjectsLastVisitDBScheme } from './userProjectsLastVisit.ts'; import type { GitHubAuthorization } from '../base/user/GitHubAuthorization.ts'; +import type { Utm } from '../base/utm.ts'; /** * Interface representing how user is stored in DB */ @@ -57,28 +58,7 @@ export interface UserDBScheme { /** * UTM parameters from signup - Data form where user went to sign up. Used for analytics purposes */ - utm?: { - /** - * UTM source - identifies which site sent the traffic - */ - source?: string; - /** - * UTM medium - identifies what type of link was used - */ - medium?: string; - /** - * UTM campaign - identifies a specific product promotion or strategic campaign - */ - campaign?: string; - /** - * UTM content - identifies what specifically was clicked to bring the user to the site - */ - content?: string; - /** - * UTM term - identifies search terms - */ - term?: string; - }; + utm?: Utm; /** * GitHub OAuth authorizations. * Used for user-to-server operations (e.g. Copilot assignment). diff --git a/index.ts b/index.ts index a6e89e9..34bdae8 100644 --- a/index.ts +++ b/index.ts @@ -14,6 +14,7 @@ export * from './src/base/event/addons'; export * from './src/base/integrations/integrationToken'; export * from './src/base/project/ProjectTaskManager'; +export * from './src/base/utm'; export * from './src/base/workspace/GitHubIntegration'; export * from './src/base/user/GitHubAuthorization'; diff --git a/package.json b/package.json index 22d0efc..9b8df56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hawk.so/types", - "version": "0.6.2", + "version": "0.6.3", "description": "TypeScript definitions for Hawk", "types": "build/index.d.ts", "main": "build/index.js", diff --git a/src/base/utm.ts b/src/base/utm.ts new file mode 100644 index 0000000..2424ee2 --- /dev/null +++ b/src/base/utm.ts @@ -0,0 +1,29 @@ +/** + * UTM parameters captured for analytics. + */ +export interface Utm { + /** + * UTM source - identifies which site sent the traffic. + */ + source?: string; + + /** + * UTM medium - identifies what type of link was used. + */ + medium?: string; + + /** + * UTM campaign - identifies a specific product promotion or strategic campaign. + */ + campaign?: string; + + /** + * UTM content - identifies what specifically was clicked to bring the user to the site. + */ + content?: string; + + /** + * UTM term - identifies search terms. + */ + term?: string; +} diff --git a/src/dbScheme/promoCodeUsage.ts b/src/dbScheme/promoCodeUsage.ts index fb9f63d..b6d149b 100644 --- a/src/dbScheme/promoCodeUsage.ts +++ b/src/dbScheme/promoCodeUsage.ts @@ -1,5 +1,6 @@ import type { ObjectId } from 'bson'; import type { PromoCodeBenefitType } from './promoCode.ts'; +import type { Utm } from '../base/utm.ts'; /** * Promo code usage representation in DataBase @@ -53,32 +54,7 @@ export interface PromoCodeUsageDBScheme { /** * UTM parameters captured when promo code was applied. Used for analytics purposes */ - utm?: { - /** - * UTM source - identifies which site sent the traffic - */ - source?: string; - - /** - * UTM medium - identifies what type of link was used - */ - medium?: string; - - /** - * UTM campaign - identifies a specific product promotion or strategic campaign - */ - campaign?: string; - - /** - * UTM content - identifies what specifically was clicked to bring the user to the site - */ - content?: string; - - /** - * UTM term - identifies search terms - */ - term?: string; - }; + utm?: Utm; /** * Date when promo code was successfully applied diff --git a/src/dbScheme/user.ts b/src/dbScheme/user.ts index 802c696..763ca2c 100644 --- a/src/dbScheme/user.ts +++ b/src/dbScheme/user.ts @@ -4,6 +4,7 @@ import type { BankCard } from './bankCard.ts'; import type { MembershipDBScheme } from './membership.ts'; import type { UserProjectsLastVisitDBScheme } from './userProjectsLastVisit.ts'; import type { GitHubAuthorization } from '../base/user/GitHubAuthorization.ts'; +import type { Utm } from '../base/utm.ts'; /** * Interface representing how user is stored in DB @@ -69,32 +70,7 @@ export interface UserDBScheme { /** * UTM parameters from signup - Data form where user went to sign up. Used for analytics purposes */ - utm?: { - /** - * UTM source - identifies which site sent the traffic - */ - source?: string; - - /** - * UTM medium - identifies what type of link was used - */ - medium?: string; - - /** - * UTM campaign - identifies a specific product promotion or strategic campaign - */ - campaign?: string; - - /** - * UTM content - identifies what specifically was clicked to bring the user to the site - */ - content?: string; - - /** - * UTM term - identifies search terms - */ - term?: string; - }; + utm?: Utm; /** * GitHub OAuth authorizations.