Skip to content

Commit 8f98c35

Browse files
atrakhConvex, Inc.
authored andcommitted
Update generated API to always use TeamResponse (#43033)
The generated API currently has Team and TeamResponse, where TeamResponse is a superset of Team. Let's consolidate. Also adds managedByUrl to TeamResponse which is the URL to the integration managing the Convex team GitOrigin-RevId: 157646f7f5379430924cee6ad97dd60e743de877
1 parent 98a6c4e commit 8f98c35

File tree

68 files changed

+238
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+238
-271
lines changed

npm-packages/convex/management-openapi.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@
444444
}
445445
]
446446
},
447+
"managedByUrl": {
448+
"type": [
449+
"string",
450+
"null"
451+
]
452+
},
447453
"name": {
448454
"$ref": "#/components/schemas/TeamName"
449455
},

npm-packages/dashboard/dashboard-management-openapi.json

Lines changed: 9 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
"content": {
271271
"application/json": {
272272
"schema": {
273-
"$ref": "#/components/schemas/Team"
273+
"$ref": "#/components/schemas/TeamResponse"
274274
}
275275
}
276276
}
@@ -1755,7 +1755,7 @@
17551755
"content": {
17561756
"application/json": {
17571757
"schema": {
1758-
"$ref": "#/components/schemas/Team"
1758+
"$ref": "#/components/schemas/TeamResponse"
17591759
}
17601760
}
17611761
}
@@ -4564,7 +4564,7 @@
45644564
"teams": {
45654565
"type": "array",
45664566
"items": {
4567-
"$ref": "#/components/schemas/Team"
4567+
"$ref": "#/components/schemas/TeamResponse"
45684568
}
45694569
}
45704570
}
@@ -5292,63 +5292,6 @@
52925292
"Warning"
52935293
]
52945294
},
5295-
"Team": {
5296-
"type": "object",
5297-
"required": [
5298-
"id",
5299-
"name",
5300-
"slug",
5301-
"suspended",
5302-
"referralCode"
5303-
],
5304-
"properties": {
5305-
"creator": {
5306-
"oneOf": [
5307-
{
5308-
"type": "null"
5309-
},
5310-
{
5311-
"$ref": "#/components/schemas/MemberId"
5312-
}
5313-
]
5314-
},
5315-
"id": {
5316-
"$ref": "#/components/schemas/TeamId"
5317-
},
5318-
"managedBy": {
5319-
"oneOf": [
5320-
{
5321-
"type": "null"
5322-
},
5323-
{
5324-
"$ref": "#/components/schemas/ManagedBy"
5325-
}
5326-
]
5327-
},
5328-
"name": {
5329-
"$ref": "#/components/schemas/TeamName"
5330-
},
5331-
"referralCode": {
5332-
"$ref": "#/components/schemas/ReferralCode"
5333-
},
5334-
"referredBy": {
5335-
"oneOf": [
5336-
{
5337-
"type": "null"
5338-
},
5339-
{
5340-
"$ref": "#/components/schemas/TeamId"
5341-
}
5342-
]
5343-
},
5344-
"slug": {
5345-
"$ref": "#/components/schemas/TeamSlug"
5346-
},
5347-
"suspended": {
5348-
"type": "boolean"
5349-
}
5350-
}
5351-
},
53525295
"TeamAccessTokenResponse": {
53535296
"type": "object",
53545297
"required": [
@@ -5601,6 +5544,12 @@
56015544
}
56025545
]
56035546
},
5547+
"managedByUrl": {
5548+
"type": [
5549+
"string",
5550+
"null"
5551+
]
5552+
},
56045553
"name": {
56055554
"$ref": "#/components/schemas/TeamName"
56065555
},

npm-packages/dashboard/src/api/teams.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { Team } from "generatedApi";
1+
import { TeamResponse } from "generatedApi";
22
import { useLastViewedTeam } from "hooks/useLastViewed";
33
import { useInitialData } from "hooks/useServerSideData";
44
import { useRouter } from "next/router";
55
import { useBBMutation, useBBQuery } from "./api";
66

