Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export interface ApiRequestOptions {
|
||||
signal?: AbortSignal
|
||||
}
|
||||
|
||||
export interface ExampleHealthResponse {
|
||||
status: 'ok'
|
||||
}
|
||||
|
||||
export interface ExampleWelcomeResponse {
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface ExampleApi {
|
||||
getHealth: (options?: ApiRequestOptions) => Promise<ExampleHealthResponse>
|
||||
getWelcome: (options?: ApiRequestOptions) => Promise<ExampleWelcomeResponse>
|
||||
}
|
||||
|
||||
export interface ApiClients {
|
||||
example: ExampleApi
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { ComputedRef, Ref } from 'vue'
|
||||
import type { AuthUser } from '~/stores/auth'
|
||||
|
||||
export type AuthMode = 'disabled' | 'mock' | 'userinfo'
|
||||
|
||||
export interface AuthClient {
|
||||
mode: AuthMode
|
||||
isEnabled: boolean
|
||||
isReady: Ref<boolean>
|
||||
isAuthenticated: ComputedRef<boolean>
|
||||
user: Ref<AuthUser | null>
|
||||
ensureInitialized: () => Promise<void>
|
||||
login: () => void | Promise<void>
|
||||
logout: () => void | Promise<void>
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
import type { LoggerApi } from '~/composables/useLogger'
|
||||
import type { AuthClient } from '~/types/auth'
|
||||
import type { ApiClients } from '~/types/api'
|
||||
|
||||
declare module '#app' {
|
||||
interface NuxtApp {
|
||||
$api: ApiClients
|
||||
$auth: AuthClient
|
||||
$logger: LoggerApi
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$api: ApiClients
|
||||
$auth: AuthClient
|
||||
$logger: LoggerApi
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import 'vue-router'
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
public?: boolean
|
||||
requiresAuth?: boolean
|
||||
roles?: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
Reference in New Issue
Block a user