Skip to content

Update Serving API - from backend PR #6302#367

Open
clllaur wants to merge 1 commit intomain-convertfrom
api-serving-update-6302
Open

Update Serving API - from backend PR #6302#367
clllaur wants to merge 1 commit intomain-convertfrom
api-serving-update-6302

Conversation

@clllaur
Copy link
Contributor

@clllaur clllaur commented Mar 18, 2026

Updating TS Serving API after the latest changes from backend repo,
PR #6302

@clllaur clllaur requested a review from a team March 18, 2026 11:50
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request synchronizes the TypeScript Serving API definitions with recent updates from the backend repository. It introduces new enumerations for account billing statuses and product lines, enhances the custom domain configuration with a version identifier, and expands the recognized traffic sources to include AI tools. These changes ensure that the frontend applications consume the most current and accurate data structures from the backend.

Highlights

  • New Billing Status Types: Added PlanStatus type and constant to represent account billing statuses like 'paid', 'trial', 'canceled', etc.
  • New Product Line Types: Introduced Products type and constant to categorize Convert product lines, including 'experiences', 'deploy', and 'addons'.
  • Custom Domain Versioning: Extended the ConfigProject type to include an optional version field for custom domains.
  • New Traffic Source: Updated traffic source definitions (VisitorSegments.source and source type/constant) to include 'ai_tool' as a new option.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sonarqubecloud
Copy link

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TypeScript serving API types to align with backend changes. The changes include adding new types for billing (PlanStatus, Products), updating the project configuration to include a version for custom domains, and extending the source type for visitor segments. My review focuses on improving the maintainability of the newly added types by reducing code duplication. I've suggested refactoring the new type and constant object pairs to derive the type from the constant, which is a common and recommended practice in TypeScript for ensuring consistency and reducing boilerplate.

Comment on lines +42 to +56
/**
* 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;

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];

Comment on lines +58 to +78
/**
* 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;

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];

* Traffic source
*/
export type source = 'campaign' | 'search' | 'referral' | 'direct';
export type source = 'campaign' | 'search' | 'referral' | 'direct' | 'ai_tool';

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant