synced api
6 files changed, +159 -0
+4-0rango/frontend/src/api/index.ts
| @@ -6,6 +6,10 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise'; | ||
| 6 | 6 | export { OpenAPI } from './core/OpenAPI'; |
| 7 | 7 | export type { OpenAPIConfig } from './core/OpenAPI'; |
| 8 | 8 | |
| 9 | +export type { logged_in } from './models/logged_in'; | |
| 10 | +export type { login } from './models/login'; | |
| 11 | +export type { logout } from './models/logout'; | |
| 9 | 12 | export type { user } from './models/user'; |
| 10 | 13 | |
| 14 | +export { AuthService } from './services/AuthService'; | |
| 11 | 15 | export { UserService } from './services/UserService'; |
+7-0rango/frontend/src/api/models/logged_in.ts
| @@ -0,0 +1,7 @@ | ||
| 1 | +/* istanbul ignore file */ | |
| 2 | +/* tslint:disable */ | |
| 3 | +/* eslint-disable */ | |
| 4 | + | |
| 5 | +export type logged_in = { | |
| 6 | + readonly detail?: boolean; | |
| 7 | +}; |
+9-0rango/frontend/src/api/models/login.ts
| @@ -0,0 +1,9 @@ | ||
| 1 | +/* istanbul ignore file */ | |
| 2 | +/* tslint:disable */ | |
| 3 | +/* eslint-disable */ | |
| 4 | + | |
| 5 | +export type login = { | |
| 6 | + username?: string; | |
| 7 | + email?: string; | |
| 8 | + password: string; | |
| 9 | +}; |
+7-0rango/frontend/src/api/models/logout.ts
| @@ -0,0 +1,7 @@ | ||
| 1 | +/* istanbul ignore file */ | |
| 2 | +/* tslint:disable */ | |
| 3 | +/* eslint-disable */ | |
| 4 | + | |
| 5 | +export type logout = { | |
| 6 | + readonly detail?: string; | |
| 7 | +}; |
+80-0rango/frontend/src/api/schema.yml
| @@ -138,6 +138,59 @@ paths: | ||
| 138 | 138 | description: '' |
| 139 | 139 | tags: |
| 140 | 140 | - User |
| 141 | + /api/auth/logout: | |
| 142 | + get: | |
| 143 | + operationId: retrieveLogout | |
| 144 | + description: '' | |
| 145 | + parameters: [] | |
| 146 | + responses: | |
| 147 | + '200': | |
| 148 | + content: | |
| 149 | + application/json: | |
| 150 | + schema: | |
| 151 | + $ref: '#/components/schemas/logout' | |
| 152 | + description: '' | |
| 153 | + tags: | |
| 154 | + - Auth | |
| 155 | + /api/auth/logged-in: | |
| 156 | + get: | |
| 157 | + operationId: retrieveLoggedIn | |
| 158 | + description: '' | |
| 159 | + parameters: [] | |
| 160 | + responses: | |
| 161 | + '200': | |
| 162 | + content: | |
| 163 | + application/json: | |
| 164 | + schema: | |
| 165 | + $ref: '#/components/schemas/logged-in' | |
| 166 | + description: '' | |
| 167 | + tags: | |
| 168 | + - Auth | |
| 169 | + /api/auth/login: | |
| 170 | + post: | |
| 171 | + operationId: createLogin | |
| 172 | + description: '' | |
| 173 | + parameters: [] | |
| 174 | + requestBody: | |
| 175 | + content: | |
| 176 | + application/json: | |
| 177 | + schema: | |
| 178 | + $ref: '#/components/schemas/login' | |
| 179 | + application/x-www-form-urlencoded: | |
| 180 | + schema: | |
| 181 | + $ref: '#/components/schemas/login' | |
| 182 | + multipart/form-data: | |
| 183 | + schema: | |
| 184 | + $ref: '#/components/schemas/login' | |
| 185 | + responses: | |
| 186 | + '201': | |
| 187 | + content: | |
| 188 | + application/json: | |
| 189 | + schema: | |
| 190 | + $ref: '#/components/schemas/login' | |
| 191 | + description: '' | |
| 192 | + tags: | |
| 193 | + - Auth | |
| 141 | 194 | components: |
| 142 | 195 | schemas: |
| 143 | 196 | user: |
| @@ -172,3 +225,30 @@ components: | ||
| 172 | 225 | required: |
| 173 | 226 | - username |
| 174 | 227 | - password |
| 228 | + logout: | |
| 229 | + type: object | |
| 230 | + properties: | |
| 231 | + detail: | |
| 232 | + type: string | |
| 233 | + readOnly: true | |
| 234 | + default: Success | |
| 235 | + logged-in: | |
| 236 | + type: object | |
| 237 | + properties: | |
| 238 | + detail: | |
| 239 | + type: boolean | |
| 240 | + readOnly: true | |
| 241 | + default: false | |
| 242 | + login: | |
| 243 | + type: object | |
| 244 | + properties: | |
| 245 | + username: | |
| 246 | + type: string | |
| 247 | + email: | |
| 248 | + type: string | |
| 249 | + format: email | |
| 250 | + password: | |
| 251 | + type: string | |
| 252 | + writeOnly: true | |
| 253 | + required: | |
| 254 | + - password |
+52-0rango/frontend/src/api/services/AuthService.ts
| @@ -0,0 +1,52 @@ | ||
| 1 | +/* istanbul ignore file */ | |
| 2 | +/* tslint:disable */ | |
| 3 | +/* eslint-disable */ | |
| 4 | +import type { logged_in } from '../models/logged_in'; | |
| 5 | +import type { login } from '../models/login'; | |
| 6 | +import type { logout } from '../models/logout'; | |
| 7 | + | |
| 8 | +import type { CancelablePromise } from '../core/CancelablePromise'; | |
| 9 | +import { OpenAPI } from '../core/OpenAPI'; | |
| 10 | +import { request as __request } from '../core/request'; | |
| 11 | + | |
| 12 | +export class AuthService { | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * @returns logout | |
| 16 | + * @throws ApiError | |
| 17 | + */ | |
| 18 | + public static retrieveLogout(): CancelablePromise<logout> { | |
| 19 | + return __request(OpenAPI, { | |
| 20 | + method: 'GET', | |
| 21 | + url: '/api/auth/logout', | |
| 22 | + }); | |
| 23 | + } | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * @returns logged_in | |
| 27 | + * @throws ApiError | |
| 28 | + */ | |
| 29 | + public static retrieveLoggedIn(): CancelablePromise<logged_in> { | |
| 30 | + return __request(OpenAPI, { | |
| 31 | + method: 'GET', | |
| 32 | + url: '/api/auth/logged-in', | |
| 33 | + }); | |
| 34 | + } | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * @param requestBody | |
| 38 | + * @returns login | |
| 39 | + * @throws ApiError | |
| 40 | + */ | |
| 41 | + public static createLogin( | |
| 42 | +requestBody?: login, | |
| 43 | +): CancelablePromise<login> { | |
| 44 | + return __request(OpenAPI, { | |
| 45 | + method: 'POST', | |
| 46 | + url: '/api/auth/login', | |
| 47 | + body: requestBody, | |
| 48 | + mediaType: 'application/json', | |
| 49 | + }); | |
| 50 | + } | |
| 51 | + | |
| 52 | +} |