@@ -8,258 +8,12 @@ import {
88 parseBool ,
99 parseInteger ,
1010} from "../../parser.js" ;
11- // Mock enums
12- export enum AuthenticatorType {
13- // Mock enum values
14- }
15- export enum AuthenticationFactor {
16- // Mock enum values
17- }
18- export enum OAuthProvider {
19- // Mock enum values
20- }
21-
22- // Mock Account class
23- class Account {
24- constructor ( sdkClient : any ) { }
25-
26- async get ( ) : Promise < any > {
27- return { result : 'GET:/v1/account:passed' } ;
28- }
29-
30- async create ( userId : string , email : string , password : string , name ?: string ) : Promise < any > {
31- return { result : 'POST:/v1/account:passed' } ;
32- }
33-
34- async delete ( ) : Promise < any > {
35- return { result : 'DELETE:/v1/account:passed' } ;
36- }
37-
38- async updateEmail ( email : string , password : string ) : Promise < any > {
39- return { result : 'PATCH:/v1/account/email:passed' } ;
40- }
41-
42- async listIdentities ( queries ?: any [ ] , total ?: boolean ) : Promise < any > {
43- return { result : 'GET:/v1/account/identities:passed' } ;
44- }
45-
46- async deleteIdentity ( identityId : string ) : Promise < any > {
47- return { result : 'DELETE:/v1/account/identities/{identityId}:passed' } ;
48- }
49-
50- async createJWT ( duration ?: number ) : Promise < any > {
51- return { result : 'POST:/v1/account/jwts:passed' } ;
52- }
53-
54- async listLogs ( queries ?: any [ ] , total ?: boolean ) : Promise < any > {
55- return { result : 'GET:/v1/account/logs:passed' } ;
56- }
57-
58- async updateMFA ( mfa : boolean ) : Promise < any > {
59- return { result : 'PATCH:/v1/account/mfa:passed' } ;
60- }
61-
62- async createMfaAuthenticator ( type : string ) : Promise < any > {
63- return { result : 'POST:/v1/account/mfa/authenticators/{type}:passed' } ;
64- }
65-
66- async createMFAAuthenticator ( type : string ) : Promise < any > {
67- return { result : 'POST:/v1/account/mfa/authenticators/{type}:passed' } ;
68- }
69-
70- async updateMfaAuthenticator ( type : string , otp : string ) : Promise < any > {
71- return { result : 'PUT:/v1/account/mfa/authenticators/{type}:passed' } ;
72- }
73-
74- async updateMFAAuthenticator ( type : string , otp : string ) : Promise < any > {
75- return { result : 'PUT:/v1/account/mfa/authenticators/{type}:passed' } ;
76- }
77-
78- async deleteMfaAuthenticator ( type : string ) : Promise < any > {
79- return { result : 'DELETE:/v1/account/mfa/authenticators/{type}:passed' } ;
80- }
81-
82- async deleteMFAAuthenticator ( type : string ) : Promise < any > {
83- return { result : 'DELETE:/v1/account/mfa/authenticators/{type}:passed' } ;
84- }
85-
86- async createMfaChallenge ( factor : string ) : Promise < any > {
87- return { result : 'POST:/v1/account/mfa/challenges:passed' } ;
88- }
89-
90- async createMFAChallenge ( factor : string ) : Promise < any > {
91- return { result : 'POST:/v1/account/mfa/challenges:passed' } ;
92- }
93-
94- async updateMfaChallenge ( challengeId : string , otp : string ) : Promise < any > {
95- return { result : 'PUT:/v1/account/mfa/challenges:passed' } ;
96- }
97-
98- async updateMFAChallenge ( challengeId : string , otp : string ) : Promise < any > {
99- return { result : 'PUT:/v1/account/mfa/challenges:passed' } ;
100- }
101-
102- async listMfaFactors ( ) : Promise < any > {
103- return { result : 'GET:/v1/account/mfa/factors:passed' } ;
104- }
105-
106- async listMFAFactors ( ) : Promise < any > {
107- return { result : 'GET:/v1/account/mfa/factors:passed' } ;
108- }
109-
110- async getMfaRecoveryCodes ( ) : Promise < any > {
111- return { result : 'GET:/v1/account/mfa/recovery-codes:passed' } ;
112- }
113-
114- async getMFARecoveryCodes ( ) : Promise < any > {
115- return { result : 'GET:/v1/account/mfa/recovery-codes:passed' } ;
116- }
117-
118- async createMfaRecoveryCodes ( ) : Promise < any > {
119- return { result : 'POST:/v1/account/mfa/recovery-codes:passed' } ;
120- }
121-
122- async createMFARecoveryCodes ( ) : Promise < any > {
123- return { result : 'POST:/v1/account/mfa/recovery-codes:passed' } ;
124- }
125-
126- async updateMfaRecoveryCodes ( ) : Promise < any > {
127- return { result : 'PATCH:/v1/account/mfa/recovery-codes:passed' } ;
128- }
129-
130- async updateMFARecoveryCodes ( ) : Promise < any > {
131- return { result : 'PATCH:/v1/account/mfa/recovery-codes:passed' } ;
132- }
133-
134- async updateName ( name : string ) : Promise < any > {
135- return { result : 'PATCH:/v1/account/name:passed' } ;
136- }
137-
138- async updatePassword ( password : string , oldPassword ?: string ) : Promise < any > {
139- return { result : 'PATCH:/v1/account/password:passed' } ;
140- }
141-
142- async updatePhone ( phone : string , password : string ) : Promise < any > {
143- return { result : 'PATCH:/v1/account/phone:passed' } ;
144- }
145-
146- async getPrefs ( ) : Promise < any > {
147- return { result : 'GET:/v1/account/prefs:passed' } ;
148- }
149-
150- async updatePrefs ( prefs : any ) : Promise < any > {
151- return { result : 'PATCH:/v1/account/prefs:passed' } ;
152- }
153-
154- async createRecovery ( email : string , url : string ) : Promise < any > {
155- return { result : 'POST:/v1/account/recovery:passed' } ;
156- }
157-
158- async updateRecovery ( userId : string , secret : string , password : string ) : Promise < any > {
159- return { result : 'PUT:/v1/account/recovery:passed' } ;
160- }
161-
162- async listSessions ( ) : Promise < any > {
163- return { result : 'GET:/v1/account/sessions:passed' } ;
164- }
165-
166- async deleteSessions ( ) : Promise < any > {
167- return { result : 'DELETE:/v1/account/sessions:passed' } ;
168- }
169-
170- async createAnonymousSession ( ) : Promise < any > {
171- return { result : 'POST:/v1/account/sessions/anonymous:passed' } ;
172- }
173-
174- async createEmailPasswordSession ( email : string , password : string ) : Promise < any > {
175- return { result : 'POST:/v1/account/sessions/email:passed' } ;
176- }
177-
178- async updateMagicURLSession ( userId : string , secret : string ) : Promise < any > {
179- return { result : 'PUT:/v1/account/sessions/magic-url:passed' } ;
180- }
181-
182- async createOAuth2Session ( provider : string , success ?: string , failure ?: string , scopes ?: any [ ] ) : Promise < any > {
183- return { result : 'GET:/v1/account/sessions/oauth2/{provider}:passed' } ;
184- }
185-
186- async updatePhoneSession ( userId : string , secret : string ) : Promise < any > {
187- return { result : 'PUT:/v1/account/sessions/phone:passed' } ;
188- }
189-
190- async createSession ( userId : string , secret : string ) : Promise < any > {
191- return { result : 'POST:/v1/account/sessions/token:passed' } ;
192- }
193-
194- async getSession ( sessionId : string ) : Promise < any > {
195- return { result : 'GET:/v1/account/sessions/{sessionId}:passed' } ;
196- }
197-
198- async updateSession ( sessionId : string ) : Promise < any > {
199- return { result : 'PATCH:/v1/account/sessions/{sessionId}:passed' } ;
200- }
201-
202- async deleteSession ( sessionId : string ) : Promise < any > {
203- return { result : 'DELETE:/v1/account/sessions/{sessionId}:passed' } ;
204- }
205-
206- async updateStatus ( ) : Promise < any > {
207- return { result : 'PATCH:/v1/account/status:passed' } ;
208- }
209-
210- async createPushTarget ( targetId : string , identifier : string , providerId ?: string ) : Promise < any > {
211- return { result : 'POST:/v1/account/targets/push:passed' } ;
212- }
213-
214- async updatePushTarget ( targetId : string , identifier : string ) : Promise < any > {
215- return { result : 'PUT:/v1/account/targets/{targetId}/push:passed' } ;
216- }
217-
218- async deletePushTarget ( targetId : string ) : Promise < any > {
219- return { result : 'DELETE:/v1/account/targets/{targetId}/push:passed' } ;
220- }
221-
222- async createEmailToken ( userId : string , email : string , phrase ?: boolean ) : Promise < any > {
223- return { result : 'POST:/v1/account/tokens/email:passed' } ;
224- }
225-
226- async createMagicURLToken ( userId : string , email : string , url ?: string , phrase ?: boolean ) : Promise < any > {
227- return { result : 'POST:/v1/account/tokens/magic-url:passed' } ;
228- }
229-
230- async createOAuth2Token ( provider : string , success ?: string , failure ?: string , scopes ?: any [ ] ) : Promise < any > {
231- return { result : 'GET:/v1/account/tokens/oauth2/{provider}:passed' } ;
232- }
233-
234- async createPhoneToken ( userId : string , phone : string ) : Promise < any > {
235- return { result : 'POST:/v1/account/tokens/phone:passed' } ;
236- }
237-
238- async createEmailVerification ( url : string ) : Promise < any > {
239- return { result : 'POST:/v1/account/verifications/email:passed' } ;
240- }
241-
242- async createVerification ( url : string ) : Promise < any > {
243- return { result : 'POST:/v1/account/verifications/email:passed' } ;
244- }
245-
246- async updateEmailVerification ( userId : string , secret : string ) : Promise < any > {
247- return { result : 'PUT:/v1/account/verifications/email:passed' } ;
248- }
249-
250- async updateVerification ( userId : string , secret : string ) : Promise < any > {
251- return { result : 'PUT:/v1/account/verifications/email:passed' } ;
252- }
253-
254- async createPhoneVerification ( ) : Promise < any > {
255- return { result : 'POST:/v1/account/verifications/phone:passed' } ;
256- }
257-
258- async updatePhoneVerification ( userId : string , secret : string ) : Promise < any > {
259- return { result : 'PUT:/v1/account/verifications/phone:passed' } ;
260- }
261- }
262-
11+ import {
12+ Account ,
13+ AuthenticatorType ,
14+ AuthenticationFactor ,
15+ OAuthProvider ,
16+ } from "@appwrite.io/console" ;
26317
26418let accountClient : Account | null = null ;
26519
0 commit comments