omgebouwd naar adonisjs, werkt nog niet echt goed
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* This file is automatically generated.
|
||||
* DO NOT EDIT manually
|
||||
*/
|
||||
|
||||
/// <reference path="./manifest.d.ts" />
|
||||
import type { InferData, InferVariants } from '@adonisjs/core/types/transformers'
|
||||
import type UserTransformer from '#transformers/user_transformer'
|
||||
|
||||
export namespace Data {
|
||||
export type User = InferData<UserTransformer>
|
||||
export namespace User {
|
||||
export type Variants = InferVariants<UserTransformer>
|
||||
}
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* This file is automatically generated.
|
||||
* DO NOT EDIT manually
|
||||
*/
|
||||
|
||||
/// <reference path="../../adonisrc.ts" />
|
||||
/// <reference path="../../config/auth.ts" />
|
||||
/// <reference path="../../config/hash.ts" />
|
||||
/// <reference path="../../config/logger.ts" />
|
||||
/// <reference path="../../config/nntp.ts" />
|
||||
/// <reference path="../../config/queue.ts" />
|
||||
/// <reference path="../../config/redis.ts" />
|
||||
@@ -0,0 +1,47 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
import type { AdonisEndpoint } from '@tuyau/core/types'
|
||||
import type { Registry } from './schema.d.ts'
|
||||
import type { ApiDefinition } from './tree.d.ts'
|
||||
|
||||
const placeholder: any = {}
|
||||
|
||||
const routes = {
|
||||
'auth.new_account.store': {
|
||||
methods: ["POST"],
|
||||
pattern: '/api/v1/auth/signup',
|
||||
tokens: [{"old":"/api/v1/auth/signup","type":0,"val":"api","end":""},{"old":"/api/v1/auth/signup","type":0,"val":"v1","end":""},{"old":"/api/v1/auth/signup","type":0,"val":"auth","end":""},{"old":"/api/v1/auth/signup","type":0,"val":"signup","end":""}],
|
||||
types: placeholder as Registry['auth.new_account.store']['types'],
|
||||
},
|
||||
'auth.access_tokens.store': {
|
||||
methods: ["POST"],
|
||||
pattern: '/api/v1/auth/login',
|
||||
tokens: [{"old":"/api/v1/auth/login","type":0,"val":"api","end":""},{"old":"/api/v1/auth/login","type":0,"val":"v1","end":""},{"old":"/api/v1/auth/login","type":0,"val":"auth","end":""},{"old":"/api/v1/auth/login","type":0,"val":"login","end":""}],
|
||||
types: placeholder as Registry['auth.access_tokens.store']['types'],
|
||||
},
|
||||
'profile.profile.show': {
|
||||
methods: ["GET","HEAD"],
|
||||
pattern: '/api/v1/account/profile',
|
||||
tokens: [{"old":"/api/v1/account/profile","type":0,"val":"api","end":""},{"old":"/api/v1/account/profile","type":0,"val":"v1","end":""},{"old":"/api/v1/account/profile","type":0,"val":"account","end":""},{"old":"/api/v1/account/profile","type":0,"val":"profile","end":""}],
|
||||
types: placeholder as Registry['profile.profile.show']['types'],
|
||||
},
|
||||
'profile.access_tokens.destroy': {
|
||||
methods: ["POST"],
|
||||
pattern: '/api/v1/account/logout',
|
||||
tokens: [{"old":"/api/v1/account/logout","type":0,"val":"api","end":""},{"old":"/api/v1/account/logout","type":0,"val":"v1","end":""},{"old":"/api/v1/account/logout","type":0,"val":"account","end":""},{"old":"/api/v1/account/logout","type":0,"val":"logout","end":""}],
|
||||
types: placeholder as Registry['profile.access_tokens.destroy']['types'],
|
||||
},
|
||||
} as const satisfies Record<string, AdonisEndpoint>
|
||||
|
||||
export { routes }
|
||||
|
||||
export const registry = {
|
||||
routes,
|
||||
$tree: {} as ApiDefinition,
|
||||
}
|
||||
|
||||
declare module '@tuyau/core/types' {
|
||||
export interface UserRegistry {
|
||||
routes: typeof routes
|
||||
$tree: ApiDefinition
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
/// <reference path="../manifest.d.ts" />
|
||||
|
||||
import type { ExtractBody, ExtractErrorResponse, ExtractQuery, ExtractQueryForGet, ExtractResponse } from '@tuyau/core/types'
|
||||
import type { InferInput, SimpleError } from '@vinejs/vine/types'
|
||||
|
||||
export type ParamValue = string | number | bigint | boolean
|
||||
|
||||
export interface Registry {
|
||||
'auth.new_account.store': {
|
||||
methods: ["POST"]
|
||||
pattern: '/api/v1/auth/signup'
|
||||
types: {
|
||||
body: ExtractBody<InferInput<(typeof import('#validators/user').signupValidator)>>
|
||||
paramsTuple: []
|
||||
params: {}
|
||||
query: ExtractQuery<InferInput<(typeof import('#validators/user').signupValidator)>>
|
||||
response: ExtractResponse<Awaited<ReturnType<import('#controllers/new_account_controller').default['store']>>>
|
||||
errorResponse: ExtractErrorResponse<Awaited<ReturnType<import('#controllers/new_account_controller').default['store']>>> | { status: 422; response: { errors: SimpleError[] } }
|
||||
}
|
||||
}
|
||||
'auth.access_tokens.store': {
|
||||
methods: ["POST"]
|
||||
pattern: '/api/v1/auth/login'
|
||||
types: {
|
||||
body: ExtractBody<InferInput<(typeof import('#validators/user').loginValidator)>>
|
||||
paramsTuple: []
|
||||
params: {}
|
||||
query: ExtractQuery<InferInput<(typeof import('#validators/user').loginValidator)>>
|
||||
response: ExtractResponse<Awaited<ReturnType<import('#controllers/access_tokens_controller').default['store']>>>
|
||||
errorResponse: ExtractErrorResponse<Awaited<ReturnType<import('#controllers/access_tokens_controller').default['store']>>> | { status: 422; response: { errors: SimpleError[] } }
|
||||
}
|
||||
}
|
||||
'profile.profile.show': {
|
||||
methods: ["GET","HEAD"]
|
||||
pattern: '/api/v1/account/profile'
|
||||
types: {
|
||||
body: {}
|
||||
paramsTuple: []
|
||||
params: {}
|
||||
query: {}
|
||||
response: ExtractResponse<Awaited<ReturnType<import('#controllers/profile_controller').default['show']>>>
|
||||
errorResponse: ExtractErrorResponse<Awaited<ReturnType<import('#controllers/profile_controller').default['show']>>>
|
||||
}
|
||||
}
|
||||
'profile.access_tokens.destroy': {
|
||||
methods: ["POST"]
|
||||
pattern: '/api/v1/account/logout'
|
||||
types: {
|
||||
body: {}
|
||||
paramsTuple: []
|
||||
params: {}
|
||||
query: {}
|
||||
response: ExtractResponse<Awaited<ReturnType<import('#controllers/access_tokens_controller').default['destroy']>>>
|
||||
errorResponse: ExtractErrorResponse<Awaited<ReturnType<import('#controllers/access_tokens_controller').default['destroy']>>>
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
import type { routes } from './index.ts'
|
||||
|
||||
export interface ApiDefinition {
|
||||
auth: {
|
||||
newAccount: {
|
||||
store: typeof routes['auth.new_account.store']
|
||||
}
|
||||
accessTokens: {
|
||||
store: typeof routes['auth.access_tokens.store']
|
||||
}
|
||||
}
|
||||
profile: {
|
||||
profile: {
|
||||
show: typeof routes['profile.profile.show']
|
||||
}
|
||||
accessTokens: {
|
||||
destroy: typeof routes['profile.access_tokens.destroy']
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user