1
1
import { GeneralRecord } from "@instill-ai/toolkit" ;
2
+ import { Nullable } from "../types" ;
2
3
3
4
export type User = {
4
5
name : string ;
@@ -52,7 +53,7 @@ export type AuthLoginActionResponse = {
52
53
} ;
53
54
54
55
export type UpdateUserResponse = {
55
- user : User ;
56
+ user : AuthenticatedUser ;
56
57
} ;
57
58
58
59
export type CreateApiTokenPayload = {
@@ -69,6 +70,9 @@ export type ChangePasswordPayload = {
69
70
new_password : string ;
70
71
} ;
71
72
73
+ export type GetAuthenticatedResponse = {
74
+ user : AuthenticatedUser ;
75
+ } ;
72
76
export type GetUserResponse = {
73
77
user : User ;
74
78
} ;
@@ -96,3 +100,72 @@ export type ListUsersResponse = {
96
100
export type CheckNamespaceResponse = {
97
101
type : NamespaceType ;
98
102
} ;
103
+
104
+ export type UserProfile = {
105
+ display_name ?: string ;
106
+ bio ?: string ;
107
+ public_email ?: string ;
108
+ company_name ?: string ;
109
+ avatar ?: string ;
110
+ social_profiles_links ?: {
111
+ webiste ?: string ;
112
+ x ?: string ;
113
+ github ?: string ;
114
+ } ;
115
+ } ;
116
+
117
+ export type OnboardingStatus =
118
+ | "ONBOARDING_STATUS_UNSPECIFIED"
119
+ | "ONBOARDING_STATUS_IN_PROGRESS"
120
+ | "ONBOARDING_STATUS_COMPLETED" ;
121
+
122
+ export type AuthenticatedUser = {
123
+ name : string ;
124
+ uid : string ;
125
+ id : string ;
126
+ create_time : string ;
127
+ update_time : string ;
128
+ customer_id : string ;
129
+ email : string ;
130
+ newsletter_subscription : boolean ;
131
+ role : string ;
132
+ onboarding_status : OnboardingStatus ;
133
+ cookie_token ?: string ;
134
+ profile ?: UserProfile ;
135
+ } ;
136
+
137
+ export type StripeSubscriptionStatus =
138
+ | "STATUS_UNSPECIFIED"
139
+ | "STATUS_INCOMPLETE"
140
+ | "STATUS_INCOMPLETE_EXPIRED"
141
+ | "STATUS_TRIALING"
142
+ | "STATUS_ACTIVE"
143
+ | "STATUS_PAST_DUE"
144
+ | "STATUS_CANCELED"
145
+ | "STATUS_UNPAID"
146
+ | "STATUS_PAUSED" ;
147
+
148
+ export type StripeSubscriptionDetail = {
149
+ product_name : string ;
150
+ id : string ;
151
+ item_id : string ;
152
+ price : number ;
153
+ canceled_at ?: number ;
154
+ trial_end ?: number ;
155
+ status : StripeSubscriptionStatus ;
156
+ description : string ;
157
+ } ;
158
+
159
+ export type UserSubscriptionPlan =
160
+ | "PLAN_UNSPECIFIED"
161
+ | "PLAN_FREEMIUM"
162
+ | "PLAN_PRO" ;
163
+
164
+ export type UserSubscription = {
165
+ plan : UserSubscriptionPlan ;
166
+ detail : Nullable < StripeSubscriptionDetail > ;
167
+ } ;
168
+
169
+ export type GetAuthenticatedUserSubscriptionsResponse = {
170
+ subscription : UserSubscription ;
171
+ } ;
0 commit comments