77
export function useTeams(): {
88
selectedTeamSlug?: string;
9-
teams?: Team[];
9+
teams?: TeamResponse[];
1010
} {
1111
const [initialData] = useInitialData();
1212
const { data: teams, isValidating } = useBBQuery({

npm-packages/dashboard/src/components/billing/DailyChartDetailView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ArrowLeftIcon } from "@radix-ui/react-icons";
22
import { Button } from "@ui/Button";
33
import { ProgressBar } from "@ui/ProgressBar";
4-
import { ProjectDetails, Team } from "generatedApi";
4+
import { ProjectDetails, TeamResponse } from "generatedApi";
55
import { formatQuantity, QuantityType } from "./lib/formatQuantity";
66
import { ProjectLink } from "./ProjectLink";
77

@@ -24,7 +24,7 @@ export function DailyChartDetailView({
2424
items: DailyChartDetailItem[];
2525
quantityType: QuantityType;
2626
onBack: () => void;
27-
team?: Team;
27+
team?: TeamResponse;
2828
memberId?: number;
2929
}) {
3030
// Calculate total for percentage calculations

npm-packages/dashboard/src/components/billing/Plans.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useListPlans } from "api/billing";
22
import { Loading } from "@ui/Loading";
3-
import { OrbSubscriptionResponse, Team } from "generatedApi";
3+
import { OrbSubscriptionResponse, TeamResponse } from "generatedApi";
44
import classNames from "classnames";
55
import { OrbSelfServePlan } from "./planCards/OrbSelfServePlan";
66
import { FreePlan } from "./planCards/FreePlan";
@@ -10,7 +10,7 @@ export function Plans({
1010
hasAdminPermissions,
1111
subscription,
1212
}: {
13-
team: Team;
13+
team: TeamResponse;
1414
hasAdminPermissions: boolean;
1515
subscription?: OrbSubscriptionResponse;
1616
}) {

npm-packages/dashboard/src/components/billing/ProjectLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ExternalLinkIcon } from "@radix-ui/react-icons";
22
import { Button } from "@ui/Button";
33
import { CopyButton } from "@common/elements/CopyButton";
4-
import { ProjectDetails, Team } from "generatedApi";
4+
import { ProjectDetails, TeamResponse } from "generatedApi";
55
import { useDeployments } from "api/deployments";
66

77
export function ProjectLink({
@@ -10,7 +10,7 @@ export function ProjectLink({
1010
memberId,
1111
}: {
1212
project: ProjectDetails | null;
13-
team?: Team;
13+
team?: TeamResponse;
1414
memberId?: number;
1515
}) {
1616
const { deployments } = useDeployments(project?.id);

npm-packages/dashboard/src/components/billing/SpendingLimits.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { Tooltip } from "@ui/Tooltip";
1515
import Link from "next/link";
1616
import { formatUsd } from "@common/lib/utils";
17-
import { Team } from "generatedApi";
17+
import { TeamResponse } from "generatedApi";
1818
import * as Sentry from "@sentry/nextjs";
1919

2020
export type SpendingLimitsValue = {
@@ -86,7 +86,7 @@ export function spendingLimitsSchema({
8686
});
8787
}
8888

89-
export function useSubmitSpendingLimits(team: Team) {
89+
export function useSubmitSpendingLimits(team: TeamResponse) {
9090
const setSpendingLimit = useSetSpendingLimit(team.id);
9191

9292
return useCallback(

npm-packages/dashboard/src/components/billing/SubscriptionOverview.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { act, fireEvent, render, screen } from "@testing-library/react";
22
import { formatDate } from "@common/lib/format";
3-
import { OrbSubscriptionResponse, Team } from "generatedApi";
3+
import { OrbSubscriptionResponse, TeamResponse } from "generatedApi";
44
import { SubscriptionOverview } from "./SubscriptionOverview";
55

66
const resumeSubscription = jest.fn();
@@ -45,7 +45,7 @@ const subscription: OrbSubscriptionResponse = {
4545
nextBillingPeriodStart: "2025-09-25",
4646
};
4747

48-
const team: Team = {
48+
const team: TeamResponse = {
4949
id: 0,
5050
name: "",
5151
creator: 0,

npm-packages/dashboard/src/components/billing/SubscriptionOverview.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
Address,
2121
BillingContactResponse,
2222
OrbSubscriptionResponse,
23-
Team,
23+
TeamResponse,
2424
} from "generatedApi";
2525
import { Tooltip } from "@ui/Tooltip";
2626
import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
@@ -44,7 +44,7 @@ export function SubscriptionOverview({
4444
hasAdminPermissions,
4545
subscription,
4646
}: {
47-
team: Team;
47+
team: TeamResponse;
4848
hasAdminPermissions: boolean;
4949
subscription?: OrbSubscriptionResponse | null;
5050
}) {
@@ -152,7 +152,7 @@ function SpendingLimitsSectionContainer({
152152
hasAdminPermissions,
153153
}: {
154154
subscription: OrbSubscriptionResponse;
155-
team: Team;
155+
team: TeamResponse;
156156
hasAdminPermissions: boolean;
157157
}) {
158158
const submitSpendingLimits = useSubmitSpendingLimits(team);
@@ -324,7 +324,7 @@ function BillingContactForm({
324324
hasAdminPermissions,
325325
}: {
326326
subscription: OrbSubscriptionResponse;
327-
team: Team;
327+
team: TeamResponse;
328328
hasAdminPermissions: boolean;
329329
}) {
330330
const [showForm, setShowForm] = useState(false);
@@ -417,7 +417,7 @@ function BillingAddressForm({
417417
subscription,
418418
hasAdminPermissions,
419419
}: {
420-
team: Team;
420+
team: TeamResponse;
421421
subscription: OrbSubscriptionResponse;
422422
hasAdminPermissions: boolean;
423423
}) {
@@ -585,7 +585,7 @@ function PaymentMethodForm({
585585
subscription,
586586
hasAdminPermissions,
587587
}: {
588-
team: Team;
588+
team: TeamResponse;
589589
subscription: OrbSubscriptionResponse;
590590
hasAdminPermissions: boolean;
591591
}) {
@@ -644,7 +644,7 @@ function UpdatePaymentMethod({
644644
team,
645645
onSave,
646646
}: {
647-
team: Team;
647+
team: TeamResponse;
648648
onSave: () => void;
649649
}) {
650650
const updatePaymentMethod = useUpdatePaymentMethod(team.id);

npm-packages/dashboard/src/components/billing/TeamUsage.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
DailyPerTagMetrics,
2424
DailyPerTagMetricsByProject,
2525
} from "hooks/usageMetrics";
26-
import { Team, ProjectDetails } from "generatedApi";
26+
import { TeamResponse, ProjectDetails } from "generatedApi";
2727
import {
2828
forwardRef,
2929
ReactNode,
@@ -86,7 +86,7 @@ const FUNCTION_BREAKDOWN_TABS = [
8686
FunctionBreakdownMetricVectorBandwidth,
8787
];
8888

89-
export function TeamUsage({ team }: { team: Team }) {
89+
export function TeamUsage({ team }: { team: TeamResponse }) {
9090
const projects = useProjects(team.id);
9191
const { query } = useRouter();
9292
const project = query.projectSlug
@@ -268,7 +268,7 @@ function FunctionBreakdownSection({
268268
componentPrefix,
269269
shownBillingPeriod,
270270
}: {
271-
team: Team;
271+
team: TeamResponse;
272272
dateRange: DateRange | null;
273273
projectId: number | null;
274274
componentPrefix: string | null;
@@ -412,7 +412,7 @@ function FunctionUsageBreakdown({
412412
usageByProject: UsageInProject[];
413413
metricsByDeployment: AggregatedFunctionMetrics[];
414414
metric: FunctionBreakdownMetric;
415-
team: Team;
415+
team: TeamResponse;
416416
}) {
417417
const maxValue = useMemo(
418418
() => Math.max(...metricsByDeployment.map(metric.getTotal)),
@@ -470,7 +470,7 @@ function FunctionUsageBreakdownByProject({
470470
project: ProjectDetails | null;
471471
metric: FunctionBreakdownMetric;
472472
rows: AggregatedFunctionMetrics[];
473-
team: Team;
473+
team: TeamResponse;
474474
maxValue: number;
475475
projectTotal: number;
476476
}) {
@@ -527,7 +527,7 @@ function DatabaseUsage({
527527
showEntitlements,
528528
componentPrefix,
529529
}: {
530-
team: Team;
530+
team: TeamResponse;
531531
dateRange: DateRange | null;
532532
projectId: number | null;
533533
componentPrefix: string | null;
@@ -763,7 +763,7 @@ function FunctionCallsUsage({
763763
functionCallsEntitlement,
764764
showEntitlements,
765765
}: {
766-
team: Team;
766+
team: TeamResponse;
767767
dateRange: DateRange | null;
768768
projectId: number | null;
769769
componentPrefix: string | null;
@@ -880,7 +880,7 @@ function ActionComputeUsage({
880880
actionComputeEntitlement,
881881
showEntitlements,
882882
}: {
883-
team: Team;
883+
team: TeamResponse;
884884
dateRange: DateRange | null;
885885
projectId: number | null;
886886
componentPrefix: string | null;
@@ -1004,7 +1004,7 @@ function FilesUsage({
10041004
bandwidthEntitlement,
10051005
showEntitlements,
10061006
}: {
1007-
team: Team;
1007+
team: TeamResponse;
10081008
dateRange: DateRange | null;
10091009
projectId: number | null;
10101010
componentPrefix: string | null;
@@ -1200,7 +1200,7 @@ function VectorUsage({
12001200
bandwidthEntitlement,
12011201
showEntitlements,
12021202
}: {
1203-
team: Team;
1203+
team: TeamResponse;
12041204
dateRange: DateRange | null;
12051205
projectId: number | null;
12061206
componentPrefix: string | null;

0 commit comments

Comments
 (0)