Skip to content

Commit a068bd9

Browse files
committed
[service-utils] Add platform, SMS, and pay capabilities to TeamCapabilities type
1 parent 3f57dc6 commit a068bd9

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

.changeset/little-pillows-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/service-utils": patch
3+
---
4+
5+
add new capabilities to the type

apps/dashboard/src/components/settings/Account/Billing/GatedSwitch.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export const AllVariants: Story = {
2828

2929
function Variants() {
3030
const [requiredPlan, setRequiredPlan] = useState<
31-
"free" | "growth" | "accelerate" | "pro"
32-
>("accelerate");
31+
"free" | "growth" | "scale" | "pro"
32+
>("scale");
3333

3434
const plans: Team["billingPlan"][] = [
3535
"free",
@@ -38,6 +38,7 @@ function Variants() {
3838
"growth_legacy",
3939
"growth",
4040
"accelerate",
41+
"scale",
4142
"pro",
4243
];
4344

apps/dashboard/src/stories/stubs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
5757
],
5858
stripeCustomerId: "cus_1234567890",
5959
capabilities: {
60+
platform: {
61+
auditLogs: true,
62+
ecosystemWallets: true,
63+
seats: true,
64+
},
6065
rpc: {
6166
enabled: true,
6267
rateLimit: 1000,
@@ -85,6 +90,10 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
8590
enabled: true,
8691
customAuth: true,
8792
customBranding: true,
93+
sms: {
94+
domestic: true,
95+
international: true,
96+
},
8897
},
8998
nebula: {
9099
enabled: true,
@@ -95,6 +104,10 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
95104
rateLimit: 100,
96105
mainnetEnabled: true,
97106
},
107+
pay: {
108+
enabled: true,
109+
rateLimit: 1000,
110+
},
98111
},
99112
planCancellationDate: null,
100113
unthreadCustomerId: null,

packages/service-utils/src/core/api.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ export type ApiResponse = {
4949
* This type should match the schema from API server.
5050
*/
5151
type TeamCapabilities = {
52+
platform: {
53+
auditLogs: boolean;
54+
ecosystemWallets: boolean;
55+
seats: boolean;
56+
};
5257
rpc: {
5358
enabled: boolean;
5459
rateLimit: number;
@@ -81,12 +86,20 @@ type TeamCapabilities = {
8186
enabled: boolean;
8287
customAuth: boolean;
8388
customBranding: boolean;
89+
sms: {
90+
domestic: boolean;
91+
international: boolean;
92+
};
8493
};
8594
engineCloud: {
8695
enabled: boolean;
8796
mainnetEnabled: boolean;
8897
rateLimit: number;
8998
};
99+
pay: {
100+
enabled: boolean;
101+
rateLimit: number;
102+
};
90103
};
91104

92105
type TeamPlan =

packages/service-utils/src/mocks.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,25 @@ export const validTeamResponse: TeamResponse = {
9393
enabled: true,
9494
customAuth: true,
9595
customBranding: true,
96+
sms: {
97+
domestic: true,
98+
international: true,
99+
},
96100
},
97101
engineCloud: {
98102
enabled: true,
99103
mainnetEnabled: true,
100104
rateLimit: 100,
101105
},
106+
pay: {
107+
enabled: true,
108+
rateLimit: 1000,
109+
},
110+
platform: {
111+
auditLogs: true,
112+
ecosystemWallets: true,
113+
seats: true,
114+
},
102115
},
103116
planCancellationDate: null,
104117
unthreadCustomerId: null,

0 commit comments

Comments
 (0)