Skip to content

Commit 7635623

Browse files
authored
Purge all Chargebee-related API methods (#17262)
* [server] Remove unused Chargebee-related payment APIs * [server] Handle all permission cases for operations on attributionIds * [server] Leftover import * fix build
1 parent 0c463e2 commit 7635623

File tree

6 files changed

+23
-1365
lines changed

6 files changed

+23
-1365
lines changed

components/dashboard/src/service/service-mock.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,12 @@ const gitpodServiceMock = createServiceMock({
230230
},
231231
];
232232
},
233-
getShowPaymentUI: async () => {
234-
return false;
235-
},
236233
getClientRegion: async () => {
237234
return "europe-west-1";
238235
},
239236
isStudent: async () => {
240237
return false;
241238
},
242-
isChargebeeCustomer: async () => {
243-
return false;
244-
},
245239
getSuggestedContextURLs: async () => {
246240
return [];
247241
},

components/gitpod-protocol/src/admin-protocol.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { FindPrebuildsParams } from "./gitpod-service";
1010
import { Project, Team, PrebuildWithStatus, TeamMemberInfo, TeamMemberRole } from "./teams-projects-protocol";
1111
import { WorkspaceInstance, WorkspaceInstancePhase } from "./workspace-instance";
1212
import { RoleOrPermission } from "./permission";
13-
import { AccountStatement } from "./accounting-protocol";
1413
import { BillingMode } from "./billing-mode";
1514
import { CostCenterJSON, ListUsageRequest, ListUsageResponse } from "./usage";
1615
import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
@@ -46,11 +45,8 @@ export interface AdminServer {
4645
adminFindPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
4746
adminSetLicense(key: string): Promise<void>;
4847

49-
adminGetAccountStatement(userId: string): Promise<AccountStatement>;
50-
adminSetProfessionalOpenSource(userId: string, shouldGetProfOSS: boolean): Promise<void>;
5148
adminIsStudent(userId: string): Promise<boolean>;
5249
adminAddStudentEmailDomain(userId: string, domain: string): Promise<void>;
53-
adminGrantExtraHours(userId: string, extraHours: number): Promise<void>;
5450
adminGetBillingMode(attributionId: string): Promise<BillingMode>;
5551

5652
adminGetSettings(): Promise<InstallationAdminSettings>;

components/gitpod-protocol/src/gitpod-service.ts

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ import { WebSocketConnectionProvider } from "./messaging/browser/connection";
5353
import { PermissionName } from "./permission";
5454
import { LicenseService } from "./license-protocol";
5555
import { Emitter } from "./util/event";
56-
import { AccountStatement, CreditAlert } from "./accounting-protocol";
57-
import { GithubUpgradeURL, PlanCoupon } from "./payment-protocol";
58-
import {
59-
TeamSubscription,
60-
TeamSubscription2,
61-
TeamSubscriptionSlot,
62-
TeamSubscriptionSlotResolved,
63-
} from "./team-subscription-protocol";
6456
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
6557
import { IDEServer } from "./ide-protocol";
6658
import { ListUsageRequest, ListUsageResponse, CostCenterJSON } from "./usage";
@@ -74,8 +66,6 @@ export interface GitpodClient {
7466

7567
onPrebuildUpdate(update: PrebuildWithStatus): void;
7668

77-
onCreditAlert(creditAlert: CreditAlert): void;
78-
7969
//#region propagating reconnection to iframe
8070
notifyDidOpenConnection(): void;
8171
notifyDidCloseConnection(): void;
@@ -242,50 +232,10 @@ export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer,
242232
* gitpod.io concerns
243233
*/
244234
isStudent(): Promise<boolean>;
245-
/**
246-
*
247-
*/
248-
getAccountStatement(options: GitpodServer.GetAccountStatementOptions): Promise<AccountStatement | undefined>;
249-
getRemainingUsageHours(): Promise<number>;
250235

251236
/**
252-
*
237+
* Stripe/Usage
253238
*/
254-
getChargebeeSiteId(): Promise<string>;
255-
createPortalSession(): Promise<{}>;
256-
createTeamPortalSession(teamId: string): Promise<{}>;
257-
checkout(planId: string, planQuantity?: number): Promise<{}>;
258-
teamCheckout(teamId: string, planId: string): Promise<{}>;
259-
getAvailableCoupons(): Promise<PlanCoupon[]>;
260-
getAppliedCoupons(): Promise<PlanCoupon[]>;
261-
262-
getShowPaymentUI(): Promise<boolean>;
263-
isChargebeeCustomer(): Promise<boolean>;
264-
265-
subscriptionUpgradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
266-
subscriptionDowngradeTo(subscriptionId: string, chargebeePlanId: string): Promise<void>;
267-
subscriptionCancel(subscriptionId: string): Promise<void>;
268-
subscriptionCancelDowngrade(subscriptionId: string): Promise<void>;
269-
270-
getTeamSubscription(teamId: string): Promise<TeamSubscription2 | undefined>;
271-
cancelTeamSubscription(teamId: string): Promise<void>;
272-
tsCancel(teamSubscriptionId: string): Promise<void>;
273-
tsGet(): Promise<TeamSubscription[]>;
274-
tsGetSlots(): Promise<TeamSubscriptionSlotResolved[]>;
275-
tsGetUnassignedSlot(teamSubscriptionId: string): Promise<TeamSubscriptionSlot | undefined>;
276-
tsAddSlots(teamSubscriptionId: string, quantity: number): Promise<void>;
277-
tsAssignSlot(
278-
teamSubscriptionId: string,
279-
teamSubscriptionSlotId: string,
280-
identityStr: string | undefined,
281-
): Promise<void>;
282-
tsReassignSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string, newIdentityStr: string): Promise<void>;
283-
tsDeactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
284-
tsReactivateSlot(teamSubscriptionId: string, teamSubscriptionSlotId: string): Promise<void>;
285-
tsAddMembersToOrg(teamSubscriptionId: string, organizationId: string): Promise<void>;
286-
287-
getGithubUpgradeUrls(): Promise<GithubUpgradeURL[]>;
288-
289239
getStripePublishableKey(): Promise<string>;
290240
getStripeSetupIntentClientSecret(): Promise<string>;
291241
findStripeSubscriptionId(attributionId: string): Promise<string | undefined>;
@@ -608,18 +558,6 @@ export class GitpodCompositeClient<Client extends GitpodClient> implements Gitpo
608558
}
609559
}
610560
}
611-
612-
onCreditAlert(creditAlert: CreditAlert): void {
613-
for (const client of this.clients) {
614-
if (client.onCreditAlert) {
615-
try {
616-
client.onCreditAlert(creditAlert);
617-
} catch (error) {
618-
console.error(error);
619-
}
620-
}
621-
}
622-
}
623561
}
624562

625563
export type GitpodService = GitpodServiceImpl<GitpodClient, GitpodServer>;

0 commit comments

Comments
 (0)