@anzar-auth/core 1.5.10 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,1184 +1,1557 @@
1
- import * as axios from 'axios';
2
- import { AxiosInstance, RawAxiosRequestConfig, AxiosPromise } from 'axios';
1
+ import * as openapi_fetch from 'openapi-fetch';
2
+ export { Client, Middleware } from 'openapi-fetch';
3
3
 
4
4
  /**
5
- * Anzar Software API
6
- * REST API for the Anzar platform. All protected routes require a Bearer token.
7
- *
8
- * The version of the OpenAPI document: 0.7.15
9
- * Contact: dev@anzar.io
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
5
+ * This file was auto-generated by openapi-typescript.
6
+ * Do not make direct changes to the file.
14
7
  */
15
- interface AWSv4Configuration {
16
- options?: {
17
- region?: string;
18
- service?: string;
8
+
9
+ interface paths {
10
+ "/auth/login": {
11
+ parameters: {
12
+ query?: never;
13
+ header?: never;
14
+ path?: never;
15
+ cookie?: never;
16
+ };
17
+ get?: never;
18
+ put?: never;
19
+ /**
20
+ * User login
21
+ * @description Authenticates a user with email and password.
22
+ *
23
+ * **Session strategy**: Returns a session cookie (`id`) managed by the server.
24
+ * **JWT strategy**: Returns `access` and `refresh` in the response body.
25
+ */
26
+ post: operations["login"];
27
+ delete?: never;
28
+ options?: never;
29
+ head?: never;
30
+ patch?: never;
31
+ trace?: never;
19
32
  };
20
- credentials?: {
21
- accessKeyId?: string;
22
- secretAccessKey?: string;
23
- sessionToken?: string;
33
+ "/auth/logout": {
34
+ parameters: {
35
+ query?: never;
36
+ header?: never;
37
+ path?: never;
38
+ cookie?: never;
39
+ };
40
+ get?: never;
41
+ put?: never;
42
+ /**
43
+ * Logout
44
+ * @description Invalidates the current session and refresh token. The client should discard all stored tokens and cookies after this call.
45
+ */
46
+ post: operations["logout"];
47
+ delete?: never;
48
+ options?: never;
49
+ head?: never;
50
+ patch?: never;
51
+ trace?: never;
52
+ };
53
+ "/auth/password/forgot": {
54
+ parameters: {
55
+ query?: never;
56
+ header?: never;
57
+ path?: never;
58
+ cookie?: never;
59
+ };
60
+ get?: never;
61
+ put?: never;
62
+ /**
63
+ * Request a password reset
64
+ * @description Sends a password reset link to the provided email address if an account exists.
65
+ *
66
+ * **Note**: Always returns `200` regardless of whether the email exists to prevent user enumeration attacks.
67
+ */
68
+ post: operations["forgotPassword"];
69
+ delete?: never;
70
+ options?: never;
71
+ head?: never;
72
+ patch?: never;
73
+ trace?: never;
74
+ };
75
+ "/auth/password/reset": {
76
+ parameters: {
77
+ query?: never;
78
+ header?: never;
79
+ path?: never;
80
+ cookie?: never;
81
+ };
82
+ /**
83
+ * Render password reset form
84
+ * @description Validates the password reset token from the email link and renders an HTML form to set a new password. The token is single-use and expires after a short window.
85
+ */
86
+ get: operations["renderPasswordResetForm"];
87
+ put?: never;
88
+ /**
89
+ * Submit new password
90
+ * @description Submits a new password using a valid reset token. The token is invalidated immediately after use. Accepts a form submission (not JSON) since it is rendered from an HTML form.
91
+ */
92
+ post: operations["submitNewPassword"];
93
+ delete?: never;
94
+ options?: never;
95
+ head?: never;
96
+ patch?: never;
97
+ trace?: never;
98
+ };
99
+ "/auth/refresh-token": {
100
+ parameters: {
101
+ query?: never;
102
+ header?: never;
103
+ path?: never;
104
+ cookie?: never;
105
+ };
106
+ get?: never;
107
+ put?: never;
108
+ /**
109
+ * Refresh access token
110
+ * @description Issues a new access token using a valid refresh token. Refresh tokens are rotated on each call — the old token is invalidated immediately.
111
+ */
112
+ post: operations["refreshToken"];
113
+ delete?: never;
114
+ options?: never;
115
+ head?: never;
116
+ patch?: never;
117
+ trace?: never;
118
+ };
119
+ "/auth/register": {
120
+ parameters: {
121
+ query?: never;
122
+ header?: never;
123
+ path?: never;
124
+ cookie?: never;
125
+ };
126
+ get?: never;
127
+ put?: never;
128
+ /**
129
+ * Register a new user
130
+ * @description Creates a new user account with email and password.
131
+ *
132
+ * **Session strategy**: Returns a session cookie (`id`) managed by the server.
133
+ * **JWT strategy**: Returns `access` and `refresh` in the response body.
134
+ */
135
+ post: operations["register"];
136
+ delete?: never;
137
+ options?: never;
138
+ head?: never;
139
+ patch?: never;
140
+ trace?: never;
141
+ };
142
+ "/auth/session": {
143
+ parameters: {
144
+ query?: never;
145
+ header?: never;
146
+ path?: never;
147
+ cookie?: never;
148
+ };
149
+ /**
150
+ * Get current session
151
+ * @description Returns the currently authenticated user's session data. Requires either a valid Bearer token or an active session cookie.
152
+ */
153
+ get: operations["getSession"];
154
+ put?: never;
155
+ post?: never;
156
+ delete?: never;
157
+ options?: never;
158
+ head?: never;
159
+ patch?: never;
160
+ trace?: never;
161
+ };
162
+ "/email/verify": {
163
+ parameters: {
164
+ query?: never;
165
+ header?: never;
166
+ path?: never;
167
+ cookie?: never;
168
+ };
169
+ /**
170
+ * Verify user email
171
+ * @description Validates the email verification token and activates the user account. On success, redirects the user to the confirmation page.
172
+ */
173
+ get: operations["verify_email"];
174
+ put?: never;
175
+ post?: never;
176
+ delete?: never;
177
+ options?: never;
178
+ head?: never;
179
+ patch?: never;
180
+ trace?: never;
181
+ };
182
+ "/permission": {
183
+ parameters: {
184
+ query?: never;
185
+ header?: never;
186
+ path?: never;
187
+ cookie?: never;
188
+ };
189
+ get?: never;
190
+ put?: never;
191
+ /**
192
+ * Create or update a permission
193
+ * @description Upserts a permission by action and resource. If it already exists it is updated, otherwise created. Requires admin privileges.
194
+ */
195
+ post: operations["createPermission"];
196
+ delete?: never;
197
+ options?: never;
198
+ head?: never;
199
+ patch?: never;
200
+ trace?: never;
201
+ };
202
+ "/role": {
203
+ parameters: {
204
+ query?: never;
205
+ header?: never;
206
+ path?: never;
207
+ cookie?: never;
208
+ };
209
+ get?: never;
210
+ put?: never;
211
+ /**
212
+ * Create or update a role
213
+ * @description Upserts a role by name. If it already exists it is updated, otherwise created. Requires admin privileges.
214
+ */
215
+ post: operations["createRole"];
216
+ delete?: never;
217
+ options?: never;
218
+ head?: never;
219
+ patch?: never;
220
+ trace?: never;
221
+ };
222
+ "/role/{id}/permission": {
223
+ parameters: {
224
+ query?: never;
225
+ header?: never;
226
+ path?: never;
227
+ cookie?: never;
228
+ };
229
+ get?: never;
230
+ put?: never;
231
+ /**
232
+ * Assign a permission to a role
233
+ * @description Assigns an existing permission to the specified role. Requires admin privileges.
234
+ */
235
+ post: operations["assignPermissionToRole"];
236
+ delete?: never;
237
+ options?: never;
238
+ head?: never;
239
+ patch?: never;
240
+ trace?: never;
241
+ };
242
+ "/user": {
243
+ parameters: {
244
+ query?: never;
245
+ header?: never;
246
+ path?: never;
247
+ cookie?: never;
248
+ };
249
+ /**
250
+ * Get current User
251
+ * @description Returns the currently authenticated user's profile. Requires either a valid Bearer token or an active session cookie.
252
+ */
253
+ get: operations["find_user"];
254
+ put?: never;
255
+ post?: never;
256
+ delete?: never;
257
+ options?: never;
258
+ head?: never;
259
+ patch?: never;
260
+ trace?: never;
261
+ };
262
+ "/user/role": {
263
+ parameters: {
264
+ query?: never;
265
+ header?: never;
266
+ path?: never;
267
+ cookie?: never;
268
+ };
269
+ get?: never;
270
+ put?: never;
271
+ /**
272
+ * Assign a role to user
273
+ * @description Assigns the specified role to a target user. Requires an authenticated session with sufficient privileges (admin only).
274
+ */
275
+ post: operations["assign_role"];
276
+ delete?: never;
277
+ options?: never;
278
+ head?: never;
279
+ patch?: never;
280
+ trace?: never;
24
281
  };
25
282
  }
26
- interface ConfigurationParameters {
27
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
28
- username?: string;
29
- password?: string;
30
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
31
- awsv4?: AWSv4Configuration;
32
- basePath?: string;
33
- serverIndex?: number;
34
- baseOptions?: any;
35
- formDataCtor?: new () => any;
36
- }
37
- declare class Configuration {
38
- /**
39
- * parameter for apiKey security
40
- * @param name security name
41
- */
42
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
43
- /**
44
- * parameter for basic security
45
- */
46
- username?: string;
47
- /**
48
- * parameter for basic security
49
- */
50
- password?: string;
51
- /**
52
- * parameter for oauth2 security
53
- * @param name security name
54
- * @param scopes oauth2 scope
55
- */
56
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
57
- /**
58
- * parameter for aws4 signature security
59
- * @param {Object} AWS4Signature - AWS4 Signature security
60
- * @param {string} options.region - aws region
61
- * @param {string} options.service - name of the service.
62
- * @param {string} credentials.accessKeyId - aws access key id
63
- * @param {string} credentials.secretAccessKey - aws access key
64
- * @param {string} credentials.sessionToken - aws session token
65
- * @memberof Configuration
66
- */
67
- awsv4?: AWSv4Configuration;
68
- /**
69
- * override base path
70
- */
71
- basePath?: string;
72
- /**
73
- * override server index
74
- */
75
- serverIndex?: number;
76
- /**
77
- * base options for axios calls
78
- */
79
- baseOptions?: any;
80
- /**
81
- * The FormData constructor that will be used to create multipart form data
82
- * requests. You can inject this here so that execution environments that
83
- * do not support the FormData class can still run the generated client.
84
- *
85
- * @type {new () => FormData}
86
- */
87
- formDataCtor?: new () => any;
88
- constructor(param?: ConfigurationParameters);
89
- /**
90
- * Check if the given MIME is a JSON MIME.
91
- * JSON MIME examples:
92
- * application/json
93
- * application/json; charset=UTF8
94
- * APPLICATION/JSON
95
- * application/vnd.company+json
96
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
97
- * @return True if the given MIME is JSON, false otherwise.
98
- */
99
- isJsonMime(mime: string): boolean;
100
- }
101
-
102
- /**
103
- * Anzar Software API
104
- * REST API for the Anzar platform. All protected routes require a Bearer token.
105
- *
106
- * The version of the OpenAPI document: 0.7.15
107
- * Contact: dev@anzar.io
108
- *
109
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
110
- * https://openapi-generator.tech
111
- * Do not edit the class manually.
112
- */
113
-
114
- interface RequestArgs {
115
- url: string;
116
- options: RawAxiosRequestConfig;
117
- }
118
- declare class BaseAPI {
119
- protected basePath: string;
120
- protected axios: AxiosInstance;
121
- protected configuration: Configuration | undefined;
122
- constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
123
- }
124
-
125
- /**
126
- * Anzar Software API
127
- * REST API for the Anzar platform. All protected routes require a Bearer token.
128
- *
129
- * The version of the OpenAPI document: 0.7.15
130
- * Contact: dev@anzar.io
131
- *
132
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
133
- * https://openapi-generator.tech
134
- * Do not edit the class manually.
135
- */
136
- declare const AlgorithmConfig: {
137
- readonly Hs256: "HS256";
138
- readonly Hs384: "HS384";
139
- readonly Hs512: "HS512";
140
- readonly Es256: "ES256";
141
- readonly Es384: "ES384";
142
- readonly Rs256: "RS256";
143
- readonly Rs384: "RS384";
144
- readonly Rs512: "RS512";
145
- readonly Ps256: "PS256";
146
- readonly Ps384: "PS384";
147
- readonly Ps512: "PS512";
148
- readonly EdDsa: "EdDSA";
149
- };
150
- type AlgorithmConfig = typeof AlgorithmConfig[keyof typeof AlgorithmConfig];
151
-
152
- /**
153
- * Anzar Software API
154
- * REST API for the Anzar platform. All protected routes require a Bearer token.
155
- *
156
- * The version of the OpenAPI document: 0.7.15
157
- * Contact: dev@anzar.io
158
- *
159
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
160
- * https://openapi-generator.tech
161
- * Do not edit the class manually.
162
- */
163
- interface App {
164
- 'environment': string;
165
- 'url': string;
166
- }
167
-
168
- /**
169
- * Anzar Software API
170
- * REST API for the Anzar platform. All protected routes require a Bearer token.
171
- *
172
- * The version of the OpenAPI document: 0.7.15
173
- * Contact: dev@anzar.io
174
- *
175
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
176
- * https://openapi-generator.tech
177
- * Do not edit the class manually.
178
- */
179
- declare const AuthStrategy: {
180
- readonly Session: "Session";
181
- readonly Jwt: "Jwt";
182
- };
183
- type AuthStrategy = typeof AuthStrategy[keyof typeof AuthStrategy];
184
-
185
- /**
186
- * Anzar Software API
187
- * REST API for the Anzar platform. All protected routes require a Bearer token.
188
- *
189
- * The version of the OpenAPI document: 0.7.15
190
- * Contact: dev@anzar.io
191
- *
192
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
193
- * https://openapi-generator.tech
194
- * Do not edit the class manually.
195
- */
196
- interface EmailVerification {
197
- 'error_redirect'?: string | null;
198
- 'required'?: boolean;
199
- 'success_redirect'?: string | null;
200
- 'token_expires_in'?: number;
201
- }
202
-
203
- /**
204
- * Anzar Software API
205
- * REST API for the Anzar platform. All protected routes require a Bearer token.
206
- *
207
- * The version of the OpenAPI document: 0.7.15
208
- * Contact: dev@anzar.io
209
- *
210
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
211
- * https://openapi-generator.tech
212
- * Do not edit the class manually.
213
- */
214
-
215
- interface EmailConfig {
216
- 'verification'?: EmailVerification;
217
- }
218
-
219
- /**
220
- * Anzar Software API
221
- * REST API for the Anzar platform. All protected routes require a Bearer token.
222
- *
223
- * The version of the OpenAPI document: 0.7.15
224
- * Contact: dev@anzar.io
225
- *
226
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
227
- * https://openapi-generator.tech
228
- * Do not edit the class manually.
229
- */
230
-
231
- interface JwtConfig {
232
- 'access_token_expires_in'?: number;
233
- 'algorithm'?: AlgorithmConfig;
234
- 'audience'?: string;
235
- 'issuer'?: string;
236
- 'refresh_token_expires_in'?: number;
237
- }
238
-
239
- /**
240
- * Anzar Software API
241
- * REST API for the Anzar platform. All protected routes require a Bearer token.
242
- *
243
- * The version of the OpenAPI document: 0.7.15
244
- * Contact: dev@anzar.io
245
- *
246
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
247
- * https://openapi-generator.tech
248
- * Do not edit the class manually.
249
- */
250
- interface PasswordRequirements {
251
- 'max_length'?: number;
252
- 'min_length'?: number;
253
- 'require_number'?: boolean;
254
- 'require_special_char'?: boolean;
255
- 'require_uppercase'?: boolean;
256
- }
257
-
258
- /**
259
- * Anzar Software API
260
- * REST API for the Anzar platform. All protected routes require a Bearer token.
261
- *
262
- * The version of the OpenAPI document: 0.7.15
263
- * Contact: dev@anzar.io
264
- *
265
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
266
- * https://openapi-generator.tech
267
- * Do not edit the class manually.
268
- */
269
- interface PasswordReset {
270
- 'error_redirect'?: string | null;
271
- 'success_redirect'?: string | null;
272
- 'token_expires_in'?: number;
273
- }
274
-
275
- /**
276
- * Anzar Software API
277
- * REST API for the Anzar platform. All protected routes require a Bearer token.
278
- *
279
- * The version of the OpenAPI document: 0.7.15
280
- * Contact: dev@anzar.io
281
- *
282
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
283
- * https://openapi-generator.tech
284
- * Do not edit the class manually.
285
- */
286
- interface PasswordSecurity {
287
- 'lockout_duration'?: number;
288
- 'max_failed_attempts'?: number;
289
- }
290
-
291
- /**
292
- * Anzar Software API
293
- * REST API for the Anzar platform. All protected routes require a Bearer token.
294
- *
295
- * The version of the OpenAPI document: 0.7.15
296
- * Contact: dev@anzar.io
297
- *
298
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
299
- * https://openapi-generator.tech
300
- * Do not edit the class manually.
301
- */
302
-
303
- interface PasswordConfig {
304
- 'requirements'?: PasswordRequirements;
305
- 'reset'?: PasswordReset;
306
- 'security'?: PasswordSecurity;
307
- }
308
-
309
- /**
310
- * Anzar Software API
311
- * REST API for the Anzar platform. All protected routes require a Bearer token.
312
- *
313
- * The version of the OpenAPI document: 0.7.15
314
- * Contact: dev@anzar.io
315
- *
316
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
317
- * https://openapi-generator.tech
318
- * Do not edit the class manually.
319
- */
320
- declare const SameSiteConfig: {
321
- readonly Strict: "Strict";
322
- readonly Lax: "Lax";
323
- readonly None: "None";
324
- };
325
- type SameSiteConfig = typeof SameSiteConfig[keyof typeof SameSiteConfig];
326
-
327
- /**
328
- * Anzar Software API
329
- * REST API for the Anzar platform. All protected routes require a Bearer token.
330
- *
331
- * The version of the OpenAPI document: 0.7.15
332
- * Contact: dev@anzar.io
333
- *
334
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
335
- * https://openapi-generator.tech
336
- * Do not edit the class manually.
337
- */
338
-
339
- interface SessionConfig {
340
- 'http_only'?: boolean;
341
- 'max_age'?: number;
342
- 'name'?: string;
343
- 'same_site'?: SameSiteConfig;
344
- 'secure'?: boolean;
345
- }
346
-
347
- /**
348
- * Anzar Software API
349
- * REST API for the Anzar platform. All protected routes require a Bearer token.
350
- *
351
- * The version of the OpenAPI document: 0.7.15
352
- * Contact: dev@anzar.io
353
- *
354
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
355
- * https://openapi-generator.tech
356
- * Do not edit the class manually.
357
- */
358
-
359
- interface Authentication {
360
- 'email'?: EmailConfig;
361
- 'jwt'?: JwtConfig;
362
- 'password'?: PasswordConfig;
363
- 'session'?: SessionConfig;
364
- 'strategy'?: AuthStrategy;
365
- }
366
-
367
- /**
368
- * Anzar Software API
369
- * REST API for the Anzar platform. All protected routes require a Bearer token.
370
- *
371
- * The version of the OpenAPI document: 0.7.15
372
- * Contact: dev@anzar.io
373
- *
374
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
375
- * https://openapi-generator.tech
376
- * Do not edit the class manually.
377
- */
378
- declare const CacheDriver: {
379
- readonly MemCached: "MemCached";
380
- readonly Redis: "Redis";
381
- };
382
- type CacheDriver = typeof CacheDriver[keyof typeof CacheDriver];
383
-
384
- /**
385
- * Anzar Software API
386
- * REST API for the Anzar platform. All protected routes require a Bearer token.
387
- *
388
- * The version of the OpenAPI document: 0.7.15
389
- * Contact: dev@anzar.io
390
- *
391
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
392
- * https://openapi-generator.tech
393
- * Do not edit the class manually.
394
- */
395
-
396
- interface Cache {
397
- 'driver': CacheDriver;
398
- 'url': string;
399
- }
400
-
401
- /**
402
- * Anzar Software API
403
- * REST API for the Anzar platform. All protected routes require a Bearer token.
404
- *
405
- * The version of the OpenAPI document: 0.7.15
406
- * Contact: dev@anzar.io
407
- *
408
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
409
- * https://openapi-generator.tech
410
- * Do not edit the class manually.
411
- */
412
- declare const DatabaseDriver: {
413
- readonly SqLite: "SQLite";
414
- readonly PostgreSql: "PostgreSQL";
415
- readonly MongoDb: "MongoDB";
416
- };
417
- type DatabaseDriver = typeof DatabaseDriver[keyof typeof DatabaseDriver];
418
-
419
- /**
420
- * Anzar Software API
421
- * REST API for the Anzar platform. All protected routes require a Bearer token.
422
- *
423
- * The version of the OpenAPI document: 0.7.15
424
- * Contact: dev@anzar.io
425
- *
426
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
427
- * https://openapi-generator.tech
428
- * Do not edit the class manually.
429
- */
430
-
431
- interface Database {
432
- 'cache': Cache;
433
- 'connection_string': string;
434
- 'driver': DatabaseDriver;
435
- }
436
-
437
- /**
438
- * Anzar Software API
439
- * REST API for the Anzar platform. All protected routes require a Bearer token.
440
- *
441
- * The version of the OpenAPI document: 0.7.15
442
- * Contact: dev@anzar.io
443
- *
444
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
445
- * https://openapi-generator.tech
446
- * Do not edit the class manually.
447
- */
448
- interface Security {
449
- 'headers'?: Array<Array<any>>;
450
- 'secret_key': string;
451
- }
452
-
453
- /**
454
- * Anzar Software API
455
- * REST API for the Anzar platform. All protected routes require a Bearer token.
456
- *
457
- * The version of the OpenAPI document: 0.7.15
458
- * Contact: dev@anzar.io
459
- *
460
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
461
- * https://openapi-generator.tech
462
- * Do not edit the class manually.
463
- */
464
- interface CorsConfig {
465
- 'allow_credentials'?: boolean;
466
- 'allowed_headers'?: Array<string>;
467
- 'allowed_methods'?: Array<string>;
468
- 'allowed_origins'?: Array<string>;
469
- 'enabled'?: boolean;
470
- 'max_age'?: number;
471
- }
472
-
473
- /**
474
- * Anzar Software API
475
- * REST API for the Anzar platform. All protected routes require a Bearer token.
476
- *
477
- * The version of the OpenAPI document: 0.7.15
478
- * Contact: dev@anzar.io
479
- *
480
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
481
- * https://openapi-generator.tech
482
- * Do not edit the class manually.
483
- */
484
- interface HttpsConfig {
485
- 'cert_path'?: string | null;
486
- 'enabled'?: boolean;
487
- 'key_path'?: string | null;
488
- 'port'?: number;
489
- }
490
-
491
- /**
492
- * Anzar Software API
493
- * REST API for the Anzar platform. All protected routes require a Bearer token.
494
- *
495
- * The version of the OpenAPI document: 0.7.15
496
- * Contact: dev@anzar.io
497
- *
498
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
499
- * https://openapi-generator.tech
500
- * Do not edit the class manually.
501
- */
502
-
503
- interface Server {
504
- 'cors'?: CorsConfig;
505
- 'https'?: HttpsConfig;
506
- }
507
-
508
- /**
509
- * Anzar Software API
510
- * REST API for the Anzar platform. All protected routes require a Bearer token.
511
- *
512
- * The version of the OpenAPI document: 0.7.15
513
- * Contact: dev@anzar.io
514
- *
515
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
516
- * https://openapi-generator.tech
517
- * Do not edit the class manually.
518
- */
519
-
520
- interface AnzarConfiguration {
521
- 'app': App;
522
- 'auth'?: Authentication;
523
- 'database': Database;
524
- 'security': Security;
525
- 'server'?: Server;
526
- }
527
-
528
- /**
529
- * Anzar Software API
530
- * REST API for the Anzar platform. All protected routes require a Bearer token.
531
- *
532
- * The version of the OpenAPI document: 0.7.15
533
- * Contact: dev@anzar.io
534
- *
535
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
536
- * https://openapi-generator.tech
537
- * Do not edit the class manually.
538
- */
539
- /**
540
- * SessionTokens model
541
- */
542
- interface SessionTokens {
543
- 'access': string;
544
- 'expires_in': number;
545
- 'refresh': string;
546
- 'token_type': string;
547
- }
548
-
549
- /**
550
- * Anzar Software API
551
- * REST API for the Anzar platform. All protected routes require a Bearer token.
552
- *
553
- * The version of the OpenAPI document: 0.7.15
554
- * Contact: dev@anzar.io
555
- *
556
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
557
- * https://openapi-generator.tech
558
- * Do not edit the class manually.
559
- */
560
- declare const Role: {
561
- readonly User: "User";
562
- readonly Admin: "Admin";
563
- };
564
- type Role = typeof Role[keyof typeof Role];
565
-
566
- /**
567
- * Anzar Software API
568
- * REST API for the Anzar platform. All protected routes require a Bearer token.
569
- *
570
- * The version of the OpenAPI document: 0.7.15
571
- * Contact: dev@anzar.io
572
- *
573
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
574
- * https://openapi-generator.tech
575
- * Do not edit the class manually.
576
- */
577
-
578
- interface User {
579
- '_id'?: string | null;
580
- 'createdAt': string;
581
- 'email': string;
582
- 'role': Role;
583
- 'username': string;
584
- 'verified': boolean;
585
- }
586
-
587
- /**
588
- * Anzar Software API
589
- * REST API for the Anzar platform. All protected routes require a Bearer token.
590
- *
591
- * The version of the OpenAPI document: 0.7.15
592
- * Contact: dev@anzar.io
593
- *
594
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
595
- * https://openapi-generator.tech
596
- * Do not edit the class manually.
597
- */
598
- /**
599
- * Verification model
600
- */
601
- interface Verification {
602
- 'link': string;
603
- 'token': string;
604
- }
605
-
606
- /**
607
- * Anzar Software API
608
- * REST API for the Anzar platform. All protected routes require a Bearer token.
609
- *
610
- * The version of the OpenAPI document: 0.7.15
611
- * Contact: dev@anzar.io
612
- *
613
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
614
- * https://openapi-generator.tech
615
- * Do not edit the class manually.
616
- */
617
-
618
- interface AuthResponse {
619
- 'tokens'?: SessionTokens | null;
620
- 'user': User;
621
- 'verification'?: Verification | null;
622
- }
623
-
624
- /**
625
- * Anzar Software API
626
- * REST API for the Anzar platform. All protected routes require a Bearer token.
627
- *
628
- * The version of the OpenAPI document: 0.7.15
629
- * Contact: dev@anzar.io
630
- *
631
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
632
- * https://openapi-generator.tech
633
- * Do not edit the class manually.
634
- */
635
- interface EmailRequest {
636
- 'email': string;
637
- }
638
-
639
- /**
640
- * Anzar Software API
641
- * REST API for the Anzar platform. All protected routes require a Bearer token.
642
- *
643
- * The version of the OpenAPI document: 0.7.15
644
- * Contact: dev@anzar.io
645
- *
646
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
647
- * https://openapi-generator.tech
648
- * Do not edit the class manually.
649
- */
650
- declare const ErrorCode: {
651
- readonly InvalidToken: "InvalidToken";
652
- readonly TokenNotFound: "TokenNotFound";
653
- readonly TokenExpired: "TokenExpired";
654
- readonly TokenAlreadyUsed: "TokenAlreadyUsed";
655
- readonly TokenCreationFailed: "TokenCreationFailed";
656
- readonly TokenRevocationFailed: "TokenRevocationFailed";
657
- readonly AccountNotVerified: "AccountNotVerified";
658
- readonly InvalidCredentials: "InvalidCredentials";
659
- readonly MissingCredentials: "MissingCredentials";
660
- readonly AccountSuspended: "AccountSuspended";
661
- readonly UserNotFound: "UserNotFound";
662
- readonly RateLimitExceeded: "RateLimitExceeded";
663
- readonly EmailSendFailed: "EmailSendFailed";
664
- readonly TlsConfig: "TlsConfig";
665
- readonly HashingFailure: "HashingFailure";
666
- readonly MalformedData: "MalformedData";
667
- readonly DatabaseError: "DatabaseError";
668
- readonly InvalidRequest: "InvalidRequest";
669
- readonly UnsupportedMediaType: "UnsupportedMediaType";
670
- readonly BadRequest: "BadRequest";
671
- readonly InternalServerError: "InternalServerError";
672
- };
673
- type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode];
674
-
675
- /**
676
- * Anzar Software API
677
- * REST API for the Anzar platform. All protected routes require a Bearer token.
678
- *
679
- * The version of the OpenAPI document: 0.7.15
680
- * Contact: dev@anzar.io
681
- *
682
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
683
- * https://openapi-generator.tech
684
- * Do not edit the class manually.
685
- */
686
-
687
- interface ErrorResponse {
688
- 'code': ErrorCode;
689
- 'details'?: any;
690
- 'message': string;
691
- }
692
-
693
- /**
694
- * Anzar Software API
695
- * REST API for the Anzar platform. All protected routes require a Bearer token.
696
- *
697
- * The version of the OpenAPI document: 0.7.15
698
- * Contact: dev@anzar.io
699
- *
700
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
701
- * https://openapi-generator.tech
702
- * Do not edit the class manually.
703
- */
704
- interface LoginRequest {
705
- 'email': string;
706
- 'password': string;
707
- }
708
-
709
- /**
710
- * Anzar Software API
711
- * REST API for the Anzar platform. All protected routes require a Bearer token.
712
- *
713
- * The version of the OpenAPI document: 0.7.15
714
- * Contact: dev@anzar.io
715
- *
716
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
717
- * https://openapi-generator.tech
718
- * Do not edit the class manually.
719
- */
720
- interface RefreshTokenRequest {
721
- 'refresh_token': string;
722
- }
723
-
724
- /**
725
- * Anzar Software API
726
- * REST API for the Anzar platform. All protected routes require a Bearer token.
727
- *
728
- * The version of the OpenAPI document: 0.7.15
729
- * Contact: dev@anzar.io
730
- *
731
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
732
- * https://openapi-generator.tech
733
- * Do not edit the class manually.
734
- */
735
- interface RegisterRequest {
736
- 'email': string;
737
- 'password': string;
738
- 'username': string;
739
- }
740
-
741
- /**
742
- * Anzar Software API
743
- * REST API for the Anzar platform. All protected routes require a Bearer token.
744
- *
745
- * The version of the OpenAPI document: 0.7.15
746
- * Contact: dev@anzar.io
747
- *
748
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
749
- * https://openapi-generator.tech
750
- * Do not edit the class manually.
751
- */
752
- interface ResetLink {
753
- 'expires_at': string;
754
- 'link': string;
755
- }
756
-
757
- /**
758
- * Anzar Software API
759
- * REST API for the Anzar platform. All protected routes require a Bearer token.
760
- *
761
- * The version of the OpenAPI document: 0.7.15
762
- * Contact: dev@anzar.io
763
- *
764
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
765
- * https://openapi-generator.tech
766
- * Do not edit the class manually.
767
- */
768
- interface ResetPasswordRequest {
769
- 'csrf_token': string;
770
- 'password': string;
771
- 'token': string;
772
- }
773
-
774
- /**
775
- * Anzar Software API
776
- * REST API for the Anzar platform. All protected routes require a Bearer token.
777
- *
778
- * The version of the OpenAPI document: 0.7.15
779
- * Contact: dev@anzar.io
780
- *
781
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
782
- * https://openapi-generator.tech
783
- * Do not edit the class manually.
784
- */
785
- interface Session {
786
- '_id'?: string | null;
787
- 'expiresAt': string;
788
- 'issuedAt': string;
789
- 'token': string;
790
- 'usedAt'?: string | null;
791
- 'userId'?: string;
792
- }
793
-
794
- /**
795
- * Anzar Software API
796
- * REST API for the Anzar platform. All protected routes require a Bearer token.
797
- *
798
- * The version of the OpenAPI document: 0.7.15
799
- * Contact: dev@anzar.io
800
- *
801
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
802
- * https://openapi-generator.tech
803
- * Do not edit the class manually.
804
- */
805
- interface TokenQuery {
806
- 'token': string;
807
- }
808
-
809
- /**
810
- * AuthApi - axios parameter creator
811
- */
812
- declare const AuthApiAxiosParamCreator: (configuration?: Configuration) => {
813
- /**
814
- * Returns the currently authenticated user\'s session data. Requires a valid Bearer token.
815
- * @summary Get current session
816
- * @param {*} [options] Override http request option.
817
- * @throws {RequiredError}
818
- */
819
- getSession: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
820
- /**
821
- * Authenticates a user with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
822
- * @summary User login
823
- * @param {LoginRequest} loginRequest User login credentials
824
- * @param {*} [options] Override http request option.
825
- * @throws {RequiredError}
826
- */
827
- login: (loginRequest: LoginRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
828
- /**
829
- * Invalidates the current session and refresh token. The client should discard stored tokens.
830
- * @summary Logout
831
- * @param {RefreshTokenRequest} refreshTokenRequest
832
- * @param {*} [options] Override http request option.
833
- * @throws {RequiredError}
834
- */
835
- logout: (refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
836
- /**
837
- * Issues a new access token using a valid refresh token. Rotate refresh tokens on each call.
838
- * @summary Refresh access token
839
- * @param {RefreshTokenRequest} refreshTokenRequest
840
- * @param {*} [options] Override http request option.
841
- * @throws {RequiredError}
842
- */
843
- refreshToken: (refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
844
- /**
845
- * Creates a new user account with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
846
- * @summary Register a new user
847
- * @param {RegisterRequest} registerRequest User register credentials
848
- * @param {*} [options] Override http request option.
849
- * @throws {RequiredError}
850
- */
851
- register: (registerRequest: RegisterRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
852
- /**
853
- * Validates the reset token from the email link and renders the password reset form.
854
- * @summary Render password reset form
855
- * @param {TokenQuery} token Password reset token
856
- * @param {*} [options] Override http request option.
857
- * @throws {RequiredError}
858
- */
859
- renderResetForm: (token: TokenQuery, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
860
- /**
861
- * Sends a password reset link to the provided email address if an account exists.
862
- * @summary Request a password reset
863
- * @param {EmailRequest} emailRequest Email address to send the reset link to
864
- * @param {*} [options] Override http request option.
865
- * @throws {RequiredError}
866
- */
867
- requestPasswordReset: (emailRequest: EmailRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
868
- /**
869
- * Submits a new password using a valid reset token. Invalidates the token after use.
870
- * @summary Submit new password
871
- * @param {ResetPasswordRequest} resetPasswordRequest Reset token and the new password
872
- * @param {*} [options] Override http request option.
873
- * @throws {RequiredError}
874
- */
875
- submitNewPassword: (resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
876
- };
877
- /**
878
- * AuthApi - functional programming interface
879
- */
880
- declare const AuthApiFp: (configuration?: Configuration) => {
881
- /**
882
- * Returns the currently authenticated user\'s session data. Requires a valid Bearer token.
883
- * @summary Get current session
884
- * @param {*} [options] Override http request option.
885
- * @throws {RequiredError}
886
- */
887
- getSession(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Session>>;
888
- /**
889
- * Authenticates a user with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
890
- * @summary User login
891
- * @param {LoginRequest} loginRequest User login credentials
892
- * @param {*} [options] Override http request option.
893
- * @throws {RequiredError}
894
- */
895
- login(loginRequest: LoginRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthResponse>>;
896
- /**
897
- * Invalidates the current session and refresh token. The client should discard stored tokens.
898
- * @summary Logout
899
- * @param {RefreshTokenRequest} refreshTokenRequest
900
- * @param {*} [options] Override http request option.
901
- * @throws {RequiredError}
902
- */
903
- logout(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
904
- /**
905
- * Issues a new access token using a valid refresh token. Rotate refresh tokens on each call.
906
- * @summary Refresh access token
907
- * @param {RefreshTokenRequest} refreshTokenRequest
908
- * @param {*} [options] Override http request option.
909
- * @throws {RequiredError}
910
- */
911
- refreshToken(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthResponse>>;
912
- /**
913
- * Creates a new user account with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
914
- * @summary Register a new user
915
- * @param {RegisterRequest} registerRequest User register credentials
916
- * @param {*} [options] Override http request option.
917
- * @throws {RequiredError}
918
- */
919
- register(registerRequest: RegisterRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthResponse>>;
920
- /**
921
- * Validates the reset token from the email link and renders the password reset form.
922
- * @summary Render password reset form
923
- * @param {TokenQuery} token Password reset token
924
- * @param {*} [options] Override http request option.
925
- * @throws {RequiredError}
926
- */
927
- renderResetForm(token: TokenQuery, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>>;
928
- /**
929
- * Sends a password reset link to the provided email address if an account exists.
930
- * @summary Request a password reset
931
- * @param {EmailRequest} emailRequest Email address to send the reset link to
932
- * @param {*} [options] Override http request option.
933
- * @throws {RequiredError}
934
- */
935
- requestPasswordReset(emailRequest: EmailRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResetLink>>;
936
- /**
937
- * Submits a new password using a valid reset token. Invalidates the token after use.
938
- * @summary Submit new password
939
- * @param {ResetPasswordRequest} resetPasswordRequest Reset token and the new password
940
- * @param {*} [options] Override http request option.
941
- * @throws {RequiredError}
942
- */
943
- submitNewPassword(resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
944
- };
945
- /**
946
- * AuthApi - factory interface
947
- */
948
- declare const AuthApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
949
- /**
950
- * Returns the currently authenticated user\'s session data. Requires a valid Bearer token.
951
- * @summary Get current session
952
- * @param {*} [options] Override http request option.
953
- * @throws {RequiredError}
954
- */
955
- getSession(options?: RawAxiosRequestConfig): AxiosPromise<Session>;
956
- /**
957
- * Authenticates a user with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
958
- * @summary User login
959
- * @param {LoginRequest} loginRequest User login credentials
960
- * @param {*} [options] Override http request option.
961
- * @throws {RequiredError}
962
- */
963
- login(loginRequest: LoginRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthResponse>;
964
- /**
965
- * Invalidates the current session and refresh token. The client should discard stored tokens.
966
- * @summary Logout
967
- * @param {RefreshTokenRequest} refreshTokenRequest
968
- * @param {*} [options] Override http request option.
969
- * @throws {RequiredError}
970
- */
971
- logout(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
972
- /**
973
- * Issues a new access token using a valid refresh token. Rotate refresh tokens on each call.
974
- * @summary Refresh access token
975
- * @param {RefreshTokenRequest} refreshTokenRequest
976
- * @param {*} [options] Override http request option.
977
- * @throws {RequiredError}
978
- */
979
- refreshToken(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthResponse>;
980
- /**
981
- * Creates a new user account with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
982
- * @summary Register a new user
983
- * @param {RegisterRequest} registerRequest User register credentials
984
- * @param {*} [options] Override http request option.
985
- * @throws {RequiredError}
986
- */
987
- register(registerRequest: RegisterRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthResponse>;
988
- /**
989
- * Validates the reset token from the email link and renders the password reset form.
990
- * @summary Render password reset form
991
- * @param {TokenQuery} token Password reset token
992
- * @param {*} [options] Override http request option.
993
- * @throws {RequiredError}
994
- */
995
- renderResetForm(token: TokenQuery, options?: RawAxiosRequestConfig): AxiosPromise<string>;
996
- /**
997
- * Sends a password reset link to the provided email address if an account exists.
998
- * @summary Request a password reset
999
- * @param {EmailRequest} emailRequest Email address to send the reset link to
1000
- * @param {*} [options] Override http request option.
1001
- * @throws {RequiredError}
1002
- */
1003
- requestPasswordReset(emailRequest: EmailRequest, options?: RawAxiosRequestConfig): AxiosPromise<ResetLink>;
1004
- /**
1005
- * Submits a new password using a valid reset token. Invalidates the token after use.
1006
- * @summary Submit new password
1007
- * @param {ResetPasswordRequest} resetPasswordRequest Reset token and the new password
1008
- * @param {*} [options] Override http request option.
1009
- * @throws {RequiredError}
1010
- */
1011
- submitNewPassword(resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
1012
- };
1013
- /**
1014
- * AuthApi - object-oriented interface
1015
- */
1016
- declare class AuthApi extends BaseAPI {
1017
- /**
1018
- * Returns the currently authenticated user\'s session data. Requires a valid Bearer token.
1019
- * @summary Get current session
1020
- * @param {*} [options] Override http request option.
1021
- * @throws {RequiredError}
1022
- */
1023
- getSession(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<Session, any, {}>>;
1024
- /**
1025
- * Authenticates a user with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
1026
- * @summary User login
1027
- * @param {LoginRequest} loginRequest User login credentials
1028
- * @param {*} [options] Override http request option.
1029
- * @throws {RequiredError}
1030
- */
1031
- login(loginRequest: LoginRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<AuthResponse, any, {}>>;
1032
- /**
1033
- * Invalidates the current session and refresh token. The client should discard stored tokens.
1034
- * @summary Logout
1035
- * @param {RefreshTokenRequest} refreshTokenRequest
1036
- * @param {*} [options] Override http request option.
1037
- * @throws {RequiredError}
1038
- */
1039
- logout(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<void, any, {}>>;
1040
- /**
1041
- * Issues a new access token using a valid refresh token. Rotate refresh tokens on each call.
1042
- * @summary Refresh access token
1043
- * @param {RefreshTokenRequest} refreshTokenRequest
1044
- * @param {*} [options] Override http request option.
1045
- * @throws {RequiredError}
1046
- */
1047
- refreshToken(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<AuthResponse, any, {}>>;
1048
- /**
1049
- * Creates a new user account with email and password. **Session strategy**: Returns a session cookie (`id`) managed by the server. **JWT strategy**: Returns `access` and `refresh` in the response body.
1050
- * @summary Register a new user
1051
- * @param {RegisterRequest} registerRequest User register credentials
1052
- * @param {*} [options] Override http request option.
1053
- * @throws {RequiredError}
1054
- */
1055
- register(registerRequest: RegisterRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<AuthResponse, any, {}>>;
1056
- /**
1057
- * Validates the reset token from the email link and renders the password reset form.
1058
- * @summary Render password reset form
1059
- * @param {TokenQuery} token Password reset token
1060
- * @param {*} [options] Override http request option.
1061
- * @throws {RequiredError}
1062
- */
1063
- renderResetForm(token: TokenQuery, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<string, any, {}>>;
1064
- /**
1065
- * Sends a password reset link to the provided email address if an account exists.
1066
- * @summary Request a password reset
1067
- * @param {EmailRequest} emailRequest Email address to send the reset link to
1068
- * @param {*} [options] Override http request option.
1069
- * @throws {RequiredError}
1070
- */
1071
- requestPasswordReset(emailRequest: EmailRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<ResetLink, any, {}>>;
1072
- /**
1073
- * Submits a new password using a valid reset token. Invalidates the token after use.
1074
- * @summary Submit new password
1075
- * @param {ResetPasswordRequest} resetPasswordRequest Reset token and the new password
1076
- * @param {*} [options] Override http request option.
1077
- * @throws {RequiredError}
1078
- */
1079
- submitNewPassword(resetPasswordRequest: ResetPasswordRequest, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<void, any, {}>>;
283
+ interface components {
284
+ schemas: {
285
+ /** @enum {string} */
286
+ AlgorithmConfig: "HS256" | "HS384" | "HS512" | "ES256" | "ES384" | "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "EdDSA";
287
+ AnzarConfiguration: {
288
+ app: components["schemas"]["App"];
289
+ auth?: components["schemas"]["Authentication"];
290
+ database: components["schemas"]["Database"];
291
+ security: components["schemas"]["Security"];
292
+ server?: components["schemas"]["Server"];
293
+ };
294
+ App: {
295
+ environment: string;
296
+ url: string;
297
+ };
298
+ /**
299
+ * @example {
300
+ * "user": {
301
+ * "username": "",
302
+ * "email": "",
303
+ * "createdAt": "1970-01-01T00:00:00Z"
304
+ * },
305
+ * "tokens": {
306
+ * "access": "",
307
+ * "expires_in": 0,
308
+ * "token_type": "",
309
+ * "refresh": ""
310
+ * },
311
+ * "verification": {
312
+ * "link": "",
313
+ * "expires_at": "1970-01-01T00:00:00Z"
314
+ * }
315
+ * }
316
+ */
317
+ AuthResponse: {
318
+ tokens?: null | components["schemas"]["SessionTokens"];
319
+ user: components["schemas"]["User"];
320
+ verification?: null | components["schemas"]["ExpiringLink"];
321
+ };
322
+ AuthStrategy: (components["schemas"]["SessionConfig"] & {
323
+ /** @enum {string} */
324
+ type: "Session";
325
+ }) | (components["schemas"]["JwtConfig"] & {
326
+ /** @enum {string} */
327
+ type: "Jwt";
328
+ });
329
+ Authentication: {
330
+ /**
331
+ * @default {
332
+ * "verification": {
333
+ * "required": false,
334
+ * "token_expires_in": 1800,
335
+ * "success_redirect": null,
336
+ * "error_redirect": null
337
+ * }
338
+ * }
339
+ */
340
+ email: components["schemas"]["EmailConfig"];
341
+ /**
342
+ * @default {
343
+ * "algorithm": {
344
+ * "type": "Argon2",
345
+ * "memory_kib": 19456,
346
+ * "iterations": 2,
347
+ * "parallelism": 1
348
+ * },
349
+ * "requirements": {
350
+ * "min_length": 8,
351
+ * "max_length": 128,
352
+ * "require_uppercase": false,
353
+ * "require_number": false,
354
+ * "require_special_char": false
355
+ * },
356
+ * "reset": {
357
+ * "token_expires_in": 1800,
358
+ * "success_redirect": null,
359
+ * "error_redirect": null
360
+ * },
361
+ * "security": {
362
+ * "max_failed_attempts": 5,
363
+ * "lockout_duration": 1800
364
+ * }
365
+ * }
366
+ */
367
+ password: components["schemas"]["PasswordConfig"];
368
+ /**
369
+ * @default {
370
+ * "enabled": false,
371
+ * "default_role": "User",
372
+ * "roles": [
373
+ * {
374
+ * "name": "User",
375
+ * "permissions": [
376
+ * "*:read"
377
+ * ]
378
+ * }
379
+ * ]
380
+ * }
381
+ */
382
+ rbac: components["schemas"]["RbacConfig"];
383
+ /**
384
+ * @default {
385
+ * "type": "Session",
386
+ * "name": "id",
387
+ * "max_age": 3600,
388
+ * "secure": true,
389
+ * "http_only": true,
390
+ * "same_site": "Strict"
391
+ * }
392
+ */
393
+ strategy: components["schemas"]["AuthStrategy"];
394
+ };
395
+ Cache: {
396
+ driver: components["schemas"]["CacheDriver"];
397
+ url: string;
398
+ };
399
+ /** @enum {string} */
400
+ CacheDriver: "MemCached" | "Redis" | "InMemory";
401
+ CorsConfig: {
402
+ /** @default true */
403
+ allow_credentials: boolean;
404
+ /**
405
+ * @default [
406
+ * "authorization",
407
+ * "content-type",
408
+ * "accept",
409
+ * "accept-language",
410
+ * "Content-Language"
411
+ * ]
412
+ */
413
+ allowed_headers: string[];
414
+ /**
415
+ * @default [
416
+ * "GET",
417
+ * "POST",
418
+ * "PUT",
419
+ * "DELETE",
420
+ * "OPTIONS"
421
+ * ]
422
+ */
423
+ allowed_methods: string[];
424
+ /**
425
+ * @default [
426
+ * "localhost:3000"
427
+ * ]
428
+ */
429
+ allowed_origins: string[];
430
+ /** @default true */
431
+ enabled: boolean;
432
+ /**
433
+ * Format: int64
434
+ * @default 3600
435
+ */
436
+ max_age: number;
437
+ };
438
+ Database: {
439
+ cache: components["schemas"]["Cache"];
440
+ connection_string: string;
441
+ driver: components["schemas"]["DatabaseDriver"];
442
+ };
443
+ /** @enum {string} */
444
+ DatabaseDriver: "SQLite" | "PostgreSQL" | "MongoDB";
445
+ EmailConfig: {
446
+ /**
447
+ * @default {
448
+ * "required": false,
449
+ * "token_expires_in": 1800,
450
+ * "success_redirect": null,
451
+ * "error_redirect": null
452
+ * }
453
+ */
454
+ verification: components["schemas"]["EmailVerification"];
455
+ };
456
+ /**
457
+ * @example {
458
+ * "email": "example@email.com"
459
+ * }
460
+ */
461
+ EmailRequest: {
462
+ email: string;
463
+ };
464
+ EmailVerification: {
465
+ /** @default null */
466
+ error_redirect: string | null;
467
+ /** @default false */
468
+ required: boolean;
469
+ /** @default null */
470
+ success_redirect: string | null;
471
+ /**
472
+ * Format: int64
473
+ * @default 1800
474
+ */
475
+ token_expires_in: number;
476
+ };
477
+ /** @enum {string} */
478
+ ErrorCode: "TokenExpired" | "TokenReplay" | "TokenInvalid" | "InvalidCredentials" | "AccountNotVerified" | "TokenInvalidSignature" | "TokenInvalidAudience" | "TokenInvalidIssuer" | "TokenInvalidAlgorithm" | "TokenMalformed" | "InsufficientPermissions" | "AccountSuspended" | "RoleNotFound" | "UserNotFound" | "TokenNotFound" | "AlreadyExists" | "ValidationFailed" | "MalformedField" | "MissingField" | "UnsupportedMediaType" | "BadRequest" | "RateLimitExceeded" | "Internal";
479
+ /**
480
+ * @example {
481
+ * "message": "An Error occured"
482
+ * }
483
+ */
484
+ ErrorResponse: {
485
+ code: components["schemas"]["ErrorCode"];
486
+ message: string;
487
+ };
488
+ /**
489
+ * @example {
490
+ * "link": "",
491
+ * "expires_at": "2026-02-19T22:42:23.467Z"
492
+ * }
493
+ */
494
+ ExpiringLink: {
495
+ /** Format: date-time */
496
+ expires_at: string;
497
+ link: string;
498
+ };
499
+ HashingAlgorithm: {
500
+ /** Format: int32 */
501
+ iterations: number;
502
+ /** Format: int32 */
503
+ memory_kib: number;
504
+ /** Format: int32 */
505
+ parallelism: number;
506
+ /** @enum {string} */
507
+ type: "Argon2";
508
+ } | {
509
+ /** Format: int32 */
510
+ cost: number;
511
+ /** @enum {string} */
512
+ type: "Bcrypt";
513
+ };
514
+ HttpsConfig: {
515
+ /** @default null */
516
+ cert_path: string | null;
517
+ /** @default false */
518
+ enabled: boolean;
519
+ /** @default null */
520
+ key_path: string | null;
521
+ /**
522
+ * Format: int32
523
+ * @default 3000
524
+ */
525
+ port: number;
526
+ };
527
+ JwtConfig: {
528
+ /**
529
+ * Format: int64
530
+ * @default 900
531
+ */
532
+ access_token_expires_in: number;
533
+ /** @default HS256 */
534
+ algorithm: components["schemas"]["AlgorithmConfig"];
535
+ /** @default */
536
+ audience: string;
537
+ /** @default */
538
+ issuer: string;
539
+ /**
540
+ * Format: int64
541
+ * @default 604800
542
+ */
543
+ refresh_token_expires_in: number;
544
+ };
545
+ /**
546
+ * @example {
547
+ * "email": "example@email.com",
548
+ * "password": "password"
549
+ * }
550
+ */
551
+ LoginRequest: {
552
+ email: string;
553
+ password: string;
554
+ };
555
+ PasswordConfig: {
556
+ /**
557
+ * @default {
558
+ * "type": "Argon2",
559
+ * "memory_kib": 19456,
560
+ * "iterations": 2,
561
+ * "parallelism": 1
562
+ * }
563
+ */
564
+ algorithm: components["schemas"]["HashingAlgorithm"];
565
+ /**
566
+ * @default {
567
+ * "min_length": 8,
568
+ * "max_length": 128,
569
+ * "require_uppercase": false,
570
+ * "require_number": false,
571
+ * "require_special_char": false
572
+ * }
573
+ */
574
+ requirements: components["schemas"]["PasswordRequirements"];
575
+ /**
576
+ * @default {
577
+ * "token_expires_in": 1800,
578
+ * "success_redirect": null,
579
+ * "error_redirect": null
580
+ * }
581
+ */
582
+ reset: components["schemas"]["PasswordReset"];
583
+ /**
584
+ * @default {
585
+ * "max_failed_attempts": 5,
586
+ * "lockout_duration": 1800
587
+ * }
588
+ */
589
+ security: components["schemas"]["PasswordSecurity"];
590
+ };
591
+ PasswordRequirements: {
592
+ /**
593
+ * Format: int32
594
+ * @default 128
595
+ */
596
+ max_length: number;
597
+ /**
598
+ * Format: int32
599
+ * @default 8
600
+ */
601
+ min_length: number;
602
+ /** @default false */
603
+ require_number: boolean;
604
+ /** @default false */
605
+ require_special_char: boolean;
606
+ /** @default false */
607
+ require_uppercase: boolean;
608
+ };
609
+ PasswordReset: {
610
+ /** @default null */
611
+ error_redirect: string | null;
612
+ /** @default null */
613
+ success_redirect: string | null;
614
+ /**
615
+ * Format: int64
616
+ * @default 1800
617
+ */
618
+ token_expires_in: number;
619
+ };
620
+ PasswordSecurity: {
621
+ /**
622
+ * Format: int64
623
+ * @default 1800
624
+ */
625
+ lockout_duration: number;
626
+ /**
627
+ * Format: int32
628
+ * @default 5
629
+ */
630
+ max_failed_attempts: number;
631
+ };
632
+ PermissionId: {
633
+ permission_id: string;
634
+ };
635
+ /**
636
+ * @example {
637
+ * "action": "read",
638
+ * "resource": "user"
639
+ * }
640
+ */
641
+ PermissionName: {
642
+ action: string;
643
+ resource: string;
644
+ };
645
+ RbacConfig: {
646
+ /** @default User */
647
+ default_role: string;
648
+ /** @default false */
649
+ enabled: boolean;
650
+ /**
651
+ * @default [
652
+ * {
653
+ * "name": "User",
654
+ * "permissions": [
655
+ * "*:read"
656
+ * ]
657
+ * }
658
+ * ]
659
+ */
660
+ roles: components["schemas"]["RoleConfig"][];
661
+ };
662
+ /**
663
+ * @example {
664
+ * "refresh_token": "edc365fa5e13751XXXXXXX"
665
+ * }
666
+ */
667
+ RefreshTokenRequest: {
668
+ /** Format: password */
669
+ refresh_token: string;
670
+ };
671
+ /**
672
+ * @example {
673
+ * "username": "name",
674
+ * "email": "example@email.com",
675
+ * "password": "password"
676
+ * }
677
+ */
678
+ RegisterRequest: {
679
+ email: string;
680
+ password: string;
681
+ username: string;
682
+ };
683
+ /**
684
+ * @example {
685
+ * "token": "",
686
+ * "csrf_token": "",
687
+ * "password": ""
688
+ * }
689
+ */
690
+ ResetPasswordRequest: {
691
+ /** Format: password */
692
+ csrf_token: string;
693
+ password: string;
694
+ /** Format: password */
695
+ token: string;
696
+ };
697
+ RoleConfig: {
698
+ name: string;
699
+ permissions: string[];
700
+ };
701
+ RoleName: {
702
+ name: string;
703
+ };
704
+ /**
705
+ * @example {
706
+ * "role": "admin"
707
+ * }
708
+ */
709
+ RoleRequest: {
710
+ role: string;
711
+ };
712
+ /** @enum {string} */
713
+ SameSiteConfig: "Strict" | "Lax" | "None";
714
+ Security: {
715
+ headers?: [
716
+ string,
717
+ string
718
+ ][];
719
+ };
720
+ Server: {
721
+ /**
722
+ * @default {
723
+ * "enabled": true,
724
+ * "allowed_origins": [
725
+ * "localhost:3000"
726
+ * ],
727
+ * "allowed_methods": [
728
+ * "GET",
729
+ * "POST",
730
+ * "PUT",
731
+ * "DELETE",
732
+ * "OPTIONS"
733
+ * ],
734
+ * "allowed_headers": [
735
+ * "authorization",
736
+ * "content-type",
737
+ * "accept",
738
+ * "accept-language",
739
+ * "Content-Language"
740
+ * ],
741
+ * "allow_credentials": true,
742
+ * "max_age": 3600
743
+ * }
744
+ */
745
+ cors: components["schemas"]["CorsConfig"];
746
+ /**
747
+ * @default {
748
+ * "enabled": false,
749
+ * "port": 3000,
750
+ * "cert_path": null,
751
+ * "key_path": null
752
+ * }
753
+ */
754
+ https: components["schemas"]["HttpsConfig"];
755
+ };
756
+ /**
757
+ * @example {
758
+ * "id": "",
759
+ * "user_id": "",
760
+ * "issued_at": "2026-02-19T22:42:23.467Z",
761
+ * "expires_at": "2026-02-19T22:42:23.467Z",
762
+ * "used_at": "2026-02-19T22:42:23.467Z",
763
+ * "token": ""
764
+ * }
765
+ */
766
+ Session: {
767
+ _id?: string | null;
768
+ /** Format: date-time */
769
+ expiresAt: string;
770
+ /** Format: date-time */
771
+ issuedAt: string;
772
+ token: string;
773
+ /** Format: date-time */
774
+ usedAt?: string | null;
775
+ userId?: string;
776
+ };
777
+ SessionConfig: {
778
+ /** @default true */
779
+ http_only: boolean;
780
+ /**
781
+ * Format: int64
782
+ * @default 3600
783
+ */
784
+ max_age: number;
785
+ /** @default id */
786
+ name: string;
787
+ /** @default Strict */
788
+ same_site: components["schemas"]["SameSiteConfig"];
789
+ /** @default true */
790
+ secure: boolean;
791
+ };
792
+ /**
793
+ * @description SessionTokens model
794
+ * @example {
795
+ * "access": "",
796
+ * "expires_in": 3600,
797
+ * "token_type": "Bearer",
798
+ * "refresh": ""
799
+ * }
800
+ */
801
+ SessionTokens: {
802
+ access: string;
803
+ /** Format: int64 */
804
+ expires_in: number;
805
+ refresh: string;
806
+ token_type: string;
807
+ };
808
+ /**
809
+ * @example {
810
+ * "token": "edc365fa5e13751XXXXXXX"
811
+ * }
812
+ */
813
+ TokenQuery: {
814
+ /** Format: password */
815
+ token: string;
816
+ };
817
+ /**
818
+ * @example {
819
+ * "id": "",
820
+ * "username": "",
821
+ * "email": "",
822
+ * "created_at": "2026-02-19T22:42:23.467Z"
823
+ * }
824
+ */
825
+ User: {
826
+ _id?: string | null;
827
+ /** Format: date-time */
828
+ createdAt: string;
829
+ email: string;
830
+ username: string;
831
+ };
832
+ };
833
+ responses: never;
834
+ parameters: never;
835
+ requestBodies: never;
836
+ headers: never;
837
+ pathItems: never;
1080
838
  }
1081
-
1082
- /**
1083
- * EmailApi - axios parameter creator
1084
- */
1085
- declare const EmailApiAxiosParamCreator: (configuration?: Configuration) => {
1086
- /**
1087
- * Validates the email token and update the user account.
1088
- * @summary Verify user email
1089
- * @param {TokenQuery} token Email Verification Token
1090
- * @param {*} [options] Override http request option.
1091
- * @throws {RequiredError}
1092
- */
1093
- verifyEmail: (token: TokenQuery, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1094
- };
1095
- /**
1096
- * EmailApi - functional programming interface
1097
- */
1098
- declare const EmailApiFp: (configuration?: Configuration) => {
1099
- /**
1100
- * Validates the email token and update the user account.
1101
- * @summary Verify user email
1102
- * @param {TokenQuery} token Email Verification Token
1103
- * @param {*} [options] Override http request option.
1104
- * @throws {RequiredError}
1105
- */
1106
- verifyEmail(token: TokenQuery, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
1107
- };
1108
- /**
1109
- * EmailApi - factory interface
1110
- */
1111
- declare const EmailApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
1112
- /**
1113
- * Validates the email token and update the user account.
1114
- * @summary Verify user email
1115
- * @param {TokenQuery} token Email Verification Token
1116
- * @param {*} [options] Override http request option.
1117
- * @throws {RequiredError}
1118
- */
1119
- verifyEmail(token: TokenQuery, options?: RawAxiosRequestConfig): AxiosPromise<void>;
1120
- };
1121
- /**
1122
- * EmailApi - object-oriented interface
1123
- */
1124
- declare class EmailApi extends BaseAPI {
1125
- /**
1126
- * Validates the email token and update the user account.
1127
- * @summary Verify user email
1128
- * @param {TokenQuery} token Email Verification Token
1129
- * @param {*} [options] Override http request option.
1130
- * @throws {RequiredError}
1131
- */
1132
- verifyEmail(token: TokenQuery, options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<void, any, {}>>;
839
+ interface operations {
840
+ login: {
841
+ parameters: {
842
+ query?: never;
843
+ header?: never;
844
+ path?: never;
845
+ cookie?: never;
846
+ };
847
+ /** @description User login credentials */
848
+ requestBody: {
849
+ content: {
850
+ "application/json": components["schemas"]["LoginRequest"];
851
+ };
852
+ };
853
+ responses: {
854
+ /** @description Authentication successful */
855
+ 200: {
856
+ headers: {
857
+ /** @description Session cookie (session strategy only). Format: id=<session_id>; HttpOnly; Secure; SameSite=Strict */
858
+ "Set-Cookie"?: string;
859
+ [name: string]: unknown;
860
+ };
861
+ content: {
862
+ "application/json": components["schemas"]["AuthResponse"];
863
+ };
864
+ };
865
+ /** @description Malformed request or validation error */
866
+ 400: {
867
+ headers: {
868
+ [name: string]: unknown;
869
+ };
870
+ content: {
871
+ "application/json": components["schemas"]["ErrorResponse"];
872
+ };
873
+ };
874
+ /** @description Invalid email or password */
875
+ 401: {
876
+ headers: {
877
+ [name: string]: unknown;
878
+ };
879
+ content: {
880
+ "application/json": components["schemas"]["ErrorResponse"];
881
+ };
882
+ };
883
+ /** @description Unexpected server error */
884
+ 500: {
885
+ headers: {
886
+ [name: string]: unknown;
887
+ };
888
+ content: {
889
+ "application/json": components["schemas"]["ErrorResponse"];
890
+ };
891
+ };
892
+ };
893
+ };
894
+ logout: {
895
+ parameters: {
896
+ query?: never;
897
+ header?: never;
898
+ path?: never;
899
+ cookie?: never;
900
+ };
901
+ /** @description Refresh token to invalidate */
902
+ requestBody: {
903
+ content: {
904
+ "application/json": components["schemas"]["RefreshTokenRequest"];
905
+ };
906
+ };
907
+ responses: {
908
+ /** @description Logged out successfully — session and refresh token invalidated */
909
+ 200: {
910
+ headers: {
911
+ [name: string]: unknown;
912
+ };
913
+ content?: never;
914
+ };
915
+ /** @description Malformed request or missing refresh token */
916
+ 400: {
917
+ headers: {
918
+ [name: string]: unknown;
919
+ };
920
+ content: {
921
+ "application/json": components["schemas"]["ErrorResponse"];
922
+ };
923
+ };
924
+ /** @description Missing or expired credentials */
925
+ 401: {
926
+ headers: {
927
+ [name: string]: unknown;
928
+ };
929
+ content: {
930
+ "application/json": components["schemas"]["ErrorResponse"];
931
+ };
932
+ };
933
+ /** @description Unexpected server error */
934
+ 500: {
935
+ headers: {
936
+ [name: string]: unknown;
937
+ };
938
+ content: {
939
+ "application/json": components["schemas"]["ErrorResponse"];
940
+ };
941
+ };
942
+ };
943
+ };
944
+ forgotPassword: {
945
+ parameters: {
946
+ query?: never;
947
+ header?: never;
948
+ path?: never;
949
+ cookie?: never;
950
+ };
951
+ /** @description Email address to send the reset link to */
952
+ requestBody: {
953
+ content: {
954
+ "application/json": components["schemas"]["EmailRequest"];
955
+ };
956
+ };
957
+ responses: {
958
+ /** @description Reset email sent if an account with that address exists */
959
+ 200: {
960
+ headers: {
961
+ [name: string]: unknown;
962
+ };
963
+ content: {
964
+ "application/json": components["schemas"]["ExpiringLink"];
965
+ };
966
+ };
967
+ /** @description Malformed request or invalid email format */
968
+ 400: {
969
+ headers: {
970
+ [name: string]: unknown;
971
+ };
972
+ content: {
973
+ "application/json": components["schemas"]["ErrorResponse"];
974
+ };
975
+ };
976
+ /** @description Unexpected server error */
977
+ 500: {
978
+ headers: {
979
+ [name: string]: unknown;
980
+ };
981
+ content: {
982
+ "application/json": components["schemas"]["ErrorResponse"];
983
+ };
984
+ };
985
+ };
986
+ };
987
+ renderPasswordResetForm: {
988
+ parameters: {
989
+ query: {
990
+ /** @description Single-use password reset token from the email link */
991
+ token: string;
992
+ };
993
+ header?: never;
994
+ path?: never;
995
+ cookie?: never;
996
+ };
997
+ requestBody?: never;
998
+ responses: {
999
+ /** @description Token valid — password reset form returned */
1000
+ 200: {
1001
+ headers: {
1002
+ [name: string]: unknown;
1003
+ };
1004
+ content: {
1005
+ "text/html": string;
1006
+ };
1007
+ };
1008
+ /** @description Malformed request or missing token */
1009
+ 400: {
1010
+ headers: {
1011
+ [name: string]: unknown;
1012
+ };
1013
+ content: {
1014
+ "application/json": components["schemas"]["ErrorResponse"];
1015
+ };
1016
+ };
1017
+ /** @description Reset token invalid or expired */
1018
+ 401: {
1019
+ headers: {
1020
+ [name: string]: unknown;
1021
+ };
1022
+ content: {
1023
+ "application/json": components["schemas"]["ErrorResponse"];
1024
+ };
1025
+ };
1026
+ /** @description Unexpected server error */
1027
+ 500: {
1028
+ headers: {
1029
+ [name: string]: unknown;
1030
+ };
1031
+ content: {
1032
+ "application/json": components["schemas"]["ErrorResponse"];
1033
+ };
1034
+ };
1035
+ };
1036
+ };
1037
+ submitNewPassword: {
1038
+ parameters: {
1039
+ query?: never;
1040
+ header?: never;
1041
+ path?: never;
1042
+ cookie?: never;
1043
+ };
1044
+ /** @description Reset token, CSRF token, and new password */
1045
+ requestBody: {
1046
+ content: {
1047
+ "application/x-www-form-urlencoded": components["schemas"]["ResetPasswordRequest"];
1048
+ };
1049
+ };
1050
+ responses: {
1051
+ /** @description Password reset successful — redirects to success page */
1052
+ 302: {
1053
+ headers: {
1054
+ /** @description URL of the post-reset success page */
1055
+ Location?: string;
1056
+ [name: string]: unknown;
1057
+ };
1058
+ content?: never;
1059
+ };
1060
+ /** @description Malformed request or validation error */
1061
+ 400: {
1062
+ headers: {
1063
+ [name: string]: unknown;
1064
+ };
1065
+ content: {
1066
+ "application/json": components["schemas"]["ErrorResponse"];
1067
+ };
1068
+ };
1069
+ /** @description Reset token or CSRF token invalid or expired */
1070
+ 401: {
1071
+ headers: {
1072
+ [name: string]: unknown;
1073
+ };
1074
+ content: {
1075
+ "application/json": components["schemas"]["ErrorResponse"];
1076
+ };
1077
+ };
1078
+ /** @description Unexpected server error */
1079
+ 500: {
1080
+ headers: {
1081
+ [name: string]: unknown;
1082
+ };
1083
+ content: {
1084
+ "application/json": components["schemas"]["ErrorResponse"];
1085
+ };
1086
+ };
1087
+ };
1088
+ };
1089
+ refreshToken: {
1090
+ parameters: {
1091
+ query?: never;
1092
+ header?: never;
1093
+ path?: never;
1094
+ cookie?: never;
1095
+ };
1096
+ /** @description Valid refresh token */
1097
+ requestBody: {
1098
+ content: {
1099
+ "application/json": components["schemas"]["RefreshTokenRequest"];
1100
+ };
1101
+ };
1102
+ responses: {
1103
+ /** @description New access token issued successfully */
1104
+ 200: {
1105
+ headers: {
1106
+ [name: string]: unknown;
1107
+ };
1108
+ content: {
1109
+ "application/json": components["schemas"]["AuthResponse"];
1110
+ };
1111
+ };
1112
+ /** @description Malformed request or missing refresh token */
1113
+ 400: {
1114
+ headers: {
1115
+ [name: string]: unknown;
1116
+ };
1117
+ content: {
1118
+ "application/json": components["schemas"]["ErrorResponse"];
1119
+ };
1120
+ };
1121
+ /** @description Refresh token invalid, expired, or already rotated */
1122
+ 401: {
1123
+ headers: {
1124
+ [name: string]: unknown;
1125
+ };
1126
+ content: {
1127
+ "application/json": components["schemas"]["ErrorResponse"];
1128
+ };
1129
+ };
1130
+ /** @description Unexpected server error */
1131
+ 500: {
1132
+ headers: {
1133
+ [name: string]: unknown;
1134
+ };
1135
+ content: {
1136
+ "application/json": components["schemas"]["ErrorResponse"];
1137
+ };
1138
+ };
1139
+ };
1140
+ };
1141
+ register: {
1142
+ parameters: {
1143
+ query?: never;
1144
+ header?: never;
1145
+ path?: never;
1146
+ cookie?: never;
1147
+ };
1148
+ /** @description User register credentials */
1149
+ requestBody: {
1150
+ content: {
1151
+ "application/json": components["schemas"]["RegisterRequest"];
1152
+ };
1153
+ };
1154
+ responses: {
1155
+ /** @description User registered successfully */
1156
+ 201: {
1157
+ headers: {
1158
+ /** @description Session cookie (session strategy only). Format: id=<session_id>; HttpOnly; Secure; SameSite=Strict */
1159
+ "Set-Cookie"?: string;
1160
+ [name: string]: unknown;
1161
+ };
1162
+ content: {
1163
+ "application/json": components["schemas"]["AuthResponse"];
1164
+ };
1165
+ };
1166
+ /** @description Malformed request or validation error */
1167
+ 400: {
1168
+ headers: {
1169
+ [name: string]: unknown;
1170
+ };
1171
+ content: {
1172
+ "application/json": components["schemas"]["ErrorResponse"];
1173
+ };
1174
+ };
1175
+ /** @description Email already registered */
1176
+ 409: {
1177
+ headers: {
1178
+ [name: string]: unknown;
1179
+ };
1180
+ content: {
1181
+ "application/json": components["schemas"]["ErrorResponse"];
1182
+ };
1183
+ };
1184
+ /** @description Unexpected server error */
1185
+ 500: {
1186
+ headers: {
1187
+ [name: string]: unknown;
1188
+ };
1189
+ content: {
1190
+ "application/json": components["schemas"]["ErrorResponse"];
1191
+ };
1192
+ };
1193
+ };
1194
+ };
1195
+ getSession: {
1196
+ parameters: {
1197
+ query?: never;
1198
+ header?: never;
1199
+ path?: never;
1200
+ cookie?: never;
1201
+ };
1202
+ requestBody?: never;
1203
+ responses: {
1204
+ /** @description Session data returned successfully */
1205
+ 200: {
1206
+ headers: {
1207
+ [name: string]: unknown;
1208
+ };
1209
+ content: {
1210
+ "application/json": components["schemas"]["Session"];
1211
+ };
1212
+ };
1213
+ /** @description Missing or expired credentials */
1214
+ 401: {
1215
+ headers: {
1216
+ [name: string]: unknown;
1217
+ };
1218
+ content: {
1219
+ "application/json": components["schemas"]["ErrorResponse"];
1220
+ };
1221
+ };
1222
+ /** @description Account suspended or unverified */
1223
+ 403: {
1224
+ headers: {
1225
+ [name: string]: unknown;
1226
+ };
1227
+ content: {
1228
+ "application/json": components["schemas"]["ErrorResponse"];
1229
+ };
1230
+ };
1231
+ /** @description Unexpected server error */
1232
+ 500: {
1233
+ headers: {
1234
+ [name: string]: unknown;
1235
+ };
1236
+ content: {
1237
+ "application/json": components["schemas"]["ErrorResponse"];
1238
+ };
1239
+ };
1240
+ };
1241
+ };
1242
+ verify_email: {
1243
+ parameters: {
1244
+ query: {
1245
+ /** @description One-time email verification token issued during registration */
1246
+ token: string;
1247
+ };
1248
+ header?: never;
1249
+ path?: never;
1250
+ cookie?: never;
1251
+ };
1252
+ requestBody?: never;
1253
+ responses: {
1254
+ /** @description Token is valid — redirects to the success page */
1255
+ 302: {
1256
+ headers: {
1257
+ /** @description URL of the post-verification success page */
1258
+ Location?: string;
1259
+ [name: string]: unknown;
1260
+ };
1261
+ content?: never;
1262
+ };
1263
+ /** @description Token is missing, malformed, or already used */
1264
+ 400: {
1265
+ headers: {
1266
+ [name: string]: unknown;
1267
+ };
1268
+ content: {
1269
+ "application/json": components["schemas"]["ErrorResponse"];
1270
+ };
1271
+ };
1272
+ /** @description Unexpected server error */
1273
+ 500: {
1274
+ headers: {
1275
+ [name: string]: unknown;
1276
+ };
1277
+ content: {
1278
+ "application/json": components["schemas"]["ErrorResponse"];
1279
+ };
1280
+ };
1281
+ };
1282
+ };
1283
+ createPermission: {
1284
+ parameters: {
1285
+ query?: never;
1286
+ header?: never;
1287
+ path?: never;
1288
+ cookie?: never;
1289
+ };
1290
+ /** @description Permission definition */
1291
+ requestBody: {
1292
+ content: {
1293
+ "application/json": components["schemas"]["PermissionName"];
1294
+ };
1295
+ };
1296
+ responses: {
1297
+ /** @description Permission upserted successfully */
1298
+ 200: {
1299
+ headers: {
1300
+ [name: string]: unknown;
1301
+ };
1302
+ content?: never;
1303
+ };
1304
+ /** @description Missing or expired credentials */
1305
+ 401: {
1306
+ headers: {
1307
+ [name: string]: unknown;
1308
+ };
1309
+ content: {
1310
+ "application/json": components["schemas"]["ErrorResponse"];
1311
+ };
1312
+ };
1313
+ /** @description Insufficient privileges */
1314
+ 403: {
1315
+ headers: {
1316
+ [name: string]: unknown;
1317
+ };
1318
+ content: {
1319
+ "application/json": components["schemas"]["ErrorResponse"];
1320
+ };
1321
+ };
1322
+ /** @description Unexpected server error */
1323
+ 500: {
1324
+ headers: {
1325
+ [name: string]: unknown;
1326
+ };
1327
+ content: {
1328
+ "application/json": components["schemas"]["ErrorResponse"];
1329
+ };
1330
+ };
1331
+ };
1332
+ };
1333
+ createRole: {
1334
+ parameters: {
1335
+ query?: never;
1336
+ header?: never;
1337
+ path?: never;
1338
+ cookie?: never;
1339
+ };
1340
+ /** @description Role definition */
1341
+ requestBody: {
1342
+ content: {
1343
+ "application/json": components["schemas"]["RoleName"];
1344
+ };
1345
+ };
1346
+ responses: {
1347
+ /** @description Role upserted successfully */
1348
+ 200: {
1349
+ headers: {
1350
+ [name: string]: unknown;
1351
+ };
1352
+ content?: never;
1353
+ };
1354
+ /** @description Missing or expired credentials */
1355
+ 401: {
1356
+ headers: {
1357
+ [name: string]: unknown;
1358
+ };
1359
+ content: {
1360
+ "application/json": components["schemas"]["ErrorResponse"];
1361
+ };
1362
+ };
1363
+ /** @description Insufficient privileges */
1364
+ 403: {
1365
+ headers: {
1366
+ [name: string]: unknown;
1367
+ };
1368
+ content: {
1369
+ "application/json": components["schemas"]["ErrorResponse"];
1370
+ };
1371
+ };
1372
+ /** @description Unexpected server error */
1373
+ 500: {
1374
+ headers: {
1375
+ [name: string]: unknown;
1376
+ };
1377
+ content: {
1378
+ "application/json": components["schemas"]["ErrorResponse"];
1379
+ };
1380
+ };
1381
+ };
1382
+ };
1383
+ assignPermissionToRole: {
1384
+ parameters: {
1385
+ query?: never;
1386
+ header?: never;
1387
+ path: {
1388
+ /** @description Role ID to assign the permission to */
1389
+ id: string;
1390
+ };
1391
+ cookie?: never;
1392
+ };
1393
+ /** @description Permission to assign */
1394
+ requestBody: {
1395
+ content: {
1396
+ "application/json": components["schemas"]["PermissionId"];
1397
+ };
1398
+ };
1399
+ responses: {
1400
+ /** @description Permission successfully assigned to role */
1401
+ 200: {
1402
+ headers: {
1403
+ [name: string]: unknown;
1404
+ };
1405
+ content?: never;
1406
+ };
1407
+ /** @description Missing or expired credentials */
1408
+ 401: {
1409
+ headers: {
1410
+ [name: string]: unknown;
1411
+ };
1412
+ content: {
1413
+ "application/json": components["schemas"]["ErrorResponse"];
1414
+ };
1415
+ };
1416
+ /** @description Insufficient privileges */
1417
+ 403: {
1418
+ headers: {
1419
+ [name: string]: unknown;
1420
+ };
1421
+ content: {
1422
+ "application/json": components["schemas"]["ErrorResponse"];
1423
+ };
1424
+ };
1425
+ /** @description Role or permission not found */
1426
+ 404: {
1427
+ headers: {
1428
+ [name: string]: unknown;
1429
+ };
1430
+ content: {
1431
+ "application/json": components["schemas"]["ErrorResponse"];
1432
+ };
1433
+ };
1434
+ /** @description Unexpected server error */
1435
+ 500: {
1436
+ headers: {
1437
+ [name: string]: unknown;
1438
+ };
1439
+ content: {
1440
+ "application/json": components["schemas"]["ErrorResponse"];
1441
+ };
1442
+ };
1443
+ };
1444
+ };
1445
+ find_user: {
1446
+ parameters: {
1447
+ query?: never;
1448
+ header?: never;
1449
+ path?: never;
1450
+ cookie?: never;
1451
+ };
1452
+ requestBody?: never;
1453
+ responses: {
1454
+ /** @description Authenticated user's profile returned successfully */
1455
+ 200: {
1456
+ headers: {
1457
+ [name: string]: unknown;
1458
+ };
1459
+ content: {
1460
+ "application/json": components["schemas"]["User"];
1461
+ };
1462
+ };
1463
+ /** @description Missing or expired credentials */
1464
+ 401: {
1465
+ headers: {
1466
+ [name: string]: unknown;
1467
+ };
1468
+ content: {
1469
+ "application/json": components["schemas"]["ErrorResponse"];
1470
+ };
1471
+ };
1472
+ /** @description Authenticated token is valid but user no longer exists */
1473
+ 404: {
1474
+ headers: {
1475
+ [name: string]: unknown;
1476
+ };
1477
+ content: {
1478
+ "application/json": components["schemas"]["ErrorResponse"];
1479
+ };
1480
+ };
1481
+ /** @description Unexpected server error */
1482
+ 500: {
1483
+ headers: {
1484
+ [name: string]: unknown;
1485
+ };
1486
+ content: {
1487
+ "application/json": components["schemas"]["ErrorResponse"];
1488
+ };
1489
+ };
1490
+ };
1491
+ };
1492
+ assign_role: {
1493
+ parameters: {
1494
+ query?: never;
1495
+ header?: never;
1496
+ path?: never;
1497
+ cookie?: never;
1498
+ };
1499
+ /** @description Role assignment payload */
1500
+ requestBody: {
1501
+ content: {
1502
+ "application/json": components["schemas"]["RoleRequest"];
1503
+ };
1504
+ };
1505
+ responses: {
1506
+ /** @description Role successfully assigned — returns updated user profile */
1507
+ 200: {
1508
+ headers: {
1509
+ [name: string]: unknown;
1510
+ };
1511
+ content: {
1512
+ "application/json": components["schemas"]["User"];
1513
+ };
1514
+ };
1515
+ /** @description Missing or expired credentials */
1516
+ 401: {
1517
+ headers: {
1518
+ [name: string]: unknown;
1519
+ };
1520
+ content: {
1521
+ "application/json": components["schemas"]["ErrorResponse"];
1522
+ };
1523
+ };
1524
+ /** @description Authenticated user does not have permission to assign roles */
1525
+ 403: {
1526
+ headers: {
1527
+ [name: string]: unknown;
1528
+ };
1529
+ content: {
1530
+ "application/json": components["schemas"]["ErrorResponse"];
1531
+ };
1532
+ };
1533
+ /** @description Target user not found */
1534
+ 404: {
1535
+ headers: {
1536
+ [name: string]: unknown;
1537
+ };
1538
+ content: {
1539
+ "application/json": components["schemas"]["ErrorResponse"];
1540
+ };
1541
+ };
1542
+ /** @description Unexpected server error */
1543
+ 500: {
1544
+ headers: {
1545
+ [name: string]: unknown;
1546
+ };
1547
+ content: {
1548
+ "application/json": components["schemas"]["ErrorResponse"];
1549
+ };
1550
+ };
1551
+ };
1552
+ };
1133
1553
  }
1134
1554
 
1135
- /**
1136
- * UsersApi - axios parameter creator
1137
- */
1138
- declare const UsersApiAxiosParamCreator: (configuration?: Configuration) => {
1139
- /**
1140
- * Returns the currently authenticated user\'s data. Requires a valid Bearer token.
1141
- * @summary Get current User
1142
- * @param {*} [options] Override http request option.
1143
- * @throws {RequiredError}
1144
- */
1145
- findUser: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1146
- };
1147
- /**
1148
- * UsersApi - functional programming interface
1149
- */
1150
- declare const UsersApiFp: (configuration?: Configuration) => {
1151
- /**
1152
- * Returns the currently authenticated user\'s data. Requires a valid Bearer token.
1153
- * @summary Get current User
1154
- * @param {*} [options] Override http request option.
1155
- * @throws {RequiredError}
1156
- */
1157
- findUser(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>>;
1158
- };
1159
- /**
1160
- * UsersApi - factory interface
1161
- */
1162
- declare const UsersApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
1163
- /**
1164
- * Returns the currently authenticated user\'s data. Requires a valid Bearer token.
1165
- * @summary Get current User
1166
- * @param {*} [options] Override http request option.
1167
- * @throws {RequiredError}
1168
- */
1169
- findUser(options?: RawAxiosRequestConfig): AxiosPromise<User>;
1170
- };
1171
- /**
1172
- * UsersApi - object-oriented interface
1173
- */
1174
- declare class UsersApi extends BaseAPI {
1175
- /**
1176
- * Returns the currently authenticated user\'s data. Requires a valid Bearer token.
1177
- * @summary Get current User
1178
- * @param {*} [options] Override http request option.
1179
- * @throws {RequiredError}
1180
- */
1181
- findUser(options?: RawAxiosRequestConfig): Promise<axios.AxiosResponse<User, any, {}>>;
1182
- }
1555
+ declare const api: openapi_fetch.Client<paths, `${string}/${string}`>;
1183
1556
 
1184
- export { AlgorithmConfig, type AnzarConfiguration, type App, AuthApi, AuthApiAxiosParamCreator, AuthApiFactory, AuthApiFp, type AuthResponse, AuthStrategy, type Authentication, type Cache, CacheDriver, Configuration, type ConfigurationParameters, type CorsConfig, type Database, DatabaseDriver, EmailApi, EmailApiAxiosParamCreator, EmailApiFactory, EmailApiFp, type EmailConfig, type EmailRequest, type EmailVerification, ErrorCode, type ErrorResponse, type HttpsConfig, type JwtConfig, type LoginRequest, type PasswordConfig, type PasswordRequirements, type PasswordReset, type PasswordSecurity, type RefreshTokenRequest, type RegisterRequest, type ResetLink, type ResetPasswordRequest, Role, SameSiteConfig, type Security, type Server, type Session, type SessionConfig, type SessionTokens, type TokenQuery, type User, UsersApi, UsersApiAxiosParamCreator, UsersApiFactory, UsersApiFp, type Verification };
1557
+ export { api, type components, type paths };