Skip to content

Commit

Permalink
Fix: Remove remaining billing query (#3517)
Browse files Browse the repository at this point in the history
* Fix: Remove remaining billing query

* fix types
  • Loading branch information
Mikehrn authored Nov 19, 2024
1 parent ef043ee commit 065644b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 275 deletions.
2 changes: 1 addition & 1 deletion packages/frontend-2/components/dashboard/Blog/Wrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const logger = useLogger()
const { data: webflowData, error } = await useAsyncData<{
items: WebflowItem[]
}>('webflow-items', () =>
$fetch('/api/webflow', {
$fetch<{ items: WebflowItem[] }>('/api/webflow', {
onResponseError({ response }) {
logger.error('API Response Error:', response.status, response.statusText)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-2/lib/common/generated/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const documents = {
"\n fragment LinkableComment on Comment {\n id\n viewerResources {\n modelId\n versionId\n objectId\n }\n }\n": types.LinkableCommentFragmentDoc,
"\n fragment UseWorkspaceInviteManager_PendingWorkspaceCollaborator on PendingWorkspaceCollaborator {\n id\n token\n workspaceId\n workspaceSlug\n user {\n id\n }\n }\n": types.UseWorkspaceInviteManager_PendingWorkspaceCollaboratorFragmentDoc,
"\n fragment WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator on WorkspaceCollaborator {\n id\n role\n }\n": types.WorkspaceMixpanelUpdateGroup_WorkspaceCollaboratorFragmentDoc,
"\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n billing {\n cost {\n total\n }\n versionsCount {\n current\n max\n }\n }\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n": types.WorkspaceMixpanelUpdateGroup_WorkspaceFragmentDoc,
"\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n": types.WorkspaceMixpanelUpdateGroup_WorkspaceFragmentDoc,
"\n mutation UpdateRole($input: WorkspaceRoleUpdateInput!) {\n workspaceMutations {\n updateRole(input: $input) {\n team {\n items {\n id\n role\n }\n }\n }\n }\n }\n": types.UpdateRoleDocument,
"\n mutation InviteToWorkspace(\n $workspaceId: String!\n $input: [WorkspaceInviteCreateInput!]!\n ) {\n workspaceMutations {\n invites {\n batchCreate(workspaceId: $workspaceId, input: $input) {\n id\n invitedTeam {\n ...SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator\n }\n }\n }\n }\n }\n": types.InviteToWorkspaceDocument,
"\n mutation CreateWorkspace($input: WorkspaceCreateInput!) {\n workspaceMutations {\n create(input: $input) {\n id\n ...SettingsDialog_Workspace\n }\n }\n }\n": types.CreateWorkspaceDocument,
Expand Down Expand Up @@ -1622,7 +1622,7 @@ export function graphql(source: "\n fragment WorkspaceMixpanelUpdateGroup_Works
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n billing {\n cost {\n total\n }\n versionsCount {\n current\n max\n }\n }\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n"): (typeof documents)["\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n billing {\n cost {\n total\n }\n versionsCount {\n current\n max\n }\n }\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n"];
export function graphql(source: "\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n"): (typeof documents)["\n fragment WorkspaceMixpanelUpdateGroup_Workspace on Workspace {\n id\n name\n description\n domainBasedMembershipProtectionEnabled\n discoverabilityEnabled\n team {\n totalCount\n items {\n ...WorkspaceMixpanelUpdateGroup_WorkspaceCollaborator\n }\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
106 changes: 17 additions & 89 deletions packages/frontend-2/lib/common/generated/gql/graphql.ts

Large diffs are not rendered by default.

16 changes: 1 addition & 15 deletions packages/frontend-2/lib/workspaces/composables/mixpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ graphql(`
description
domainBasedMembershipProtectionEnabled
discoverabilityEnabled
billing {
cost {
total
}
versionsCount {
current
max
}
}
team {
totalCount
items {
Expand Down Expand Up @@ -70,12 +61,7 @@ export const useWorkspacesMixpanel = () => {
teamMemberCount: roleCount[Roles.Workspace.Member],
teamGuestCount: roleCount[Roles.Workspace.Guest],
// eslint-disable-next-line camelcase
server_id: resolveMixpanelServerId(window.location.hostname),
...(workspace.billing && {
costTotal: workspace.billing.cost.total,
versionsCountCurrent: workspace.billing.versionsCount.current,
versionsCountMax: workspace.billing.versionsCount.max
})
server_id: resolveMixpanelServerId(window.location.hostname)
}

mixpanel.get_group('workspace_id', workspace.id).set(input)
Expand Down
84 changes: 0 additions & 84 deletions packages/server/modules/core/graph/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,12 +883,6 @@ export type CreateVersionInput = {
totalChildrenCount?: InputMaybe<Scalars['Int']['input']>;
};

export enum Currency {
Eur = 'EUR',
Gbp = 'GBP',
Usd = 'USD'
}

export type DeleteModelInput = {
id: Scalars['ID']['input'];
projectId: Scalars['ID']['input'];
Expand Down Expand Up @@ -4131,33 +4125,6 @@ export type WorkspaceCollection = {
totalCount: Scalars['Int']['output'];
};

export type WorkspaceCost = {
__typename?: 'WorkspaceCost';
/** Currency of the price */
currency: Currency;
/** Discount applied to the total */
discount?: Maybe<WorkspaceCostDiscount>;
items: Array<WorkspaceCostItem>;
/** Estimated cost of the workspace with no discount applied */
subTotal: Scalars['Float']['output'];
/** Total cost with discount applied */
total: Scalars['Float']['output'];
};

export type WorkspaceCostDiscount = {
__typename?: 'WorkspaceCostDiscount';
amount: Scalars['Float']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCostItem = {
__typename?: 'WorkspaceCostItem';
cost: Scalars['Float']['output'];
count: Scalars['Int']['output'];
label: Scalars['String']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCreateInput = {
defaultLogoIndex?: InputMaybe<Scalars['Int']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
Expand All @@ -4181,7 +4148,6 @@ export type WorkspaceDomainDeleteInput = {
export enum WorkspaceFeatureName {
DomainBasedSecurityPolicies = 'domainBasedSecurityPolicies',
OidcSso = 'oidcSso',
Workspace = 'workspace',
WorkspaceDataRegionSpecificity = 'workspaceDataRegionSpecificity'
}

Expand Down Expand Up @@ -4460,14 +4426,6 @@ export type WorkspaceUpdateInput = {
slug?: InputMaybe<Scalars['String']['input']>;
};

export type WorkspaceVersionsCount = {
__typename?: 'WorkspaceVersionsCount';
/** Total number of versions of all projects in the workspace */
current: Scalars['Int']['output'];
/** Maximum number of version of all projects in the workspace with no additional cost */
max: Scalars['Int']['output'];
};



export type ResolverTypeWrapper<T> = Promise<T> | T;
Expand Down Expand Up @@ -4621,7 +4579,6 @@ export type ResolversTypes = {
CreateServerRegionInput: CreateServerRegionInput;
CreateUserEmailInput: CreateUserEmailInput;
CreateVersionInput: CreateVersionInput;
Currency: Currency;
DateTime: ResolverTypeWrapper<Scalars['DateTime']['output']>;
DeleteModelInput: DeleteModelInput;
DeleteUserEmailInput: DeleteUserEmailInput;
Expand Down Expand Up @@ -4790,9 +4747,6 @@ export type ResolversTypes = {
WorkspaceCollaborator: ResolverTypeWrapper<WorkspaceCollaboratorGraphQLReturn>;
WorkspaceCollaboratorCollection: ResolverTypeWrapper<Omit<WorkspaceCollaboratorCollection, 'items'> & { items: Array<ResolversTypes['WorkspaceCollaborator']> }>;
WorkspaceCollection: ResolverTypeWrapper<Omit<WorkspaceCollection, 'items'> & { items: Array<ResolversTypes['Workspace']> }>;
WorkspaceCost: ResolverTypeWrapper<WorkspaceCost>;
WorkspaceCostDiscount: ResolverTypeWrapper<WorkspaceCostDiscount>;
WorkspaceCostItem: ResolverTypeWrapper<WorkspaceCostItem>;
WorkspaceCreateInput: WorkspaceCreateInput;
WorkspaceDomain: ResolverTypeWrapper<WorkspaceDomain>;
WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput;
Expand All @@ -4819,7 +4773,6 @@ export type ResolversTypes = {
WorkspaceSubscription: ResolverTypeWrapper<WorkspaceSubscription>;
WorkspaceTeamFilter: WorkspaceTeamFilter;
WorkspaceUpdateInput: WorkspaceUpdateInput;
WorkspaceVersionsCount: ResolverTypeWrapper<WorkspaceVersionsCount>;
};

/** Mapping between all available schema types and the resolvers parents */
Expand Down Expand Up @@ -5050,9 +5003,6 @@ export type ResolversParentTypes = {
WorkspaceCollaborator: WorkspaceCollaboratorGraphQLReturn;
WorkspaceCollaboratorCollection: Omit<WorkspaceCollaboratorCollection, 'items'> & { items: Array<ResolversParentTypes['WorkspaceCollaborator']> };
WorkspaceCollection: Omit<WorkspaceCollection, 'items'> & { items: Array<ResolversParentTypes['Workspace']> };
WorkspaceCost: WorkspaceCost;
WorkspaceCostDiscount: WorkspaceCostDiscount;
WorkspaceCostItem: WorkspaceCostItem;
WorkspaceCreateInput: WorkspaceCreateInput;
WorkspaceDomain: WorkspaceDomain;
WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput;
Expand All @@ -5075,7 +5025,6 @@ export type ResolversParentTypes = {
WorkspaceSubscription: WorkspaceSubscription;
WorkspaceTeamFilter: WorkspaceTeamFilter;
WorkspaceUpdateInput: WorkspaceUpdateInput;
WorkspaceVersionsCount: WorkspaceVersionsCount;
};

export type HasScopeDirectiveArgs = {
Expand Down Expand Up @@ -6512,29 +6461,6 @@ export type WorkspaceCollectionResolvers<ContextType = GraphQLContext, ParentTyp
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type WorkspaceCostResolvers<ContextType = GraphQLContext, ParentType extends ResolversParentTypes['WorkspaceCost'] = ResolversParentTypes['WorkspaceCost']> = {
currency?: Resolver<ResolversTypes['Currency'], ParentType, ContextType>;
discount?: Resolver<Maybe<ResolversTypes['WorkspaceCostDiscount']>, ParentType, ContextType>;
items?: Resolver<Array<ResolversTypes['WorkspaceCostItem']>, ParentType, ContextType>;
subTotal?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
total?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type WorkspaceCostDiscountResolvers<ContextType = GraphQLContext, ParentType extends ResolversParentTypes['WorkspaceCostDiscount'] = ResolversParentTypes['WorkspaceCostDiscount']> = {
amount?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type WorkspaceCostItemResolvers<ContextType = GraphQLContext, ParentType extends ResolversParentTypes['WorkspaceCostItem'] = ResolversParentTypes['WorkspaceCostItem']> = {
cost?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
count?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
label?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
name?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type WorkspaceDomainResolvers<ContextType = GraphQLContext, ParentType extends ResolversParentTypes['WorkspaceDomain'] = ResolversParentTypes['WorkspaceDomain']> = {
domain?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
Expand Down Expand Up @@ -6608,12 +6534,6 @@ export type WorkspaceSubscriptionResolvers<ContextType = GraphQLContext, ParentT
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type WorkspaceVersionsCountResolvers<ContextType = GraphQLContext, ParentType extends ResolversParentTypes['WorkspaceVersionsCount'] = ResolversParentTypes['WorkspaceVersionsCount']> = {
current?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
max?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type Resolvers<ContextType = GraphQLContext> = {
ActiveUserMutations?: ActiveUserMutationsResolvers<ContextType>;
Activity?: ActivityResolvers<ContextType>;
Expand Down Expand Up @@ -6752,9 +6672,6 @@ export type Resolvers<ContextType = GraphQLContext> = {
WorkspaceCollaborator?: WorkspaceCollaboratorResolvers<ContextType>;
WorkspaceCollaboratorCollection?: WorkspaceCollaboratorCollectionResolvers<ContextType>;
WorkspaceCollection?: WorkspaceCollectionResolvers<ContextType>;
WorkspaceCost?: WorkspaceCostResolvers<ContextType>;
WorkspaceCostDiscount?: WorkspaceCostDiscountResolvers<ContextType>;
WorkspaceCostItem?: WorkspaceCostItemResolvers<ContextType>;
WorkspaceDomain?: WorkspaceDomainResolvers<ContextType>;
WorkspaceInviteMutations?: WorkspaceInviteMutationsResolvers<ContextType>;
WorkspaceMutations?: WorkspaceMutationsResolvers<ContextType>;
Expand All @@ -6764,7 +6681,6 @@ export type Resolvers<ContextType = GraphQLContext> = {
WorkspaceSsoProvider?: WorkspaceSsoProviderResolvers<ContextType>;
WorkspaceSsoSession?: WorkspaceSsoSessionResolvers<ContextType>;
WorkspaceSubscription?: WorkspaceSubscriptionResolvers<ContextType>;
WorkspaceVersionsCount?: WorkspaceVersionsCountResolvers<ContextType>;
};

export type DirectiveResolvers<ContextType = GraphQLContext> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,12 +864,6 @@ export type CreateVersionInput = {
totalChildrenCount?: InputMaybe<Scalars['Int']['input']>;
};

export enum Currency {
Eur = 'EUR',
Gbp = 'GBP',
Usd = 'USD'
}

export type DeleteModelInput = {
id: Scalars['ID']['input'];
projectId: Scalars['ID']['input'];
Expand Down Expand Up @@ -4112,33 +4106,6 @@ export type WorkspaceCollection = {
totalCount: Scalars['Int']['output'];
};

export type WorkspaceCost = {
__typename?: 'WorkspaceCost';
/** Currency of the price */
currency: Currency;
/** Discount applied to the total */
discount?: Maybe<WorkspaceCostDiscount>;
items: Array<WorkspaceCostItem>;
/** Estimated cost of the workspace with no discount applied */
subTotal: Scalars['Float']['output'];
/** Total cost with discount applied */
total: Scalars['Float']['output'];
};

export type WorkspaceCostDiscount = {
__typename?: 'WorkspaceCostDiscount';
amount: Scalars['Float']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCostItem = {
__typename?: 'WorkspaceCostItem';
cost: Scalars['Float']['output'];
count: Scalars['Int']['output'];
label: Scalars['String']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCreateInput = {
defaultLogoIndex?: InputMaybe<Scalars['Int']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
Expand All @@ -4162,7 +4129,6 @@ export type WorkspaceDomainDeleteInput = {
export enum WorkspaceFeatureName {
DomainBasedSecurityPolicies = 'domainBasedSecurityPolicies',
OidcSso = 'oidcSso',
Workspace = 'workspace',
WorkspaceDataRegionSpecificity = 'workspaceDataRegionSpecificity'
}

Expand Down Expand Up @@ -4441,14 +4407,6 @@ export type WorkspaceUpdateInput = {
slug?: InputMaybe<Scalars['String']['input']>;
};

export type WorkspaceVersionsCount = {
__typename?: 'WorkspaceVersionsCount';
/** Total number of versions of all projects in the workspace */
current: Scalars['Int']['output'];
/** Maximum number of version of all projects in the workspace with no additional cost */
max: Scalars['Int']['output'];
};

export type CrossSyncCommitBranchMetadataQueryVariables = Exact<{
streamId: Scalars['String']['input'];
commitId: Scalars['String']['input'];
Expand Down
42 changes: 0 additions & 42 deletions packages/server/test/graphql/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,6 @@ export type CreateVersionInput = {
totalChildrenCount?: InputMaybe<Scalars['Int']['input']>;
};

export enum Currency {
Eur = 'EUR',
Gbp = 'GBP',
Usd = 'USD'
}

export type DeleteModelInput = {
id: Scalars['ID']['input'];
projectId: Scalars['ID']['input'];
Expand Down Expand Up @@ -4113,33 +4107,6 @@ export type WorkspaceCollection = {
totalCount: Scalars['Int']['output'];
};

export type WorkspaceCost = {
__typename?: 'WorkspaceCost';
/** Currency of the price */
currency: Currency;
/** Discount applied to the total */
discount?: Maybe<WorkspaceCostDiscount>;
items: Array<WorkspaceCostItem>;
/** Estimated cost of the workspace with no discount applied */
subTotal: Scalars['Float']['output'];
/** Total cost with discount applied */
total: Scalars['Float']['output'];
};

export type WorkspaceCostDiscount = {
__typename?: 'WorkspaceCostDiscount';
amount: Scalars['Float']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCostItem = {
__typename?: 'WorkspaceCostItem';
cost: Scalars['Float']['output'];
count: Scalars['Int']['output'];
label: Scalars['String']['output'];
name: Scalars['String']['output'];
};

export type WorkspaceCreateInput = {
defaultLogoIndex?: InputMaybe<Scalars['Int']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
Expand All @@ -4163,7 +4130,6 @@ export type WorkspaceDomainDeleteInput = {
export enum WorkspaceFeatureName {
DomainBasedSecurityPolicies = 'domainBasedSecurityPolicies',
OidcSso = 'oidcSso',
Workspace = 'workspace',
WorkspaceDataRegionSpecificity = 'workspaceDataRegionSpecificity'
}

Expand Down Expand Up @@ -4442,14 +4408,6 @@ export type WorkspaceUpdateInput = {
slug?: InputMaybe<Scalars['String']['input']>;
};

export type WorkspaceVersionsCount = {
__typename?: 'WorkspaceVersionsCount';
/** Total number of versions of all projects in the workspace */
current: Scalars['Int']['output'];
/** Maximum number of version of all projects in the workspace with no additional cost */
max: Scalars['Int']['output'];
};

export type CreateObjectMutationVariables = Exact<{
input: ObjectCreateInput;
}>;
Expand Down

0 comments on commit 065644b

Please sign in to comment.