The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Improve billing settings UI (#22377)
Thomas des Francsd8cc81cb91a4
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex 7c4ee7bacb2..9367462fc5c 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -1570,6 +1570,7 @@ type BillingSubscription {currentPeriodEnd: DateTimemetadata: JSON!phases: [BillingSubscriptionSchedulePhase!]!+ cancelAt: DateTime}enum SubscriptionStatus {diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex 3595ae36f93..3c7851897c3 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -1226,6 +1226,7 @@ export interface BillingSubscription {currentPeriodEnd?: Scalars['DateTime']metadata: Scalars['JSON']phases: BillingSubscriptionSchedulePhase[]+ cancelAt?: Scalars['DateTime']__typename: 'BillingSubscription'}@@ -4300,6 +4301,7 @@ export interface BillingSubscriptionGenqlSelection{currentPeriodEnd?: boolean | numbermetadata?: boolean | numberphases?: BillingSubscriptionSchedulePhaseGenqlSelection+ cancelAt?: boolean | number__typename?: boolean | number__scalar?: boolean | number}diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.tsindex dc0151e2f9d..367b434651a 100644--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts@@ -3112,6 +3112,9 @@ export default {"phases": [133],+ "cancelAt": [+ 4+ ],"__typename": [1]diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex a1a0e1b433b..0ace4cc3db4 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -711,6 +711,7 @@ export type BillingSession = {export type BillingSubscription = {__typename?: 'BillingSubscription';billingSubscriptionItems?: Maybe<Array<BillingSubscriptionItem>>;+ cancelAt?: Maybe<Scalars['DateTime']['output']>;currentPeriodEnd?: Maybe<Scalars['DateTime']['output']>;id: Scalars['UUID']['output'];interval?: Maybe<SubscriptionInterval>;@@ -7764,26 +7765,26 @@ export type BillingSubscriptionSchedulePhaseItemFragmentFragment = { __typename?export type CancelSwitchBillingIntervalMutationVariables = Exact<{ [key: string]: never; }>;-export type CancelSwitchBillingIntervalMutation = { __typename?: 'Mutation', cancelSwitchBillingInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type CancelSwitchBillingIntervalMutation = { __typename?: 'Mutation', cancelSwitchBillingInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type CancelSwitchBillingPlanMutationVariables = Exact<{ [key: string]: never; }>;-export type CancelSwitchBillingPlanMutation = { __typename?: 'Mutation', cancelSwitchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type CancelSwitchBillingPlanMutation = { __typename?: 'Mutation', cancelSwitchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type CancelSwitchResourceCreditPriceMutationVariables = Exact<{ [key: string]: never; }>;-export type CancelSwitchResourceCreditPriceMutation = { __typename?: 'Mutation', cancelSwitchResourceCreditPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type CancelSwitchResourceCreditPriceMutation = { __typename?: 'Mutation', cancelSwitchResourceCreditPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type CheckoutSessionMutationVariables = Exact<{recurringInterval: SubscriptionInterval;@@ -7819,26 +7820,26 @@ export type SetResourceCreditSubscriptionPriceMutationVariables = Exact<{}>;-export type SetResourceCreditSubscriptionPriceMutation = { __typename?: 'Mutation', setResourceCreditSubscriptionPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type SetResourceCreditSubscriptionPriceMutation = { __typename?: 'Mutation', setResourceCreditSubscriptionPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type SwitchBillingPlanMutationVariables = Exact<{ [key: string]: never; }>;-export type SwitchBillingPlanMutation = { __typename?: 'Mutation', switchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type SwitchBillingPlanMutation = { __typename?: 'Mutation', switchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type SwitchSubscriptionIntervalMutationVariables = Exact<{ [key: string]: never; }>;-export type SwitchSubscriptionIntervalMutation = { __typename?: 'Mutation', switchSubscriptionInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type SwitchSubscriptionIntervalMutation = { __typename?: 'Mutation', switchSubscriptionInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };+ }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };export type BillingPortalSessionQueryVariables = Exact<{returnUrlPath?: InputMaybe<Scalars['String']['input']>;@@ -8231,17 +8232,17 @@ export type GetUsageAnalyticsQueryVariables = Exact<{export type GetUsageAnalyticsQuery = { __typename?: 'Query', getUsageAnalytics: { __typename?: 'UsageAnalytics', periodStart: string, periodEnd: string, usageByUser: Array<{ __typename?: 'UsageBreakdownItem', key: string, label?: string | null, creditsUsed: number }>, usageByOperationType: Array<{ __typename?: 'UsageBreakdownItem', key: string, creditsUsed: number }>, usageByModel: Array<{ __typename?: 'UsageBreakdownItem', key: string, creditsUsed: number }>, timeSeries: Array<{ __typename?: 'UsageTimeSeries', date: string, creditsUsed: number }>, userDailyUsage?: { __typename?: 'UsageUserDaily', userWorkspaceId: string, dailyUsage: Array<{ __typename?: 'UsageTimeSeries', date: string, creditsUsed: number }> } | null } };-export type BillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> };+export type BillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> };-export type CurrentBillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type CurrentBillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }}> | null };-export type UserQueryFragmentFragment = { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidSignedEnterpriseKey: boolean, hasValidEnterpriseValidityToken: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, isInternalMessagesImportEnabled: boolean, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, installedApplications: Array<{ __typename?: 'Application', id: string, name: string, universalIdentifier: string, logo?: string | null }>, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type UserQueryFragmentFragment = { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidSignedEnterpriseKey: boolean, hasValidEnterpriseValidityToken: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, isInternalMessagesImportEnabled: boolean, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, installedApplications: Array<{ __typename?: 'Application', id: string, name: string, universalIdentifier: string, logo?: string | null }>, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null } | null, billingCustomer?: { __typename?: 'BillingCustomer', id: string, hasPaymentMethod?: boolean | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } };+ }> | null } | null, billingCustomer?: { __typename?: 'BillingCustomer', id: string, hasPaymentMethod?: boolean | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } };export type WorkspaceUrlsFragmentFragment = { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null };@@ -8260,10 +8261,10 @@ export type DeleteUserWorkspaceMutation = { __typename?: 'Mutation', deleteUserFexport type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;-export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidSignedEnterpriseKey: boolean, hasValidEnterpriseValidityToken: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, isInternalMessagesImportEnabled: boolean, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, installedApplications: Array<{ __typename?: 'Application', id: string, name: string, universalIdentifier: string, logo?: string | null }>, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:+export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidSignedEnterpriseKey: boolean, hasValidEnterpriseValidityToken: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, isInternalMessagesImportEnabled: boolean, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, installedApplications: Array<{ __typename?: 'Application', id: string, name: string, universalIdentifier: string, logo?: string | null }>, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct:| { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }| { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }- }> | null } | null, billingCustomer?: { __typename?: 'BillingCustomer', id: string, hasPaymentMethod?: boolean | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } } };+ }> | null } | null, billingCustomer?: { __typename?: 'BillingCustomer', id: string, hasPaymentMethod?: boolean | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } } };export type ViewFieldFragmentFragment = { __typename?: 'ViewField', id: string, fieldMetadataId: string, viewId: string, isVisible: boolean, position: number, size: number, aggregateOperation?: AggregateOperations | null, viewFieldGroupId?: string | null, isActive: boolean, createdAt: string, updatedAt: string, deletedAt?: string | null };@@ -8720,12 +8721,12 @@ export const ObjectPermissionFragmentFragmentDoc = {"kind":"Document","definitioexport const WorkspaceUrlsFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}}]} as unknown as DocumentNode<WorkspaceUrlsFragmentFragment, unknown>;export const BillingSubscriptionSchedulePhaseItemFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}}]} as unknown as DocumentNode<BillingSubscriptionSchedulePhaseItemFragmentFragment, unknown>;export const BillingSubscriptionSchedulePhaseFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}}]} as unknown as DocumentNode<BillingSubscriptionSchedulePhaseFragmentFragment, unknown>;-export const CurrentBillingSubscriptionFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}}]} as unknown as DocumentNode<CurrentBillingSubscriptionFragmentFragment, unknown>;-export const BillingSubscriptionFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}}]} as unknown as DocumentNode<BillingSubscriptionFragmentFragment, unknown>;+export const CurrentBillingSubscriptionFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}}]} as unknown as DocumentNode<CurrentBillingSubscriptionFragmentFragment, unknown>;+export const BillingSubscriptionFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}}]} as unknown as DocumentNode<BillingSubscriptionFragmentFragment, unknown>;export const RoleFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}}]} as unknown as DocumentNode<RoleFragmentFragment, unknown>;export const AvailableWorkspaceFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<AvailableWorkspaceFragmentFragment, unknown>;export const AvailableWorkspacesFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<AvailableWorkspacesFragmentFragment, unknown>;-export const UserQueryFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessFullAdminPanel"}},{"kind":"Field","name":{"kind":"Name","value":"canImpersonate"}},{"kind":"Field","name":{"kind":"Name","value":"supportUserHash"}},{"kind":"Field","name":{"kind":"Name","value":"onboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMember"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"deletedWorkspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentUserWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"}},{"kind":"Field","name":{"kind":"Name","value":"objectsPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodSummary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"strategy"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidSignedEnterpriseKey"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidEnterpriseValidityToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceCustomApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"installedApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isCustomDomainEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataVersion"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingCustomer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingEntitlements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembersCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fastModel"}},{"kind":"Field","name":{"kind":"Name","value":"smartModel"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"enabledAiModelIds"}},{"kind":"Field","name":{"kind":"Name","value":"useRecommendedModels"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"trashRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"eventLogRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"editableProfileFields"}},{"kind":"Field","name":{"kind":"Name","value":"isInternalMessagesImportEnabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userVars"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"colorScheme"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"locale"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","name":{"kind":"Name","value":"dateFormat"}},{"kind":"Field","name":{"kind":"Name","value":"timeFormat"}},{"kind":"Field","name":{"kind":"Name","value":"calendarStartDay"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DeletedWorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}}]} as unknown as DocumentNode<UserQueryFragmentFragment, unknown>;+export const UserQueryFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessFullAdminPanel"}},{"kind":"Field","name":{"kind":"Name","value":"canImpersonate"}},{"kind":"Field","name":{"kind":"Name","value":"supportUserHash"}},{"kind":"Field","name":{"kind":"Name","value":"onboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMember"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"deletedWorkspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentUserWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"}},{"kind":"Field","name":{"kind":"Name","value":"objectsPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodSummary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"strategy"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidSignedEnterpriseKey"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidEnterpriseValidityToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceCustomApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"installedApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isCustomDomainEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataVersion"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingCustomer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingEntitlements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembersCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fastModel"}},{"kind":"Field","name":{"kind":"Name","value":"smartModel"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"enabledAiModelIds"}},{"kind":"Field","name":{"kind":"Name","value":"useRecommendedModels"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"trashRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"eventLogRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"editableProfileFields"}},{"kind":"Field","name":{"kind":"Name","value":"isInternalMessagesImportEnabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userVars"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"colorScheme"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"locale"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","name":{"kind":"Name","value":"dateFormat"}},{"kind":"Field","name":{"kind":"Name","value":"timeFormat"}},{"kind":"Field","name":{"kind":"Name","value":"calendarStartDay"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DeletedWorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}}]} as unknown as DocumentNode<UserQueryFragmentFragment, unknown>;export const ViewFieldFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewFieldFragmentFragment, unknown>;export const ViewFieldGroupFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewFieldGroupFragmentFragment, unknown>;export const ViewFilterFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilter"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"relationTargetFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewFilterFragmentFragment, unknown>;@@ -8884,16 +8885,16 @@ export const FindOneApplicationRegistrationDocument = {"kind":"Document","definiexport const UninstallApplicationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UninstallApplication"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"uninstallApplication"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}]}]}}]} as unknown as DocumentNode<UninstallApplicationMutation, UninstallApplicationMutationVariables>;export const UpdateOneApplicationVariableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOneApplicationVariable"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"value"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOneApplicationVariable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}},{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"value"}}},{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}]}]}}]} as unknown as DocumentNode<UpdateOneApplicationVariableMutation, UpdateOneApplicationVariableMutationVariables>;export const ApplicationConnectionProvidersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ApplicationConnectionProviders"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applicationConnectionProviders"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"oauth"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scopes"}},{"kind":"Field","name":{"kind":"Name","value":"isClientCredentialsConfigured"}}]}}]}}]}}]} as unknown as DocumentNode<ApplicationConnectionProvidersQuery, ApplicationConnectionProvidersQueryVariables>;-export const CancelSwitchBillingIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingIntervalMutation, CancelSwitchBillingIntervalMutationVariables>;-export const CancelSwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingPlanMutation, CancelSwitchBillingPlanMutationVariables>;-export const CancelSwitchResourceCreditPriceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchResourceCreditPriceMutation, CancelSwitchResourceCreditPriceMutationVariables>;+export const CancelSwitchBillingIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingIntervalMutation, CancelSwitchBillingIntervalMutationVariables>;+export const CancelSwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingPlanMutation, CancelSwitchBillingPlanMutationVariables>;+export const CancelSwitchResourceCreditPriceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchResourceCreditPriceMutation, CancelSwitchResourceCreditPriceMutationVariables>;export const CheckoutSessionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CheckoutSession"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recurringInterval"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionInterval"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"successUrlPath"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"plan"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPlanKey"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"requirePaymentMethod"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkoutSession"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"recurringInterval"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recurringInterval"}}},{"kind":"Argument","name":{"kind":"Name","value":"successUrlPath"},"value":{"kind":"Variable","name":{"kind":"Name","value":"successUrlPath"}}},{"kind":"Argument","name":{"kind":"Name","value":"plan"},"value":{"kind":"Variable","name":{"kind":"Name","value":"plan"}}},{"kind":"Argument","name":{"kind":"Name","value":"requirePaymentMethod"},"value":{"kind":"Variable","name":{"kind":"Name","value":"requirePaymentMethod"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode<CheckoutSessionMutation, CheckoutSessionMutationVariables>;export const CreateBillingPaymentMethodSetupIntentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateBillingPaymentMethodSetupIntent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createBillingPaymentMethodSetupIntent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"clientSecret"}}]}}]}}]} as unknown as DocumentNode<CreateBillingPaymentMethodSetupIntentMutation, CreateBillingPaymentMethodSetupIntentMutationVariables>;export const CreateSubscriptionPaymentIntentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscriptionPaymentIntent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"recurringInterval"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionInterval"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"plan"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPlanKey"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"idempotencyKey"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createSubscriptionPaymentIntent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"recurringInterval"},"value":{"kind":"Variable","name":{"kind":"Name","value":"recurringInterval"}}},{"kind":"Argument","name":{"kind":"Name","value":"plan"},"value":{"kind":"Variable","name":{"kind":"Name","value":"plan"}}},{"kind":"Argument","name":{"kind":"Name","value":"idempotencyKey"},"value":{"kind":"Variable","name":{"kind":"Name","value":"idempotencyKey"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"clientSecret"}},{"kind":"Field","name":{"kind":"Name","value":"paymentIntentType"}}]}}]}}]} as unknown as DocumentNode<CreateSubscriptionPaymentIntentMutation, CreateSubscriptionPaymentIntentMutationVariables>;export const EndSubscriptionTrialPeriodDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"EndSubscriptionTrialPeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"endSubscriptionTrialPeriod"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}},{"kind":"Field","name":{"kind":"Name","value":"billingPortalUrl"}}]}}]}}]} as unknown as DocumentNode<EndSubscriptionTrialPeriodMutation, EndSubscriptionTrialPeriodMutationVariables>;-export const SetResourceCreditSubscriptionPriceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetResourceCreditSubscriptionPrice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"priceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setResourceCreditSubscriptionPrice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"priceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"priceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SetResourceCreditSubscriptionPriceMutation, SetResourceCreditSubscriptionPriceMutationVariables>;-export const SwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"switchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SwitchBillingPlanMutation, SwitchBillingPlanMutationVariables>;-export const SwitchSubscriptionIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SwitchSubscriptionInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"switchSubscriptionInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SwitchSubscriptionIntervalMutation, SwitchSubscriptionIntervalMutationVariables>;+export const SetResourceCreditSubscriptionPriceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetResourceCreditSubscriptionPrice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"priceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setResourceCreditSubscriptionPrice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"priceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"priceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SetResourceCreditSubscriptionPriceMutation, SetResourceCreditSubscriptionPriceMutationVariables>;+export const SwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"switchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SwitchBillingPlanMutation, SwitchBillingPlanMutationVariables>;+export const SwitchSubscriptionIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SwitchSubscriptionInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"switchSubscriptionInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<SwitchSubscriptionIntervalMutation, SwitchSubscriptionIntervalMutationVariables>;export const BillingPortalSessionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BillingPortalSession"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"returnUrlPath"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"forPaymentMethodUpdate"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"billingPortalSession"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"returnUrlPath"},"value":{"kind":"Variable","name":{"kind":"Name","value":"returnUrlPath"}}},{"kind":"Argument","name":{"kind":"Name","value":"forPaymentMethodUpdate"},"value":{"kind":"Variable","name":{"kind":"Name","value":"forPaymentMethodUpdate"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]} as unknown as DocumentNode<BillingPortalSessionQuery, BillingPortalSessionQueryVariables>;export const GetResourceCreditUsageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetResourceCreditUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getResourceCreditUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"usedCredits"}},{"kind":"Field","name":{"kind":"Name","value":"grantedCredits"}},{"kind":"Field","name":{"kind":"Name","value":"rolloverCredits"}},{"kind":"Field","name":{"kind":"Name","value":"totalGrantedCredits"}},{"kind":"Field","name":{"kind":"Name","value":"unitPriceCents"}}]}}]}}]} as unknown as DocumentNode<GetResourceCreditUsageQuery, GetResourceCreditUsageQueryVariables>;export const ListPlansDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"listPlans"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"listPlans"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"baseProducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingLicensedProduct"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingPriceLicensedFragment"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"resourceCreditProducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingLicensedProduct"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingPriceLicensedFragment"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"meteredProducts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingMeteredProduct"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"prices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingPriceMeteredFragment"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingPriceLicensedFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPriceLicensed"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"recurringInterval"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageType"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingPriceMeteredFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPriceMetered"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"priceUsageType"}},{"kind":"Field","name":{"kind":"Name","value":"recurringInterval"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"tiers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"flatAmount"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"upTo"}}]}}]}}]} as unknown as DocumentNode<ListPlansQuery, ListPlansQueryVariables>;@@ -8952,7 +8953,7 @@ export const UnsubscribePagePreviewUrlDocument = {"kind":"Document","definitionsexport const GetUsageAnalyticsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUsageAnalytics"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UsageAnalyticsInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getUsageAnalytics"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"usageByUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByOperationType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timeSeries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"periodStart"}},{"kind":"Field","name":{"kind":"Name","value":"periodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"userDailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"dailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetUsageAnalyticsQuery, GetUsageAnalyticsQueryVariables>;export const DeleteUserAccountDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserAccount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserAccountMutation, DeleteUserAccountMutationVariables>;export const DeleteUserWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUserFromWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceMemberIdToDelete"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserWorkspaceMutation, DeleteUserWorkspaceMutationVariables>;-export const GetCurrentUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserQueryFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"colorScheme"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"locale"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","name":{"kind":"Name","value":"dateFormat"}},{"kind":"Field","name":{"kind":"Name","value":"timeFormat"}},{"kind":"Field","name":{"kind":"Name","value":"calendarStartDay"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DeletedWorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessFullAdminPanel"}},{"kind":"Field","name":{"kind":"Name","value":"canImpersonate"}},{"kind":"Field","name":{"kind":"Name","value":"supportUserHash"}},{"kind":"Field","name":{"kind":"Name","value":"onboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMember"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"deletedWorkspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentUserWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"}},{"kind":"Field","name":{"kind":"Name","value":"objectsPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodSummary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"strategy"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidSignedEnterpriseKey"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidEnterpriseValidityToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceCustomApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"installedApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isCustomDomainEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataVersion"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingCustomer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingEntitlements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembersCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fastModel"}},{"kind":"Field","name":{"kind":"Name","value":"smartModel"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"enabledAiModelIds"}},{"kind":"Field","name":{"kind":"Name","value":"useRecommendedModels"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"trashRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"eventLogRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"editableProfileFields"}},{"kind":"Field","name":{"kind":"Name","value":"isInternalMessagesImportEnabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userVars"}}]}}]} as unknown as DocumentNode<GetCurrentUserQuery, GetCurrentUserQueryVariables>;+export const GetCurrentUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserQueryFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"colorScheme"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"locale"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","name":{"kind":"Name","value":"dateFormat"}},{"kind":"Field","name":{"kind":"Name","value":"timeFormat"}},{"kind":"Field","name":{"kind":"Name","value":"calendarStartDay"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DeletedWorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessFullAdminPanel"}},{"kind":"Field","name":{"kind":"Name","value":"canImpersonate"}},{"kind":"Field","name":{"kind":"Name","value":"supportUserHash"}},{"kind":"Field","name":{"kind":"Name","value":"onboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMember"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"deletedWorkspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentUserWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"}},{"kind":"Field","name":{"kind":"Name","value":"objectsPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodSummary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"strategy"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidSignedEnterpriseKey"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidEnterpriseValidityToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceCustomApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"installedApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isCustomDomainEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataVersion"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingCustomer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingEntitlements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembersCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fastModel"}},{"kind":"Field","name":{"kind":"Name","value":"smartModel"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"enabledAiModelIds"}},{"kind":"Field","name":{"kind":"Name","value":"useRecommendedModels"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"trashRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"eventLogRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"editableProfileFields"}},{"kind":"Field","name":{"kind":"Name","value":"isInternalMessagesImportEnabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userVars"}}]}}]} as unknown as DocumentNode<GetCurrentUserQuery, GetCurrentUserQueryVariables>;export const CreateManyViewFieldGroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateManyViewFieldGroups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateViewFieldGroupInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createManyViewFieldGroups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}}]} as unknown as DocumentNode<CreateManyViewFieldGroupsMutation, CreateManyViewFieldGroupsMutationVariables>;export const CreateManyViewFieldsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateManyViewFields"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateViewFieldInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createManyViewFields"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<CreateManyViewFieldsMutation, CreateManyViewFieldsMutationVariables>;export const CreateManyViewGroupsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateManyViewGroups"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateViewGroupInput"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createManyViewGroups"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"inputs"},"value":{"kind":"Variable","name":{"kind":"Name","value":"inputs"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<CreateManyViewGroupsMutation, CreateManyViewGroupsMutationVariables>;diff --git a/packages/twenty-front/src/modules/error-handler/components/AppPageErrorFallback.tsx b/packages/twenty-front/src/modules/error-handler/components/AppPageErrorFallback.tsxindex d0677d1d14e..a5a60c6f895 100644--- a/packages/twenty-front/src/modules/error-handler/components/AppPageErrorFallback.tsx+++ b/packages/twenty-front/src/modules/error-handler/components/AppPageErrorFallback.tsx@@ -1,8 +1,6 @@import { AppErrorDisplay } from '@/error-handler/components/internal/AppErrorDisplay';import { type AppErrorDisplayProps } from '@/error-handler/types/AppErrorDisplayProps';-import { PageBody } from '@/ui/layout/page/components/PageBody';-import { PageContainer } from '@/ui/layout/page/components/PageContainer';-import { PageHeader } from '@/ui/layout/page/components/PageHeader';+import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';import { t } from '@lingui/core/macro';type AppPageErrorFallbackProps = AppErrorDisplayProps;@@ -13,16 +11,12 @@ export const AppPageErrorFallback = ({title = t`Sorry, something went wrong`,}: AppPageErrorFallbackProps) => {return (- <PageContainer>- <PageHeader />-- <PageBody>- <AppErrorDisplay- error={error}- resetErrorBoundary={resetErrorBoundary}- title={title}- />- </PageBody>- </PageContainer>+ <PageCardLayout header={null} showInformationBanner={false}>+ <AppErrorDisplay+ error={error}+ resetErrorBoundary={resetErrorBoundary}+ title={title}+ />+ </PageCardLayout>);};diff --git a/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx b/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsxindex f0fceeb8238..40bf93ed84d 100644--- a/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx+++ b/packages/twenty-front/src/modules/front-components/hooks/__tests__/useFrontComponentExecutionContext.test.tsx@@ -543,7 +543,7 @@ describe('useFrontComponentExecutionContext', () => {title: 'Confirm?',subtitle: 'Are you sure?',confirmButtonText: 'Yes',- confirmButtonAccent: 'danger' as never,+ confirmButtonAccent: 'danger',},);});@@ -559,6 +559,32 @@ describe('useFrontComponentExecutionContext', () => {confirmButtonAccent: 'danger',});});++ it('should preserve danger as the default confirmation accent', async () => {+ const { result } = renderUseFrontComponentExecutionContext({+ frontComponentId: FRONT_COMPONENT_ID,+ });++ await act(async () => {+ await result.current.frontComponentHostCommunicationApi.openCommandConfirmationModal(+ {+ title: 'Confirm?',+ subtitle: 'Are you sure?',+ },+ );+ });++ expect(mockOpenConfirmationModal).toHaveBeenCalledWith({+ caller: {+ type: 'frontComponent',+ frontComponentId: FRONT_COMPONENT_ID,+ },+ title: 'Confirm?',+ subtitle: 'Are you sure?',+ confirmButtonText: undefined,+ confirmButtonAccent: 'danger',+ });+ });});describe('enqueueSnackbar', () => {diff --git a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.tsindex 24151d2b6c1..56c3712ad5b 100644--- a/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts+++ b/packages/twenty-front/src/modules/front-components/hooks/useFrontComponentExecutionContext.ts@@ -205,7 +205,12 @@ export const useFrontComponentExecutionContext = ({};const openCommandConfirmationModal: FrontComponentHostCommunicationApi['openCommandConfirmationModal'] =- async ({ title, subtitle, confirmButtonText, confirmButtonAccent }) => {+ async ({+ title,+ subtitle,+ confirmButtonText,+ confirmButtonAccent = 'danger',+ }) => {openConfirmationModal({caller: { type: 'frontComponent', frontComponentId },title,diff --git a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsxindex 23c9f81f8ca..d9d9efea76b 100644--- a/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx+++ b/packages/twenty-front/src/modules/information-banner/components/billing/InformationBannerFailPaymentInfo.tsx@@ -39,7 +39,9 @@ export const InformationBannerFailPaymentInfo = () => {? t`Last payment failed. Please update your billing details.`: t`Last payment failed. Please contact your admin.`}- buttonTitle={hasPermissionToUpdateBillingDetails ? t`Update` : undefined}+ buttonTitle={+ hasPermissionToUpdateBillingDetails ? t`Update payment` : undefined+ }buttonOnClick={() => openBillingPortal()}isButtonDisabled={loading || !isDefined(data)}/>diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingContent.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingContent.tsxindex 6877a11c7f9..3c7f7668a5a 100644--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingContent.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingContent.tsx@@ -4,7 +4,9 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { useRedirect } from '@/domain-manager/hooks/useRedirect';import { SettingsBillingCreditsSection } from '@/settings/billing/components/SettingsBillingCreditsSection';import { SettingsBillingSubscriptionInfo } from '@/settings/billing/components/SettingsBillingSubscriptionInfo';+import { SettingsBillingTrialNoPaymentMethodBanner } from '@/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner';import { useGetResourceCreditUsage } from '@/settings/billing/hooks/useGetResourceCreditUsage';+import { billingHasPaymentMethodSelector } from '@/settings/billing/states/billingHasPaymentMethodSelector';import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';@@ -25,18 +27,33 @@ export const SettingsBillingContent = () => {const currentWorkspace = useAtomStateValue(currentWorkspaceState);+ const currentBillingSubscription =+ currentWorkspace?.currentBillingSubscription;+const subscriptions = currentWorkspace?.billingSubscriptions;const hasSubscriptions = (subscriptions?.length ?? 0) > 0;const subscriptionStatus = useSubscriptionStatus();+ const billingHasPaymentMethod = useAtomStateValue(+ billingHasPaymentMethodSelector,+ );const { isGetResourceCreditUsageQueryLoaded: isUsageQueryLoaded } =useGetResourceCreditUsage();+ const displayTrialNoPaymentMethodCard =+ subscriptionStatus === SubscriptionStatus.Trialing &&+ billingHasPaymentMethod === false;+const hasNotCanceledCurrentSubscription =isDefined(subscriptionStatus) &&subscriptionStatus !== SubscriptionStatus.Canceled;+ const hasScheduledCancellation =+ currentBillingSubscription?.status !== SubscriptionStatus.Canceled &&+ isDefined(currentBillingSubscription?.cancelAt);+ const canCancelCurrentSubscription =+ hasNotCanceledCurrentSubscription && !hasScheduledCancellation;const { data, loading } = useQuery(BillingPortalSessionDocument, {variables: {@@ -56,24 +73,29 @@ export const SettingsBillingContent = () => {return (<SettingsPageContainer>+ {displayTrialNoPaymentMethodCard && currentBillingSubscription && (+ <SettingsBillingTrialNoPaymentMethodBanner+ currentBillingSubscription={currentBillingSubscription}+ />+ )}{hasNotCanceledCurrentSubscription &¤tWorkspace &&- currentWorkspace.currentBillingSubscription && (+ currentBillingSubscription && (<SettingsBillingSubscriptionInfocurrentWorkspace={currentWorkspace}- currentBillingSubscription={- currentWorkspace.currentBillingSubscription- }+ currentBillingSubscription={currentBillingSubscription}+ onUpdatePayment={openBillingPortal}+ isUpdatePaymentDisabled={billingPortalButtonDisabled}/>)}{hasNotCanceledCurrentSubscription &¤tWorkspace &&- currentWorkspace.currentBillingSubscription &&+ currentBillingSubscription &&isUsageQueryLoaded && (<SettingsBillingCreditsSection- currentBillingSubscription={- currentWorkspace.currentBillingSubscription- }+ currentBillingSubscription={currentBillingSubscription}+ onUpdatePayment={openBillingPortal}+ isUpdatePaymentDisabled={billingPortalButtonDisabled}/>)}<Section>@@ -89,7 +111,7 @@ export const SettingsBillingContent = () => {disabled={billingPortalButtonDisabled}/></Section>- {hasNotCanceledCurrentSubscription && (+ {canCancelCurrentSubscription && (<Section><H2Titletitle={t`Cancel your subscription`}diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsxindex 48edb2c756e..d3167336ac2 100644--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingCreditsSection.tsx@@ -1,146 +1,326 @@import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';import { useNumberFormat } from '@/localization/hooks/useNumberFormat';import { ResourceCreditPriceSelector } from '@/settings/billing/components/internal/ResourceCreditPriceSelector';-import { SettingsBillingLabelValueItem } from '@/settings/billing/components/internal/SettingsBillingLabelValueItem';-import { SubscriptionInfoContainer } from '@/settings/billing/components/SubscriptionInfoContainer';+import {+ StyledSettingsBillingCard,+ StyledSettingsBillingCardHeader,+} from '@/settings/billing/components/internal/SettingsBillingCard';+import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';import { useBillingWording } from '@/settings/billing/hooks/useBillingWording';import { useCurrentBillingFlags } from '@/settings/billing/hooks/useCurrentBillingFlags';import { useCurrentResourceCredit } from '@/settings/billing/hooks/useCurrentResourceCredit';import { useGetResourceCreditUsage } from '@/settings/billing/hooks/useGetResourceCreditUsage';+import { useSplitPhaseItemsInPrices } from '@/settings/billing/hooks/useSplitPhaseItemsInPrices';+import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';+import { useModal } from '@/ui/layout/modal/hooks/useModal';import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';import { styled } from '@linaria/react';import { t } from '@lingui/core/macro';-import { useContext } from 'react';import { DOCUMENTATION_PATHS } from 'twenty-shared/constants';import { SettingsPath } from 'twenty-shared/types';-import { getSettingsPath } from 'twenty-shared/utils';-import { IconChartBar, IconExternalLink } from 'twenty-ui/icon';-import { HorizontalSeparator, Section } from 'twenty-ui/layout';-import { H2Title } from 'twenty-ui/typography';-import { Info, ProgressBar } from 'twenty-ui/feedback';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';+import {+ IconChartBar,+ IconCoins,+ IconExternalLink,+ IconInfoCircle,+} from 'twenty-ui/icon';+import { ProgressBar } from 'twenty-ui/feedback';import { Button } from 'twenty-ui/input';+import { Section } from 'twenty-ui/layout';import { UndecoratedLink } from 'twenty-ui/navigation';-import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';-import { SubscriptionStatus } from '~/generated-metadata/graphql';+import { H2Title } from 'twenty-ui/typography';+import { themeCssVariables, useTheme } from 'twenty-ui/theme-constants';+import {+ PermissionFlagType,+ SubscriptionStatus,+} from '~/generated-metadata/graphql';-const StyledCreditUsageFooterActions = styled.div`+const MIN_VISIBLE_EMPTY_CREDIT_PROGRESS_PERCENTAGE = 4;++const StyledSettingsBillingCardBody = styled.div`+ display: flex;+ flex-direction: column;+ gap: ${themeCssVariables.spacing[3]};+ padding: ${themeCssVariables.spacing[3]};+`;++const StyledCreditsHeading = styled.div`+ align-items: baseline;+ display: flex;+ gap: ${themeCssVariables.spacing[1]};+ min-width: 0;+`;++const StyledCreditsHeadingLeft = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[2]};+`;++const StyledCreditsAmount = styled.span`+ color: ${themeCssVariables.font.color.primary};+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.medium};+ white-space: nowrap;+`;++const StyledCreditsInterval = styled.span`+ color: ${themeCssVariables.font.color.light};+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.regular};+ white-space: nowrap;+`;++const StyledCreditsFooter = styled.div`+ align-items: center;+ color: ${themeCssVariables.font.color.tertiary};+ display: flex;+ flex-wrap: wrap;+ font-size: ${themeCssVariables.font.size.sm};+ gap: ${themeCssVariables.spacing[2]};+ justify-content: flex-end;+`;++const StyledCreditsCardBody = styled(StyledSettingsBillingCardBody)`+ padding: ${themeCssVariables.spacing[4]} ${themeCssVariables.spacing[3]}+ ${themeCssVariables.spacing[3]};+`;++const StyledRolloverText = styled.div`+ align-items: center;+ display: flex;+ flex: 1 1 280px;+ gap: ${themeCssVariables.spacing[1]};+ min-width: 0;+`;++const StyledUsageMetrics = styled.div`+ align-items: center;display: flex;+ flex: 0 0 auto;gap: ${themeCssVariables.spacing[2]};- margin-top: ${themeCssVariables.spacing[4]};+ white-space: nowrap;+`;++const StyledMetricValue = styled.span`+ color: ${themeCssVariables.font.color.secondary};+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.medium};+`;++const StyledCreditUsageFooterActions = styled.div`+ display: flex;+ gap: ${themeCssVariables.spacing[3]};+ margin-top: ${themeCssVariables.spacing[3]};`;export const SettingsBillingCreditsSection = ({currentBillingSubscription,+ onUpdatePayment,+ isUpdatePaymentDisabled,}: {currentBillingSubscription: NonNullable<CurrentWorkspace['currentBillingSubscription']>;+ onUpdatePayment: () => void;+ isUpdatePaymentDisabled: boolean;}) => {- const { theme } = useContext(ThemeContext);+ const theme = useTheme();const subscriptionStatus = useSubscriptionStatus();+ const { openModal } = useModal();const { formatNumber } = useNumberFormat();const { isMonthlyPlan } = useCurrentBillingFlags();+ const { splitedPhaseItemsInPrices } = useSplitPhaseItemsInPrices();+ const nextResourceCreditPrice =+ splitedPhaseItemsInPrices.nextResourceCreditPrice;- const { getResourceCreditPricesByInterval } = useCurrentResourceCredit();+ const isCancellationScheduled =+ currentBillingSubscription.status !== SubscriptionStatus.Canceled &&+ isDefined(currentBillingSubscription.cancelAt);++ const {+ currentResourceCreditBillingPrice,+ getResourceCreditPricesByInterval,+ } = useCurrentResourceCredit();const { getIntervalLabel } = useBillingWording();const isTrialing = subscriptionStatus === SubscriptionStatus.Trialing;+ const shouldUpdatePayment =+ subscriptionStatus === SubscriptionStatus.PastDue ||+ subscriptionStatus === SubscriptionStatus.Unpaid;+ const { [PermissionFlagType.WORKSPACE]: hasPermissionToEndTrialPeriod } =+ usePermissionFlagMap();const { getResourceCreditUsage } = useGetResourceCreditUsage();const { usedCredits, grantedCredits, totalGrantedCredits, rolloverCredits } =getResourceCreditUsage();- const progressBarValue = (usedCredits / totalGrantedCredits) * 100;-const intervalLabel = getIntervalLabel(isMonthlyPlan);+ const packageCredits = currentResourceCreditBillingPrice?.creditAmount;+ const nextCreditsByPeriod = nextResourceCreditPrice?.creditAmount;+ const displayedGrantedCredits = packageCredits ?? grantedCredits;+ const canCancelCreditPackSwitch =+ !isCancellationScheduled &&+ !shouldUpdatePayment &&+ isDefined(nextResourceCreditPrice) &&+ packageCredits !== nextCreditsByPeriod;++ const remainingCreditsPercentage =+ totalGrantedCredits > 0+ ? ((totalGrantedCredits - usedCredits) / totalGrantedCredits) * 100+ : 0;+ const clampedRemainingCreditsPercentage = Math.min(+ 100,+ Math.max(0, remainingCreditsPercentage),+ );+ const isCreditsEmpty = clampedRemainingCreditsPercentage === 0;+ const displayedProgressBarValue = isCreditsEmpty+ ? MIN_VISIBLE_EMPTY_CREDIT_PROGRESS_PERCENTAGE+ : clampedRemainingCreditsPercentage;++ const hasRolloverCredits = rolloverCredits > 0;const usedCreditsDisplay = formatNumber(usedCredits, { decimals: 2 });+ const grantedCreditsDisplay = formatNumber(displayedGrantedCredits, {+ decimals: 2,+ });const totalGrantedCreditsDisplay = formatNumber(totalGrantedCredits, {decimals: 2,});- const grantedCreditsDisplay = formatNumber(grantedCredits, { decimals: 2 });- const rolloverCreditsDisplay = formatNumber(rolloverCredits, { decimals: 2 });- const rolloverCapDisplay = formatNumber(grantedCredits * 2, { decimals: 2 });+ const rolloverCreditsDisplay = formatNumber(rolloverCredits, {+ decimals: 2,+ });+ const rolloverCapDisplay = formatNumber(displayedGrantedCredits * 2, {+ decimals: 2,+ });+ const remainingCreditsPercentageDisplay = formatNumber(+ clampedRemainingCreditsPercentage,+ { decimals: 0 },+ );const resourceCreditPrices = getResourceCreditPricesByInterval(currentBillingSubscription.interval,);+ const creditsDocumentationUrl = getDocumentationUrl({+ path: DOCUMENTATION_PATHS.USER_GUIDE_BILLING_CAPABILITIES_CREDITS,+ });return (- <>- <Section>- <H2Title- title={t`Credit Usage`}- description={t`Track your ${intervalLabel} workflow credit consumption.`}- />- <SubscriptionInfoContainer>- <SettingsBillingLabelValueItem- label={t`Credits Used`}- value={t`${usedCreditsDisplay} / ${totalGrantedCreditsDisplay} available`}+ <Section>+ <H2Title+ title={t`Credits`}+ description={t`Credits are used by workflows, AI chats, agents, and approved apps`}+ />+ <StyledSettingsBillingCard>+ <StyledSettingsBillingCardHeader>+ <StyledCreditsHeadingLeft>+ <IconCoins+ size={theme.icon.size.md}+ color={themeCssVariables.color.green9}+ />+ <StyledCreditsHeading>+ <StyledCreditsAmount>+ {t`${grantedCreditsDisplay} credits`}+ </StyledCreditsAmount>+ <StyledCreditsInterval>+ {isTrialing+ ? t`/${intervalLabel} after trial`+ : t`/${intervalLabel}`}+ </StyledCreditsInterval>+ </StyledCreditsHeading>+ </StyledCreditsHeadingLeft>+ <ResourceCreditPriceSelector+ resourceCreditPrices={resourceCreditPrices}+ isTrialing={isTrialing}+ shouldRedirectToManageBilling={isCancellationScheduled}+ shouldRedirectToUpdatePayment={shouldUpdatePayment}+ canEndTrialPeriod={hasPermissionToEndTrialPeriod}+ onManageBilling={onUpdatePayment}+ isManageBillingDisabled={isUpdatePaymentDisabled}+ onUpdatePayment={onUpdatePayment}+ isUpdatePaymentDisabled={isUpdatePaymentDisabled}+ canCancelCreditPackSwitch={canCancelCreditPackSwitch}+ onCancelCreditPackSwitch={() =>+ openModal(BILLING_MODAL_IDS.cancelSwitchMeteredPrice)+ }/>+ </StyledSettingsBillingCardHeader>+ <StyledCreditsCardBody><ProgressBar- value={progressBarValue}+ value={displayedProgressBarValue}+ backgroundColor={themeCssVariables.background.tertiary}barColor={- progressBarValue > 100 ? theme.color.red8 : theme.color.blue+ isCreditsEmpty+ ? themeCssVariables.color.red9+ : themeCssVariables.color.green9}- backgroundColor={theme.background.tertiary}- withBorderRadius={true}+ withBorderRadius/>-- {!isTrialing && (- <>- <HorizontalSeparator noMargin color={theme.background.tertiary} />- <SettingsBillingLabelValueItem- label={t`This ${intervalLabel}'s credits`}- value={grantedCreditsDisplay}- />- {rolloverCredits > 0 && (- <SettingsBillingLabelValueItem- label={t`Rolled over`}- value={`+${rolloverCreditsDisplay}`}- />- )}- <Info- accent="blue"- text={t`Unused credits roll over, up to 2× your plan's credits (max ${rolloverCapDisplay}).`}- />- </>- )}- </SubscriptionInfoContainer>-- <StyledCreditUsageFooterActions>- <UndecoratedLink to={getSettingsPath(SettingsPath.Usage)}>- <Button- Icon={IconChartBar}- title={t`View usage`}- variant="secondary"- />- </UndecoratedLink>+ <StyledCreditsFooter>+ {isTrialing ? (+ <StyledRolloverText>+ <StyledMetricValue>+ {totalGrantedCreditsDisplay}+ </StyledMetricValue>+ {t`credits available during the trial period`}+ </StyledRolloverText>+ ) : hasRolloverCredits ? (+ <StyledRolloverText>+ <StyledMetricValue>+ {totalGrantedCreditsDisplay}+ </StyledMetricValue>+ {t`credits available (Including ${rolloverCreditsDisplay} from rollover)`}+ </StyledRolloverText>+ ) : (+ <StyledRolloverText>+ <IconInfoCircle size={theme.icon.size.sm} />+ {t`Unused credits roll over, up to 2× your plan's credits (max ${rolloverCapDisplay}).`}+ </StyledRolloverText>+ )}+ <StyledUsageMetrics>+ <span>+ <StyledMetricValue>{usedCreditsDisplay}</StyledMetricValue>{' '}+ {t`credits used`}+ </span>+ <span>·</span>+ <span>+ <StyledMetricValue>+ {remainingCreditsPercentageDisplay}+ </StyledMetricValue>{' '}+ {t`% left`}+ </span>+ </StyledUsageMetrics>+ </StyledCreditsFooter>+ </StyledCreditsCardBody>+ </StyledSettingsBillingCard>+ <StyledCreditUsageFooterActions>+ <UndecoratedLink to={getSettingsPath(SettingsPath.Usage)}><Button- Icon={IconExternalLink}- title={t`How credits work`}- variant="secondary"- onClick={() =>- window.open(- getDocumentationUrl({- path: DOCUMENTATION_PATHS.USER_GUIDE_BILLING_CAPABILITIES_CREDITS,- }),- '_blank',- )- }+ Icon={IconChartBar}+ title={t`View usage`}+ variant="primary"+ size="small"/>- </StyledCreditUsageFooterActions>- </Section>- <Section>- <ResourceCreditPriceSelector- resourceCreditPrices={resourceCreditPrices}- isTrialing={isTrialing}+ </UndecoratedLink>+ <Button+ Icon={IconExternalLink}+ title={t`How credits work`}+ variant="secondary"+ size="small"+ onClick={() =>+ window.open(+ creditsDocumentationUrl,+ '_blank',+ 'noopener,noreferrer',+ )+ }/>- </Section>- </>+ </StyledCreditUsageFooterActions>+ </Section>);};diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsxindex 3da45a7d15f..91b517fe840 100644--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx@@ -1,16 +1,12 @@-import { SubscriptionInfoContainer } from '@/settings/billing/components/SubscriptionInfoContainer';-import {- SubscriptionInfoHeaderRow,- SubscriptionInfoRowContainer,-} from '@/settings/billing/components/internal/SubscriptionInfoRowContainer';--import {- type CurrentWorkspace,- currentWorkspaceState,-} from '@/auth/states/currentWorkspaceState';+import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';+import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersState';+import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';import { useNumberFormat } from '@/localization/hooks/useNumberFormat';-import { PlansTags } from '@/settings/billing/components/internal/PlansTags';+import { SettingsBillingSubscriptionInfoCard } from '@/settings/billing/components/internal/SettingsBillingSubscriptionInfoCard';+import { SettingsBillingSubscriptionInfoCardHeaderActions } from '@/settings/billing/components/internal/SettingsBillingSubscriptionInfoCardHeaderActions';+import { SettingsBillingSubscriptionInfoModals } from '@/settings/billing/components/internal/SettingsBillingSubscriptionInfoModals';+import { useApplyCurrentWorkspaceBillingUpdate } from '@/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate';import { useBillingSubscriptionCost } from '@/settings/billing/hooks/useBillingSubscriptionCost';import { useBillingWording } from '@/settings/billing/hooks/useBillingWording';import { useCurrentBillingFlags } from '@/settings/billing/hooks/useCurrentBillingFlags';@@ -18,37 +14,22 @@ import { useCurrentPlan } from '@/settings/billing/hooks/useCurrentPlan';import { useCurrentResourceCredit } from '@/settings/billing/hooks/useCurrentResourceCredit';import { useEndSubscriptionTrialPeriod } from '@/settings/billing/hooks/useEndSubscriptionTrialPeriod';import { useGetResourceCreditUsage } from '@/settings/billing/hooks/useGetResourceCreditUsage';-import { useHasNextBillingPhase } from '@/settings/billing/hooks/useHasNextBillingPhase';import { useNextBillingPhase } from '@/settings/billing/hooks/useNextBillingPhase';-import { useNextBillingSeats } from '@/settings/billing/hooks/useNextBillingSeats';import { useNextPlan } from '@/settings/billing/hooks/useNextPlan';import { useSplitPhaseItemsInPrices } from '@/settings/billing/hooks/useSplitPhaseItemsInPrices';import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';-import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';-import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { useSubscriptionStatus } from '@/workspace/hooks/useSubscriptionStatus';+import { CombinedGraphQLErrors } from '@apollo/client/errors';import { useMutation } from '@apollo/client/react';-import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';-import { useMemo, useState } from 'react';+import { useState } from 'react';import { isDefined } from 'twenty-shared/utils';-import {- IconArrowDown,- IconArrowUp,- IconCalendarEvent,- IconCalendarRepeat,- IconCircleX,- IconCoins,- IconSum,- IconTag,- IconUsers,-} from 'twenty-ui/icon';-import { H2Title, Label } from 'twenty-ui/typography';-import { Button } from 'twenty-ui/input';-import { HorizontalSeparator, Section } from 'twenty-ui/layout';-import { themeCssVariables } from 'twenty-ui/theme-constants';+import { IconClockPlay, IconCoins, IconTag } from 'twenty-ui/icon';+import { H2Title } from 'twenty-ui/typography';+import { Section } from 'twenty-ui/layout';import {BillingPlanKey,CancelSwitchBillingIntervalDocument,@@ -62,58 +43,30 @@ import {} from '~/generated-metadata/graphql';import { beautifyExactDate } from '~/utils/date-utils';-const SWITCH_BILLING_INTERVAL_TO_MONTHLY_MODAL_ID =- 'switch-billing-interval-to-monthly-modal';--const SWITCH_BILLING_INTERVAL_TO_YEARLY_MODAL_ID =- 'switch-billing-interval-to-yearly-modal';--const SWITCH_BILLING_PLAN_TO_ENTERPRISE_MODAL_ID =- 'switch-billing-plan-to-enterprise-modal';--const SWITCH_BILLING_PLAN_TO_PRO_MODAL_ID = 'switch-billing-plan-to-pro-modal';--const END_TRIAL_PERIOD_MODAL_ID = 'end-trial-period-modal';--const CANCEL_SWITCH_BILLING_PLAN_MODAL_ID = 'cancel-switch-billing-plan-modal';--const CANCEL_SWITCH_BILLING_INTERVAL_MODAL_ID =- 'cancel-switch-billing-interval-modal';--const CANCEL_SWITCH_METERED_PRICE_MODAL_ID =- 'cancel-switch-metered-price-modal';--const StyledSwitchButtonContainer = styled.div`- align-items: center;- display: flex;- gap: ${themeCssVariables.spacing[2]};- margin-top: ${themeCssVariables.spacing[4]};-`;--const StyledTotalGroup = styled.div`- display: flex;- flex-direction: column;- gap: ${themeCssVariables.spacing[1]};-`;-export const SettingsBillingSubscriptionInfo = ({currentWorkspace,currentBillingSubscription,+ onUpdatePayment,+ isUpdatePaymentDisabled,}: {currentWorkspace: CurrentWorkspace;currentBillingSubscription: NonNullable<CurrentWorkspace['currentBillingSubscription']>;+ onUpdatePayment: () => void;+ isUpdatePaymentDisabled: boolean;}) => {const { t } = useLingui();const { formatNumber } = useNumberFormat();const { openModal } = useModal();- const { refetchResourceCreditUsage } = useGetResourceCreditUsage();-const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();+ const { applyCurrentWorkspaceBillingUpdate } =+ useApplyCurrentWorkspaceBillingUpdate();+ const { refetchResourceCreditUsage } = useGetResourceCreditUsage();+const { currentResourceCreditBillingPrice } = useCurrentResourceCredit();const { currentPlan, oppositPlan } = useCurrentPlan();@@ -121,10 +74,8 @@ export const SettingsBillingSubscriptionInfo = ({useCurrentBillingFlags();const { splitedPhaseItemsInPrices } = useSplitPhaseItemsInPrices();- const { hasNextBillingPhase } = useHasNextBillingPhase();- const { nextPlan } = useNextPlan();- const { nextBillingSeats } = useNextBillingSeats();const { nextBillingPhase } = useNextBillingPhase();+ const { nextPlan } = useNextPlan();const nextInterval =splitedPhaseItemsInPrices?.nextBasePrice?.recurringInterval;const nextResourceCreditPrice =@@ -139,9 +90,7 @@ export const SettingsBillingSubscriptionInfo = ({const nextCreditsByPeriod = nextResourceCreditPrice?.creditAmount ?? null;const {- getIntervalLabel,getIntervalLabelAsAdjectiveCapitalize,- getYearlyDiscountPercent,confirmationModalSwitchToProMessage,confirmationModalSwitchToOrganizationMessage,confirmationModalSwitchToMonthlyMessage,@@ -169,12 +118,26 @@ export const SettingsBillingSubscriptionInfo = ({CancelSwitchResourceCreditPriceDocument,);- const setCurrentWorkspace = useSetAtomState(currentWorkspaceState);+ const currentWorkspaceMembers = useAtomStateValue(+ currentWorkspaceMembersState,+ );const isTrialPeriod = subscriptionStatus === SubscriptionStatus.Trialing;+ const shouldUpdatePayment =+ subscriptionStatus === SubscriptionStatus.PastDue ||+ subscriptionStatus === SubscriptionStatus.Unpaid;++ const scheduledCancellationDate = currentBillingSubscription.cancelAt;+ const isCancellationScheduled =+ currentBillingSubscription.status !== SubscriptionStatus.Canceled &&+ isDefined(scheduledCancellationDate);+ const scheduledCancellationDateLabel = isDefined(scheduledCancellationDate)+ ? beautifyExactDate(scheduledCancellationDate)+ : undefined;const canSwitchSubscription =- subscriptionStatus !== SubscriptionStatus.PastDue;+ subscriptionStatus !== SubscriptionStatus.PastDue &&+ !isCancellationScheduled;const { endTrialPeriod, isLoading: isEndTrialPeriodLoading } =useEndSubscriptionTrialPeriod();@@ -193,45 +156,174 @@ export const SettingsBillingSubscriptionInfo = ({const formatCentsToDisplay = (cents: number | null | undefined) =>isDefined(cents) ? formatNumber(cents / 100, { decimals: 2 }) : undefined;- const perSeatUnit = isMonthlyPlan ? t`mo` : t`yr`;- const totalIntervalWord = getIntervalLabel(isMonthlyPlan);- const creditsIntervalAdjective =- getIntervalLabelAsAdjectiveCapitalize(isMonthlyPlan);+ const formatBillingPeriodCentsToMonthlyDisplay = (+ cents: number | null | undefined,+ ) =>+ isDefined(cents)+ ? formatNumber(+ (currentInterval === SubscriptionInterval.Year ? cents / 12 : cents) /+ 100,+ { decimals: 2 },+ )+ : undefined;const perSeatPriceDisplay = formatCentsToDisplay(perSeatAmountCents);+ const displayedPerSeatPrice =+ formatBillingPeriodCentsToMonthlyDisplay(perSeatAmountCents);- const seatsInlinePrice =- isDefined(seats) && isDefined(perSeatPriceDisplay)- ? t`${seats} × $${perSeatPriceDisplay} / seat / ${perSeatUnit}`- : undefined;-- const totalDisplay = formatCentsToDisplay(totalCents);- const seatsSubtotalDisplay = formatCentsToDisplay(seatsSubtotalCents);- const creditsSubtotalDisplay = formatCentsToDisplay(creditsSubtotalCents);+ const totalDisplay = formatBillingPeriodCentsToMonthlyDisplay(totalCents);+ const seatsSubtotalDisplay =+ formatBillingPeriodCentsToMonthlyDisplay(seatsSubtotalCents);+ const creditsSubtotalDisplay =+ formatBillingPeriodCentsToMonthlyDisplay(creditsSubtotalCents);const totalRenewDate = isDefined(currentBillingSubscription.currentPeriodEnd)? getBeautifiedRenewDate(): undefined;+ const displayedSubscriptionDate = isCancellationScheduled+ ? scheduledCancellationDateLabel+ : totalRenewDate;+ const subscriptionDateLabel = isCancellationScheduled+ ? t`End date`+ : t`Renewal date`;++ const subscriptionDescription =+ isCancellationScheduled && isDefined(scheduledCancellationDateLabel)+ ? t`Your subscription is scheduled to end on ${scheduledCancellationDateLabel}. You will keep access until then`+ : isDefined(totalRenewDate)+ ? t`Next charge ${totalRenewDate}. Invoice amount may vary if you add members or credits between periods`+ : t`Invoice amount may vary if you add members or credits between periods`;++ const planLabel =+ currentPlan.planKey === BillingPlanKey.PRO+ ? t`Pro plan`+ : t`Organization plan`;+ const planName =+ currentPlan.planKey === BillingPlanKey.PRO+ ? t`pro plan`+ : t`organization plan`;+ const intervalUnit =+ currentInterval === SubscriptionInterval.Month ? t`month` : t`year`;+ const startSubscriptionSubtitle = isDefined(perSeatPriceDisplay)+ ? t`We will activate your $${perSeatPriceDisplay}/user/${intervalUnit} ${planName}. Do you want to proceed?`+ : t`We will activate your ${planName}. Do you want to proceed?`;++ const statusDescriptor = (() => {+ if (isCancellationScheduled) {+ return {+ label: t`Ending`,+ tone: 'orange' as const,+ };+ }++ switch (currentBillingSubscription.status) {+ case SubscriptionStatus.Active:+ return { label: t`Active`, tone: 'blue' as const };+ case SubscriptionStatus.Trialing:+ return { label: t`Trial`, tone: 'sky' as const };+ case SubscriptionStatus.PastDue:+ return { label: t`Past due`, tone: 'red' as const };+ case SubscriptionStatus.Canceled:+ return { label: t`Canceled`, tone: 'gray' as const };+ case SubscriptionStatus.Incomplete:+ return { label: t`Incomplete`, tone: 'orange' as const };+ case SubscriptionStatus.IncompleteExpired:+ return { label: t`Incomplete expired`, tone: 'gray' as const };+ case SubscriptionStatus.Paused:+ return { label: t`Paused`, tone: 'gray' as const };+ case SubscriptionStatus.Unpaid:+ return { label: t`Unpaid`, tone: 'red' as const };+ default:+ return { label: t`Unknown`, tone: 'gray' as const };+ }+ })();++ const currentIntervalLabel = getIntervalLabelAsAdjectiveCapitalize(+ currentInterval === SubscriptionInterval.Month,+ );- const totalBreakdownText =- isDefined(seatsSubtotalDisplay) && isDefined(creditsSubtotalDisplay)- ? t`$${seatsSubtotalDisplay} seats + $${creditsSubtotalDisplay} credits`+ const seatsSubtotalValue = isDefined(seatsSubtotalDisplay)+ ? `$${seatsSubtotalDisplay}`+ : '-';+ const seatCountLabel = seats === 1 ? t`seat` : t`seats`;+ const seatsSubtotalDetails =+ isDefined(seats) && isDefined(displayedPerSeatPrice)+ ? t`(${seats} ${seatCountLabel} × $${displayedPerSeatPrice})`: undefined;- const totalNextChargeText = isDefined(totalRenewDate)- ? t`next charge ${totalRenewDate}`++ const creditsSubtotalValue = isDefined(creditsSubtotalDisplay)+ ? `$${creditsSubtotalDisplay}`+ : '-';+ const creditsSubtotalDetails = isDefined(currentCreditsByPeriod)+ ? t`(${formatNumber(currentCreditsByPeriod, { decimals: 2 })} credits)`: undefined;- const totalHelperText = isDefined(totalBreakdownText)- ? [totalBreakdownText, totalNextChargeText].filter(isDefined).join(' · ')+ const totalValue = isDefined(totalDisplay) ? `$${totalDisplay}` : '-';+ const totalIntervalSubtitle = isDefined(totalDisplay)+ ? currentInterval === SubscriptionInterval.Month+ ? t`/month`+ : t`/month billed yearly`+ : undefined;+ const scheduledChangeStartDate = isDefined(nextBillingPhase?.start_date)+ ? beautifyExactDate(nextBillingPhase.start_date * 1000): undefined;- const yearlyDiscountPercent = getYearlyDiscountPercent();-- const switchToYearlyTitle =- yearlyDiscountPercent > 0- ? t`Switch to Yearly · save ${yearlyDiscountPercent}%`- : t`Switch to Yearly`;-- // Loading states to avoid race conditions on actions+ const canDisplaySwitchToYearlyAction =+ !isCancellationScheduled &&+ !shouldUpdatePayment &&+ isMonthlyPlan &&+ (!nextInterval || currentInterval === nextInterval);+ const canDisplaySwitchToMonthlyAction =+ !isCancellationScheduled &&+ !shouldUpdatePayment &&+ isYearlyPlan &&+ (!nextInterval || currentInterval === nextInterval);+ const canSwitchToOrganizationPlan =+ isProPlan && (!nextPlan || currentPlan.planKey === nextPlan.planKey);+ const canCancelIntervalSwitch =+ isDefined(nextInterval) && currentInterval !== nextInterval;+ const canStartSubscription = isTrialPeriod && hasPermissionToEndTrialPeriod;+ const canSwitchToProPlan =+ isEnterprisePlan && (!nextPlan || currentPlan.planKey === nextPlan.planKey);+ const canCancelPlanSwitch =+ isDefined(nextPlan) && currentPlan.planKey !== nextPlan.planKey;++ const scheduledChangeItems = [+ ...(nextPlan && currentPlan.planKey !== nextPlan.planKey+ ? [+ {+ Icon: IconTag,+ label: t`Plan`,+ value:+ nextPlan.planKey === BillingPlanKey.PRO+ ? t`Pro`+ : t`Organization`,+ },+ ]+ : []),+ ...(nextInterval && currentInterval !== nextInterval+ ? [+ {+ Icon: IconClockPlay,+ label: t`Billing interval`,+ value: getIntervalLabelAsAdjectiveCapitalize(+ nextInterval === SubscriptionInterval.Month,+ ),+ },+ ]+ : []),+ ...(isDefined(nextCreditsByPeriod) &&+ currentCreditsByPeriod !== nextCreditsByPeriod+ ? [+ {+ Icon: IconCoins,+ label: t`Credits`,+ value: t`${formatNumber(nextCreditsByPeriod, {+ decimals: 2,+ })} credits`,+ },+ ]+ : []),+ ];const [isSwitchingInterval, setIsSwitchingInterval] = useState(false);const [isSwitchingPlan, setIsSwitchingPlan] = useState(false);const [isCancellingPlanSwitch, setIsCancellingPlanSwitch] = useState(false);@@ -240,418 +332,245 @@ export const SettingsBillingSubscriptionInfo = ({const [isCancellingMeteredSwitch, setIsCancellingMeteredSwitch] =useState(false);- const isAnyActionLoading = useMemo(- () =>- isSwitchingInterval ||- isSwitchingPlan ||- isCancellingPlanSwitch ||- isCancellingIntervalSwitch ||- isCancellingMeteredSwitch ||- isEndTrialPeriodLoading,- [- isSwitchingInterval,- isSwitchingPlan,- isCancellingPlanSwitch,- isCancellingIntervalSwitch,- isCancellingMeteredSwitch,- isEndTrialPeriodLoading,- ],- );-- const refreshWorkspace = ({- currentBillingSubscription,- billingSubscriptions,- }: Pick<- CurrentWorkspace,- 'currentBillingSubscription' | 'billingSubscriptions'- >) => {- setCurrentWorkspace({- ...currentWorkspace,- currentBillingSubscription,- billingSubscriptions,+ const isAnyActionLoading =+ isSwitchingInterval ||+ isSwitchingPlan ||+ isCancellingPlanSwitch ||+ isCancellingIntervalSwitch ||+ isCancellingMeteredSwitch ||+ isEndTrialPeriodLoading;++ const isSubscriptionActionDisabled =+ !canSwitchSubscription || isAnyActionLoading;++ const applyBillingUpdate = (+ billingUpdate: Parameters<typeof applyCurrentWorkspaceBillingUpdate>[0],+ ) => {+ applyCurrentWorkspaceBillingUpdate(billingUpdate, {+ onBillingUpdateApplied: refetchResourceCreditUsage,});- refetchResourceCreditUsage();};- const switchInterval = async () => {- if (isAnyActionLoading || isSwitchingInterval) return;- setIsSwitchingInterval(true);+ const runBillingAction = async ({+ action,+ getErrorMessage,+ getSuccessMessage,+ isLoading,+ setIsLoading,+ }: {+ action: () => Promise<void>;+ getErrorMessage: () => string;+ getSuccessMessage: () => string;+ isLoading: boolean;+ setIsLoading: (isLoading: boolean) => void;+ }) => {+ if (isAnyActionLoading || isLoading) return;++ setIsLoading(true);try {- const { success } = await endTrialPeriodIfNeeded();- if (success === false) {- return;- }- const { data } = await switchSubscriptionIntervalMutation();-- const beautifiedRenewDate = getBeautifiedRenewDate();- const isCurrentMonth =- currentBillingSubscription.interval === SubscriptionInterval.Month;- const message = isCurrentMonth- ? t`Subscription has been switched to Yearly.`- : t`Subscription will be switch to Monthly the ${beautifiedRenewDate}.`;-- if (- isDefined(data?.switchSubscriptionInterval.currentBillingSubscription)- ) {- refreshWorkspace(data.switchSubscriptionInterval);- }- enqueueSuccessSnackBar({ message });- } catch {+ await action();++ enqueueSuccessSnackBar({ message: getSuccessMessage() });+ } catch (error) {enqueueErrorSnackBar({- message: t`Error while switching subscription.`,+ message: getErrorMessage(),});++ if (!CombinedGraphQLErrors.is(error)) {+ throw error;+ }} finally {- setIsSwitchingInterval(false);+ setIsLoading(false);}};- const endTrialPeriodIfNeeded = async () => {- if (currentBillingSubscription.status === SubscriptionStatus.Trialing) {- return await endTrialPeriod();- }- return { success: true };+ const switchInterval = async () => {+ await runBillingAction({+ action: async () => {+ const { data } = await switchSubscriptionIntervalMutation();++ if (+ isDefined(data?.switchSubscriptionInterval.currentBillingSubscription)+ ) {+ applyBillingUpdate(data.switchSubscriptionInterval);+ }+ },+ getErrorMessage: () => t`Error while switching subscription.`,+ getSuccessMessage: () => {+ const isCurrentMonth =+ currentBillingSubscription.interval === SubscriptionInterval.Month;++ if (isCurrentMonth) {+ return t`Subscription has been switched to Yearly.`;+ }++ return isTrialPeriod+ ? t`Subscription has been switched to Monthly.`+ : t`Subscription will be switched to Monthly the ${getBeautifiedRenewDate()}.`;+ },+ isLoading: isSwitchingInterval,+ setIsLoading: setIsSwitchingInterval,+ });};const switchPlan = async () => {- if (isAnyActionLoading || isSwitchingPlan) return;- setIsSwitchingPlan(true);- try {- const { success } = await endTrialPeriodIfNeeded();- if (success === false) {- return;- }- const { data } = await switchBillingPlan();- if (isDefined(data?.switchBillingPlan.currentBillingSubscription)) {- refreshWorkspace(data.switchBillingPlan);- }- const beautifiedRenewDate = getBeautifiedRenewDate();- enqueueSuccessSnackBar({- message:- oppositPlan === BillingPlanKey.ENTERPRISE- ? t`Subscription has been switched to ${oppositPlan} Plan.`- : t`Subscription will be switched to ${oppositPlan} Plan the ${beautifiedRenewDate}.`,- });- } catch {- enqueueErrorSnackBar({- message: t`Error while switching subscription to ${oppositPlan} Plan.`,- });- } finally {- setIsSwitchingPlan(false);- }+ await runBillingAction({+ action: async () => {+ const { data } = await switchBillingPlan();+ if (isDefined(data?.switchBillingPlan.currentBillingSubscription)) {+ applyBillingUpdate(data.switchBillingPlan);+ }+ },+ getErrorMessage: () =>+ t`Error while switching subscription to ${oppositPlan} Plan.`,+ getSuccessMessage: () => {+ return oppositPlan === BillingPlanKey.ENTERPRISE || isTrialPeriod+ ? t`Subscription has been switched to ${oppositPlan} Plan.`+ : t`Subscription will be switched to ${oppositPlan} Plan the ${getBeautifiedRenewDate()}.`;+ },+ isLoading: isSwitchingPlan,+ setIsLoading: setIsSwitchingPlan,+ });};const cancelPlanSwitching = async () => {- if (isAnyActionLoading || isCancellingPlanSwitch) return;- setIsCancellingPlanSwitch(true);- try {- const { data } = await cancelSwitchBillingPlan();-- if (isDefined(data?.cancelSwitchBillingPlan.currentBillingSubscription)) {- refreshWorkspace(data.cancelSwitchBillingPlan);- }-- enqueueSuccessSnackBar({- message: t`Plan switching has been cancelled.`,- });- } catch {- enqueueErrorSnackBar({- message: t`Error while cancelling plan switching.`,- });- } finally {- setIsCancellingPlanSwitch(false);- }+ await runBillingAction({+ action: async () => {+ const { data } = await cancelSwitchBillingPlan();++ if (+ isDefined(data?.cancelSwitchBillingPlan.currentBillingSubscription)+ ) {+ applyBillingUpdate(data.cancelSwitchBillingPlan);+ }+ },+ getErrorMessage: () => t`Error while cancelling plan switching.`,+ getSuccessMessage: () => t`Plan switching has been cancelled.`,+ isLoading: isCancellingPlanSwitch,+ setIsLoading: setIsCancellingPlanSwitch,+ });};const cancelIntervalSwitching = async () => {- if (isAnyActionLoading || isCancellingIntervalSwitch) return;- setIsCancellingIntervalSwitch(true);- try {- const { data } = await cancelSwitchBillingInterval();- if (- isDefined(data?.cancelSwitchBillingInterval.currentBillingSubscription)- ) {- refreshWorkspace(data.cancelSwitchBillingInterval);- }- enqueueSuccessSnackBar({- message: t`Interval switching has been cancelled.`,- });- } catch {- enqueueErrorSnackBar({- message: t`Error while cancelling interval switching.`,- });- } finally {- setIsCancellingIntervalSwitch(false);- }+ await runBillingAction({+ action: async () => {+ const { data } = await cancelSwitchBillingInterval();+ if (+ isDefined(+ data?.cancelSwitchBillingInterval.currentBillingSubscription,+ )+ ) {+ applyBillingUpdate(data.cancelSwitchBillingInterval);+ }+ },+ getErrorMessage: () => t`Error while cancelling interval switching.`,+ getSuccessMessage: () => t`Interval switching has been cancelled.`,+ isLoading: isCancellingIntervalSwitch,+ setIsLoading: setIsCancellingIntervalSwitch,+ });};const cancelResourceCreditSwitching = async () => {- if (isAnyActionLoading || isCancellingMeteredSwitch) return;- setIsCancellingMeteredSwitch(true);- try {- const { data } = await cancelSwitchResourceCreditPrice();-- if (- isDefined(- data?.cancelSwitchResourceCreditPrice?.currentBillingSubscription,- )- ) {- refreshWorkspace(data.cancelSwitchResourceCreditPrice);- }-- enqueueSuccessSnackBar({- message: t`Credit pack switching has been cancelled.`,- });- } catch {- enqueueErrorSnackBar({- message: t`Error while cancelling credit pack switching.`,- });- } finally {- setIsCancellingMeteredSwitch(false);- }+ await runBillingAction({+ action: async () => {+ const { data } = await cancelSwitchResourceCreditPrice();++ if (+ isDefined(+ data?.cancelSwitchResourceCreditPrice?.currentBillingSubscription,+ )+ ) {+ applyBillingUpdate(data.cancelSwitchResourceCreditPrice);+ }+ },+ getErrorMessage: () => t`Error while cancelling credit pack switching.`,+ getSuccessMessage: () => t`Credit pack switching has been cancelled.`,+ isLoading: isCancellingMeteredSwitch,+ setIsLoading: setIsCancellingMeteredSwitch,+ });};return (<Section>- <H2Title title={t`Subscription`} description={t`About my subscription`} />- <SubscriptionInfoContainer>- <SubscriptionInfoHeaderRow show={hasNextBillingPhase} />- <SubscriptionInfoRowContainer- label={t`Plan`}- Icon={IconTag}- currentValue={- <PlansTags- plan={currentPlan.planKey}- isTrialPeriod={isTrialPeriod}- />- }- nextValue={- nextPlan ? (- <PlansTags- plan={nextPlan.planKey}- isTrialPeriod={isTrialPeriod}- />- ) : undefined- }- />- <SubscriptionInfoRowContainer- label={t`Billing interval`}- Icon={IconCalendarEvent}- currentValue={getIntervalLabelAsAdjectiveCapitalize(- currentInterval === SubscriptionInterval.Month,- )}- nextValue={- nextInterval- ? getIntervalLabelAsAdjectiveCapitalize(- nextInterval === SubscriptionInterval.Month,- )- : undefined- }- />- {currentBillingSubscription.currentPeriodEnd && (- <SubscriptionInfoRowContainer- label={t`Renewal date`}- Icon={IconCalendarRepeat}- currentValue={getBeautifiedRenewDate()}- nextValue={- nextBillingPhase- ? beautifyExactDate(nextBillingPhase.end_date * 1000)- : undefined+ <H2Title title={t`Subscription`} description={subscriptionDescription} />+ <SettingsBillingSubscriptionInfoCard+ canDisplaySwitchToMonthlyAction={canDisplaySwitchToMonthlyAction}+ canDisplaySwitchToYearlyAction={canDisplaySwitchToYearlyAction}+ creditsSubtotalDetails={creditsSubtotalDetails}+ creditsSubtotalValue={creditsSubtotalValue}+ currentIntervalLabel={currentIntervalLabel}+ displayedSubscriptionDate={displayedSubscriptionDate}+ headerActions={+ <SettingsBillingSubscriptionInfoCardHeaderActions+ canCancelIntervalSwitch={canCancelIntervalSwitch}+ canCancelPlanSwitch={canCancelPlanSwitch}+ canStartSubscription={canStartSubscription}+ canSwitchToOrganizationPlan={canSwitchToOrganizationPlan}+ canSwitchToProPlan={canSwitchToProPlan}+ isCancellationScheduled={isCancellationScheduled}+ isEndTrialPeriodDisabled={+ isEndTrialPeriodLoading || isAnyActionLoading}+ isSubscriptionActionDisabled={isSubscriptionActionDisabled}+ isTrialPeriod={isTrialPeriod}+ isUpdatePaymentDisabled={isUpdatePaymentDisabled}+ onCancelIntervalSwitch={() =>+ openModal(BILLING_MODAL_IDS.cancelSwitchBillingInterval)+ }+ onCancelPlanSwitch={() =>+ openModal(BILLING_MODAL_IDS.cancelSwitchBillingPlan)+ }+ onEndTrialPeriod={() => openModal(BILLING_MODAL_IDS.endTrialPeriod)}+ onSwitchToOrganization={() =>+ openModal(BILLING_MODAL_IDS.switchBillingPlanToEnterprise)+ }+ onSwitchToPro={() =>+ openModal(BILLING_MODAL_IDS.switchBillingPlanToPro)+ }+ onUpdatePayment={onUpdatePayment}+ shouldUpdatePayment={shouldUpdatePayment}/>- )}- <SubscriptionInfoRowContainer- label={t`Seats`}- Icon={IconUsers}- currentValue={seatsInlinePrice ?? seats}- nextValue={nextBillingSeats}- />- <SubscriptionInfoRowContainer- label={t`${creditsIntervalAdjective} credits`}- Icon={IconCoins}- currentValue={- isDefined(currentCreditsByPeriod)- ? formatNumber(currentCreditsByPeriod, { decimals: 2 })- : undefined- }- nextValue={- isDefined(nextCreditsByPeriod)- ? formatNumber(nextCreditsByPeriod, { decimals: 2 })- : undefined- }- />- {isDefined(totalCents) && (- <>- <HorizontalSeparator- noMargin- color={themeCssVariables.background.tertiary}- />- <StyledTotalGroup>- <SubscriptionInfoRowContainer- label={t`Total per ${totalIntervalWord}`}- Icon={IconSum}- currentValue={`$${totalDisplay}`}- />- {isDefined(totalHelperText) && <Label>{totalHelperText}</Label>}- </StyledTotalGroup>- </>- )}- </SubscriptionInfoContainer>- <StyledSwitchButtonContainer>- {isTrialPeriod && hasPermissionToEndTrialPeriod && (- <Button- Icon={IconArrowUp}- title={t`Subscribe Now`}- variant="secondary"- onClick={() => openModal(END_TRIAL_PERIOD_MODAL_ID)}- disabled={isEndTrialPeriodLoading || isAnyActionLoading}- />- )}- {nextInterval && currentInterval !== nextInterval && (- <Button- Icon={IconCircleX}- title={t`Cancel interval switching`}- variant="secondary"- onClick={() => openModal(CANCEL_SWITCH_BILLING_INTERVAL_MODAL_ID)}- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {isMonthlyPlan &&- (!nextInterval || currentInterval === nextInterval) && (- <Button- Icon={IconArrowUp}- title={switchToYearlyTitle}- variant="secondary"- onClick={() =>- openModal(SWITCH_BILLING_INTERVAL_TO_YEARLY_MODAL_ID)- }- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {isYearlyPlan &&- (!nextInterval || currentInterval === nextInterval) && (- <Button- Icon={IconArrowUp}- title={t`Switch to Monthly`}- variant="secondary"- onClick={() =>- openModal(SWITCH_BILLING_INTERVAL_TO_MONTHLY_MODAL_ID)- }- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {isProPlan &&- (!nextPlan || currentPlan.planKey === nextPlan.planKey) && (- <Button- Icon={IconArrowUp}- title={t`Switch to Organization`}- variant="secondary"- onClick={() =>- openModal(SWITCH_BILLING_PLAN_TO_ENTERPRISE_MODAL_ID)- }- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {isEnterprisePlan &&- (!nextPlan || currentPlan.planKey === nextPlan.planKey) && (- <Button- Icon={IconArrowDown}- title={t`Switch to Pro`}- variant="secondary"- onClick={() => openModal(SWITCH_BILLING_PLAN_TO_PRO_MODAL_ID)}- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {nextPlan && currentPlan.planKey !== nextPlan.planKey && (- <Button- Icon={IconCircleX}- title={t`Cancel plan switching`}- variant="secondary"- onClick={() => openModal(CANCEL_SWITCH_BILLING_PLAN_MODAL_ID)}- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- {nextResourceCreditPrice &&- currentCreditsByPeriod !== nextCreditsByPeriod && (- <Button- Icon={IconCircleX}- title={t`Cancel credit pack switching`}- variant="secondary"- onClick={() => openModal(CANCEL_SWITCH_METERED_PRICE_MODAL_ID)}- disabled={!canSwitchSubscription || isAnyActionLoading}- />- )}- </StyledSwitchButtonContainer>- <ConfirmationModal- modalInstanceId={SWITCH_BILLING_INTERVAL_TO_YEARLY_MODAL_ID}- title={t`Change to Yearly?`}- subtitle={confirmationModalSwitchToYearlyMessage()}- onConfirmClick={switchInterval}- confirmButtonText={t`Confirm`}- confirmButtonAccent={'blue'}- loading={isSwitchingInterval}- />- <ConfirmationModal- modalInstanceId={SWITCH_BILLING_INTERVAL_TO_MONTHLY_MODAL_ID}- title={t`Change to Monthly?`}- subtitle={confirmationModalSwitchToMonthlyMessage()}- onConfirmClick={switchInterval}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isSwitchingInterval}- />- <ConfirmationModal- modalInstanceId={CANCEL_SWITCH_BILLING_INTERVAL_MODAL_ID}- title={t`Cancel interval switching?`}- subtitle={confirmationModalCancelIntervalSwitchingMessage()}- onConfirmClick={cancelIntervalSwitching}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isCancellingIntervalSwitch}- />- <ConfirmationModal- modalInstanceId={SWITCH_BILLING_PLAN_TO_ENTERPRISE_MODAL_ID}- title={t`Change to Organization Plan?`}- subtitle={confirmationModalSwitchToOrganizationMessage()}- onConfirmClick={switchPlan}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isSwitchingPlan}- />- <ConfirmationModal- modalInstanceId={SWITCH_BILLING_PLAN_TO_PRO_MODAL_ID}- title={t`Change to Pro Plan?`}- subtitle={confirmationModalSwitchToProMessage()}- onConfirmClick={switchPlan}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isSwitchingPlan}- />- <ConfirmationModal- modalInstanceId={CANCEL_SWITCH_BILLING_PLAN_MODAL_ID}- title={t`Cancel plan switching?`}- subtitle={confirmationModalCancelPlanSwitchingMessage()}- onConfirmClick={cancelPlanSwitching}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isCancellingPlanSwitch}- />- <ConfirmationModal- modalInstanceId={END_TRIAL_PERIOD_MODAL_ID}- title={t`Start Your Subscription`}- subtitle={t`We will activate your paid plan. Do you want to proceed?`}- onConfirmClick={endTrialPeriod}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isEndTrialPeriodLoading}+ }+ isSubscriptionActionDisabled={isSubscriptionActionDisabled}+ onSwitchToMonthly={() =>+ openModal(BILLING_MODAL_IDS.switchBillingIntervalToMonthly)+ }+ onSwitchToYearly={() =>+ openModal(BILLING_MODAL_IDS.switchBillingIntervalToYearly)+ }+ planLabel={planLabel}+ scheduledChangeItems={scheduledChangeItems}+ scheduledChangeStartDate={scheduledChangeStartDate}+ seatsSubtotalDetails={seatsSubtotalDetails}+ seatsSubtotalValue={seatsSubtotalValue}+ statusDescriptor={statusDescriptor}+ subscriptionDateLabel={subscriptionDateLabel}+ totalIntervalSubtitle={totalIntervalSubtitle}+ totalValue={totalValue}+ totalWorkspaceMembersCount={currentWorkspace.workspaceMembersCount}+ workspaceMemberDefaultName={t`Workspace member`}+ workspaceMembers={currentWorkspaceMembers}/>- <ConfirmationModal- modalInstanceId={CANCEL_SWITCH_METERED_PRICE_MODAL_ID}- title={t`Cancel credit pack switching?`}- subtitle={t`You have scheduled a credit pack change. Do you want to cancel it?`}- onConfirmClick={cancelResourceCreditSwitching}- confirmButtonText={t`Confirm`}- confirmButtonAccent="blue"- loading={isCancellingMeteredSwitch}+ <SettingsBillingSubscriptionInfoModals+ cancelIntervalSwitchingSubtitle={confirmationModalCancelIntervalSwitchingMessage()}+ cancelPlanSwitchingSubtitle={confirmationModalCancelPlanSwitchingMessage()}+ isCancellingIntervalSwitch={isCancellingIntervalSwitch}+ isCancellingMeteredSwitch={isCancellingMeteredSwitch}+ isCancellingPlanSwitch={isCancellingPlanSwitch}+ isEndTrialPeriodLoading={isEndTrialPeriodLoading}+ isSwitchingInterval={isSwitchingInterval}+ isSwitchingPlan={isSwitchingPlan}+ onCancelIntervalSwitching={cancelIntervalSwitching}+ onCancelPlanSwitching={cancelPlanSwitching}+ onCancelResourceCreditSwitching={cancelResourceCreditSwitching}+ onEndTrialPeriod={endTrialPeriod}+ onSwitchInterval={switchInterval}+ onSwitchPlan={switchPlan}+ startSubscriptionSubtitle={startSubscriptionSubtitle}+ switchToMonthlySubtitle={confirmationModalSwitchToMonthlyMessage()}+ switchToOrganizationSubtitle={confirmationModalSwitchToOrganizationMessage()}+ switchToProSubtitle={confirmationModalSwitchToProMessage()}+ switchToYearlySubtitle={confirmationModalSwitchToYearlyMessage()}/></Section>);diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsxnew file mode 100644index 00000000000..5b898c31a90--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingTrialNoPaymentMethodBanner.tsx@@ -0,0 +1,75 @@+import { useSnackBarOnQueryError } from '@/apollo/hooks/useSnackBarOnQueryError';+import { type CurrentWorkspace } from '@/auth/states/currentWorkspaceState';+import { useRedirect } from '@/domain-manager/hooks/useRedirect';+import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';+import { useQuery } from '@apollo/client/react';+import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath, isDefined } from 'twenty-shared/utils';+import { InlineBanner } from 'twenty-ui/feedback';+import {+ BillingPlanKey,+ BillingPortalSessionDocument,+ PermissionFlagType,+} from '~/generated-metadata/graphql';+import { formatDate } from '~/utils/date-utils';++type SettingsBillingTrialNoPaymentMethodBannerProps = {+ currentBillingSubscription: NonNullable<+ CurrentWorkspace['currentBillingSubscription']+ >;+};++export const SettingsBillingTrialNoPaymentMethodBanner = ({+ currentBillingSubscription,+}: SettingsBillingTrialNoPaymentMethodBannerProps) => {+ const { redirect } = useRedirect();++ const { [PermissionFlagType.BILLING]: hasPermissionToManageBilling } =+ usePermissionFlagMap();++ const { data, error } = useQuery(BillingPortalSessionDocument, {+ variables: {+ returnUrlPath: getSettingsPath(SettingsPath.Billing),+ forPaymentMethodUpdate: true,+ },+ skip: !hasPermissionToManageBilling,+ });++ useSnackBarOnQueryError(error);++ const openPaymentMethodUpdate = () => {+ if (isDefined(data?.billingPortalSession.url)) {+ redirect(data.billingPortalSession.url);+ }+ };++ const planName =+ currentBillingSubscription.metadata?.['plan'] === BillingPlanKey.PRO+ ? t`pro plan`+ : t`organization plan`;++ const trialEndDate = isDefined(currentBillingSubscription.currentPeriodEnd)+ ? formatDate(currentBillingSubscription.currentPeriodEnd, 'MMM dd')+ : undefined;++ const message = isDefined(trialEndDate)+ ? hasPermissionToManageBilling+ ? t`Trial ends ${trialEndDate}, please add card details to keep the ${planName}`+ : t`Trial ends ${trialEndDate}. Please contact your admin to add card details to keep the ${planName}`+ : hasPermissionToManageBilling+ ? t`Trial ends soon, please add card details to keep the ${planName}`+ : t`Trial ends soon. Please contact your admin to add card details to keep the ${planName}`;++ return (+ <InlineBanner+ color="blue"+ message={message}+ button={{+ title: t`Add card`,+ hidden: !hasPermissionToManageBilling,+ onClick: openPaymentMethodUpdate,+ }}+ />+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/AnimatedFormattedNumber.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/AnimatedFormattedNumber.tsxnew file mode 100644index 00000000000..bb159157616--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/AnimatedFormattedNumber.tsx@@ -0,0 +1,25 @@+import { animated, useSpring } from '@react-spring/web';++const COUNT_UP_ANIMATION_CONFIG = {+ tension: 300,+ friction: 30,+};++export const AnimatedFormattedNumber = ({+ formatValue,+ value,+}: {+ formatValue: (value: number) => string;+ value: number;+}) => {+ const { animatedValue } = useSpring({+ animatedValue: value,+ config: COUNT_UP_ANIMATION_CONFIG,+ });++ return (+ <animated.span style={{ fontVariantNumeric: 'tabular-nums' }}>+ {animatedValue.to(formatValue)}+ </animated.span>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsxnew file mode 100644index 00000000000..9c51ef4451b--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx@@ -0,0 +1,423 @@+import { AnimatedFormattedNumber } from '@/settings/billing/components/internal/AnimatedFormattedNumber';+import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';+import { ModalStatefulWrapper } from '@/ui/layout/modal/components/ModalStatefulWrapper';+import { styled } from '@linaria/react';+import { t } from '@lingui/core/macro';+import { AnimatePresence, motion } from 'framer-motion';+import { type ChangeEvent, type ElementType, type ReactNode } from 'react';+import { isDefined } from 'twenty-shared/utils';+import {+ IconCoins,+ IconHistory,+ IconRefreshDot,+ IconSparkles,+} from 'twenty-ui/icon';+import { Button, Slider } from 'twenty-ui/input';+import { Section, SectionAlignment, SectionFontColor } from 'twenty-ui/layout';+import { OverflowingTextWithTooltip } from 'twenty-ui/surfaces';+import { themeCssVariables, useTheme } from 'twenty-ui/theme-constants';+import { H1Title, H1TitleFontColor } from 'twenty-ui/typography';++const PACKAGE_SUMMARY_ROW_HEIGHT = 24;+const PACKAGE_SUMMARY_ROW_GAP = 4;++const StyledCenteredTitle = styled.div`+ text-align: center;++ h2 {+ margin-bottom: ${themeCssVariables.spacing[6]};+ }+`;++const StyledSectionContainer = styled.div`+ font-size: ${themeCssVariables.font.size.md};+ line-height: 1.4;+ margin-bottom: ${themeCssVariables.spacing[6]};+ text-box-edge: cap alphabetic;+ text-box-trim: trim-both;+`;++const StyledPackageCard = styled.div`+ background-color: ${themeCssVariables.background.secondary};+ border: 1px solid ${themeCssVariables.border.color.medium};+ border-radius: ${themeCssVariables.border.radius.md};+ display: flex;+ flex-direction: column;+ gap: ${themeCssVariables.spacing[4]};+ padding: 11px;+`;++const StyledPackageHeader = styled.div`+ display: flex;+ flex-direction: column;+ gap: ${themeCssVariables.spacing[3]};+`;++const StyledPackageHeaderRow = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[1]};+ height: ${themeCssVariables.spacing[4]};+`;++const StyledPackageHeaderTitle = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[1]};+ min-width: 0;+`;++const StyledPackageCreditAmount = styled.span`+ color: ${themeCssVariables.font.color.primary};+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.medium};+ white-space: nowrap;+`;++const StyledPackagePrice = styled.span`+ color: ${themeCssVariables.font.color.tertiary};+ flex: 1 1 auto;+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.regular};+ text-align: right;+ white-space: nowrap;+`;++const StyledPackageDetails = styled.div`+ display: flex;+ flex-direction: column;+ gap: ${themeCssVariables.spacing[3]};+`;++const StyledPackageDivider = styled.div`+ background-color: ${themeCssVariables.border.color.medium};+ height: 1px;+ width: 100%;+`;++const StyledPackageSummaryRows = styled.div`+ display: flex;+ flex-direction: column;+`;++const StyledPackageSummaryRow = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[1]};+ height: ${themeCssVariables.spacing[6]};+ margin-bottom: ${themeCssVariables.spacing[1]};+ min-width: 0;++ &:last-child {+ margin-bottom: 0;+ }+`;++const StyledAnimatedPackageSummaryRow = motion.create(StyledPackageSummaryRow);++const StyledPackageSummaryLabel = styled.div`+ align-items: center;+ color: ${themeCssVariables.font.color.tertiary};+ display: flex;+ flex: 0 0 116px;+ font-size: ${themeCssVariables.font.size.sm};+ gap: ${themeCssVariables.spacing[1]};+ min-height: ${themeCssVariables.spacing[6]};+ min-width: 0;+`;++const StyledPackageSummaryLabelText = styled.div`+ flex: 0 0 96px;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+`;++const StyledPackageSummaryValue = styled.div`+ align-items: center;+ color: ${themeCssVariables.font.color.primary};+ display: flex;+ flex: 1 1 auto;+ font-size: ${themeCssVariables.font.size.md};+ min-height: ${themeCssVariables.spacing[6]};+ min-width: 0;+ overflow: hidden;+ padding: 0 ${themeCssVariables.spacing[1]};+ white-space: nowrap;+`;++const StyledMutedText = styled.span`+ color: ${themeCssVariables.font.color.tertiary};+ margin-left: ${themeCssVariables.spacing[1]};+`;++const StyledAmountWithUnit = styled.span`+ align-items: center;+ display: inline-flex;+ gap: ${themeCssVariables.spacing[1]};+`;++const StyledCurrentValueText = styled.span`+ text-decoration-line: none;++ &[data-strikethrough='true'] {+ text-decoration-line: line-through;+ }+`;++const StyledModalActions = styled.div`+ display: flex;+ gap: ${themeCssVariables.spacing[2]};+ margin-top: ${themeCssVariables.spacing[6]};++ > div {+ flex: 1;+ }+`;++const PackageSummaryLabelText = ({ label }: { label: string }) => (+ <StyledPackageSummaryLabelText>+ <OverflowingTextWithTooltip text={label} />+ </StyledPackageSummaryLabelText>+);++type ResourceCreditPackagePickerModalProps = {+ currentCreditAmountDisplay: string;+ currentCreditPriceDisplay: string;+ formatAnimatedCreditAmount: (value: number) => string;+ formatAnimatedPriceAmount: (value: number) => string;+ formatAnimatedRolloverLimit: (value: number) => string;+ intervalAdjective: string;+ intervalLabel: string;+ isChanged: boolean;+ isConfirmDisabled: boolean;+ isUpdating: boolean;+ newRolloverLimit: number | undefined;+ newRolloverLimitValue: number;+ onCancel: () => void;+ onConfirm: () => void;+ onSliderChange: (event: ChangeEvent<HTMLInputElement>) => void;+ priceCount: number;+ selectedCreditAmountValue: number;+ selectedPriceAmountValue: number;+ selectedPriceIndex: number;+};++export const ResourceCreditPackagePickerModal = ({+ currentCreditAmountDisplay,+ currentCreditPriceDisplay,+ formatAnimatedCreditAmount,+ formatAnimatedPriceAmount,+ formatAnimatedRolloverLimit,+ intervalAdjective,+ intervalLabel,+ isChanged,+ isConfirmDisabled,+ isUpdating,+ newRolloverLimit,+ newRolloverLimitValue,+ onCancel,+ onConfirm,+ onSliderChange,+ priceCount,+ selectedCreditAmountValue,+ selectedPriceAmountValue,+ selectedPriceIndex,+}: ResourceCreditPackagePickerModalProps) => {+ const theme = useTheme();++ const renderPackageSummaryRow = ({+ Icon,+ label,+ value,+ }: {+ Icon: ElementType<{ color?: string; size?: number; stroke?: number }>;+ label: string;+ value: ReactNode;+ }) => (+ <StyledPackageSummaryRow>+ <StyledPackageSummaryLabel>+ <Icon+ size={theme.icon.size.md}+ stroke={theme.icon.stroke.sm}+ color={themeCssVariables.font.color.tertiary}+ />+ <PackageSummaryLabelText label={label} />+ </StyledPackageSummaryLabel>+ <StyledPackageSummaryValue>{value}</StyledPackageSummaryValue>+ </StyledPackageSummaryRow>+ );++ return (+ <ModalStatefulWrapper+ modalInstanceId={BILLING_MODAL_IDS.creditPackagePicker}+ isClosable={true}+ size="medium"+ padding="large"+ overlay="dark"+ width="360px"+ dataGloballyPreventClickOutside+ renderInDocumentBody+ smallBorderRadius+ autoHeight+ >+ <StyledCenteredTitle>+ <H1Title+ title={t`Choose ${intervalAdjective} credits`}+ fontColor={H1TitleFontColor.Primary}+ />+ </StyledCenteredTitle>+ <StyledSectionContainer>+ <Section+ alignment={SectionAlignment.Center}+ fontColor={SectionFontColor.Primary}+ >+ {t`Select the credit package to add to your ${intervalAdjective} bill.`}+ </Section>+ </StyledSectionContainer>+ <StyledPackageCard>+ <StyledPackageHeader>+ <StyledPackageHeaderRow>+ <StyledPackageHeaderTitle>+ <IconCoins+ size={theme.icon.size.md}+ color={themeCssVariables.color.green9}+ />+ <StyledPackageCreditAmount>+ <AnimatedFormattedNumber+ value={selectedCreditAmountValue}+ formatValue={formatAnimatedCreditAmount}+ />{' '}+ {t`credits`}+ </StyledPackageCreditAmount>+ </StyledPackageHeaderTitle>+ <StyledPackagePrice>+ $+ <AnimatedFormattedNumber+ value={selectedPriceAmountValue}+ formatValue={formatAnimatedPriceAmount}+ />+ /{intervalLabel}+ </StyledPackagePrice>+ </StyledPackageHeaderRow>+ <Slider+ aria-label={t`Credit package`}+ min={0}+ max={priceCount - 1}+ step={1}+ value={selectedPriceIndex}+ onChange={onSliderChange}+ disabled={isUpdating}+ color="green"+ />+ </StyledPackageHeader>+ <StyledPackageDetails>+ <StyledPackageDivider />+ <StyledPackageSummaryRows>+ {renderPackageSummaryRow({+ Icon: IconHistory,+ label: t`Current`,+ value: (+ <>+ <StyledCurrentValueText+ data-strikethrough={isChanged || undefined}+ >+ {t`${currentCreditAmountDisplay} credits `}+ </StyledCurrentValueText>+ <StyledMutedText>+ <StyledCurrentValueText+ data-strikethrough={isChanged || undefined}+ >+ {t`($${currentCreditPriceDisplay}/${intervalLabel})`}+ </StyledCurrentValueText>+ </StyledMutedText>+ </>+ ),+ })}+ <AnimatePresence initial={false}>+ {isChanged && (+ <StyledAnimatedPackageSummaryRow+ key="new-credit-package-summary-row"+ initial={{+ height: 0,+ marginBottom: 0,+ opacity: 0,+ y: -2,+ }}+ animate={{+ height: PACKAGE_SUMMARY_ROW_HEIGHT,+ marginBottom: PACKAGE_SUMMARY_ROW_GAP,+ opacity: 1,+ y: 0,+ }}+ exit={{+ height: 0,+ marginBottom: 0,+ opacity: 0,+ y: -2,+ }}+ transition={{+ duration: theme.animation.duration.fast,+ ease: 'easeInOut',+ }}+ >+ <StyledPackageSummaryLabel>+ <IconSparkles+ size={theme.icon.size.md}+ stroke={theme.icon.stroke.sm}+ color={themeCssVariables.font.color.tertiary}+ />+ <PackageSummaryLabelText label={t`New credit pack`} />+ </StyledPackageSummaryLabel>+ <StyledPackageSummaryValue>+ <span>+ $+ <AnimatedFormattedNumber+ value={selectedPriceAmountValue}+ formatValue={formatAnimatedPriceAmount}+ />+ {t` per ${intervalLabel}`}+ </span>+ </StyledPackageSummaryValue>+ </StyledAnimatedPackageSummaryRow>+ )}+ </AnimatePresence>+ {isDefined(newRolloverLimit) &&+ renderPackageSummaryRow({+ Icon: IconRefreshDot,+ label: t`New rollover limit`,+ value: (+ <StyledAmountWithUnit>+ <AnimatedFormattedNumber+ value={newRolloverLimitValue}+ formatValue={formatAnimatedRolloverLimit}+ />+ <span>{t`credits`}</span>+ </StyledAmountWithUnit>+ ),+ })}+ </StyledPackageSummaryRows>+ </StyledPackageDetails>+ </StyledPackageCard>+ <StyledModalActions>+ <Button+ onClick={onCancel}+ variant="secondary"+ title={t`Cancel`}+ fullWidth+ justify="center"+ />+ <Button+ onClick={onConfirm}+ variant="primary"+ accent="blue"+ title={t`Confirm`}+ fullWidth+ justify="center"+ disabled={isConfirmDisabled}+ />+ </StyledModalActions>+ </ModalStatefulWrapper>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsxindex 52accf9648f..175a31f683d 100644--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx@@ -1,21 +1,20 @@-import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { useNumberFormat } from '@/localization/hooks/useNumberFormat';-import { SettingsBillingLabelValueItem } from '@/settings/billing/components/internal/SettingsBillingLabelValueItem';-import { useBillingSubscriptionCost } from '@/settings/billing/hooks/useBillingSubscriptionCost';+import { ResourceCreditPackagePickerModal } from '@/settings/billing/components/internal/ResourceCreditPackagePickerModal';+import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';+import { useApplyCurrentWorkspaceBillingUpdate } from '@/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate';import { useBillingWording } from '@/settings/billing/hooks/useBillingWording';import { useCurrentResourceCredit } from '@/settings/billing/hooks/useCurrentResourceCredit';import { useGetResourceCreditUsage } from '@/settings/billing/hooks/useGetResourceCreditUsage';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';-import { Select } from '@/ui/input/components/Select';import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';import { useModal } from '@/ui/layout/modal/hooks/useModal';-import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';+import { CombinedGraphQLErrors } from '@apollo/client/errors';import { useMutation } from '@apollo/client/react';import { styled } from '@linaria/react';import { t } from '@lingui/core/macro';-import { useState } from 'react';+import { type ChangeEvent, useMemo, useState } from 'react';import { isDefined } from 'twenty-shared/utils';-import { H2Title } from 'twenty-ui/typography';+import { IconArrowUp, IconCircleX, IconCreditCard } from 'twenty-ui/icon';import { Button } from 'twenty-ui/input';import { themeCssVariables } from 'twenty-ui/theme-constants';import {@@ -24,63 +23,53 @@ import {type BillingPriceLicensed,} from '~/generated-metadata/graphql';-const StyledRow = styled.div`- align-items: flex-end;- display: flex;- flex-wrap: wrap;- gap: ${themeCssVariables.spacing[2]};-`;--const StyledSelectContainer = styled.div`- flex: 1 1;-`;+const PREDEFINED_RESOURCE_CREDIT_PACKAGE_MULTIPLIERS = [2, 4];-const StyledButtonContainer = styled.div`- flex: 0 0 auto;-`;--const StyledSummary = styled.div`+const StyledActionContainer = styled.div`+ align-items: center;display: flex;- flex-direction: column;+ flex-wrap: wrap;gap: ${themeCssVariables.spacing[2]};- margin-top: ${themeCssVariables.spacing[2]};+ justify-content: flex-end;`;export const ResourceCreditPriceSelector = ({resourceCreditPrices,isTrialing = false,+ shouldRedirectToManageBilling = false,+ shouldRedirectToUpdatePayment = false,+ canEndTrialPeriod = true,+ onManageBilling,+ isManageBillingDisabled = false,+ onUpdatePayment,+ isUpdatePaymentDisabled = false,+ canCancelCreditPackSwitch = false,+ onCancelCreditPackSwitch,}: {resourceCreditPrices: BillingPriceLicensed[];isTrialing?: boolean;+ shouldRedirectToManageBilling?: boolean;+ shouldRedirectToUpdatePayment?: boolean;+ canEndTrialPeriod?: boolean;+ onManageBilling: () => void;+ isManageBillingDisabled?: boolean;+ onUpdatePayment: () => void;+ isUpdatePaymentDisabled?: boolean;+ canCancelCreditPackSwitch?: boolean;+ onCancelCreditPackSwitch?: () => void;}) => {const { currentResourceCreditBillingPrice } = useCurrentResourceCredit();const { formatNumber } = useNumberFormat();- const { getTotalCentsWithCreditsAmountCents } = useBillingSubscriptionCost();-- const [currentWorkspace, setCurrentWorkspace] = useAtomState(- currentWorkspaceState,- );+ const { applyCurrentWorkspaceBillingUpdate } =+ useApplyCurrentWorkspaceBillingUpdate();const { refetchResourceCreditUsage } = useGetResourceCreditUsage();const { getIntervalLabel } = useBillingWording();- const [currentResourceCreditPrice, setCurrentResourceCreditPrice] = useState(- currentResourceCreditBillingPrice,- );+ const currentResourceCreditPrice = currentResourceCreditBillingPrice;- const toOption = (price: BillingPriceLicensed) => {- const priceDisplay = formatNumber((price.unitAmount ?? 0) / 100);- const credits = formatNumber(price.creditAmount ?? 0, {- abbreviate: true,- decimals: 2,- });-- return {- label: t`${credits} Credits - $${priceDisplay}`,- value: price.stripePriceId,- };- };+ const [selectedPriceId, setSelectedPriceId] = useState<string | undefined>();const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();@@ -88,30 +77,103 @@ export const ResourceCreditPriceSelector = ({SetResourceCreditSubscriptionPriceDocument,);- const options = [...resourceCreditPrices]- .sort((a, b) => (a.creditAmount ?? 0) - (b.creditAmount ?? 0))- .map(toOption);+ const sortedResourceCreditPrices = useMemo(+ () =>+ [...resourceCreditPrices].sort(+ (a, b) => (a.unitAmount ?? 0) - (b.unitAmount ?? 0),+ ),+ [resourceCreditPrices],+ );- const { openModal } = useModal();- const [selectedPriceId, setSelectedPriceId] = useState<string | undefined>(- undefined,+ const currentPriceAmountCents = currentResourceCreditPrice?.unitAmount ?? 0;++ const defaultResourceCreditPriceForPicker = useMemo(+ () =>+ sortedResourceCreditPrices.find(+ (price) =>+ price.stripePriceId !== currentResourceCreditPrice?.stripePriceId &&+ (price.unitAmount ?? 0) > currentPriceAmountCents,+ ) ??+ sortedResourceCreditPrices.find(+ (price) =>+ price.stripePriceId !== currentResourceCreditPrice?.stripePriceId,+ ) ??+ currentResourceCreditPrice ??+ sortedResourceCreditPrices[0],+ [+ currentPriceAmountCents,+ currentResourceCreditPrice,+ sortedResourceCreditPrices,+ ],);- const selectedPrice = resourceCreditPrices.find(- ({ stripePriceId }) => stripePriceId === selectedPriceId,+ const selectedPrice =+ sortedResourceCreditPrices.find(+ ({ stripePriceId }) => stripePriceId === selectedPriceId,+ ) ??+ currentResourceCreditPrice ??+ sortedResourceCreditPrices[0];++ const selectedPriceIndex = Math.max(+ 0,+ sortedResourceCreditPrices.findIndex(+ ({ stripePriceId }) => stripePriceId === selectedPrice?.stripePriceId,+ ),);+ const fixedResourceCreditPrices = useMemo(() => {+ const higherResourceCreditPrices = sortedResourceCreditPrices.filter(+ (price) =>+ price.stripePriceId !== currentResourceCreditPrice?.stripePriceId &&+ (price.unitAmount ?? 0) > currentPriceAmountCents,+ );++ if (currentPriceAmountCents <= 0) {+ return higherResourceCreditPrices.slice(+ 0,+ PREDEFINED_RESOURCE_CREDIT_PACKAGE_MULTIPLIERS.length,+ );+ }++ const selectedStripePriceIds = new Set<string>();++ return PREDEFINED_RESOURCE_CREDIT_PACKAGE_MULTIPLIERS.map((multiplier) => {+ const targetUnitAmount = currentPriceAmountCents * multiplier;+ const nextMatchingPrice = higherResourceCreditPrices.find(+ (price) =>+ !selectedStripePriceIds.has(price.stripePriceId) &&+ (price.unitAmount ?? 0) >= targetUnitAmount,+ );++ if (isDefined(nextMatchingPrice)) {+ selectedStripePriceIds.add(nextMatchingPrice.stripePriceId);+ }++ return nextMatchingPrice;+ }).filter((price): price is BillingPriceLicensed => isDefined(price));+ }, [+ currentPriceAmountCents,+ currentResourceCreditPrice?.stripePriceId,+ sortedResourceCreditPrices,+ ]);+const isChanged =- isDefined(selectedPriceId) &&- selectedPriceId !== currentResourceCreditPrice?.stripePriceId;+ isDefined(selectedPrice) &&+ selectedPrice.stripePriceId !== currentResourceCreditPrice?.stripePriceId;++ const hasAlternativeResourceCreditPrice = sortedResourceCreditPrices.some(+ (price) =>+ price.stripePriceId !== currentResourceCreditPrice?.stripePriceId,+ );const isUpgrade = () => {if (!isChanged ||!isDefined(selectedPrice) ||!isDefined(currentResourceCreditPrice)- )+ ) {return false;+ }return ((selectedPrice.creditAmount ?? 0) >@@ -119,131 +181,246 @@ export const ResourceCreditPriceSelector = ({);};- const handleChange = (priceId: string) => {- setSelectedPriceId(priceId);+ const isMonthly =+ selectedPrice?.recurringInterval === SubscriptionInterval.Month;+ const intervalAdjective = getIntervalLabel(isMonthly, true);+ const intervalLabel = getIntervalLabel(isMonthly);++ const formatPriceAmount = (price: BillingPriceLicensed | undefined) =>+ isDefined(price) ? formatNumber((price.unitAmount ?? 0) / 100) : undefined;++ const formatCreditAmount = (price: BillingPriceLicensed | undefined) =>+ isDefined(price)+ ? formatNumber(price.creditAmount ?? 0, {+ abbreviate: true,+ decimals: 2,+ })+ : undefined;++ const selectedPriceDisplay = formatPriceAmount(selectedPrice);+ const selectedCreditAmountDisplay = formatCreditAmount(selectedPrice);+ const currentCreditAmountDisplay =+ formatCreditAmount(currentResourceCreditPrice) ?? formatNumber(0);+ const currentCreditPriceDisplay =+ formatPriceAmount(currentResourceCreditPrice) ?? formatNumber(0);++ const selectedCreditUnitAmount = selectedPrice?.unitAmount;+ const selectedCreditAmount = selectedPrice?.creditAmount;+ const selectedCreditAmountValue = selectedCreditAmount ?? 0;+ const selectedPriceAmountValue = isDefined(selectedCreditUnitAmount)+ ? selectedCreditUnitAmount / 100+ : 0;++ const newRolloverLimit = isDefined(selectedCreditAmount)+ ? selectedCreditAmount * 2+ : undefined;++ const newRolloverLimitValue = newRolloverLimit ?? 0;++ const formatAnimatedCreditAmount = (value: number) =>+ formatNumber(Math.max(0, Math.round(value)), {+ abbreviate: true,+ decimals: 2,+ });++ const formatAnimatedPriceAmount = (value: number) =>+ formatNumber(Math.max(0, value));++ const formatAnimatedRolloverLimit = (value: number) =>+ formatNumber(Math.max(0, Math.round(value)), { decimals: 2 });++ const { openModal, closeModal } = useModal();++ const redirectToRequiredBillingAction = () => {+ if (shouldRedirectToUpdatePayment) {+ onUpdatePayment();++ return true;+ }++ if (shouldRedirectToManageBilling) {+ onManageBilling();++ return true;+ }++ return false;};- const confirmModalId = 'RESOURCE_CREDIT_PRICE_CHANGE_CONFIRMATION_MODAL';+ const openConfirmationForPrice = (price: BillingPriceLicensed) => {+ if (redirectToRequiredBillingAction()) {+ return;+ }- const handleOpenConfirm = () => {- if (!isChanged || !selectedPrice) return;- openModal(confirmModalId);+ setSelectedPriceId(price.stripePriceId);+ openModal(BILLING_MODAL_IDS.confirmResourceCreditPriceChange);};- const isMonthly =- currentResourceCreditPrice?.recurringInterval ===- SubscriptionInterval.Month;- const intervalAdjective = getIntervalLabel(isMonthly, true);+ const handleOpenCreditPackagePicker = () => {+ if (redirectToRequiredBillingAction()) {+ return;+ }- const effectiveResourceCreditPrice =- selectedPrice ?? currentResourceCreditPrice;- const effectiveCreditUnitAmount = effectiveResourceCreditPrice?.unitAmount;- const effectiveCreditAmount = effectiveResourceCreditPrice?.creditAmount;+ setSelectedPriceId(defaultResourceCreditPriceForPicker?.stripePriceId);+ openModal(BILLING_MODAL_IDS.creditPackagePicker);+ };- const newTotalCents = isDefined(effectiveCreditUnitAmount)- ? getTotalCentsWithCreditsAmountCents(effectiveCreditUnitAmount)- : undefined;- const newRolloverCap = isDefined(effectiveCreditAmount)- ? effectiveCreditAmount * 2- : undefined;+ const handleSliderChange = (event: ChangeEvent<HTMLInputElement>) => {+ const price = sortedResourceCreditPrices[Number(event.target.value)];- const newTotalDisplay = isDefined(newTotalCents)- ? formatNumber(newTotalCents / 100, { decimals: 2 })- : undefined;- const newRolloverCapDisplay = isDefined(newRolloverCap)- ? formatNumber(newRolloverCap, { decimals: 2 })- : undefined;+ if (isDefined(price)) {+ setSelectedPriceId(price.stripePriceId);+ }+ };++ const handleConfirmPackagePicker = () => {+ if (!isDefined(selectedPrice) || !isChanged) {+ return;+ }++ closeModal(BILLING_MODAL_IDS.creditPackagePicker);+ openModal(BILLING_MODAL_IDS.confirmResourceCreditPriceChange);+ };const handleConfirmClick = async () => {- if (!selectedPrice) return;try {const { data } = await setResourceCreditPrice({variables: { priceId: selectedPrice.stripePriceId },});- if (- isDefined(- data?.setResourceCreditSubscriptionPrice.currentBillingSubscription,- ) &&- isDefined(currentWorkspace)- ) {- const newCurrentWorkspace = {- ...currentWorkspace,- currentBillingSubscription:- data.setResourceCreditSubscriptionPrice.currentBillingSubscription,- billingSubscriptions:- data?.setResourceCreditSubscriptionPrice.billingSubscriptions,- };- setCurrentWorkspace(newCurrentWorkspace);- refetchResourceCreditUsage();- }- enqueueSuccessSnackBar({ message: t`Resource credits updated.` });- const newPrice = resourceCreditPrices.find(- ({ stripePriceId }) => stripePriceId === selectedPrice.stripePriceId,+ applyCurrentWorkspaceBillingUpdate(+ data?.setResourceCreditSubscriptionPrice,+ {+ onBillingUpdateApplied: refetchResourceCreditUsage,+ },);- if (isDefined(newPrice)) {- setCurrentResourceCreditPrice(newPrice);- }+ enqueueSuccessSnackBar({ message: t`Resource credits updated.` });setSelectedPriceId(undefined);- } catch {+ } catch (error) {enqueueErrorSnackBar({ message: t`Failed to update resource credits.` });++ if (!CombinedGraphQLErrors.is(error)) {+ throw error;+ }+ }+ };++ if (sortedResourceCreditPrices.length === 0) {+ return null;+ }++ const shouldShowPrimaryAction =+ shouldRedirectToUpdatePayment ||+ shouldRedirectToManageBilling ||+ !isTrialing ||+ canEndTrialPeriod;+ const PrimaryActionIcon =+ shouldRedirectToUpdatePayment || shouldRedirectToManageBilling+ ? IconCreditCard+ : IconArrowUp;+ const handlePrimaryActionClick = () => {+ if (redirectToRequiredBillingAction()) {+ return;+ }++ if (isTrialing) {+ openModal(BILLING_MODAL_IDS.endTrialPeriod);+ return;}++ handleOpenCreditPackagePicker();};return (<>- <H2Title- title={t`Add ${intervalAdjective} credits`}- description={t`Stacks on top of your plan's base credits and adjusts your ${intervalAdjective} bill.`}- />- <StyledRow>- <StyledSelectContainer>- <Select- dropdownId="settings_billing-resource-credit-price"- options={options}- value={- selectedPriceId ?? currentResourceCreditPrice?.stripePriceId ?? ''+ <StyledActionContainer>+ {canCancelCreditPackSwitch && (+ <Button+ Icon={IconCircleX}+ title={t`Cancel credit pack switching`}+ variant="secondary"+ size="small"+ onClick={onCancelCreditPackSwitch}+ disabled={isUpdating}+ />+ )}+ {!isTrialing &&+ !canCancelCreditPackSwitch &&+ !shouldRedirectToUpdatePayment &&+ !shouldRedirectToManageBilling &&+ fixedResourceCreditPrices.map((price) => {+ const priceDisplay = formatPriceAmount(price) ?? '';++ return (+ <Button+ key={price.stripePriceId}+ Icon={IconArrowUp}+ title={t`Increase to $${priceDisplay}`}+ variant="secondary"+ size="small"+ onClick={() => openConfirmationForPrice(price)}+ disabled={+ isUpdating ||+ (shouldRedirectToManageBilling && isManageBillingDisabled)+ }+ />+ );+ })}+ {shouldShowPrimaryAction && (+ <Button+ Icon={PrimaryActionIcon}+ title={+ shouldRedirectToUpdatePayment+ ? t`Update payment`+ : shouldRedirectToManageBilling+ ? t`Manage billing`+ : t`Increase`}- onChange={handleChange}- disabled={isUpdating || isTrialing}- description={- isTrialing ? t`Please start your subscription first` : undefined+ variant="primary"+ accent="green"+ size="small"+ onClick={handlePrimaryActionClick}+ disabled={+ isUpdating ||+ (shouldRedirectToUpdatePayment && isUpdatePaymentDisabled) ||+ (shouldRedirectToManageBilling && isManageBillingDisabled) ||+ (!shouldRedirectToUpdatePayment &&+ !shouldRedirectToManageBilling &&+ !isTrialing &&+ !hasAlternativeResourceCreditPrice)}- fullWidth/>- </StyledSelectContainer>- {isChanged && (- <StyledButtonContainer>- <Button- title={isUpgrade() ? t`Upgrade` : t`Downgrade`}- onClick={handleOpenConfirm}- variant="primary"- isLoading={isUpdating}- disabled={!isChanged}- accent={isUpgrade() ? 'blue' : 'danger'}- />- </StyledButtonContainer>- )}- </StyledRow>- {!isTrialing &&- isChanged &&- isDefined(newTotalDisplay) &&- isDefined(newRolloverCapDisplay) && (- <StyledSummary>- <SettingsBillingLabelValueItem- label={t`New ${intervalAdjective} total`}- value={`$${newTotalDisplay}`}- isValueInPrimaryColor- />- <SettingsBillingLabelValueItem- label={t`New rollover cap`}- value={t`${newRolloverCapDisplay} credits`}- />- </StyledSummary>)}+ </StyledActionContainer>+ <ResourceCreditPackagePickerModal+ currentCreditAmountDisplay={currentCreditAmountDisplay}+ currentCreditPriceDisplay={currentCreditPriceDisplay}+ formatAnimatedCreditAmount={formatAnimatedCreditAmount}+ formatAnimatedPriceAmount={formatAnimatedPriceAmount}+ formatAnimatedRolloverLimit={formatAnimatedRolloverLimit}+ intervalAdjective={intervalAdjective}+ intervalLabel={intervalLabel}+ isChanged={isChanged}+ isConfirmDisabled={!isChanged || isUpdating}+ isUpdating={isUpdating}+ newRolloverLimit={newRolloverLimit}+ newRolloverLimitValue={newRolloverLimitValue}+ onCancel={() => closeModal(BILLING_MODAL_IDS.creditPackagePicker)}+ onConfirm={handleConfirmPackagePicker}+ onSliderChange={handleSliderChange}+ priceCount={sortedResourceCreditPrices.length}+ selectedCreditAmountValue={selectedCreditAmountValue}+ selectedPriceAmountValue={selectedPriceAmountValue}+ selectedPriceIndex={selectedPriceIndex}+ /><ConfirmationModal- modalInstanceId={confirmModalId}+ modalInstanceId={BILLING_MODAL_IDS.confirmResourceCreditPriceChange}title={isUpgrade() ? t`Confirm upgrade` : t`Confirm downgrade`}- subtitle={t`Confirm changing your current resource credit allocation.`}+ subtitle={+ isDefined(selectedCreditAmountDisplay) &&+ isDefined(selectedPriceDisplay)+ ? t`Confirm changing to ${selectedCreditAmountDisplay} credits for $${selectedPriceDisplay} per ${intervalLabel}.`+ : t`Confirm changing your current resource credit allocation.`+ }confirmButtonText={isUpgrade() ? t`Upgrade` : t`Downgrade`}confirmButtonAccent={isUpgrade() ? 'blue' : 'danger'}loading={isUpdating}diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCard.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCard.tsxnew file mode 100644index 00000000000..2343adeb3ff--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCard.tsx@@ -0,0 +1,23 @@+import { styled } from '@linaria/react';+import { themeCssVariables } from 'twenty-ui/theme-constants';++export const StyledSettingsBillingCard = styled.div`+ background-color: ${themeCssVariables.background.secondary};+ border: 1px solid ${themeCssVariables.border.color.medium};+ border-radius: ${themeCssVariables.border.radius.md};+ display: flex;+ flex-direction: column;+ overflow: hidden;+ width: 100%;+`;++export const StyledSettingsBillingCardHeader = styled.div`+ align-items: center;+ background-color: ${themeCssVariables.background.transparent.lighter};+ border-bottom: 1px solid ${themeCssVariables.background.transparent.light};+ display: flex;+ flex-wrap: wrap;+ gap: ${themeCssVariables.spacing[2]};+ justify-content: space-between;+ padding: ${themeCssVariables.spacing[3]};+`;diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCardField.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCardField.tsxnew file mode 100644index 00000000000..2520aecfec7--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingCardField.tsx@@ -0,0 +1,107 @@+import { styled } from '@linaria/react';+import { type ReactNode } from 'react';+import { type TablerIconsProps } from 'twenty-ui/icon';+import { OverflowingTextWithTooltip } from 'twenty-ui/surfaces';+import { themeCssVariables, useTheme } from 'twenty-ui/theme-constants';++const StyledBillingFieldRow = styled.div`+ align-items: center;+ display: grid;+ gap: ${themeCssVariables.spacing[1]};+ grid-template-columns: 92px minmax(0, 1fr);+ min-height: 24px;+`;++const StyledBillingFieldLabel = styled.div`+ align-items: center;+ color: ${themeCssVariables.font.color.tertiary};+ display: flex;+ font-size: ${themeCssVariables.font.size.sm};+ gap: ${themeCssVariables.spacing[2]};+ min-width: 0;+`;++const StyledBillingFieldValue = styled.div`+ align-items: center;+ color: ${themeCssVariables.font.color.primary};+ display: flex;+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.regular};+ min-width: 0;+`;++const StyledScheduledChangeItem = styled.div`+ align-items: center;+ box-sizing: border-box;+ display: grid;+ gap: ${themeCssVariables.spacing[1]};+ grid-template-columns: 92px minmax(0, 1fr);+ min-height: 24px;+ min-width: 0;++ & + & {+ border-left: 1px solid ${themeCssVariables.background.transparent.light};+ padding-left: ${themeCssVariables.spacing[6]};+ }++ @media (max-width: 640px) {+ & + & {+ border-left: 0;+ border-top: 1px solid ${themeCssVariables.background.transparent.light};+ padding-left: 0;+ padding-top: ${themeCssVariables.spacing[3]};+ }++ &:not(:last-child) {+ padding-bottom: ${themeCssVariables.spacing[3]};+ }+ }+`;++type BillingFieldRowProps = {+ Icon: (props: TablerIconsProps) => ReactNode;+ label: string;+ children: ReactNode;+};++export const BillingFieldRow = ({+ Icon,+ label,+ children,+}: BillingFieldRowProps) => {+ const theme = useTheme();++ return (+ <StyledBillingFieldRow>+ <StyledBillingFieldLabel>+ <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />+ <OverflowingTextWithTooltip text={label} />+ </StyledBillingFieldLabel>+ <StyledBillingFieldValue>{children}</StyledBillingFieldValue>+ </StyledBillingFieldRow>+ );+};++export type ScheduledBillingChangeFieldProps = {+ Icon: (props: TablerIconsProps) => ReactNode;+ label: string;+ value: string;+};++export const ScheduledBillingChangeField = ({+ Icon,+ label,+ value,+}: ScheduledBillingChangeFieldProps) => {+ const theme = useTheme();++ return (+ <StyledScheduledChangeItem>+ <StyledBillingFieldLabel>+ <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />+ <OverflowingTextWithTooltip text={label} />+ </StyledBillingFieldLabel>+ <StyledBillingFieldValue>{value}</StyledBillingFieldValue>+ </StyledScheduledChangeItem>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCard.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCard.tsxnew file mode 100644index 00000000000..46f906ae5b0--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCard.tsx@@ -0,0 +1,348 @@+import {+ BillingFieldRow,+ ScheduledBillingChangeField,+ type ScheduledBillingChangeFieldProps,+} from '@/settings/billing/components/internal/SettingsBillingCardField';+import {+ StyledSettingsBillingCard,+ StyledSettingsBillingCardHeader,+} from '@/settings/billing/components/internal/SettingsBillingCard';+import { SettingsTextLink } from '@/settings/components/SettingsTextLink';+import { WorkspaceMemberAvatarStack } from '@/workspace-member/components/WorkspaceMemberAvatarStack';+import { styled } from '@linaria/react';+import { useLingui } from '@lingui/react/macro';+import { type ComponentProps, type ReactNode } from 'react';+import { isDefined } from 'twenty-shared/utils';+import {+ IconCalendarDue,+ IconClockPlay,+ IconCoins,+ IconSum,+ IconUserCircle,+ IconUsers,+} from 'twenty-ui/icon';+import { themeCssVariables } from 'twenty-ui/theme-constants';++type BillingStatusTone = 'blue' | 'gray' | 'orange' | 'red' | 'sky';++const STATUS_PILL_COLORS: Record<+ BillingStatusTone,+ { background: string; color: string }+> = {+ blue: {+ background: themeCssVariables.color.blue4,+ color: themeCssVariables.accent.accent11,+ },+ gray: {+ background: themeCssVariables.color.gray4,+ color: themeCssVariables.color.gray11,+ },+ orange: {+ background: themeCssVariables.color.orange4,+ color: themeCssVariables.color.orange11,+ },+ red: {+ background: themeCssVariables.color.red4,+ color: themeCssVariables.color.red11,+ },+ sky: {+ background: themeCssVariables.color.sky4,+ color: themeCssVariables.color.sky11,+ },+};++const StyledSettingsBillingCardGridBody = styled.div`+ display: grid;+ gap: ${themeCssVariables.spacing[6]};+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);+ padding: ${themeCssVariables.spacing[4]} ${themeCssVariables.spacing[3]};++ @media (max-width: 640px) {+ grid-template-columns: 1fr;+ }+`;++const StyledPlanHeader = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[2]};+ min-width: 0;+`;++const StyledPlanLabel = styled.span`+ color: ${themeCssVariables.font.color.primary};+ font-size: ${themeCssVariables.font.size.md};+ font-weight: ${themeCssVariables.font.weight.medium};+ white-space: nowrap;+`;++const StyledStatusPill = styled.span<{ tone: BillingStatusTone }>`+ align-items: center;+ background-color: ${({ tone }) => STATUS_PILL_COLORS[tone].background};+ border-radius: ${themeCssVariables.border.radius.pill};+ color: ${({ tone }) => STATUS_PILL_COLORS[tone].color};+ display: inline-flex;+ font-size: ${themeCssVariables.font.size.sm};+ font-weight: ${themeCssVariables.font.weight.medium};+ gap: ${themeCssVariables.spacing[1]};+ height: 22px;+ padding: 0 ${themeCssVariables.spacing[2]};+ white-space: nowrap;+`;++const StyledStatusDot = styled.span<{ tone: BillingStatusTone }>`+ background-color: currentColor;+ border-radius: 50%;+ height: 4px;+ width: 4px;+`;++const StyledHeaderActions = styled.div`+ align-items: center;+ display: flex;+ flex-wrap: wrap;+ gap: ${themeCssVariables.spacing[2]};+ justify-content: flex-end;+`;++const StyledBillingFieldList = styled.div`+ display: flex;+ flex-direction: column;+ gap: ${themeCssVariables.spacing[1]};+ min-width: 0;+`;++const StyledBillingFieldListWithDivider = styled(StyledBillingFieldList)`+ border-left: 1px solid ${themeCssVariables.background.transparent.light};+ padding-left: ${themeCssVariables.spacing[6]};++ @media (max-width: 640px) {+ border-left: 0;+ border-top: 1px solid ${themeCssVariables.background.transparent.light};+ padding-left: 0;+ padding-top: ${themeCssVariables.spacing[4]};+ }+`;++const StyledBillingIntervalValue = styled.div`+ align-items: center;+ display: flex;+ gap: ${themeCssVariables.spacing[1]};+ min-width: 0;+`;++const StyledBillingIntervalSeparator = styled.span`+ color: ${themeCssVariables.font.color.tertiary};+`;++const StyledSecondaryText = styled.span`+ color: ${themeCssVariables.font.color.tertiary};+ margin-left: ${themeCssVariables.spacing[1]};+`;++const StyledScheduledChangeHeader = styled.div`+ align-items: center;+ background-color: ${themeCssVariables.background.transparent.lighter};+ border-bottom: 1px solid ${themeCssVariables.background.transparent.light};+ border-top: 1px solid ${themeCssVariables.background.transparent.light};+ display: flex;+ font-size: ${themeCssVariables.font.size.sm};+ gap: ${themeCssVariables.spacing[1]};+ min-height: 32px;+ padding: 0 ${themeCssVariables.spacing[3]};+`;++const StyledScheduledChangeTitle = styled.span`+ color: ${themeCssVariables.font.color.primary};+ font-weight: ${themeCssVariables.font.weight.medium};+`;++const StyledScheduledChangeDate = styled.span`+ color: ${themeCssVariables.font.color.tertiary};+`;++const StyledScheduledChangeGrid = styled.div<{ columns: number }>`+ display: grid;+ gap: ${themeCssVariables.spacing[6]};+ grid-template-columns: ${({ columns }) =>+ `repeat(${columns}, minmax(0, 1fr))`};+ padding: ${themeCssVariables.spacing[3]};++ @media (max-width: 640px) {+ gap: 0;+ grid-template-columns: 1fr;+ }+`;++type SettingsBillingSubscriptionInfoCardProps = {+ canDisplaySwitchToMonthlyAction: boolean;+ canDisplaySwitchToYearlyAction: boolean;+ creditsSubtotalDetails?: string;+ creditsSubtotalValue: string;+ currentIntervalLabel: string;+ displayedSubscriptionDate?: string;+ headerActions: ReactNode;+ isSubscriptionActionDisabled: boolean;+ onSwitchToMonthly: () => void;+ onSwitchToYearly: () => void;+ planLabel: string;+ scheduledChangeItems: ScheduledBillingChangeFieldProps[];+ scheduledChangeStartDate?: string;+ seatsSubtotalDetails?: string;+ seatsSubtotalValue: string;+ statusDescriptor: {+ label: string;+ tone: BillingStatusTone;+ };+ subscriptionDateLabel: string;+ totalIntervalSubtitle?: string;+ totalValue: string;+ totalWorkspaceMembersCount?: number | null;+ workspaceMemberDefaultName: string;+ workspaceMembers: ComponentProps<+ typeof WorkspaceMemberAvatarStack+ >['workspaceMembers'];+};++export const SettingsBillingSubscriptionInfoCard = ({+ canDisplaySwitchToMonthlyAction,+ canDisplaySwitchToYearlyAction,+ creditsSubtotalDetails,+ creditsSubtotalValue,+ currentIntervalLabel,+ displayedSubscriptionDate,+ headerActions,+ isSubscriptionActionDisabled,+ onSwitchToMonthly,+ onSwitchToYearly,+ planLabel,+ scheduledChangeItems,+ scheduledChangeStartDate,+ seatsSubtotalDetails,+ seatsSubtotalValue,+ statusDescriptor,+ subscriptionDateLabel,+ totalIntervalSubtitle,+ totalValue,+ totalWorkspaceMembersCount,+ workspaceMemberDefaultName,+ workspaceMembers,+}: SettingsBillingSubscriptionInfoCardProps) => {+ const { t } = useLingui();+ const hasScheduledChange = scheduledChangeItems.length > 0;++ return (+ <StyledSettingsBillingCard>+ <StyledSettingsBillingCardHeader>+ <StyledPlanHeader>+ <StyledPlanLabel>{planLabel}</StyledPlanLabel>+ <StyledStatusPill tone={statusDescriptor.tone}>+ <StyledStatusDot tone={statusDescriptor.tone} />+ {statusDescriptor.label}+ </StyledStatusPill>+ </StyledPlanHeader>+ <StyledHeaderActions>{headerActions}</StyledHeaderActions>+ </StyledSettingsBillingCardHeader>+ <StyledSettingsBillingCardGridBody>+ <StyledBillingFieldList>+ <BillingFieldRow label={t`Seats`} Icon={IconUserCircle}>+ <WorkspaceMemberAvatarStack+ workspaceMembers={workspaceMembers}+ totalWorkspaceMembersCount={totalWorkspaceMembersCount}+ defaultAvatarName={workspaceMemberDefaultName}+ />+ </BillingFieldRow>+ <BillingFieldRow label={t`Billing interval`} Icon={IconClockPlay}>+ <StyledBillingIntervalValue>+ {currentIntervalLabel}+ {canDisplaySwitchToYearlyAction && (+ <>+ <StyledBillingIntervalSeparator>+ ·+ </StyledBillingIntervalSeparator>+ <SettingsTextLink+ variant="secondary"+ title={t`Switch to yearly`}+ onClick={onSwitchToYearly}+ disabled={isSubscriptionActionDisabled}+ >+ {t`Switch to yearly`}+ </SettingsTextLink>+ </>+ )}+ {canDisplaySwitchToMonthlyAction && (+ <>+ <StyledBillingIntervalSeparator>+ ·+ </StyledBillingIntervalSeparator>+ <SettingsTextLink+ variant="secondary"+ title={t`Downgrade to monthly`}+ onClick={onSwitchToMonthly}+ disabled={isSubscriptionActionDisabled}+ >+ {t`Downgrade to monthly`} →+ </SettingsTextLink>+ </>+ )}+ </StyledBillingIntervalValue>+ </BillingFieldRow>+ {isDefined(displayedSubscriptionDate) && (+ <BillingFieldRow+ label={subscriptionDateLabel}+ Icon={IconCalendarDue}+ >+ {displayedSubscriptionDate}+ </BillingFieldRow>+ )}+ </StyledBillingFieldList>+ <StyledBillingFieldListWithDivider>+ <BillingFieldRow label={t`Seats`} Icon={IconUsers}>+ {seatsSubtotalValue}+ {seatsSubtotalDetails && (+ <StyledSecondaryText>{seatsSubtotalDetails}</StyledSecondaryText>+ )}+ </BillingFieldRow>+ <BillingFieldRow label={t`Credits`} Icon={IconCoins}>+ {creditsSubtotalValue}+ {creditsSubtotalDetails && (+ <StyledSecondaryText>+ {creditsSubtotalDetails}+ </StyledSecondaryText>+ )}+ </BillingFieldRow>+ <BillingFieldRow label={t`Total`} Icon={IconSum}>+ {totalValue}+ {isDefined(totalIntervalSubtitle) && (+ <StyledSecondaryText>{totalIntervalSubtitle}</StyledSecondaryText>+ )}+ </BillingFieldRow>+ </StyledBillingFieldListWithDivider>+ </StyledSettingsBillingCardGridBody>+ {hasScheduledChange && (+ <>+ <StyledScheduledChangeHeader>+ <StyledScheduledChangeTitle>+ {t`Scheduled change`}+ </StyledScheduledChangeTitle>+ {isDefined(scheduledChangeStartDate) && (+ <StyledScheduledChangeDate>+ · {t`Starting ${scheduledChangeStartDate}`}+ </StyledScheduledChangeDate>+ )}+ </StyledScheduledChangeHeader>+ <StyledScheduledChangeGrid columns={scheduledChangeItems.length}>+ {scheduledChangeItems.map((scheduledChangeItem) => (+ <ScheduledBillingChangeField+ Icon={scheduledChangeItem.Icon}+ key={scheduledChangeItem.label}+ label={scheduledChangeItem.label}+ value={scheduledChangeItem.value}+ />+ ))}+ </StyledScheduledChangeGrid>+ </>+ )}+ </StyledSettingsBillingCard>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCardHeaderActions.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCardHeaderActions.tsxnew file mode 100644index 00000000000..da9fd19fcce--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoCardHeaderActions.tsx@@ -0,0 +1,139 @@+import { useLingui } from '@lingui/react/macro';+import {+ IconArrowDown,+ IconArrowUp,+ IconCircleX,+ IconCreditCard,+} from 'twenty-ui/icon';+import { Button } from 'twenty-ui/input';++export type SettingsBillingSubscriptionInfoCardHeaderActionsProps = {+ canCancelIntervalSwitch: boolean;+ canCancelPlanSwitch: boolean;+ canStartSubscription: boolean;+ canSwitchToOrganizationPlan: boolean;+ canSwitchToProPlan: boolean;+ isCancellationScheduled: boolean;+ isEndTrialPeriodDisabled: boolean;+ isSubscriptionActionDisabled: boolean;+ isTrialPeriod: boolean;+ isUpdatePaymentDisabled: boolean;+ onCancelIntervalSwitch: () => void;+ onCancelPlanSwitch: () => void;+ onEndTrialPeriod: () => void;+ onSwitchToOrganization: () => void;+ onSwitchToPro: () => void;+ onUpdatePayment: () => void;+ shouldUpdatePayment: boolean;+};++export const SettingsBillingSubscriptionInfoCardHeaderActions = ({+ canCancelIntervalSwitch,+ canCancelPlanSwitch,+ canStartSubscription,+ canSwitchToOrganizationPlan,+ canSwitchToProPlan,+ isCancellationScheduled,+ isEndTrialPeriodDisabled,+ isSubscriptionActionDisabled,+ isTrialPeriod,+ isUpdatePaymentDisabled,+ onCancelIntervalSwitch,+ onCancelPlanSwitch,+ onEndTrialPeriod,+ onSwitchToOrganization,+ onSwitchToPro,+ onUpdatePayment,+ shouldUpdatePayment,+}: SettingsBillingSubscriptionInfoCardHeaderActionsProps) => {+ const { t } = useLingui();++ if (isCancellationScheduled) {+ return (+ <Button+ Icon={IconCreditCard}+ title={t`Manage billing`}+ variant="primary"+ accent="blue"+ size="small"+ onClick={onUpdatePayment}+ disabled={isUpdatePaymentDisabled}+ />+ );+ }++ if (shouldUpdatePayment) {+ return (+ <Button+ Icon={IconArrowUp}+ title={t`Update payment`}+ variant="primary"+ accent="blue"+ size="small"+ onClick={onUpdatePayment}+ disabled={isUpdatePaymentDisabled}+ />+ );+ }++ return (+ <>+ {canCancelIntervalSwitch && (+ <Button+ Icon={IconCircleX}+ title={t`Cancel interval switching`}+ variant="secondary"+ size="small"+ onClick={onCancelIntervalSwitch}+ disabled={isSubscriptionActionDisabled}+ />+ )}+ {canSwitchToOrganizationPlan && (+ <Button+ Icon={IconArrowUp}+ title={+ isTrialPeriod+ ? t`Switch to Organization`+ : t`Upgrade to Organization`+ }+ variant={isTrialPeriod ? 'secondary' : 'primary'}+ accent={isTrialPeriod ? 'default' : 'blue'}+ size="small"+ onClick={onSwitchToOrganization}+ disabled={isSubscriptionActionDisabled}+ />+ )}+ {canStartSubscription && (+ <Button+ Icon={IconArrowUp}+ title={t`Subscribe Now`}+ variant="primary"+ accent="blue"+ size="small"+ onClick={onEndTrialPeriod}+ disabled={isEndTrialPeriodDisabled}+ />+ )}+ {canSwitchToProPlan && (+ <Button+ Icon={IconArrowDown}+ title={t`Switch to Pro`}+ variant="secondary"+ size="small"+ onClick={onSwitchToPro}+ disabled={isSubscriptionActionDisabled}+ />+ )}+ {canCancelPlanSwitch && (+ <Button+ Icon={IconCircleX}+ title={t`Cancel plan switching`}+ variant="secondary"+ size="small"+ onClick={onCancelPlanSwitch}+ disabled={isSubscriptionActionDisabled}+ />+ )}+ </>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoModals.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoModals.tsxnew file mode 100644index 00000000000..d7aa3befdf4--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/SettingsBillingSubscriptionInfoModals.tsx@@ -0,0 +1,126 @@+import { BILLING_MODAL_IDS } from '@/settings/billing/constants/BillingModalIds';+import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';+import { useLingui } from '@lingui/react/macro';++type SettingsBillingSubscriptionInfoModalsProps = {+ cancelIntervalSwitchingSubtitle: string;+ cancelPlanSwitchingSubtitle: string;+ isCancellingIntervalSwitch: boolean;+ isCancellingMeteredSwitch: boolean;+ isCancellingPlanSwitch: boolean;+ isEndTrialPeriodLoading: boolean;+ isSwitchingInterval: boolean;+ isSwitchingPlan: boolean;+ onCancelIntervalSwitching: () => void;+ onCancelPlanSwitching: () => void;+ onCancelResourceCreditSwitching: () => void;+ onEndTrialPeriod: () => void;+ onSwitchInterval: () => void;+ onSwitchPlan: () => void;+ startSubscriptionSubtitle: string;+ switchToMonthlySubtitle: string;+ switchToOrganizationSubtitle: string;+ switchToProSubtitle: string;+ switchToYearlySubtitle: string;+};++export const SettingsBillingSubscriptionInfoModals = ({+ cancelIntervalSwitchingSubtitle,+ cancelPlanSwitchingSubtitle,+ isCancellingIntervalSwitch,+ isCancellingMeteredSwitch,+ isCancellingPlanSwitch,+ isEndTrialPeriodLoading,+ isSwitchingInterval,+ isSwitchingPlan,+ onCancelIntervalSwitching,+ onCancelPlanSwitching,+ onCancelResourceCreditSwitching,+ onEndTrialPeriod,+ onSwitchInterval,+ onSwitchPlan,+ startSubscriptionSubtitle,+ switchToMonthlySubtitle,+ switchToOrganizationSubtitle,+ switchToProSubtitle,+ switchToYearlySubtitle,+}: SettingsBillingSubscriptionInfoModalsProps) => {+ const { t } = useLingui();++ return (+ <>+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.switchBillingIntervalToYearly}+ title={t`Change to Yearly?`}+ subtitle={switchToYearlySubtitle}+ onConfirmClick={onSwitchInterval}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isSwitchingInterval}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.switchBillingIntervalToMonthly}+ title={t`Change to Monthly?`}+ subtitle={switchToMonthlySubtitle}+ onConfirmClick={onSwitchInterval}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isSwitchingInterval}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.cancelSwitchBillingInterval}+ title={t`Cancel interval switching?`}+ subtitle={cancelIntervalSwitchingSubtitle}+ onConfirmClick={onCancelIntervalSwitching}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isCancellingIntervalSwitch}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.switchBillingPlanToEnterprise}+ title={t`Change to Organization Plan?`}+ subtitle={switchToOrganizationSubtitle}+ onConfirmClick={onSwitchPlan}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isSwitchingPlan}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.switchBillingPlanToPro}+ title={t`Change to Pro Plan?`}+ subtitle={switchToProSubtitle}+ onConfirmClick={onSwitchPlan}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isSwitchingPlan}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.cancelSwitchBillingPlan}+ title={t`Cancel plan switching?`}+ subtitle={cancelPlanSwitchingSubtitle}+ onConfirmClick={onCancelPlanSwitching}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isCancellingPlanSwitch}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.endTrialPeriod}+ title={t`Start Your Subscription`}+ subtitle={startSubscriptionSubtitle}+ onConfirmClick={onEndTrialPeriod}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isEndTrialPeriodLoading}+ />+ <ConfirmationModal+ modalInstanceId={BILLING_MODAL_IDS.cancelSwitchMeteredPrice}+ title={t`Cancel credit pack switching?`}+ subtitle={t`You have scheduled a credit pack change. Do you want to cancel it?`}+ onConfirmClick={onCancelResourceCreditSwitching}+ confirmButtonText={t`Confirm`}+ confirmButtonAccent="blue"+ loading={isCancellingMeteredSwitch}+ />+ </>+ );+};diff --git a/packages/twenty-front/src/modules/settings/billing/constants/BillingModalIds.ts b/packages/twenty-front/src/modules/settings/billing/constants/BillingModalIds.tsnew file mode 100644index 00000000000..cc457508ee8--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/constants/BillingModalIds.ts@@ -0,0 +1,13 @@+export const BILLING_MODAL_IDS = {+ cancelSwitchBillingInterval: 'cancel-switch-billing-interval-modal',+ cancelSwitchBillingPlan: 'cancel-switch-billing-plan-modal',+ cancelSwitchMeteredPrice: 'cancel-switch-metered-price-modal',+ confirmResourceCreditPriceChange:+ 'resource-credit-price-change-confirmation-modal',+ creditPackagePicker: 'resource-credit-package-picker-modal',+ endTrialPeriod: 'end-trial-period-modal',+ switchBillingIntervalToMonthly: 'switch-billing-interval-to-monthly-modal',+ switchBillingIntervalToYearly: 'switch-billing-interval-to-yearly-modal',+ switchBillingPlanToEnterprise: 'switch-billing-plan-to-enterprise-modal',+ switchBillingPlanToPro: 'switch-billing-plan-to-pro-modal',+} as const;diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useHasNextBillingPhase.test.ts b/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useHasNextBillingPhase.test.tsdeleted file mode 100644index b7916130f56..00000000000--- a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useHasNextBillingPhase.test.ts+++ /dev/null@@ -1,7 +0,0 @@-import { useHasNextBillingPhase } from '@/settings/billing/hooks/useHasNextBillingPhase';--describe('useHasNextBillingPhase', () => {- it('should be a function', () => {- expect(typeof useHasNextBillingPhase).toBe('function');- });-});diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useNextBillingSeats.test.ts b/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useNextBillingSeats.test.tsdeleted file mode 100644index ac3610863ca..00000000000--- a/packages/twenty-front/src/modules/settings/billing/hooks/__tests__/useNextBillingSeats.test.ts+++ /dev/null@@ -1,7 +0,0 @@-import { useNextBillingSeats } from '@/settings/billing/hooks/useNextBillingSeats';--describe('useNextBillingSeats', () => {- it('should be a function', () => {- expect(typeof useNextBillingSeats).toBe('function');- });-});diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate.tsnew file mode 100644index 00000000000..3438ac1f171--- /dev/null+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate.ts@@ -0,0 +1,61 @@+import {+ type CurrentWorkspace,+ currentWorkspaceState,+} from '@/auth/states/currentWorkspaceState';+import { useStore } from 'jotai';+import { isDefined } from 'twenty-shared/utils';++type CurrentWorkspaceBillingUpdate = Pick<+ CurrentWorkspace,+ 'billingSubscriptions' | 'currentBillingSubscription'+>;++type CurrentBillingSubscription = NonNullable<+ CurrentWorkspace['currentBillingSubscription']+>;++type ApplyCurrentWorkspaceBillingUpdateOptions = {+ onBillingUpdateApplied?: () => void;+ transformCurrentBillingSubscription?: (+ currentBillingSubscription: CurrentBillingSubscription,+ ) => CurrentBillingSubscription;+};++export const useApplyCurrentWorkspaceBillingUpdate = () => {+ const store = useStore();++ const applyCurrentWorkspaceBillingUpdate = (+ billingUpdate: CurrentWorkspaceBillingUpdate | null | undefined,+ options?: ApplyCurrentWorkspaceBillingUpdateOptions,+ ) => {+ const currentBillingSubscription =+ billingUpdate?.currentBillingSubscription;++ if (!isDefined(billingUpdate) || !isDefined(currentBillingSubscription)) {+ return false;+ }++ const currentWorkspace = store.get(currentWorkspaceState.atom);++ if (!isDefined(currentWorkspace)) {+ return false;+ }++ store.set(currentWorkspaceState.atom, {+ ...currentWorkspace,+ currentBillingSubscription:+ options?.transformCurrentBillingSubscription?.(+ currentBillingSubscription,+ ) ?? currentBillingSubscription,+ billingSubscriptions: billingUpdate.billingSubscriptions,+ });++ options?.onBillingUpdateApplied?.();++ return true;+ };++ return {+ applyCurrentWorkspaceBillingUpdate,+ };+};diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useBillingWording.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useBillingWording.tsindex e5bf17a7f7f..d9ff7ca0d4f 100644--- a/packages/twenty-front/src/modules/settings/billing/hooks/useBillingWording.ts+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useBillingWording.ts@@ -100,27 +100,40 @@ export const useBillingWording = () => {const confirmationModalSwitchToYearlyMessage = () => {if (subscriptionStatus === SubscriptionStatus.Trialing) {- return t`Your trial period will end, and you will be charged $${yearlyPrice} per user per year billed annually. A prorata with your current subscription will be applied.`;+ return t`Your billing interval will switch to yearly immediately and your trial will continue. When it ends, you will be charged $${yearlyPrice} per user per year billed annually.`;}+return t`You will be charged $${yearlyPrice} per user per year billed annually. A prorata with your current subscription will be applied.`;};const confirmationModalSwitchToMonthlyMessage = () => {+ if (subscriptionStatus === SubscriptionStatus.Trialing) {+ return t`Your billing interval will switch to monthly immediately and your trial will continue. When it ends, you will be charged $${monthlyPrice} per user per month billed monthly.`;+ }+const beautifiedRenewDate = getBeautifiedRenewDate();return t`You will be charged $${monthlyPrice} per user per month billed monthly. The change will be applied the ${beautifiedRenewDate}.`;};const confirmationModalSwitchToOrganizationMessage = () => {- const prefix =- subscriptionStatus === SubscriptionStatus.Trialing- ? t`Your trial period will end, and `- : '';+ if (subscriptionStatus === SubscriptionStatus.Trialing) {+ const suffix = isYearlyPlan ? t` billed annually` : '';++ return t`Your plan will switch to Organization immediately and your trial will continue. When it ends, you will be charged $${enterprisePrice} per user per month${suffix}.`;+ }+const body = t`you will be charged $${enterprisePrice} per user per month`;const suffix = isYearlyPlan ? t` billed annually` : '';- return capitalize(`${prefix}${body}${suffix}.`);+ return capitalize(`${body}${suffix}.`);};const confirmationModalSwitchToProMessage = () => {+ if (subscriptionStatus === SubscriptionStatus.Trialing) {+ const suffix = isYearlyPlan ? t` billed annually` : '';++ return t`Your plan will switch to Pro immediately and your trial will continue. When it ends, you will be charged $${proPrice} per user per month${suffix}.`;+ }+const beautifiedRenewDate = getBeautifiedRenewDate();const suffix1 = isYearlyPlan ? t` billed annually` : '';const suffix2 = t`. The change will be applied the ${beautifiedRenewDate}.`;diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.tsindex 4b9c6f750eb..6c0fe23a40c 100644--- a/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts+++ b/packages/twenty-front/src/modules/settings/billing/hooks/useCreditUpgradeAction.ts@@ -1,8 +1,8 @@-import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';import { useNumberFormat } from '@/localization/hooks/useNumberFormat';+import { useApplyCurrentWorkspaceBillingUpdate } from '@/settings/billing/hooks/useApplyCurrentWorkspaceBillingUpdate';import { useGetNextResourceCreditPrice } from '@/settings/billing/hooks/useGetNextResourceCreditPrice';import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';-import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';+import { CombinedGraphQLErrors } from '@apollo/client/errors';import { useMutation } from '@apollo/client/react';import { t } from '@lingui/core/macro';import { isDefined } from 'twenty-shared/utils';@@ -17,9 +17,8 @@ export const useCreditUpgradeAction = () => {const { enqueueSuccessSnackBar, enqueueErrorSnackBar, enqueueInfoSnackBar } =useSnackBar();- const [currentWorkspace, setCurrentWorkspace] = useAtomState(- currentWorkspaceState,- );+ const { applyCurrentWorkspaceBillingUpdate } =+ useApplyCurrentWorkspaceBillingUpdate();const [setResourceCreditSubscriptionPrice, { loading: isUpgrading }] =useMutation(SetResourceCreditSubscriptionPriceDocument);@@ -55,33 +54,31 @@ export const useCreditUpgradeAction = () => {variables: { priceId: nextPrice.stripePriceId },});- if (- isDefined(- data?.setResourceCreditSubscriptionPrice.currentBillingSubscription,- ) &&- isDefined(currentWorkspace)- ) {- setCurrentWorkspace({- ...currentWorkspace,- currentBillingSubscription: {- ...data.setResourceCreditSubscriptionPrice- .currentBillingSubscription,+ applyCurrentWorkspaceBillingUpdate(+ data?.setResourceCreditSubscriptionPrice,+ {+ transformCurrentBillingSubscription: (+ currentBillingSubscription,+ ) => ({+ ...currentBillingSubscription,billingSubscriptionItems:- data.setResourceCreditSubscriptionPrice.currentBillingSubscription?.billingSubscriptionItems?.map(+ currentBillingSubscription.billingSubscriptionItems?.map((item) => ({...item,hasReachedCurrentPeriodCap: false,}),),- },- billingSubscriptions:- data.setResourceCreditSubscriptionPrice.billingSubscriptions,- });- }+ }),+ },+ );enqueueSuccessSnackBar({ message: t`Credit plan upgraded.` });- } catch {+ } catch (error) {enqueueErrorSnackBar({ message: t`Failed to upgrade credit plan.` });++ if (!CombinedGraphQLErrors.is(error)) {+ throw error;+ }}};diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useHasNextBillingPhase.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useHasNextBillingPhase.tsdeleted file mode 100644index 1766513b67b..00000000000--- a/packages/twenty-front/src/modules/settings/billing/hooks/useHasNextBillingPhase.ts+++ /dev/null@@ -1,11 +0,0 @@-import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';--export const useHasNextBillingPhase = () => {- const currentWorkspace = useAtomStateValue(currentWorkspaceState);-- const hasNextBillingPhase =- currentWorkspace?.currentBillingSubscription?.phases.length === 2;-- return { hasNextBillingPhase };-};diff --git a/packages/twenty-front/src/modules/settings/billing/hooks/useNextBillingSeats.ts b/packages/twenty-front/src/modules/settings/billing/hooks/useNextBillingSeats.tsdeleted file mode 100644index 25d6d2a940c..00000000000--- a/packages/twenty-front/src/modules/settings/billing/hooks/useNextBillingSeats.ts+++ /dev/null@@ -1,18 +0,0 @@-import { useNextBillingPhase } from '@/settings/billing/hooks/useNextBillingPhase';-import { useSplitPhaseItemsInPrices } from '@/settings/billing/hooks/useSplitPhaseItemsInPrices';-import { findOrThrow, isDefined } from 'twenty-shared/utils';--export const useNextBillingSeats = () => {- const { splitedPhaseItemsInPrices } = useSplitPhaseItemsInPrices();- const { nextBillingPhase } = useNextBillingPhase();- const nextBasePrice = splitedPhaseItemsInPrices.nextBasePrice;- const nextBillingSeats =- isDefined(nextBasePrice) && nextBillingPhase- ? findOrThrow(- nextBillingPhase?.items,- ({ price }) => nextBasePrice.stripePriceId === price,- ).quantity- : undefined;-- return { nextBillingSeats };-};diff --git a/packages/twenty-front/src/modules/settings/components/SettingsTextLink.tsx b/packages/twenty-front/src/modules/settings/components/SettingsTextLink.tsxnew file mode 100644index 00000000000..a8f021fce7e--- /dev/null+++ b/packages/twenty-front/src/modules/settings/components/SettingsTextLink.tsx@@ -0,0 +1,105 @@+import { css, cx } from '@linaria/core';+import { type MouseEventHandler, type ReactNode } from 'react';+import { Link, type LinkProps } from 'react-router-dom';+import { themeCssVariables } from 'twenty-ui/theme-constants';++type SettingsTextLinkVariant = 'primary' | 'secondary';++type SettingsTextLinkCommonProps = {+ children: ReactNode;+ className?: string;+ title?: string;+ variant?: SettingsTextLinkVariant;+};++type SettingsTextLinkProps =+ | (SettingsTextLinkCommonProps & {+ disabled?: boolean;+ onClick?: MouseEventHandler<HTMLButtonElement>;+ to?: undefined;+ })+ | (SettingsTextLinkCommonProps & {+ disabled?: never;+ onClick?: MouseEventHandler<HTMLAnchorElement>;+ to: LinkProps['to'];+ });++const settingsTextLinkBaseClassName = css`+ background: none;+ border: 0;+ cursor: pointer;+ font: inherit;+ margin: 0;+ overflow: hidden;+ padding: 0;+ text-decoration: underline;+ text-overflow: ellipsis;+ text-underline-offset: 2px;+ white-space: nowrap;++ &:disabled {+ cursor: not-allowed;+ opacity: 0.5;+ }+`;++const settingsTextLinkPrimaryClassName = css`+ color: ${themeCssVariables.font.color.primary};+ text-decoration-color: ${themeCssVariables.border.color.strong};++ &:not(:disabled):hover {+ color: ${themeCssVariables.color.blue};+ text-decoration-color: ${themeCssVariables.color.blue};+ }+`;++const settingsTextLinkSecondaryClassName = css`+ color: ${themeCssVariables.font.color.tertiary};+ text-decoration-color: ${themeCssVariables.font.color.tertiary};++ &:not(:disabled):hover {+ color: ${themeCssVariables.color.blue};+ text-decoration-color: ${themeCssVariables.color.blue};+ }+`;++export const SettingsTextLink = ({+ children,+ className,+ title,+ variant = 'primary',+ ...props+}: SettingsTextLinkProps) => {+ const textLinkClassName = cx(+ settingsTextLinkBaseClassName,+ variant === 'primary'+ ? settingsTextLinkPrimaryClassName+ : settingsTextLinkSecondaryClassName,+ className,+ );++ if (props.to !== undefined) {+ return (+ <Link+ className={textLinkClassName}+ onClick={props.onClick}+ title={title}+ to={props.to}+ >+ {children}+ </Link>+ );+ }++ return (+ <button+ className={textLinkClassName}+ disabled={props.disabled ?? false}+ onClick={props.onClick}+ title={title}+ type="button"+ >+ {children}+ </button>+ );+};diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsxindex 92a50ee71ca..cf69165fa15 100644--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx@@ -8,6 +8,7 @@ import { isDDLLockedState } from '@/client-config/states/isDDLLockedState';import { isObjectMetadataReadOnly } from '@/object-record/read-only/utils/isObjectMetadataReadOnly';import { SettingsItemTypeTag } from '@/settings/components/SettingsItemTypeTag';import { SettingsNameCellSecondaryLabel } from '@/settings/components/SettingsNameCellSecondaryLabel';+import { SettingsTextLink } from '@/settings/components/SettingsTextLink';import { RELATION_TYPES } from '@/settings/data-model/constants/RelationTypes';import { SettingsObjectFieldInactiveActionDropdown } from '@/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown';import { TableCell } from '@/ui/layout/table/components/TableCell';@@ -15,8 +16,7 @@ import { TableRow } from '@/ui/layout/table/components/TableRow';import { styled } from '@linaria/react';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { useLingui } from '@lingui/react/macro';-import { useContext, useMemo } from 'react';-import { Link } from 'react-router-dom';+import { type MouseEvent, useContext, useMemo } from 'react';import { FieldMetadataType, SettingsPath } from 'twenty-shared/types';import { getSettingsPath, isDefined } from 'twenty-shared/utils';import {@@ -63,27 +63,6 @@ const StyledRelationType = styled.div`gap: ${themeCssVariables.spacing[1]};`;-const StyledLinkContainer = styled.div`- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;-- > a {- color: ${themeCssVariables.font.color.primary};- overflow: hidden;- text-decoration: underline;- text-decoration-color: ${themeCssVariables.border.color.strong};- text-overflow: ellipsis;- text-underline-offset: 2px;- white-space: nowrap;-- &:hover {- color: ${themeCssVariables.color.blue};- text-decoration-color: ${themeCssVariables.color.blue};- }- }-`;-export const SettingsObjectRelationItemTableRow = ({fieldMetadataItem,objectMetadataItem,@@ -191,17 +170,17 @@ export const SettingsObjectRelationItemTableRow = ({)}<StyledNameContainer>{isRelatedObjectLinkable ? (- <StyledLinkContainer>- <Link- to={getSettingsPath(SettingsPath.ObjectDetail, {- objectNamePlural: relationObjectMetadataItem.namePlural,- })}- onClick={(event) => event.stopPropagation()}- title={targetObjectLabel}- >- {targetObjectLabel}- </Link>- </StyledLinkContainer>+ <SettingsTextLink+ to={getSettingsPath(SettingsPath.ObjectDetail, {+ objectNamePlural: relationObjectMetadataItem.namePlural,+ })}+ onClick={(event: MouseEvent<HTMLAnchorElement>) =>+ event.stopPropagation()+ }+ title={targetObjectLabel}+ >+ {targetObjectLabel}+ </SettingsTextLink>) : (<StyledNameLabel title={targetObjectLabel}>{targetObjectLabel}diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableHeader.tsxindex 7b7f0ee2757..f437d516875 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableHeader.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableHeader.tsx@@ -7,8 +7,8 @@ export const SettingsRolesTableHeader = () => {return (<Table><TableRow- mobileGridAutoColumns="5fr 1fr 1fr 35px"- gridAutoColumns="332px 3fr 2fr 1fr"+ mobileGridAutoColumns="5fr 2fr 35px"+ gridAutoColumns="332px 5fr 1fr"><TableHeader><Trans>Name</Trans>@@ -17,7 +17,6 @@ export const SettingsRolesTableHeader = () => {<Trans>Assigned to</Trans></TableHeader><TableHeader></TableHeader>- <TableHeader></TableHeader></TableRow></Table>);diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsxindex 734ede6fe65..b8831ee6b28 100644--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx@@ -1,23 +1,16 @@import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersState';+import { type RoleWithPartialMembers } from '@/settings/roles/types/RoleWithPartialMembers';import { TableCell } from '@/ui/layout/table/components/TableCell';import { TableRow } from '@/ui/layout/table/components/TableRow';+import { t } from '@lingui/core/macro';import { styled } from '@linaria/react';-import React, { useContext } from 'react';+import { useContext } from 'react';import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';import { SettingsPath } from 'twenty-shared/types';-import { getSettingsPath, isDefined } from 'twenty-shared/utils';-import { Avatar } from 'twenty-ui/data-display';+import { getSettingsPath } from 'twenty-shared/utils';import { IconChevronRight, IconLock, useIcons } from 'twenty-ui/icon';-import { AppTooltip, TooltipDelay } from 'twenty-ui/surfaces';import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';--import { type RoleWithPartialMembers } from '@/settings/roles/types/RoleWithPartialMembers';-import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';--const StyledAssignedText = styled.div`- color: ${themeCssVariables.font.color.secondary};- font-size: ${themeCssVariables.font.size.sm};-`;+import { WorkspaceMemberAvatarStack } from '@/workspace-member/components/WorkspaceMemberAvatarStack';const StyledNameCell = styled.div`color: ${themeCssVariables.font.color.primary};@@ -25,17 +18,9 @@ const StyledNameCell = styled.div`gap: ${themeCssVariables.spacing[1]};`;-const StyledAvatarGroup = styled.div`+const StyledAssignedToCell = styled.div`display: flex;justify-content: flex-end;-- > * {- margin-left: -5px;-- &:first-of-type {- margin-left: 0;- }- }`;const StyledIconLockContainer = styled.div`@@ -57,6 +42,8 @@ type SettingsRolesTableRowProps = {role: RoleWithPartialMembers;};+const MAX_VISIBLE_ROLE_MEMBER_AVATARS = 5;+export const SettingsRolesTableRow = ({ role }: SettingsRolesTableRowProps) => {const { theme } = useContext(ThemeContext);const { getIcon } = useIcons();@@ -66,20 +53,19 @@ export const SettingsRolesTableRow = ({ role }: SettingsRolesTableRowProps) => {currentWorkspaceMembersState,);- const enrichedWorkspaceMembers = role.workspaceMembers- .map((workspaceMember) =>+ const enrichedWorkspaceMembers = role.workspaceMembers.map(+ (workspaceMember) =>currentWorkspaceMembers.find((member) => member.id === workspaceMember.id,- ),- )- .filter(isDefined);+ ) ?? workspaceMember,+ );return (<StyledTableRowContainer><TableRowkey={role.id}- gridAutoColumns="332px 3fr 2fr 1fr"- mobileGridAutoColumns="5fr 1fr 1fr 35px"+ gridAutoColumns="332px 5fr 1fr"+ mobileGridAutoColumns="5fr 2fr 35px"to={getSettingsPath(SettingsPath.RoleDetail, { roleId: role.id })}><TableCell>@@ -98,34 +84,14 @@ export const SettingsRolesTableRow = ({ role }: SettingsRolesTableRowProps) => {</StyledNameCell></TableCell><TableCell align="right">- <StyledAvatarGroup>- {enrichedWorkspaceMembers.slice(0, 5).map((workspaceMember) => (- <React.Fragment key={workspaceMember.id}>- <div id={`avatar-${workspaceMember.id}`}>- <Avatar- avatarUrl={getAbsoluteImageUrl(workspaceMember.avatarUrl)}- placeholderColorSeed={workspaceMember.id}- placeholder={workspaceMember.name.firstName ?? ''}- type="rounded"- size="md"- />- </div>- <AppTooltip- anchorSelect={`#avatar-${workspaceMember.id}`}- content={`${workspaceMember.name.firstName} ${workspaceMember.name.lastName}`}- noArrow- place="top"- positionStrategy="fixed"- delay={TooltipDelay.shortDelay}- />- </React.Fragment>- ))}- </StyledAvatarGroup>- </TableCell>- <TableCell align="left">- <StyledAssignedText>- {role.workspaceMembers.length}- </StyledAssignedText>+ <StyledAssignedToCell>+ <WorkspaceMemberAvatarStack+ defaultAvatarName={t`Workspace member`}+ maxVisible={MAX_VISIBLE_ROLE_MEMBER_AVATARS}+ totalWorkspaceMembersCount={role.workspaceMembers.length}+ workspaceMembers={enrichedWorkspaceMembers}+ />+ </StyledAssignedToCell></TableCell><TableCell align="right" color={theme.font.color.tertiary}><IconChevronRight size={theme.icon.size.md} />diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsxindex e99ffb3b256..dc3f5a50701 100644--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx@@ -74,10 +74,12 @@ export const SettingsRoleAssignmentTableRow = ({}case 'agent': {const Icon = getIcon(roleTarget.data.icon || 'IconRobot');- return <Icon size={theme.icon.size.md} />;+ return <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />;}case 'apiKey': {- return <IconKey size={theme.icon.size.md} />;+ return (+ <IconKey size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />+ );}}};diff --git a/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx b/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsxindex 43814863eb5..3966961782d 100644--- a/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx+++ b/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx@@ -182,7 +182,7 @@ export const ConfirmationModal = ({<StyledCenteredButtononClick={handleConfirmClick}- variant="secondary"+ variant="primary"accent={confirmButtonAccent}title={translatedConfirmButtonText}disabled={!isValidValue || loading}diff --git a/packages/twenty-front/src/modules/ui/layout/modal/components/ModalStatefulWrapper.tsx b/packages/twenty-front/src/modules/ui/layout/modal/components/ModalStatefulWrapper.tsxindex 0fa24aa4bb7..85243daa00b 100644--- a/packages/twenty-front/src/modules/ui/layout/modal/components/ModalStatefulWrapper.tsx+++ b/packages/twenty-front/src/modules/ui/layout/modal/components/ModalStatefulWrapper.tsx@@ -30,6 +30,7 @@ export const ModalStatefulWrapper = ({smallBorderRadius,narrowWidth,autoHeight,+ width,}: ModalStatefulWrapperProps) => {const isMobile = useIsMobile();const modalRef = useRef<HTMLDivElement>(null);@@ -82,6 +83,7 @@ export const ModalStatefulWrapper = ({smallBorderRadius={smallBorderRadius}narrowWidth={narrowWidth}autoHeight={autoHeight}+ width={width}modalZIndex={RootStackingContextZIndices.RootModal}backdropZIndex={RootStackingContextZIndices.RootModalBackDrop}backdropClickOutsideId={MODAL_BACKDROP_CLICK_OUTSIDE_ID}diff --git a/packages/twenty-front/src/modules/ui/layout/modal/types/ModalStatefulWrapperProps.ts b/packages/twenty-front/src/modules/ui/layout/modal/types/ModalStatefulWrapperProps.tsindex 1ee91c6a0e9..a5d6662fdeb 100644--- a/packages/twenty-front/src/modules/ui/layout/modal/types/ModalStatefulWrapperProps.ts+++ b/packages/twenty-front/src/modules/ui/layout/modal/types/ModalStatefulWrapperProps.ts@@ -10,6 +10,7 @@ export type ModalStatefulWrapperProps = Pick<| 'smallBorderRadius'| 'narrowWidth'| 'autoHeight'+ | 'width'> &React.PropsWithChildren & {modalInstanceId: string;diff --git a/packages/twenty-front/src/modules/users/graphql/fragments/billingSubscriptionsFragment.ts b/packages/twenty-front/src/modules/users/graphql/fragments/billingSubscriptionsFragment.tsindex 10a7f09ba9f..152fe74d588 100644--- a/packages/twenty-front/src/modules/users/graphql/fragments/billingSubscriptionsFragment.ts+++ b/packages/twenty-front/src/modules/users/graphql/fragments/billingSubscriptionsFragment.ts@@ -7,6 +7,7 @@ export const BILLING_SUBSCRIPTION_FRAGMENT = gql`idstatusmetadata+ cancelAtphases {...BillingSubscriptionSchedulePhaseFragment}diff --git a/packages/twenty-front/src/modules/users/graphql/fragments/currentBillingSubscriptionFragement.ts b/packages/twenty-front/src/modules/users/graphql/fragments/currentBillingSubscriptionFragement.tsindex 82b8ea883fa..4b398543ff0 100644--- a/packages/twenty-front/src/modules/users/graphql/fragments/currentBillingSubscriptionFragement.ts+++ b/packages/twenty-front/src/modules/users/graphql/fragments/currentBillingSubscriptionFragement.ts@@ -9,6 +9,7 @@ export const CURRENT_BILLING_SUBSCRIPTION_FRAGMENT = gql`intervalmetadatacurrentPeriodEnd+ cancelAtphases {...BillingSubscriptionSchedulePhaseFragment}diff --git a/packages/twenty-front/src/modules/workspace-member/components/WorkspaceMemberAvatarStack.tsx b/packages/twenty-front/src/modules/workspace-member/components/WorkspaceMemberAvatarStack.tsxnew file mode 100644index 00000000000..d073ebabe27--- /dev/null+++ b/packages/twenty-front/src/modules/workspace-member/components/WorkspaceMemberAvatarStack.tsx@@ -0,0 +1,121 @@+import { styled } from '@linaria/react';+import { Avatar, AvatarGroup } from 'twenty-ui/data-display';+import { themeCssVariables } from 'twenty-ui/theme-constants';++import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';++const DEFAULT_MAX_VISIBLE_MEMBER_AVATARS = 5;+const WORKSPACE_MEMBER_AVATAR_CHIP_SIZE = '18px';++type WorkspaceMemberAvatarStackMember = {+ avatarUrl?: string | null;+ id: string;+ name?: {+ firstName?: string | null;+ lastName?: string | null;+ } | null;+ userEmail?: string | null;+};++type WorkspaceMemberAvatarStackProps = {+ defaultAvatarName: string;+ maxVisible?: number;+ totalWorkspaceMembersCount?: number | null;+ workspaceMembers: WorkspaceMemberAvatarStackMember[];+};++const StyledAvatarStackContainer = styled.div`+ align-items: center;+ display: flex;+ min-width: 0;+`;++const StyledAvatarContainer = styled.div`+ border: 1px solid ${themeCssVariables.background.secondary};+ border-radius: 50%;+ display: flex;+`;++const StyledMoreAvatar = styled.div`+ align-items: center;+ background-color: ${themeCssVariables.background.tertiary};+ border: 1px solid ${themeCssVariables.background.secondary};+ border-radius: ${themeCssVariables.border.radius.md};+ box-sizing: border-box;+ color: ${themeCssVariables.font.color.secondary};+ display: flex;+ font-size: 12px;+ font-weight: ${themeCssVariables.font.weight.medium};+ height: ${WORKSPACE_MEMBER_AVATAR_CHIP_SIZE};+ justify-content: center;+ min-width: ${WORKSPACE_MEMBER_AVATAR_CHIP_SIZE};+ padding: 0 ${themeCssVariables.spacing[1]};+ width: fit-content;+`;++const getWorkspaceMemberDisplayName = (+ workspaceMember: WorkspaceMemberAvatarStackMember,+ defaultAvatarName: string,+) => {+ const fullName = [+ workspaceMember.name?.firstName,+ workspaceMember.name?.lastName,+ ]+ .filter(Boolean)+ .join(' ')+ .trim();++ return fullName || workspaceMember.userEmail || defaultAvatarName;+};++export const WorkspaceMemberAvatarStack = ({+ defaultAvatarName,+ maxVisible = DEFAULT_MAX_VISIBLE_MEMBER_AVATARS,+ totalWorkspaceMembersCount,+ workspaceMembers,+}: WorkspaceMemberAvatarStackProps) => {+ const visibleWorkspaceMembers = workspaceMembers.slice(0, maxVisible);+ const visibleWorkspaceMembersCount = visibleWorkspaceMembers.length;+ const hiddenWorkspaceMembersCount = Math.max(+ 0,+ (totalWorkspaceMembersCount ?? workspaceMembers.length) -+ visibleWorkspaceMembersCount,+ );++ if (visibleWorkspaceMembersCount === 0 && hiddenWorkspaceMembersCount === 0) {+ return null;+ }++ return (+ <StyledAvatarStackContainer>+ <AvatarGroup+ avatars={visibleWorkspaceMembers.map((workspaceMember) => {+ const displayName = getWorkspaceMemberDisplayName(+ workspaceMember,+ defaultAvatarName,+ );++ return (+ <StyledAvatarContainer key={workspaceMember.id}>+ <Avatar+ avatarUrl={getAbsoluteImageUrl(workspaceMember.avatarUrl)}+ placeholder={displayName}+ placeholderColorSeed={workspaceMember.id}+ size="md"+ type="rounded"+ />+ </StyledAvatarContainer>+ );+ })}+ maxVisible={maxVisible}+ overflowAvatar={+ hiddenWorkspaceMembersCount > 0 ? (+ <StyledMoreAvatar>+{hiddenWorkspaceMembersCount}</StyledMoreAvatar>+ ) : undefined+ }+ overlap="left"+ overlapOffset="4px"+ />+ </StyledAvatarStackContainer>+ );+};diff --git a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.tsindex 1a763a98202..1c0949d7aca 100644--- a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts@@ -142,6 +142,7 @@ export class BillingSubscriptionEntity extends WorkspaceRelatedEntity {@Column({ nullable: false, type: 'jsonb', default: [] })phases: Array<BillingSubscriptionSchedulePhaseDTO>;+ @Field(() => Date, { nullable: true })@Column({ nullable: true, type: 'timestamptz' })cancelAt: Date | null;diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/billing-subscription-update.service.spec.ts b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/billing-subscription-update.service.spec.tsindex 316fd616e7d..0812ecc1e4e 100644--- a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/billing-subscription-update.service.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/billing-subscription-update.service.spec.ts@@ -10,6 +10,7 @@ import { BillingSubscriptionItemEntity } from 'src/engine/core-modules/billing/eimport { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';+import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';import { BillingPriceService } from 'src/engine/core-modules/billing/services/billing-price.service';import { BillingProductService } from 'src/engine/core-modules/billing/services/billing-product.service';import { BillingSubscriptionPhaseService } from 'src/engine/core-modules/billing/services/billing-subscription-phase.service';@@ -262,6 +263,85 @@ describe('BillingSubscriptionUpdateService', () => {).toHaveBeenCalled();});+ it('should update from PRO to ENTERPRISE during trial without immediate invoicing', async () => {+ arrangeBillingSubscriptionRepositoryFindOneOrFail(+ billingSubscriptionRepository,+ {+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ licensedPriceId: LICENSE_PRICE_PRO_MONTH_ID,+ resourceCreditPriceId: METER_PRICE_PRO_MONTH_ID,+ seats: 1,+ status: SubscriptionStatus.Trialing,+ },+ );++ arrangeBillingPriceRepositoryFindOneOrFail(billingPriceRepository, {+ [LICENSE_PRICE_PRO_MONTH_ID]: buildBillingPriceEntity({+ stripePriceId: LICENSE_PRICE_PRO_MONTH_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ isMetered: false,+ }),+ [METER_PRICE_PRO_MONTH_ID]: buildBillingPriceEntity({+ stripePriceId: METER_PRICE_PRO_MONTH_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ isMetered: true,+ tiers: buildDefaultMeteredTiers(),+ }),+ });++ arrangeStripeSubscriptionScheduleServiceLoadSubscriptionSchedule(+ stripeSubscriptionScheduleService,+ {},+ );++ arrangeBillingProductServiceGetProductPrices(billingProductService, [+ buildBillingPriceEntity({+ stripePriceId: LICENSE_PRICE_ENTERPRISE_MONTH_ID,+ planKey: BillingPlanKey.ENTERPRISE,+ interval: SubscriptionInterval.Month,+ isMetered: false,+ }) as BillingPriceEntity,+ buildBillingPriceEntity({+ stripePriceId: METER_PRICE_ENTERPRISE_MONTH_ID,+ planKey: BillingPlanKey.ENTERPRISE,+ interval: SubscriptionInterval.Month,+ isMetered: true,+ tiers: buildDefaultMeteredTiers(),+ }) as BillingPriceEntity,+ ]);++ await service.updateSubscription('ws_1', 'sub_db_1', {+ type: SubscriptionUpdateType.PLAN,+ newPlan: BillingPlanKey.ENTERPRISE,+ });++ expect(stripeSubscriptionService.updateSubscription).toHaveBeenCalledWith(+ 'sub_1',+ {+ items: [+ {+ id: 'si_licensed',+ price: LICENSE_PRICE_ENTERPRISE_MONTH_ID,+ quantity: 1,+ },+ {+ id: 'si_resource_credit',+ price: METER_PRICE_ENTERPRISE_MONTH_ID,+ quantity: 1,+ },+ ],+ proration_behavior: 'none',+ metadata: { plan: BillingPlanKey.ENTERPRISE },+ },+ );+ expect(+ billingSubscriptionService.syncSubscriptionToDatabase,+ ).toHaveBeenCalled();+ });+it('should update from PRO to ENTERPRISE - with schedule', async () => {arrangeBillingSubscriptionRepositoryFindOneOrFail(billingSubscriptionRepository,@@ -684,6 +764,84 @@ describe('BillingSubscriptionUpdateService', () => {).toHaveBeenCalled();});+ it('should change interval from monthly to yearly during trial without resetting billing anchor', async () => {+ arrangeBillingSubscriptionRepositoryFindOneOrFail(+ billingSubscriptionRepository,+ {+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ licensedPriceId: LICENSE_PRICE_PRO_MONTH_ID,+ resourceCreditPriceId: METER_PRICE_PRO_MONTH_ID,+ seats: 1,+ status: SubscriptionStatus.Trialing,+ },+ );++ arrangeBillingPriceRepositoryFindOneOrFail(billingPriceRepository, {+ [LICENSE_PRICE_PRO_MONTH_ID]: buildBillingPriceEntity({+ stripePriceId: LICENSE_PRICE_PRO_MONTH_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ isMetered: false,+ }),+ [METER_PRICE_PRO_MONTH_ID]: buildBillingPriceEntity({+ stripePriceId: METER_PRICE_PRO_MONTH_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Month,+ isMetered: true,+ tiers: buildDefaultMeteredTiers(),+ }),+ });++ arrangeStripeSubscriptionScheduleServiceLoadSubscriptionSchedule(+ stripeSubscriptionScheduleService,+ {},+ );++ arrangeBillingProductServiceGetProductPrices(billingProductService, [+ buildBillingPriceEntity({+ stripePriceId: LICENSE_PRICE_PRO_YEAR_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Year,+ isMetered: false,+ }) as BillingPriceEntity,+ buildBillingPriceEntity({+ stripePriceId: METER_PRICE_PRO_YEAR_ID,+ planKey: BillingPlanKey.PRO,+ interval: SubscriptionInterval.Year,+ isMetered: true,+ tiers: buildDefaultMeteredTiers(),+ }) as BillingPriceEntity,+ ]);++ await service.updateSubscription('ws_1', 'sub_db_1', {+ type: SubscriptionUpdateType.INTERVAL,+ newInterval: SubscriptionInterval.Year,+ });++ expect(stripeSubscriptionService.updateSubscription).toHaveBeenCalledWith(+ 'sub_1',+ {+ items: [+ {+ id: 'si_licensed',+ price: LICENSE_PRICE_PRO_YEAR_ID,+ quantity: 1,+ },+ {+ id: 'si_resource_credit',+ price: METER_PRICE_PRO_YEAR_ID,+ quantity: 1,+ },+ ],+ proration_behavior: 'none',+ },+ );+ expect(+ billingSubscriptionService.syncSubscriptionToDatabase,+ ).toHaveBeenCalled();+ });+it('should change interval from monthly to yearly - with schedule (ENTERPRISE monthly to PRO yearly downgrade)', async () => {arrangeBillingSubscriptionRepositoryFindOneOrFail(billingSubscriptionRepository,@@ -1382,4 +1540,30 @@ describe('BillingSubscriptionUpdateService', () => {).toHaveBeenCalled();});});++ describe('shouldUpdateAtSubscriptionPeriodEnd', () => {+ it('should update plan changes immediately during trial', async () => {+ await expect(+ service.shouldUpdateAtSubscriptionPeriodEnd(+ { status: SubscriptionStatus.Trialing } as BillingSubscriptionEntity,+ {+ type: SubscriptionUpdateType.PLAN,+ newPlan: BillingPlanKey.PRO,+ },+ ),+ ).resolves.toBe(false);+ });++ it('should update interval changes immediately during trial', async () => {+ await expect(+ service.shouldUpdateAtSubscriptionPeriodEnd(+ { status: SubscriptionStatus.Trialing } as BillingSubscriptionEntity,+ {+ type: SubscriptionUpdateType.INTERVAL,+ newInterval: SubscriptionInterval.Month,+ },+ ),+ ).resolves.toBe(false);+ });+ });});diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/build-subscription.util.ts b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/build-subscription.util.tsindex 92c027a5efc..185e35770ea 100644--- a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/build-subscription.util.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/build-subscription.util.ts@@ -16,6 +16,7 @@ export const buildSubscription = ({licensedPriceId = LICENSE_PRICE_PRO_MONTH_ID,resourceCreditPriceId = METER_PRICE_PRO_MONTH_ID,seats = 1,+ status = SubscriptionStatus.Active,workspaceId = 'ws_1',stripeSubscriptionId = 'sub_1',currentPeriodEnd = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),@@ -25,6 +26,7 @@ export const buildSubscription = ({licensedPriceId?: string;resourceCreditPriceId?: string;seats?: number;+ status?: SubscriptionStatus;workspaceId?: string;stripeSubscriptionId?: string;currentPeriodEnd?: Date;@@ -33,7 +35,7 @@ export const buildSubscription = ({id: 'sub_db_1',workspaceId,stripeSubscriptionId,- status: SubscriptionStatus.Active,+ status,interval,currentPeriodEnd,billingSubscriptionItems: [diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/mock-builders.util.ts b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/mock-builders.util.tsindex 0c195feee6e..4ad30887823 100644--- a/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/mock-builders.util.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/services/__test__/utils/mock-builders.util.ts@@ -7,6 +7,7 @@ import { type BillingSubscriptionEntity } from 'src/engine/core-modules/billing/import { type BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';import { BillingProductKey } from 'src/engine/core-modules/billing/enums/billing-product-key.enum';import { type SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';+import { type SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';import { type BillingProductService } from 'src/engine/core-modules/billing/services/billing-product.service';import { type BillingSubscriptionPhaseService } from 'src/engine/core-modules/billing/services/billing-subscription-phase.service';@@ -89,6 +90,7 @@ export const arrangeBillingSubscriptionRepositoryFindOneOrFail = (licensedPriceId?: string;resourceCreditPriceId?: string;seats?: number;+ status?: SubscriptionStatus;workspaceId?: string;stripeSubscriptionId?: string;currentPeriodEnd?: Date;diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-update.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-update.service.tsindex 12e23a17494..97f1d14e9e7 100644--- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-update.service.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-update.service.ts@@ -20,6 +20,7 @@ import { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entitimport { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';import { BillingProductKey } from 'src/engine/core-modules/billing/enums/billing-product-key.enum';import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';+import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';import { BillingPriceService } from 'src/engine/core-modules/billing/services/billing-price.service';import { BillingProductService } from 'src/engine/core-modules/billing/services/billing-product.service';import { BillingSubscriptionPhaseService } from 'src/engine/core-modules/billing/services/billing-subscription-phase.service';@@ -272,7 +273,10 @@ export class BillingSubscriptionUpdateService {} else {const subscriptionOptions = computeSubscriptionUpdateOptions(subscriptionUpdate,- { currentSeats: licensedItem.quantity },+ {+ currentSeats: licensedItem.quantity,+ isTrialing: subscription.status === SubscriptionStatus.Trialing,+ },);if (@@ -525,6 +529,14 @@ export class BillingSubscriptionUpdateService {subscription: BillingSubscriptionEntity,update: SubscriptionUpdate,): Promise<boolean> {+ if (+ subscription.status === SubscriptionStatus.Trialing &&+ (update.type === SubscriptionUpdateType.INTERVAL ||+ update.type === SubscriptionUpdateType.PLAN)+ ) {+ return false;+ }+switch (update.type) {case SubscriptionUpdateType.PLAN: {const currentPlan =diff --git a/packages/twenty-server/src/engine/core-modules/billing/utils/__tests__/compute-subscription-update-options.util.spec.ts b/packages/twenty-server/src/engine/core-modules/billing/utils/__tests__/compute-subscription-update-options.util.spec.tsindex ab0986c3315..7c4b21d112f 100644--- a/packages/twenty-server/src/engine/core-modules/billing/utils/__tests__/compute-subscription-update-options.util.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/utils/__tests__/compute-subscription-update-options.util.spec.ts@@ -32,6 +32,23 @@ describe('computeSubscriptionUpdateOptions', () => {});});+ it('returns no proration and plan metadata for PLAN update type during trial', () => {+ const result = computeSubscriptionUpdateOptions(+ {+ type: SubscriptionUpdateType.PLAN,+ newPlan: BillingPlanKey.ENTERPRISE,+ },+ { isTrialing: true },+ );++ expect(result).toEqual({+ proration: 'none',+ metadata: {+ plan: BillingPlanKey.ENTERPRISE,+ },+ });+ });+it('returns proration and anchor for INTERVAL update type', () => {const result = computeSubscriptionUpdateOptions({type: SubscriptionUpdateType.INTERVAL,@@ -44,6 +61,20 @@ describe('computeSubscriptionUpdateOptions', () => {});});+ it('returns no proration or anchor for INTERVAL update type during trial', () => {+ const result = computeSubscriptionUpdateOptions(+ {+ type: SubscriptionUpdateType.INTERVAL,+ newInterval: SubscriptionInterval.Month,+ },+ { isTrialing: true },+ );++ expect(result).toEqual({+ proration: 'none',+ });+ });+it('returns always_invoice when increasing seats', () => {const result = computeSubscriptionUpdateOptions({diff --git a/packages/twenty-server/src/engine/core-modules/billing/utils/compute-subscription-update-options.util.ts b/packages/twenty-server/src/engine/core-modules/billing/utils/compute-subscription-update-options.util.tsindex dcf9339901a..67d167155d0 100644--- a/packages/twenty-server/src/engine/core-modules/billing/utils/compute-subscription-update-options.util.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/utils/compute-subscription-update-options.util.ts@@ -9,7 +9,7 @@ import {export const computeSubscriptionUpdateOptions = (subscriptionUpdate: SubscriptionUpdate,- context?: { currentSeats?: number },+ context?: { currentSeats?: number; isTrialing?: boolean },): {proration: Stripe.SubscriptionUpdateParams.ProrationBehavior;metadata?: Record<string, string>;@@ -18,7 +18,7 @@ export const computeSubscriptionUpdateOptions = (switch (subscriptionUpdate.type) {case SubscriptionUpdateType.PLAN:return {- proration: 'always_invoice',+ proration: context?.isTrialing ? 'none' : 'always_invoice',metadata: {plan: subscriptionUpdate.newPlan,},@@ -28,10 +28,14 @@ export const computeSubscriptionUpdateOptions = (proration: 'none',};case SubscriptionUpdateType.INTERVAL:- return {- proration: 'create_prorations',- anchor: 'now',- };+ return context?.isTrialing+ ? {+ proration: 'none',+ }+ : {+ proration: 'create_prorations',+ anchor: 'now',+ };case SubscriptionUpdateType.SEATS: {const currentSeats = context?.currentSeats ?? subscriptionUpdate.newSeats;diff --git a/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.module.scss b/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.module.scssindex 68c8c0de25b..d4515ce527d 100644--- a/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.module.scss+++ b/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.module.scss@@ -4,9 +4,21 @@}.itemContainer {- margin-right: -3px;+ display: flex;++ &[data-overlap='right'] {+ margin-right: calc(-1 * var(--avatar-group-overlap-offset));+ }- &:last-child {+ &[data-overlap='right']:last-child {margin-right: 0;}++ &[data-overlap='left'] {+ margin-left: calc(-1 * var(--avatar-group-overlap-offset));+ }++ &[data-overlap='left']:first-child {+ margin-left: 0;+ }}diff --git a/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.tsx b/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.tsxindex 0b38fd19ed8..4212faa99df 100644--- a/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.tsx+++ b/packages/twenty-ui/src/data-display/AvatarGroup/AvatarGroup.tsx@@ -1,23 +1,56 @@-import { type ReactNode } from 'react';+import { clsx } from 'clsx';+import { type CSSProperties, type ReactNode } from 'react';import styles from './AvatarGroup.module.scss';export type AvatarGroupProps = {avatars: ReactNode[];+ className?: string;+ maxVisible?: number;+ overflowAvatar?: ReactNode;+ overlap?: 'left' | 'right';+ overlapOffset?: string;};const MAX_AVATARS_NB = 4;-export const AvatarGroup = ({ avatars }: AvatarGroupProps) => {- if (!avatars.length) return null;+export const AvatarGroup = ({+ avatars,+ className,+ maxVisible = MAX_AVATARS_NB,+ overflowAvatar,+ overlap = 'right',+ overlapOffset = '3px',+}: AvatarGroupProps) => {+ const visibleAvatars = avatars.slice(0, maxVisible);++ if (!visibleAvatars.length && !overflowAvatar) return null;++ const itemStyle = {+ '--avatar-group-overlap-offset': overlapOffset,+ } as CSSProperties;return (- <div className={styles.container}>- {avatars.slice(0, MAX_AVATARS_NB).map((avatar, index) => (- <div className={styles.itemContainer} key={index}>+ <div className={clsx(styles.container, className)}>+ {visibleAvatars.map((avatar, index) => (+ <div+ className={styles.itemContainer}+ data-overlap={overlap}+ key={index}+ style={itemStyle}+ >{avatar}</div>))}+ {overflowAvatar && (+ <div+ className={styles.itemContainer}+ data-overlap={overlap}+ style={itemStyle}+ >+ {overflowAvatar}+ </div>+ )}</div>);};diff --git a/packages/twenty-ui/src/input/Button/Button.module.scss b/packages/twenty-ui/src/input/Button/Button.module.scssindex 24146088947..216052a7090 100644--- a/packages/twenty-ui/src/input/Button/Button.module.scss+++ b/packages/twenty-ui/src/input/Button/Button.module.scss@@ -142,6 +142,18 @@ $primary-accents: (hover: var(--t-color-red8),active: var(--t-color-red10),),+ 'green': (+ bg: var(--t-color-green9),+ bg-disabled: var(--t-color-green3),+ border: var(--t-background-transparent-light),+ border-focus: var(--t-color-green9),+ focus-needs-enabled: false,+ shadow-focus: var(--t-color-green3),+ color: $gray-scale-light-gray1,+ color-disabled: var(--t-color-green9),+ hover: var(--t-color-green10),+ active: var(--t-color-green12),+ ),);@each $accent, $tokens in $primary-accents {@@ -183,6 +195,7 @@ $primary-inverted-colors: ('default': var(--t-font-color-secondary),'blue': var(--t-color-blue),'danger': var(--t-color-red),+ 'green': var(--t-color-green9),);.button[data-variant='primary'][data-inverted] {@@ -244,6 +257,16 @@ $secondary-accents: (hover: var(--t-background-danger),active: var(--t-background-danger),),+ 'green': (+ border-secondary: var(--t-color-green9),+ border-focus: var(--t-color-green9),+ focus-needs-enabled-secondary: false,+ shadow-focus: var(--t-color-green3),+ color: var(--t-color-green9),+ color-disabled: var(--t-color-green3),+ hover: var(--t-color-green3),+ active: var(--t-color-green4),+ ),);@each $accent, $tokens in $secondary-accents {diff --git a/packages/twenty-ui/src/input/Button/Button.tsx b/packages/twenty-ui/src/input/Button/Button.tsxindex 9a6f9e583e6..91ae7634920 100644--- a/packages/twenty-ui/src/input/Button/Button.tsx+++ b/packages/twenty-ui/src/input/Button/Button.tsx@@ -16,7 +16,7 @@ import styles from './Button.module.scss';export type ButtonSize = 'medium' | 'small';export type ButtonPosition = 'standalone' | 'left' | 'middle' | 'right';export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';-export type ButtonAccent = 'default' | 'blue' | 'danger';+export type ButtonAccent = 'default' | 'blue' | 'danger' | 'green';export type ButtonProps = {id?: string;diff --git a/packages/twenty-ui/src/input/ButtonGroup/ButtonGroup.tsx b/packages/twenty-ui/src/input/ButtonGroup/ButtonGroup.tsxindex b005b2a7c28..991c9b9b48e 100644--- a/packages/twenty-ui/src/input/ButtonGroup/ButtonGroup.tsx+++ b/packages/twenty-ui/src/input/ButtonGroup/ButtonGroup.tsx@@ -36,7 +36,7 @@ export const ButtonGroup = ({}// eslint-disable-next-line @typescript-eslint/no-explicit-any- const additionalProps: any = { position, variant, accent, size };+ const additionalProps: any = { position };if (isDefined(variant)) {additionalProps.variant = variant;diff --git a/packages/twenty-ui/src/input/Slider/Slider.module.scss b/packages/twenty-ui/src/input/Slider/Slider.module.scssnew file mode 100644index 00000000000..6a8eef422cb--- /dev/null+++ b/packages/twenty-ui/src/input/Slider/Slider.module.scss@@ -0,0 +1,91 @@+.slider {+ --slider-thumb-size: 12px;+ --slider-track-size: 16px;++ cursor: pointer;+ height: var(--slider-track-size);+ position: relative;+ width: 100%;++ &[data-disabled='true'] {+ cursor: not-allowed;+ opacity: 0.5;+ }++ &:has(.input:focus-visible) {+ box-shadow: 0 0 0 3px var(--t-color-blue3);+ }+}++.track {+ background: var(--t-background-tertiary);+ border-radius: var(--t-border-radius-pill);+ height: var(--slider-track-size);+ inset: 0;+ overflow: hidden;+ position: absolute;+}++.fill {+ background: var(--slider-main-color);+ border-radius: var(--t-border-radius-pill);+ height: 100%;+ left: 0;+ min-width: var(--slider-track-size);+ position: absolute;+ top: 0;+ width: var(--slider-fill);++ &::after {+ background: var(--t-background-primary);+ border-radius: var(--t-border-radius-rounded);+ content: '';+ height: var(--slider-thumb-size);+ position: absolute;+ right: 2px;+ top: 2px;+ width: var(--slider-thumb-size);+ }+}++.input {+ appearance: none;+ background: transparent;+ cursor: inherit;+ height: var(--slider-track-size);+ inset: 0;+ margin: 0;+ opacity: 0;+ position: absolute;+ width: 100%;++ &::-webkit-slider-runnable-track {+ background: transparent;+ border: 0;+ height: var(--slider-track-size);+ }++ &::-webkit-slider-thumb {+ appearance: none;+ background: transparent;+ border: 0;+ border-radius: var(--t-border-radius-rounded);+ height: var(--slider-thumb-size);+ margin-top: 2px;+ width: var(--slider-thumb-size);+ }++ &::-moz-range-track {+ background: transparent;+ border: 0;+ height: var(--slider-track-size);+ }++ &::-moz-range-thumb {+ background: transparent;+ border: 0;+ border-radius: var(--t-border-radius-rounded);+ height: var(--slider-thumb-size);+ width: var(--slider-thumb-size);+ }+}diff --git a/packages/twenty-ui/src/input/Slider/Slider.module.scss.d.ts b/packages/twenty-ui/src/input/Slider/Slider.module.scss.d.tsnew file mode 100644index 00000000000..fd238978bc2--- /dev/null+++ b/packages/twenty-ui/src/input/Slider/Slider.module.scss.d.ts@@ -0,0 +1,8 @@+declare const styles: {+ readonly fill: 'fill';+ readonly input: 'input';+ readonly slider: 'slider';+ readonly track: 'track';+};++export default styles;diff --git a/packages/twenty-ui/src/input/Slider/Slider.tsx b/packages/twenty-ui/src/input/Slider/Slider.tsxnew file mode 100644index 00000000000..d8adf3b85c5--- /dev/null+++ b/packages/twenty-ui/src/input/Slider/Slider.tsx@@ -0,0 +1,101 @@+import { clsx } from 'clsx';+import {+ type ChangeEvent,+ type CSSProperties,+ type InputHTMLAttributes,+} from 'react';++import { type ThemeColor } from '@ui/theme';+import { themeCssVariables } from '@ui/theme-constants';++import styles from './Slider.module.scss';++export type SliderColor = ThemeColor;++export type SliderProps = Omit<+ InputHTMLAttributes<HTMLInputElement>,+ 'max' | 'min' | 'onChange' | 'step' | 'type' | 'value'+> & {+ max: number;+ min?: number;+ onChange: (event: ChangeEvent<HTMLInputElement>) => void;+ step?: number;+ value: number;+ color?: SliderColor;+};++const getSliderProgress = ({+ max,+ min,+ value,+}: {+ max: number;+ min: number;+ value: number;+}) => {+ if (max <= min) {+ return 0;+ }++ return Math.min(1, Math.max(0, (value - min) / (max - min)));+};+++const getSliderFill = ({+ max,+ min,+ value,+}: {+ max: number;+ min: number;+ value: number;+}) => {+ const progress = getSliderProgress({ max, min, value });++ return `calc(${progress * 100}% + (1 - ${progress}) * var(--slider-track-size))`;+};++export const Slider = ({+ className,+ color = 'blue',+ disabled,+ max,+ min = 0,+ onChange,+ step = 1,+ style,+ value,+ ...props+}: SliderProps) => {+ const sliderColor = `${color}9` as keyof typeof themeCssVariables.color;++ return (+ <div+ className={clsx(styles.slider, className)}+ data-disabled={disabled || undefined}+ style={+ {+ ...style,+ '--slider-fill': getSliderFill({ max, min, value }),+ '--slider-main-color': themeCssVariables.color[sliderColor],+ } as CSSProperties+ }+ >+ <div className={styles.track}>+ <div className={styles.fill} />+ </div>+ <input+ className={styles.input}+ disabled={disabled}+ max={max}+ min={min}+ onChange={onChange}+ step={step}+ type="range"+ value={value}+ // oxlint-disable-next-line react/jsx-props-no-spreading+ {...props}+ />+ </div>+ );+};diff --git a/packages/twenty-ui/src/input/index.ts b/packages/twenty-ui/src/input/index.tsindex c03c4a32553..1e28c2cdf79 100644--- a/packages/twenty-ui/src/input/index.ts+++ b/packages/twenty-ui/src/input/index.ts@@ -95,6 +95,8 @@ export type { RoundedIconButtonSize } from './RoundedIconButton/RoundedIconButtoexport { RoundedIconButton } from './RoundedIconButton/RoundedIconButton';export type { SearchInputProps } from './SearchInput/SearchInput';export { SearchInput } from './SearchInput/SearchInput';+export type { SliderColor, SliderProps } from './Slider/Slider';+export { Slider } from './Slider/Slider';export type { TabContentProps } from './TabButton/TabButton';export {StyledTabContainer,diff --git a/packages/twenty-ui/src/surfaces/Modal/Modal.tsx b/packages/twenty-ui/src/surfaces/Modal/Modal.tsxindex 617c5c5e04c..0022038146a 100644--- a/packages/twenty-ui/src/surfaces/Modal/Modal.tsx+++ b/packages/twenty-ui/src/surfaces/Modal/Modal.tsx@@ -53,6 +53,7 @@ export const Modal = ({smallBorderRadius,narrowWidth,autoHeight,+ width,modalZIndex = DEFAULT_MODAL_Z_INDEX,backdropZIndex = DEFAULT_BACKDROP_Z_INDEX,backdropTestId = 'modal-backdrop',@@ -113,6 +114,7 @@ export const Modal = ({style={{'--modal-z-index': modalZIndex,+ width: isMobile ? undefined : width,gap:gap !== undefined ? `var(--t-spacing-${gap})` : undefined,} as React.CSSPropertiesdiff --git a/packages/twenty-ui/src/surfaces/Modal/types/ModalProps.ts b/packages/twenty-ui/src/surfaces/Modal/types/ModalProps.tsindex e128fda6bd0..0b603334437 100644--- a/packages/twenty-ui/src/surfaces/Modal/types/ModalProps.ts+++ b/packages/twenty-ui/src/surfaces/Modal/types/ModalProps.ts@@ -17,6 +17,7 @@ export type ModalProps = React.PropsWithChildren & {smallBorderRadius?: boolean;narrowWidth?: boolean;autoHeight?: boolean;+ width?: React.CSSProperties['width'];modalZIndex?: number;backdropZIndex?: number;backdropTestId?: string;