File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed
packages/clients/src/api/account/v2 Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ import {
99import {
1010 marshalCreateProjectRequest ,
1111 marshalUpdateProjectRequest ,
12+ unmarshalCaptchaProvider ,
1213 unmarshalListProjectsResponse ,
1314 unmarshalProject ,
1415} from './marshalling.gen'
1516import type {
17+ CaptchaProvider ,
1618 CreateProjectRequest ,
1719 DeleteProjectRequest ,
1820 GetProjectRequest ,
@@ -149,4 +151,18 @@ export class API extends ParentAPI {
149151 } ,
150152 unmarshalProject ,
151153 )
154+
155+ /**
156+ * Get a Captcha provider.
157+ *
158+ * @returns A Promise of CaptchaProvider
159+ */
160+ getCaptchaProvider = ( ) =>
161+ this . client . fetch < CaptchaProvider > (
162+ {
163+ method : 'GET' ,
164+ path : `/account/v2/captcha-provider` ,
165+ } ,
166+ unmarshalCaptchaProvider ,
167+ )
152168}
Original file line number Diff line number Diff line change 22// If you have any remark or suggestion do not hesitate to open an issue.
33export { API } from './api.gen'
44export type {
5+ CaptchaProvider ,
6+ CaptchaProviderName ,
57 CreateProjectRequest ,
68 DeleteProjectRequest ,
79 GetProjectRequest ,
Original file line number Diff line number Diff line change 77} from '../../../bridge'
88import type { DefaultValues } from '../../../bridge'
99import type {
10+ CaptchaProvider ,
1011 CreateProjectRequest ,
1112 ListProjectsResponse ,
1213 Project ,
@@ -30,6 +31,16 @@ export const unmarshalProject = (data: unknown) => {
3031 } as Project
3132}
3233
34+ export const unmarshalCaptchaProvider = ( data : unknown ) => {
35+ if ( ! isJSONObject ( data ) ) {
36+ throw new TypeError (
37+ `Unmarshalling the type 'CaptchaProvider' failed as data isn't a dictionary.` ,
38+ )
39+ }
40+
41+ return { name : data . name } as CaptchaProvider
42+ }
43+
3344export const unmarshalListProjectsResponse = ( data : unknown ) => {
3445 if ( ! isJSONObject ( data ) ) {
3546 throw new TypeError (
Original file line number Diff line number Diff line change 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 CaptchaProviderName =
5+ | 'unknown_name'
6+ | 'recaptcha_v2'
7+ | 'friendly_captcha'
8+ | 'hcaptcha'
9+
410export type ListProjectsRequestOrderBy =
511 | 'created_at_asc'
612 | 'created_at_desc'
713 | 'name_asc'
814 | 'name_desc'
915
16+ export interface CaptchaProvider {
17+ name : CaptchaProviderName
18+ }
19+
1020/** List projects response. */
1121export interface ListProjectsResponse {
1222 /** Total number of Projects. */
You can’t perform that action at this time.
0 commit comments