feat(frontend/auth): Added way to automatically fetch providers
This allows the frontend to list all available providers without hardcoding them in.
This commit is contained in:
parent
9ce9fa44e4
commit
6d630fee92
22 changed files with 1448 additions and 221 deletions
|
|
@ -30,6 +30,10 @@ models/LoginOtp500Response.ts
|
|||
models/LoginOtpRequest.ts
|
||||
models/LoginRequest.ts
|
||||
models/Logout200Response.ts
|
||||
models/ProviderList200Response.ts
|
||||
models/ProviderList200ResponsePayload.ts
|
||||
models/ProviderList200ResponsePayloadListInner.ts
|
||||
models/ProviderList200ResponsePayloadListInnerColors.ts
|
||||
models/Signin200Response.ts
|
||||
models/Signin200ResponsePayload.ts
|
||||
models/Signin400Response.ts
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import type {
|
|||
LoginOtpRequest,
|
||||
LoginRequest,
|
||||
Logout200Response,
|
||||
ProviderList200Response,
|
||||
Signin200Response,
|
||||
Signin400Response,
|
||||
Signin500Response,
|
||||
|
|
@ -92,6 +93,8 @@ import {
|
|||
LoginRequestToJSON,
|
||||
Logout200ResponseFromJSON,
|
||||
Logout200ResponseToJSON,
|
||||
ProviderList200ResponseFromJSON,
|
||||
ProviderList200ResponseToJSON,
|
||||
Signin200ResponseFromJSON,
|
||||
Signin200ResponseToJSON,
|
||||
Signin400ResponseFromJSON,
|
||||
|
|
@ -515,6 +518,44 @@ export class OpenapiOtherApi extends runtime.BaseAPI {
|
|||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async providerListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProviderList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
|
||||
let urlPath = `/api/auth/providerList`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
// CHANGED: Handle all status codes defined in the OpenAPI spec, not just 2xx responses
|
||||
// This allows typed access to error responses (4xx, 5xx) and other status codes.
|
||||
// The code routes responses based on the actual HTTP status code and returns
|
||||
// appropriately typed ApiResponse wrappers for each status code.
|
||||
if (response.status === 200) {
|
||||
// Object response for status 200
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ProviderList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
// CHANGED: Throw error if status code is not handled by any of the defined responses
|
||||
// This ensures all code paths return a value and provides clear error messages for unexpected status codes
|
||||
// Only throw if responses were defined but none matched the actual status code
|
||||
throw new runtime.ResponseError(response, `Unexpected status code: ${response.status}. Expected one of: 200`);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async providerList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProviderList200Response> {
|
||||
const response = await this.providerListRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async signinRaw(requestParameters: SigninRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Signin200Response | Signin400Response | Signin500Response>> {
|
||||
|
|
|
|||
637
frontend/src/api/generated/docs/OpenapiOtherApi.md
Normal file
637
frontend/src/api/generated/docs/OpenapiOtherApi.md
Normal file
|
|
@ -0,0 +1,637 @@
|
|||
# OpenapiOtherApi
|
||||
|
||||
All URIs are relative to *https://local.maix.me:8888*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**disableOtp**](OpenapiOtherApi.md#disableotp) | **PUT** /api/auth/disableOtp | |
|
||||
| [**enableOtp**](OpenapiOtherApi.md#enableotp) | **PUT** /api/auth/enableOtp | |
|
||||
| [**getUser**](OpenapiOtherApi.md#getuser) | **GET** /api/user/info/{user} | |
|
||||
| [**guestLogin**](OpenapiOtherApi.md#guestlogin) | **POST** /api/auth/guest | |
|
||||
| [**login**](OpenapiOtherApi.md#loginoperation) | **POST** /api/auth/login | |
|
||||
| [**loginOtp**](OpenapiOtherApi.md#loginotpoperation) | **POST** /api/auth/otp | |
|
||||
| [**logout**](OpenapiOtherApi.md#logout) | **POST** /api/auth/logout | |
|
||||
| [**providerList**](OpenapiOtherApi.md#providerlist) | **GET** /api/auth/providerList | |
|
||||
| [**signin**](OpenapiOtherApi.md#signin) | **POST** /api/auth/signin | |
|
||||
| [**statusOtp**](OpenapiOtherApi.md#statusotp) | **GET** /api/auth/statusOtp | |
|
||||
|
||||
|
||||
|
||||
## disableOtp
|
||||
|
||||
> DisableOtp200Response disableOtp()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { DisableOtpRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.disableOtp();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**DisableOtp200Response**](DisableOtp200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **401** | Default Response | - |
|
||||
| **500** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## enableOtp
|
||||
|
||||
> EnableOtp200Response enableOtp()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { EnableOtpRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.enableOtp();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**EnableOtp200Response**](EnableOtp200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **401** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## getUser
|
||||
|
||||
> GetUser200Response getUser(user)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { GetUserRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
const body = {
|
||||
// GetUserUserParameter
|
||||
user: ...,
|
||||
} satisfies GetUserRequest;
|
||||
|
||||
try {
|
||||
const data = await api.getUser(body);
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **user** | [](.md) | | [Defaults to `undefined`] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**GetUser200Response**](GetUser200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **401** | Default Response | - |
|
||||
| **403** | Default Response | - |
|
||||
| **404** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## guestLogin
|
||||
|
||||
> GuestLogin200Response guestLogin()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { GuestLoginRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.guestLogin();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**GuestLogin200Response**](GuestLogin200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **500** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## login
|
||||
|
||||
> Login200Response login(loginRequest)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { LoginOperationRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
const body = {
|
||||
// LoginRequest
|
||||
loginRequest: ...,
|
||||
} satisfies LoginOperationRequest;
|
||||
|
||||
try {
|
||||
const data = await api.login(body);
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **loginRequest** | [LoginRequest](LoginRequest.md) | | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Login200Response**](Login200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **202** | Default Response | - |
|
||||
| **400** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## loginOtp
|
||||
|
||||
> LoginOtp200Response loginOtp(loginOtpRequest)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { LoginOtpOperationRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
const body = {
|
||||
// LoginOtpRequest
|
||||
loginOtpRequest: ...,
|
||||
} satisfies LoginOtpOperationRequest;
|
||||
|
||||
try {
|
||||
const data = await api.loginOtp(body);
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **loginOtpRequest** | [LoginOtpRequest](LoginOtpRequest.md) | | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**LoginOtp200Response**](LoginOtp200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **400** | Default Response | - |
|
||||
| **401** | Default Response | - |
|
||||
| **408** | Default Response | - |
|
||||
| **500** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## logout
|
||||
|
||||
> Logout200Response logout()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { LogoutRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.logout();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Logout200Response**](Logout200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## providerList
|
||||
|
||||
> ProviderList200Response providerList()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { ProviderListRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.providerList();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**ProviderList200Response**](ProviderList200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## signin
|
||||
|
||||
> Signin200Response signin(loginRequest)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { SigninRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
const body = {
|
||||
// LoginRequest
|
||||
loginRequest: ...,
|
||||
} satisfies SigninRequest;
|
||||
|
||||
try {
|
||||
const data = await api.signin(body);
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **loginRequest** | [LoginRequest](LoginRequest.md) | | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Signin200Response**](Signin200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **400** | Default Response | - |
|
||||
| **500** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
## statusOtp
|
||||
|
||||
> StatusOtp200Response statusOtp()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
Configuration,
|
||||
OpenapiOtherApi,
|
||||
} from '';
|
||||
import type { StatusOtpRequest } from '';
|
||||
|
||||
async function example() {
|
||||
console.log("🚀 Testing SDK...");
|
||||
const api = new OpenapiOtherApi();
|
||||
|
||||
try {
|
||||
const data = await api.statusOtp();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the test
|
||||
example().catch(console.error);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**StatusOtp200Response**](StatusOtp200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `application/json`
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Default Response | - |
|
||||
| **401** | Default Response | - |
|
||||
| **500** | Default Response | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
38
frontend/src/api/generated/docs/ProviderList200Response.md
Normal file
38
frontend/src/api/generated/docs/ProviderList200Response.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
# ProviderList200Response
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type
|
||||
------------ | -------------
|
||||
`kind` | string
|
||||
`msg` | string
|
||||
`payload` | [ProviderList200ResponsePayload](ProviderList200ResponsePayload.md)
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import type { ProviderList200Response } from ''
|
||||
|
||||
// TODO: Update the object below with actual values
|
||||
const example = {
|
||||
"kind": null,
|
||||
"msg": null,
|
||||
"payload": null,
|
||||
} satisfies ProviderList200Response
|
||||
|
||||
console.log(example)
|
||||
|
||||
// Convert the instance to a JSON string
|
||||
const exampleJSON: string = JSON.stringify(example)
|
||||
console.log(exampleJSON)
|
||||
|
||||
// Parse the JSON string back to an object
|
||||
const exampleParsed = JSON.parse(exampleJSON) as ProviderList200Response
|
||||
console.log(exampleParsed)
|
||||
```
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
# ProviderList200ResponsePayload
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type
|
||||
------------ | -------------
|
||||
`list` | [Array<ProviderList200ResponsePayloadListInner>](ProviderList200ResponsePayloadListInner.md)
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import type { ProviderList200ResponsePayload } from ''
|
||||
|
||||
// TODO: Update the object below with actual values
|
||||
const example = {
|
||||
"list": null,
|
||||
} satisfies ProviderList200ResponsePayload
|
||||
|
||||
console.log(example)
|
||||
|
||||
// Convert the instance to a JSON string
|
||||
const exampleJSON: string = JSON.stringify(example)
|
||||
console.log(exampleJSON)
|
||||
|
||||
// Parse the JSON string back to an object
|
||||
const exampleParsed = JSON.parse(exampleJSON) as ProviderList200ResponsePayload
|
||||
console.log(exampleParsed)
|
||||
```
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
# ProviderList200ResponsePayloadListInner
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type
|
||||
------------ | -------------
|
||||
`displayName` | string
|
||||
`name` | string
|
||||
`colors` | [ProviderList200ResponsePayloadListInnerColors](ProviderList200ResponsePayloadListInnerColors.md)
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import type { ProviderList200ResponsePayloadListInner } from ''
|
||||
|
||||
// TODO: Update the object below with actual values
|
||||
const example = {
|
||||
"displayName": null,
|
||||
"name": null,
|
||||
"colors": null,
|
||||
} satisfies ProviderList200ResponsePayloadListInner
|
||||
|
||||
console.log(example)
|
||||
|
||||
// Convert the instance to a JSON string
|
||||
const exampleJSON: string = JSON.stringify(example)
|
||||
console.log(exampleJSON)
|
||||
|
||||
// Parse the JSON string back to an object
|
||||
const exampleParsed = JSON.parse(exampleJSON) as ProviderList200ResponsePayloadListInner
|
||||
console.log(exampleParsed)
|
||||
```
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
# ProviderList200ResponsePayloadListInnerColors
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type
|
||||
------------ | -------------
|
||||
`normal` | string
|
||||
`hover` | string
|
||||
|
||||
## Example
|
||||
|
||||
```typescript
|
||||
import type { ProviderList200ResponsePayloadListInnerColors } from ''
|
||||
|
||||
// TODO: Update the object below with actual values
|
||||
const example = {
|
||||
"normal": null,
|
||||
"hover": null,
|
||||
} satisfies ProviderList200ResponsePayloadListInnerColors
|
||||
|
||||
console.log(example)
|
||||
|
||||
// Convert the instance to a JSON string
|
||||
const exampleJSON: string = JSON.stringify(example)
|
||||
console.log(exampleJSON)
|
||||
|
||||
// Parse the JSON string back to an object
|
||||
const exampleParsed = JSON.parse(exampleJSON) as ProviderList200ResponsePayloadListInnerColors
|
||||
console.log(exampleParsed)
|
||||
```
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
110
frontend/src/api/generated/models/ProviderList200Response.ts
Normal file
110
frontend/src/api/generated/models/ProviderList200Response.ts
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @fastify/swagger
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 9.6.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { ProviderList200ResponsePayload } from './ProviderList200ResponsePayload';
|
||||
import {
|
||||
ProviderList200ResponsePayloadFromJSON,
|
||||
ProviderList200ResponsePayloadFromJSONTyped,
|
||||
ProviderList200ResponsePayloadToJSON,
|
||||
ProviderList200ResponsePayloadToJSONTyped,
|
||||
} from './ProviderList200ResponsePayload';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ProviderList200Response
|
||||
*/
|
||||
export interface ProviderList200Response {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ProviderList200Response
|
||||
*/
|
||||
kind: ProviderList200ResponseKindEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ProviderList200Response
|
||||
*/
|
||||
msg: ProviderList200ResponseMsgEnum;
|
||||
/**
|
||||
*
|
||||
* @type {ProviderList200ResponsePayload}
|
||||
* @memberof ProviderList200Response
|
||||
*/
|
||||
payload: ProviderList200ResponsePayload;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ProviderList200ResponseKindEnum = {
|
||||
Success: 'success'
|
||||
} as const;
|
||||
export type ProviderList200ResponseKindEnum = typeof ProviderList200ResponseKindEnum[keyof typeof ProviderList200ResponseKindEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const ProviderList200ResponseMsgEnum = {
|
||||
ProviderListSuccess: 'providerList.success'
|
||||
} as const;
|
||||
export type ProviderList200ResponseMsgEnum = typeof ProviderList200ResponseMsgEnum[keyof typeof ProviderList200ResponseMsgEnum];
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ProviderList200Response interface.
|
||||
*/
|
||||
export function instanceOfProviderList200Response(value: object): value is ProviderList200Response {
|
||||
if (!('kind' in value) || value['kind'] === undefined) return false;
|
||||
if (!('msg' in value) || value['msg'] === undefined) return false;
|
||||
if (!('payload' in value) || value['payload'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ProviderList200ResponseFromJSON(json: any): ProviderList200Response {
|
||||
return ProviderList200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderList200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'kind': json['kind'],
|
||||
'msg': json['msg'],
|
||||
'payload': ProviderList200ResponsePayloadFromJSON(json['payload']),
|
||||
};
|
||||
}
|
||||
|
||||
export function ProviderList200ResponseToJSON(json: any): ProviderList200Response {
|
||||
return ProviderList200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponseToJSONTyped(value?: ProviderList200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'kind': value['kind'],
|
||||
'msg': value['msg'],
|
||||
'payload': ProviderList200ResponsePayloadToJSON(value['payload']),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @fastify/swagger
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 9.6.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { ProviderList200ResponsePayloadListInner } from './ProviderList200ResponsePayloadListInner';
|
||||
import {
|
||||
ProviderList200ResponsePayloadListInnerFromJSON,
|
||||
ProviderList200ResponsePayloadListInnerFromJSONTyped,
|
||||
ProviderList200ResponsePayloadListInnerToJSON,
|
||||
ProviderList200ResponsePayloadListInnerToJSONTyped,
|
||||
} from './ProviderList200ResponsePayloadListInner';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ProviderList200ResponsePayload
|
||||
*/
|
||||
export interface ProviderList200ResponsePayload {
|
||||
/**
|
||||
*
|
||||
* @type {Array<ProviderList200ResponsePayloadListInner>}
|
||||
* @memberof ProviderList200ResponsePayload
|
||||
*/
|
||||
list: Array<ProviderList200ResponsePayloadListInner>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ProviderList200ResponsePayload interface.
|
||||
*/
|
||||
export function instanceOfProviderList200ResponsePayload(value: object): value is ProviderList200ResponsePayload {
|
||||
if (!('list' in value) || value['list'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadFromJSON(json: any): ProviderList200ResponsePayload {
|
||||
return ProviderList200ResponsePayloadFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderList200ResponsePayload {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'list': ((json['list'] as Array<any>).map(ProviderList200ResponsePayloadListInnerFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadToJSON(json: any): ProviderList200ResponsePayload {
|
||||
return ProviderList200ResponsePayloadToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadToJSONTyped(value?: ProviderList200ResponsePayload | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'list': ((value['list'] as Array<any>).map(ProviderList200ResponsePayloadListInnerToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @fastify/swagger
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 9.6.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { ProviderList200ResponsePayloadListInnerColors } from './ProviderList200ResponsePayloadListInnerColors';
|
||||
import {
|
||||
ProviderList200ResponsePayloadListInnerColorsFromJSON,
|
||||
ProviderList200ResponsePayloadListInnerColorsFromJSONTyped,
|
||||
ProviderList200ResponsePayloadListInnerColorsToJSON,
|
||||
ProviderList200ResponsePayloadListInnerColorsToJSONTyped,
|
||||
} from './ProviderList200ResponsePayloadListInnerColors';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ProviderList200ResponsePayloadListInner
|
||||
*/
|
||||
export interface ProviderList200ResponsePayloadListInner {
|
||||
/**
|
||||
* Name to display to the user
|
||||
* @type {string}
|
||||
* @memberof ProviderList200ResponsePayloadListInner
|
||||
*/
|
||||
displayName: string;
|
||||
/**
|
||||
* internal Name of the provider
|
||||
* @type {string}
|
||||
* @memberof ProviderList200ResponsePayloadListInner
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
*
|
||||
* @type {ProviderList200ResponsePayloadListInnerColors}
|
||||
* @memberof ProviderList200ResponsePayloadListInner
|
||||
*/
|
||||
colors: ProviderList200ResponsePayloadListInnerColors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ProviderList200ResponsePayloadListInner interface.
|
||||
*/
|
||||
export function instanceOfProviderList200ResponsePayloadListInner(value: object): value is ProviderList200ResponsePayloadListInner {
|
||||
if (!('displayName' in value) || value['displayName'] === undefined) return false;
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('colors' in value) || value['colors'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerFromJSON(json: any): ProviderList200ResponsePayloadListInner {
|
||||
return ProviderList200ResponsePayloadListInnerFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderList200ResponsePayloadListInner {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'displayName': json['display_name'],
|
||||
'name': json['name'],
|
||||
'colors': ProviderList200ResponsePayloadListInnerColorsFromJSON(json['colors']),
|
||||
};
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerToJSON(json: any): ProviderList200ResponsePayloadListInner {
|
||||
return ProviderList200ResponsePayloadListInnerToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerToJSONTyped(value?: ProviderList200ResponsePayloadListInner | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'display_name': value['displayName'],
|
||||
'name': value['name'],
|
||||
'colors': ProviderList200ResponsePayloadListInnerColorsToJSON(value['colors']),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* @fastify/swagger
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 9.6.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface ProviderList200ResponsePayloadListInnerColors
|
||||
*/
|
||||
export interface ProviderList200ResponsePayloadListInnerColors {
|
||||
/**
|
||||
* Default color for the provider
|
||||
* @type {string}
|
||||
* @memberof ProviderList200ResponsePayloadListInnerColors
|
||||
*/
|
||||
normal: string;
|
||||
/**
|
||||
* Hover color for the provider
|
||||
* @type {string}
|
||||
* @memberof ProviderList200ResponsePayloadListInnerColors
|
||||
*/
|
||||
hover: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ProviderList200ResponsePayloadListInnerColors interface.
|
||||
*/
|
||||
export function instanceOfProviderList200ResponsePayloadListInnerColors(value: object): value is ProviderList200ResponsePayloadListInnerColors {
|
||||
if (!('normal' in value) || value['normal'] === undefined) return false;
|
||||
if (!('hover' in value) || value['hover'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerColorsFromJSON(json: any): ProviderList200ResponsePayloadListInnerColors {
|
||||
return ProviderList200ResponsePayloadListInnerColorsFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerColorsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProviderList200ResponsePayloadListInnerColors {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'normal': json['normal'],
|
||||
'hover': json['hover'],
|
||||
};
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerColorsToJSON(json: any): ProviderList200ResponsePayloadListInnerColors {
|
||||
return ProviderList200ResponsePayloadListInnerColorsToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ProviderList200ResponsePayloadListInnerColorsToJSONTyped(value?: ProviderList200ResponsePayloadListInnerColors | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'normal': value['normal'],
|
||||
'hover': value['hover'],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -29,6 +29,10 @@ export * from './LoginOtp500Response';
|
|||
export * from './LoginOtpRequest';
|
||||
export * from './LoginRequest';
|
||||
export * from './Logout200Response';
|
||||
export * from './ProviderList200Response';
|
||||
export * from './ProviderList200ResponsePayload';
|
||||
export * from './ProviderList200ResponsePayloadListInner';
|
||||
export * from './ProviderList200ResponsePayloadListInnerColors';
|
||||
export * from './Signin200Response';
|
||||
export * from './Signin200ResponsePayload';
|
||||
export * from './Signin400Response';
|
||||
|
|
|
|||
|
|
@ -3,15 +3,16 @@ export * from './generated'
|
|||
|
||||
|
||||
const basePath = (() => {
|
||||
let u = new URL(location.href);
|
||||
u.pathname = "";
|
||||
u.hash = "";
|
||||
u.search = "";
|
||||
return u.toString().replace(/\/+$/, '');
|
||||
let u = new URL(location.href);
|
||||
u.pathname = "";
|
||||
u.hash = "";
|
||||
u.search = "";
|
||||
return u.toString().replace(/\/+$/, '');
|
||||
|
||||
})();
|
||||
|
||||
export const client = new OpenapiOtherApi(new Configuration({ basePath }));
|
||||
export default client;
|
||||
|
||||
Object.assign(window as any, { apiClient: client });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue