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
49 changes: 46 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,44 @@ 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;
Comment on lines +42 to +56

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

To improve maintainability and reduce redundancy, you can define the PlanStatus type from the constant object. This avoids duplicating the string literals and the JSDoc comments, ensuring they are always in sync.

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

export type PlanStatus = (typeof PlanStatus)[keyof typeof PlanStatus];


/**
* The Convert product line this billing plan pertains to.
* - `experiences`: Relates to A/B testing, MVT, Split URL, and personalization features.
* - `deploy`: Relates to the "Deploy" feature for rolling out changes to specific audiences without A/B testing reports. Knowledge Base: "Deployments have the potential to contain small segments...and this could be interpreted by Privacy Authorities in Europe as identification of data subjects."
* - `addons`: Relates to add-on products that extend the core platform capabilities.
*
*/
export type Products = 'experiences' | 'deploy' | 'addons';

/**
* The Convert product line this billing plan pertains to.
* - `experiences`: Relates to A/B testing, MVT, Split URL, and personalization features.
* - `deploy`: Relates to the "Deploy" feature for rolling out changes to specific audiences without A/B testing reports. Knowledge Base: "Deployments have the potential to contain small segments...and this could be interpreted by Privacy Authorities in Europe as identification of data subjects."
* - `addons`: Relates to add-on products that extend the core platform capabilities.
*
*/
export const Products = {
EXPERIENCES: 'experiences',
DEPLOY: 'deploy',
ADDONS: 'addons'
} as const;
Comment on lines +58 to +78

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

To improve maintainability and reduce redundancy, you can define the Products type from the constant object. This avoids duplicating the string literals and the JSDoc comments, ensuring they are always in sync.

/**
 * The Convert product line this billing plan pertains to.
 * - `experiences`: Relates to A/B testing, MVT, Split URL, and personalization features.
 * - `deploy`: Relates to the "Deploy" feature for rolling out changes to specific audiences without A/B testing reports. Knowledge Base: "Deployments have the potential to contain small segments...and this could be interpreted by Privacy Authorities in Europe as identification of data subjects."
 * - `addons`: Relates to add-on products that extend the core platform capabilities.
 *
 */
export const Products = {
    EXPERIENCES: 'experiences',
    DEPLOY: 'deploy',
    ADDONS: 'addons'
} as const;

export type Products = (typeof Products)[keyof typeof Products];


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 +2438,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 +2794,7 @@ export type VisitorSegments = {
/**
* Traffic source
*/
source?: 'campaign' | 'search' | 'referral' | 'direct';
source?: 'campaign' | 'search' | 'referral' | 'direct' | 'ai_tool';
/**
* Campaign string
*/
Expand Down Expand Up @@ -2805,7 +2847,7 @@ export const browser = {
/**
* Traffic source
*/
export type source = 'campaign' | 'search' | 'referral' | 'direct';
export type 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 type definition is coupled with the source constant object defined below. To improve maintainability and avoid redundancy, consider defining the type from the constant object. This would also involve moving the constant definition before this type definition.

For example:

/**
 * Traffic source
 */
export const source = {
    CAMPAIGN: 'campaign',
    SEARCH: 'search',
    REFERRAL: 'referral',
    DIRECT: 'direct',
    AI_TOOL: 'ai_tool'
} as const;

export type source = (typeof source)[keyof typeof source];

Since this change spans across areas not fully covered by the diff, a direct code suggestion is not provided.


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

/**
Expand Down
Loading