Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions packages/types/src/config/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ export const ConfigAudienceTypes = {
TRANSIENT: 'transient'
} as const;

/**
* Account billing status
*/
export type PlanStatus = 'paid' | 'trial' | 'trialExpired' | 'canceled' | 'paused';

/**
* Account billing status
*/
export const PlanStatus = {
PAID: 'paid',
TRIAL: 'trial',
TRIAL_EXPIRED: 'trialExpired',
CANCELED: 'canceled',
PAUSED: 'paused'
} as const;

export type PageNumber = {
/**
* The page number for paginated results. For example, if `results_per_page` is 30, `page: 2` will retrieve items 31-60.
Expand Down Expand Up @@ -2400,6 +2416,10 @@ export type ConfigProject = {
* Custom domain to be used instead of standard Convert's one
*/
domain?: string;
/**
* The version of the custom domain.
*/
readonly version?: string;
} | null;
/**
* List of domains allowed to be tracked under this project
Expand Down Expand Up @@ -2752,7 +2772,7 @@ export type VisitorSegments = {
/**
* Traffic source
*/
source?: 'campaign' | 'search' | 'referral' | 'direct';
source?: 'campaign' | 'search' | 'referral' | 'direct' | 'ai_tool';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This PR adds the 'ai_tool' traffic source in two places: here in VisitorSegments and in the source type on line 2828. This duplication creates a maintenance risk, as future updates might miss one of the locations.

To centralize the definition, you should use a single named type. This would involve refactoring the existing source type (ideally renaming it to Source or TrafficSource to follow naming conventions) and then referencing it here.

Example of a better approach:

// Define the type once
export type TrafficSource = 'campaign' | 'search' | 'referral' | 'direct' | 'ai_tool';

// ... in VisitorSegments
source?: TrafficSource;

Since this file is auto-generated, this refactoring might need to be done in the source OpenAPI specification or the generation tool.

/**
* Campaign string
*/
Expand Down Expand Up @@ -2805,7 +2825,7 @@ export const browser = {
/**
* Traffic source
*/
export type source = 'campaign' | 'search' | 'referral' | 'direct';
export type source = 'campaign' | 'search' | 'referral' | 'direct' | 'ai_tool';

/**
* Traffic source
Expand All @@ -2814,7 +2834,8 @@ export const source = {
CAMPAIGN: 'campaign',
SEARCH: 'search',
REFERRAL: 'referral',
DIRECT: 'direct'
DIRECT: 'direct',
AI_TOOL: 'ai_tool'
} as const;

/**
Expand Down
Loading