Minor tweaks to routes and frontend. Added generated routes from openapi.json
This commit is contained in:
		
							parent
							
								
									75b2b1e142
								
							
						
					
					
						commit
						39b99d5509
					
				@ -4,6 +4,7 @@ from sqlmodel import select
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
from fastapi import APIRouter
 | 
					from fastapi import APIRouter
 | 
				
			||||||
from app.api.dependencies import SessionDep
 | 
					from app.api.dependencies import SessionDep
 | 
				
			||||||
 | 
					from app.core.config import settings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
logger = logging.getLogger(__name__)
 | 
					logger = logging.getLogger(__name__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -15,7 +16,7 @@ async def health_check() -> bool:
 | 
				
			|||||||
    return True
 | 
					    return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@router.get("/test-db/")
 | 
					@router.get("/test-db/", include_in_schema=settings.is_local_environment)
 | 
				
			||||||
async def test_db(session: SessionDep) -> bool:
 | 
					async def test_db(session: SessionDep) -> bool:
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        session.exec(select(1))
 | 
					        session.exec(select(1))
 | 
				
			||||||
 | 
				
			|||||||
@ -83,6 +83,11 @@ class Settings(BaseSettings):
 | 
				
			|||||||
    def emails_enabled(self) -> bool:
 | 
					    def emails_enabled(self) -> bool:
 | 
				
			||||||
        return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)
 | 
					        return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @computed_field
 | 
				
			||||||
 | 
					    @property
 | 
				
			||||||
 | 
					    def is_local_environment(self) -> bool:
 | 
				
			||||||
 | 
					        return self.ENVIRONMENT == "local"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EMAIL_TEST_USER: EmailStr = "test@example.com"
 | 
					    EMAIL_TEST_USER: EmailStr = "test@example.com"
 | 
				
			||||||
    FIRST_SUPERUSER: EmailStr
 | 
					    FIRST_SUPERUSER: EmailStr
 | 
				
			||||||
    FIRST_SUPERUSER_PASSWORD: str
 | 
					    FIRST_SUPERUSER_PASSWORD: str
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										14
									
								
								frontend/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								frontend/package-lock.json
									
									
									
										generated
									
									
									
								
							@ -8,7 +8,6 @@
 | 
				
			|||||||
			"name": "frontend",
 | 
								"name": "frontend",
 | 
				
			||||||
			"version": "0.0.0",
 | 
								"version": "0.0.0",
 | 
				
			||||||
			"dependencies": {
 | 
								"dependencies": {
 | 
				
			||||||
        "@hey-api/client-fetch": "^0.8.3",
 | 
					 | 
				
			||||||
				"@hookform/resolvers": "^3.9.1",
 | 
									"@hookform/resolvers": "^3.9.1",
 | 
				
			||||||
				"@radix-ui/react-accordion": "^1.2.3",
 | 
									"@radix-ui/react-accordion": "^1.2.3",
 | 
				
			||||||
				"@radix-ui/react-alert-dialog": "^1.1.2",
 | 
									"@radix-ui/react-alert-dialog": "^1.1.2",
 | 
				
			||||||
@ -55,6 +54,7 @@
 | 
				
			|||||||
			"devDependencies": {
 | 
								"devDependencies": {
 | 
				
			||||||
				"@eslint/js": "^9.16.0",
 | 
									"@eslint/js": "^9.16.0",
 | 
				
			||||||
				"@faker-js/faker": "^9.3.0",
 | 
									"@faker-js/faker": "^9.3.0",
 | 
				
			||||||
 | 
									"@hey-api/client-axios": "^0.6.2",
 | 
				
			||||||
				"@hey-api/openapi-ts": "^0.64.11",
 | 
									"@hey-api/openapi-ts": "^0.64.11",
 | 
				
			||||||
				"@tanstack/eslint-plugin-query": "^5.62.1",
 | 
									"@tanstack/eslint-plugin-query": "^5.62.1",
 | 
				
			||||||
				"@tanstack/react-query-devtools": "^5.62.3",
 | 
									"@tanstack/react-query-devtools": "^5.62.3",
 | 
				
			||||||
@ -1018,12 +1018,16 @@
 | 
				
			|||||||
			"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz",
 | 
								"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz",
 | 
				
			||||||
			"integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg=="
 | 
								"integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg=="
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    "node_modules/@hey-api/client-fetch": {
 | 
							"node_modules/@hey-api/client-axios": {
 | 
				
			||||||
      "version": "0.8.3",
 | 
								"version": "0.6.2",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@hey-api/client-fetch/-/client-fetch-0.8.3.tgz",
 | 
								"resolved": "https://registry.npmjs.org/@hey-api/client-axios/-/client-axios-0.6.2.tgz",
 | 
				
			||||||
      "integrity": "sha512-EBVa8wwUMyBSeQ32PtCz6u5bFQZIMAufvwCT1ZtpjqT3caJQEza4NokbGU50q1ZVrMsM5Ot6GuDNJOF3TMo26Q==",
 | 
								"integrity": "sha512-DwaOJ+LROSMJgYWXpqBeLquf2/aJXPpXkVfrnOj3gBaaxSZ71x1uwVGuujVkRhJpImbP4Gt58Fl9ECNPdDLTSw==",
 | 
				
			||||||
 | 
								"dev": true,
 | 
				
			||||||
			"funding": {
 | 
								"funding": {
 | 
				
			||||||
				"url": "https://github.com/sponsors/hey-api"
 | 
									"url": "https://github.com/sponsors/hey-api"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								"peerDependencies": {
 | 
				
			||||||
 | 
									"axios": ">= 1.0.0 < 2"
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		"node_modules/@hey-api/json-schema-ref-parser": {
 | 
							"node_modules/@hey-api/json-schema-ref-parser": {
 | 
				
			||||||
 | 
				
			|||||||
@ -10,10 +10,10 @@
 | 
				
			|||||||
		"preview": "vite preview",
 | 
							"preview": "vite preview",
 | 
				
			||||||
		"format:check": "prettier --check .",
 | 
							"format:check": "prettier --check .",
 | 
				
			||||||
		"format": "prettier --write .",
 | 
							"format": "prettier --write .",
 | 
				
			||||||
    "knip": "knip"
 | 
							"knip": "knip",
 | 
				
			||||||
 | 
							"generate-client": "openapi-ts --input http://localhost:8000/openapi.json --output ./src/client --client @hey-api/client-axios"
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	"dependencies": {
 | 
						"dependencies": {
 | 
				
			||||||
    "@hey-api/client-fetch": "^0.8.3",
 | 
					 | 
				
			||||||
		"@hookform/resolvers": "^3.9.1",
 | 
							"@hookform/resolvers": "^3.9.1",
 | 
				
			||||||
		"@radix-ui/react-accordion": "^1.2.3",
 | 
							"@radix-ui/react-accordion": "^1.2.3",
 | 
				
			||||||
		"@radix-ui/react-alert-dialog": "^1.1.2",
 | 
							"@radix-ui/react-alert-dialog": "^1.1.2",
 | 
				
			||||||
@ -60,6 +60,7 @@
 | 
				
			|||||||
	"devDependencies": {
 | 
						"devDependencies": {
 | 
				
			||||||
		"@eslint/js": "^9.16.0",
 | 
							"@eslint/js": "^9.16.0",
 | 
				
			||||||
		"@faker-js/faker": "^9.3.0",
 | 
							"@faker-js/faker": "^9.3.0",
 | 
				
			||||||
 | 
							"@hey-api/client-axios": "^0.6.2",
 | 
				
			||||||
		"@hey-api/openapi-ts": "^0.64.11",
 | 
							"@hey-api/openapi-ts": "^0.64.11",
 | 
				
			||||||
		"@tanstack/eslint-plugin-query": "^5.62.1",
 | 
							"@tanstack/eslint-plugin-query": "^5.62.1",
 | 
				
			||||||
		"@tanstack/react-query-devtools": "^5.62.3",
 | 
							"@tanstack/react-query-devtools": "^5.62.3",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										18
									
								
								frontend/src/client/client.gen.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								frontend/src/client/client.gen.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					// This file is auto-generated by @hey-api/openapi-ts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import type { ClientOptions } from './types.gen';
 | 
				
			||||||
 | 
					import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-axios';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * The `createClientConfig()` function will be called on client initialization
 | 
				
			||||||
 | 
					 * and the returned object will become the client's initial configuration.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You may want to initialize your client this way instead of calling
 | 
				
			||||||
 | 
					 * `setConfig()`. This is useful for example if you're using Next.js
 | 
				
			||||||
 | 
					 * to ensure your client always has the correct values.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const client = createClient(createConfig<ClientOptions>({
 | 
				
			||||||
 | 
					    baseURL: 'http://localhost:8000'
 | 
				
			||||||
 | 
					}));
 | 
				
			||||||
							
								
								
									
										3
									
								
								frontend/src/client/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								frontend/src/client/index.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					// This file is auto-generated by @hey-api/openapi-ts
 | 
				
			||||||
 | 
					export * from './types.gen';
 | 
				
			||||||
 | 
					export * from './sdk.gen';
 | 
				
			||||||
							
								
								
									
										217
									
								
								frontend/src/client/sdk.gen.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										217
									
								
								frontend/src/client/sdk.gen.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,217 @@
 | 
				
			|||||||
 | 
					// This file is auto-generated by @hey-api/openapi-ts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { type Options as ClientOptions, type TDataShape, type Client, urlSearchParamsBodySerializer } from '@hey-api/client-axios';
 | 
				
			||||||
 | 
					import type { CartShowCartData, CartAddToCartData, CartAddToCartError, CartRemoveFromCartData, CartRemoveFromCartError, CartUpdateCountInCartData, CartUpdateCountInCartError, CartPurchaseData, UserDeleteUserData, UserLogoutData, UserRegisterData, UserRegisterError, UserUpdateUserData, UserUpdateUserError, UtilsHealthCheckData, UtilsHealthCheckResponse, UtilsTestDbData, UtilsTestDbResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginLoginAccessTokenError, ShopLoginAccessTokenData, ShopLoginAccessTokenResponse, ShopLoginAccessTokenError, ShopDeleteUserData, ShopDeleteUserError, ShopLogoutData, ShopRegisterData, ShopRegisterError, ShopUpdateUserData, ShopUpdateUserError } from './types.gen';
 | 
				
			||||||
 | 
					import { client as _heyApiClient } from './client.gen';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * You can provide a client instance returned by `createClient()` instead of
 | 
				
			||||||
 | 
					     * individual options. This might be also useful if you want to implement a
 | 
				
			||||||
 | 
					     * custom client.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    client?: Client;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * You can pass arbitrary values through the `meta` object. This can be
 | 
				
			||||||
 | 
					     * used to access values that aren't defined as part of the SDK function.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    meta?: Record<string, unknown>;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Show Cart
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const cartShowCart = <ThrowOnError extends boolean = false>(options?: Options<CartShowCartData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/cart/',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Add To Cart
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const cartAddToCart = <ThrowOnError extends boolean = false>(options: Options<CartAddToCartData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).put<unknown, CartAddToCartError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/cart/add/{product_id}',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Remove From Cart
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const cartRemoveFromCart = <ThrowOnError extends boolean = false>(options: Options<CartRemoveFromCartData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).delete<unknown, CartRemoveFromCartError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/cart/remove/{product_id}',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Update Count In Cart
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const cartUpdateCountInCart = <ThrowOnError extends boolean = false>(options: Options<CartUpdateCountInCartData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).put<unknown, CartUpdateCountInCartError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/cart/update/{product_id}',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Purchase
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const cartPurchase = <ThrowOnError extends boolean = false>(options?: Options<CartPurchaseData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).get<unknown, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/cart/purchase',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Delete user
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const userDeleteUser = <ThrowOnError extends boolean = false>(options?: Options<UserDeleteUserData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).delete<unknown, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/user/delete',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * User logout
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const userLogout = <ThrowOnError extends boolean = false>(options?: Options<UserLogoutData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).delete<unknown, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/user/logout',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Register new user
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const userRegister = <ThrowOnError extends boolean = false>(options: Options<UserRegisterData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).post<unknown, UserRegisterError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/user/register',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/json',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Update user details
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const userUpdateUser = <ThrowOnError extends boolean = false>(options: Options<UserUpdateUserData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).put<unknown, UserUpdateUserError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/user/update',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/json',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Health Check
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const utilsHealthCheck = <ThrowOnError extends boolean = false>(options?: Options<UtilsHealthCheckData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).get<UtilsHealthCheckResponse, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/utils/health-check/',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Test Db
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const utilsTestDb = <ThrowOnError extends boolean = false>(options?: Options<UtilsTestDbData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).get<UtilsTestDbResponse, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/utils/test-db/',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Login Access Token
 | 
				
			||||||
 | 
					 * OAuth2 compatible token login, get an access token for future requests
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const loginLoginAccessToken = <ThrowOnError extends boolean = false>(options: Options<LoginLoginAccessTokenData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).post<LoginLoginAccessTokenResponse, LoginLoginAccessTokenError, ThrowOnError>({
 | 
				
			||||||
 | 
					        ...urlSearchParamsBodySerializer,
 | 
				
			||||||
 | 
					        url: '/login/access-token',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/x-www-form-urlencoded',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Login Access Token
 | 
				
			||||||
 | 
					 * OAuth2 compatible token login, get an access token for future requests
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const shopLoginAccessToken = <ThrowOnError extends boolean = false>(options: Options<ShopLoginAccessTokenData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).post<ShopLoginAccessTokenResponse, ShopLoginAccessTokenError, ThrowOnError>({
 | 
				
			||||||
 | 
					        ...urlSearchParamsBodySerializer,
 | 
				
			||||||
 | 
					        url: '/shop/{shop_uuid}/login/access-token',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/x-www-form-urlencoded',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Delete user
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const shopDeleteUser = <ThrowOnError extends boolean = false>(options: Options<ShopDeleteUserData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).delete<unknown, ShopDeleteUserError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/shop/{shop_uuid}/user/delete',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * User logout
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const shopLogout = <ThrowOnError extends boolean = false>(options?: Options<ShopLogoutData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options?.client ?? _heyApiClient).delete<unknown, unknown, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/shop/{shop_uuid}/user/logout',
 | 
				
			||||||
 | 
					        ...options
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Register new user
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const shopRegister = <ThrowOnError extends boolean = false>(options: Options<ShopRegisterData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).post<unknown, ShopRegisterError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/shop/{shop_uuid}/user/register',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/json',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Update user details
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export const shopUpdateUser = <ThrowOnError extends boolean = false>(options: Options<ShopUpdateUserData, ThrowOnError>) => {
 | 
				
			||||||
 | 
					    return (options.client ?? _heyApiClient).put<unknown, ShopUpdateUserError, ThrowOnError>({
 | 
				
			||||||
 | 
					        url: '/shop/{shop_uuid}/user/update',
 | 
				
			||||||
 | 
					        ...options,
 | 
				
			||||||
 | 
					        headers: {
 | 
				
			||||||
 | 
					            'Content-Type': 'application/json',
 | 
				
			||||||
 | 
					            ...options?.headers
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
							
								
								
									
										408
									
								
								frontend/src/client/types.gen.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										408
									
								
								frontend/src/client/types.gen.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,408 @@
 | 
				
			|||||||
 | 
					// This file is auto-generated by @hey-api/openapi-ts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type BodyLoginLoginAccessToken = {
 | 
				
			||||||
 | 
					    grant_type?: string | null;
 | 
				
			||||||
 | 
					    username: string;
 | 
				
			||||||
 | 
					    password: string;
 | 
				
			||||||
 | 
					    scope?: string;
 | 
				
			||||||
 | 
					    client_id?: string | null;
 | 
				
			||||||
 | 
					    client_secret?: string | null;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type BodyShopLoginAccessToken = {
 | 
				
			||||||
 | 
					    grant_type?: string | null;
 | 
				
			||||||
 | 
					    username: string;
 | 
				
			||||||
 | 
					    password: string;
 | 
				
			||||||
 | 
					    scope?: string;
 | 
				
			||||||
 | 
					    client_id?: string | null;
 | 
				
			||||||
 | 
					    client_secret?: string | null;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type HttpValidationError = {
 | 
				
			||||||
 | 
					    detail?: Array<ValidationError>;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type Token = {
 | 
				
			||||||
 | 
					    access_token: string;
 | 
				
			||||||
 | 
					    token_type?: string;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserRegister = {
 | 
				
			||||||
 | 
					    username: string;
 | 
				
			||||||
 | 
					    email: string;
 | 
				
			||||||
 | 
					    phone_number: string;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Password must be at least 8 and at most 128 characters long, contain a lower case, upper case letter, a number and a special character (#?!@$ %^&*-)
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    password: string;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ValidationError = {
 | 
				
			||||||
 | 
					    loc: Array<string | number>;
 | 
				
			||||||
 | 
					    msg: string;
 | 
				
			||||||
 | 
					    type: string;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartShowCartData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/cart/';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartShowCartResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartAddToCartData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path: {
 | 
				
			||||||
 | 
					        product_id: number;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    query?: {
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Count must be greater than or equal to 1
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        count?: number;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    url: '/cart/add/{product_id}';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartAddToCartErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartAddToCartError = CartAddToCartErrors[keyof CartAddToCartErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartAddToCartResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartRemoveFromCartData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path: {
 | 
				
			||||||
 | 
					        product_id: number;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/cart/remove/{product_id}';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartRemoveFromCartErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartRemoveFromCartError = CartRemoveFromCartErrors[keyof CartRemoveFromCartErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartRemoveFromCartResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartUpdateCountInCartData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path: {
 | 
				
			||||||
 | 
					        product_id: number;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    query: {
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Count must be provided
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        count: number;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    url: '/cart/update/{product_id}';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartUpdateCountInCartErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartUpdateCountInCartError = CartUpdateCountInCartErrors[keyof CartUpdateCountInCartErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartUpdateCountInCartResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartPurchaseData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/cart/purchase';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type CartPurchaseResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserDeleteUserData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/user/delete';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserDeleteUserResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserLogoutData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/user/logout';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserLogoutResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserRegisterData = {
 | 
				
			||||||
 | 
					    body: UserRegister;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/user/register';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserRegisterErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserRegisterError = UserRegisterErrors[keyof UserRegisterErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserRegisterResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserUpdateUserData = {
 | 
				
			||||||
 | 
					    body: {
 | 
				
			||||||
 | 
					        [key: string]: unknown;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/user/update';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserUpdateUserErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserUpdateUserError = UserUpdateUserErrors[keyof UserUpdateUserErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UserUpdateUserResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsHealthCheckData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/utils/health-check/';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsHealthCheckResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: boolean;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsHealthCheckResponse = UtilsHealthCheckResponses[keyof UtilsHealthCheckResponses];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsTestDbData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/utils/test-db/';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsTestDbResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: boolean;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type UtilsTestDbResponse = UtilsTestDbResponses[keyof UtilsTestDbResponses];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type LoginLoginAccessTokenData = {
 | 
				
			||||||
 | 
					    body: BodyLoginLoginAccessToken;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/login/access-token';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type LoginLoginAccessTokenErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type LoginLoginAccessTokenError = LoginLoginAccessTokenErrors[keyof LoginLoginAccessTokenErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type LoginLoginAccessTokenResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: Token;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type LoginLoginAccessTokenResponse = LoginLoginAccessTokenResponses[keyof LoginLoginAccessTokenResponses];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLoginAccessTokenData = {
 | 
				
			||||||
 | 
					    body: BodyShopLoginAccessToken;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/shop/{shop_uuid}/login/access-token';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLoginAccessTokenErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLoginAccessTokenError = ShopLoginAccessTokenErrors[keyof ShopLoginAccessTokenErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLoginAccessTokenResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: Token;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLoginAccessTokenResponse = ShopLoginAccessTokenResponses[keyof ShopLoginAccessTokenResponses];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopDeleteUserData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path: {
 | 
				
			||||||
 | 
					        shop_uuid: unknown;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/shop/{shop_uuid}/user/delete';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopDeleteUserErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopDeleteUserError = ShopDeleteUserErrors[keyof ShopDeleteUserErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopDeleteUserResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLogoutData = {
 | 
				
			||||||
 | 
					    body?: never;
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/shop/{shop_uuid}/user/logout';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopLogoutResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopRegisterData = {
 | 
				
			||||||
 | 
					    body: UserRegister;
 | 
				
			||||||
 | 
					    path: {
 | 
				
			||||||
 | 
					        shop_uuid: unknown;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/shop/{shop_uuid}/user/register';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopRegisterErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopRegisterError = ShopRegisterErrors[keyof ShopRegisterErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopRegisterResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopUpdateUserData = {
 | 
				
			||||||
 | 
					    body: {
 | 
				
			||||||
 | 
					        [key: string]: unknown;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    path?: never;
 | 
				
			||||||
 | 
					    query?: never;
 | 
				
			||||||
 | 
					    url: '/shop/{shop_uuid}/user/update';
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopUpdateUserErrors = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Validation Error
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    422: HttpValidationError;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopUpdateUserError = ShopUpdateUserErrors[keyof ShopUpdateUserErrors];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ShopUpdateUserResponses = {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Successful Response
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    200: unknown;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export type ClientOptions = {
 | 
				
			||||||
 | 
					    baseURL: 'http://localhost:8000' | (string & {});
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@ -3,7 +3,6 @@ import { z } from "zod";
 | 
				
			|||||||
import { useForm } from "react-hook-form";
 | 
					import { useForm } from "react-hook-form";
 | 
				
			||||||
import { zodResolver } from "@hookform/resolvers/zod";
 | 
					import { zodResolver } from "@hookform/resolvers/zod";
 | 
				
			||||||
import { Link } from "@tanstack/react-router";
 | 
					import { Link } from "@tanstack/react-router";
 | 
				
			||||||
import { IconBrandFacebook, IconBrandGithub } from "@tabler/icons-react";
 | 
					 | 
				
			||||||
import { cn } from "@/lib/utils";
 | 
					import { cn } from "@/lib/utils";
 | 
				
			||||||
import { Button } from "@/components/ui/button";
 | 
					import { Button } from "@/components/ui/button";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
@ -47,7 +46,6 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	function onSubmit(data: z.infer<typeof formSchema>) {
 | 
						function onSubmit(data: z.infer<typeof formSchema>) {
 | 
				
			||||||
		setIsLoading(true);
 | 
							setIsLoading(true);
 | 
				
			||||||
		// eslint-disable-next-line no-console
 | 
					 | 
				
			||||||
		console.log(data);
 | 
							console.log(data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		setTimeout(() => {
 | 
							setTimeout(() => {
 | 
				
			||||||
@ -101,28 +99,6 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
 | 
				
			|||||||
							<div className="absolute inset-0 flex items-center">
 | 
												<div className="absolute inset-0 flex items-center">
 | 
				
			||||||
								<span className="w-full border-t" />
 | 
													<span className="w-full border-t" />
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
							<div className="relative flex justify-center text-xs uppercase">
 | 
					 | 
				
			||||||
								<span className="bg-background px-2 text-muted-foreground">
 | 
					 | 
				
			||||||
									Or continue with
 | 
					 | 
				
			||||||
								</span>
 | 
					 | 
				
			||||||
							</div>
 | 
					 | 
				
			||||||
						</div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						<div className="flex items-center gap-2">
 | 
					 | 
				
			||||||
							<Button
 | 
					 | 
				
			||||||
								variant="outline"
 | 
					 | 
				
			||||||
								className="w-full"
 | 
					 | 
				
			||||||
								type="button"
 | 
					 | 
				
			||||||
								disabled={isLoading}>
 | 
					 | 
				
			||||||
								<IconBrandGithub className="h-4 w-4" /> GitHub
 | 
					 | 
				
			||||||
							</Button>
 | 
					 | 
				
			||||||
							<Button
 | 
					 | 
				
			||||||
								variant="outline"
 | 
					 | 
				
			||||||
								className="w-full"
 | 
					 | 
				
			||||||
								type="button"
 | 
					 | 
				
			||||||
								disabled={isLoading}>
 | 
					 | 
				
			||||||
								<IconBrandFacebook className="h-4 w-4" /> Facebook
 | 
					 | 
				
			||||||
							</Button>
 | 
					 | 
				
			||||||
						</div>
 | 
											</div>
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
				</form>
 | 
									</form>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user