Skip to content

Commit 39a0dcd

Browse files
authored
feat(account): remove the MFA endpoints (#244)
1 parent 0f245ce commit 39a0dcd

File tree

3 files changed

+0
-196
lines changed

3 files changed

+0
-196
lines changed

packages/clients/src/api/account/v2/api.gen.ts

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,19 @@ import {
77
validatePathParam,
88
} from '../../../bridge'
99
import {
10-
marshalCreateMFAOTPRequest,
1110
marshalCreateProjectRequest,
1211
marshalUpdateProjectRequest,
13-
marshalValidateMFAOTPRequest,
14-
unmarshalListMFAOTPsResponse,
1512
unmarshalListProjectsResponse,
16-
unmarshalMFAOTP,
1713
unmarshalProject,
18-
unmarshalValidateMFAOTPResponse,
1914
} from './marshalling.gen'
2015
import type {
21-
CreateMFAOTPRequest,
2216
CreateProjectRequest,
23-
DeleteMFAOTPRequest,
2417
DeleteProjectRequest,
2518
GetProjectRequest,
26-
ListMFAOTPsRequest,
27-
ListMFAOTPsResponse,
2819
ListProjectsRequest,
2920
ListProjectsResponse,
30-
MFAOTP,
3121
Project,
3222
UpdateProjectRequest,
33-
ValidateMFAOTPRequest,
34-
ValidateMFAOTPResponse,
3523
} from './types.gen'
3624

3725
const jsonContentHeaders = {
@@ -151,86 +139,4 @@ export class AccountV2GenAPI extends API {
151139
},
152140
unmarshalProject,
153141
)
154-
155-
protected pageOfListMFAOTPs = (request: Readonly<ListMFAOTPsRequest>) =>
156-
this.client.fetch<ListMFAOTPsResponse>(
157-
{
158-
method: 'GET',
159-
path: `/account/v2/mfa/otps`,
160-
urlParams: urlParams(
161-
['account_root_user_id', request.accountRootUserId],
162-
['order_by', request.orderBy ?? 'created_at_asc'],
163-
['page', request.page],
164-
[
165-
'page_size',
166-
request.pageSize ?? this.client.settings.defaultPageSize,
167-
],
168-
),
169-
},
170-
unmarshalListMFAOTPsResponse,
171-
)
172-
173-
/**
174-
* List MFA OTPs
175-
*
176-
* @param request - The request {@link ListMFAOTPsRequest}
177-
* @returns A Promise of ListMFAOTPsResponse
178-
*/
179-
listMFAOTPs = (request: Readonly<ListMFAOTPsRequest>) =>
180-
enrichForPagination('mfaOtps', this.pageOfListMFAOTPs, request)
181-
182-
/**
183-
* Create MFA OTP
184-
*
185-
* @param request - The request {@link CreateMFAOTPRequest}
186-
* @returns A Promise of MFAOTP
187-
*/
188-
createMFAOTP = (request: Readonly<CreateMFAOTPRequest>) =>
189-
this.client.fetch<MFAOTP>(
190-
{
191-
body: JSON.stringify(
192-
marshalCreateMFAOTPRequest(request, this.client.settings),
193-
),
194-
headers: jsonContentHeaders,
195-
method: 'POST',
196-
path: `/account/v2/mfa/otps`,
197-
},
198-
unmarshalMFAOTP,
199-
)
200-
201-
/**
202-
* Validate MFA OTP
203-
*
204-
* @param request - The request {@link ValidateMFAOTPRequest}
205-
* @returns A Promise of ValidateMFAOTPResponse
206-
*/
207-
validateMFAOTP = (request: Readonly<ValidateMFAOTPRequest>) =>
208-
this.client.fetch<ValidateMFAOTPResponse>(
209-
{
210-
body: JSON.stringify(
211-
marshalValidateMFAOTPRequest(request, this.client.settings),
212-
),
213-
headers: jsonContentHeaders,
214-
method: 'POST',
215-
path: `/account/v2/mfa/otps/${validatePathParam(
216-
'mfaOtpId',
217-
request.mfaOtpId,
218-
)}/validate`,
219-
},
220-
unmarshalValidateMFAOTPResponse,
221-
)
222-
223-
/**
224-
* Delete MFA OTP
225-
*
226-
* @param request - The request {@link DeleteMFAOTPRequest}
227-
*/
228-
deleteMFAOTP = (request: Readonly<DeleteMFAOTPRequest>) =>
229-
this.client.fetch<void>({
230-
method: 'DELETE',
231-
path: `/account/v2/mfa/otps/${validatePathParam(
232-
'mfaOtpId',
233-
request.mfaOtpId,
234-
)}`,
235-
})
236142
}

packages/clients/src/api/account/v2/marshalling.gen.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,12 @@ import {
77
} from '../../../bridge'
88
import type { DefaultValues } from '../../../bridge'
99
import type {
10-
CreateMFAOTPRequest,
1110
CreateProjectRequest,
12-
ListMFAOTPsResponse,
1311
ListProjectsResponse,
14-
MFAOTP,
1512
Project,
1613
UpdateProjectRequest,
17-
ValidateMFAOTPRequest,
18-
ValidateMFAOTPResponse,
1914
} from './types.gen'
2015

21-
export const unmarshalMFAOTP = (data: unknown) => {
22-
if (!isJSONObject(data)) {
23-
throw new TypeError(
24-
`Unmarshalling the type 'MFAOTP' failed as data isn't a dictionary.`,
25-
)
26-
}
27-
28-
return { id: data.id } as MFAOTP
29-
}
30-
3116
export const unmarshalProject = (data: unknown) => {
3217
if (!isJSONObject(data)) {
3318
throw new TypeError(
@@ -45,19 +30,6 @@ export const unmarshalProject = (data: unknown) => {
4530
} as Project
4631
}
4732

48-
export const unmarshalListMFAOTPsResponse = (data: unknown) => {
49-
if (!isJSONObject(data)) {
50-
throw new TypeError(
51-
`Unmarshalling the type 'ListMFAOTPsResponse' failed as data isn't a dictionary.`,
52-
)
53-
}
54-
55-
return {
56-
mfaOtps: unmarshalArrayOfObject(data.mfa_otps, unmarshalMFAOTP),
57-
totalCount: data.total_count,
58-
} as ListMFAOTPsResponse
59-
}
60-
6133
export const unmarshalListProjectsResponse = (data: unknown) => {
6234
if (!isJSONObject(data)) {
6335
throw new TypeError(
@@ -71,23 +43,6 @@ export const unmarshalListProjectsResponse = (data: unknown) => {
7143
} as ListProjectsResponse
7244
}
7345

74-
export const unmarshalValidateMFAOTPResponse = (data: unknown) => {
75-
if (!isJSONObject(data)) {
76-
throw new TypeError(
77-
`Unmarshalling the type 'ValidateMFAOTPResponse' failed as data isn't a dictionary.`,
78-
)
79-
}
80-
81-
return { backupCodes: data.backup_codes } as ValidateMFAOTPResponse
82-
}
83-
84-
export const marshalCreateMFAOTPRequest = (
85-
request: CreateMFAOTPRequest,
86-
defaults: DefaultValues,
87-
): Record<string, unknown> => ({
88-
account_root_user_id: request.accountRootUserId,
89-
})
90-
9146
export const marshalCreateProjectRequest = (
9247
request: CreateProjectRequest,
9348
defaults: DefaultValues,
@@ -104,10 +59,3 @@ export const marshalUpdateProjectRequest = (
10459
description: request.description,
10560
name: request.name,
10661
})
107-
108-
export const marshalValidateMFAOTPRequest = (
109-
request: ValidateMFAOTPRequest,
110-
defaults: DefaultValues,
111-
): Record<string, unknown> => ({
112-
otp: request.otp,
113-
})
Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33

4-
export type ListMFAOTPsRequestOrderBy = 'created_at_asc' | 'created_at_desc'
5-
64
export type ListProjectsRequestOrderBy =
75
| 'created_at_asc'
86
| 'created_at_desc'
97
| 'name_asc'
108
| 'name_desc'
119

12-
/** List mfaot ps response */
13-
export interface ListMFAOTPsResponse {
14-
/** The total number of MFA OTPs */
15-
totalCount: number
16-
/** The paginated returned MFA OTPs */
17-
mfaOtps: Array<MFAOTP>
18-
}
19-
2010
/** List projects response */
2111
export interface ListProjectsResponse {
2212
/** The total number of projects */
@@ -25,12 +15,6 @@ export interface ListProjectsResponse {
2515
projects: Array<Project>
2616
}
2717

28-
/** Mfaotp */
29-
export interface MFAOTP {
30-
/** The ID of the MFA OTP */
31-
id: string
32-
}
33-
3418
/** Project */
3519
export interface Project {
3620
/** The ID of the project */
@@ -47,12 +31,6 @@ export interface Project {
4731
description: string
4832
}
4933

50-
/** Validate mfaotp response */
51-
export interface ValidateMFAOTPResponse {
52-
/** The backup codes of the MFA OTP */
53-
backupCodes: Array<string>
54-
}
55-
5634
export type CreateProjectRequest = {
5735
/** The name of the project */
5836
name: string
@@ -95,31 +73,3 @@ export type UpdateProjectRequest = {
9573
/** The description of the project */
9674
description?: string
9775
}
98-
99-
export type ListMFAOTPsRequest = {
100-
/** The page number for the returned MFA OTPs */
101-
page?: number
102-
/** The maximum number of MFA OTP per page */
103-
pageSize?: number
104-
/** The sort order of the returned MFA OTPs */
105-
orderBy?: ListMFAOTPsRequestOrderBy
106-
/** Filter out by a account root user ID */
107-
accountRootUserId: string
108-
}
109-
110-
export type CreateMFAOTPRequest = {
111-
/** The account root user ID of the MFA OTP */
112-
accountRootUserId: string
113-
}
114-
115-
export type ValidateMFAOTPRequest = {
116-
/** The MFA OTP ID */
117-
mfaOtpId: string
118-
/** The code of the MFA OTP */
119-
otp: string
120-
}
121-
122-
export type DeleteMFAOTPRequest = {
123-
/** The MFA OTP ID */
124-
mfaOtpId: string
125-
}

0 commit comments

Comments
 (0)