diff --git a/.adonisjs/client/data.d.ts b/.adonisjs/client/data.d.ts index 4208617..fd0cf7f 100644 --- a/.adonisjs/client/data.d.ts +++ b/.adonisjs/client/data.d.ts @@ -6,6 +6,7 @@ /// import type { InferData, InferVariants } from '@adonisjs/core/types/transformers' import type { InferSharedProps, InferFlashData } from '@adonisjs/inertia/types' +import type KitsKitCommentTransformer from '#app/kits/transformers/kit_comment_transformer' import type KitsKitRecordTransformer from '#app/kits/transformers/kit_record_transformer' import type KitsKitTransformer from '#app/kits/transformers/kit_transformer' import type ProfileProfileTransformer from '#app/profile/transformers/profile_transformer' @@ -13,6 +14,10 @@ import type InertiaMiddleware from '#core/middleware/inertia_middleware' export namespace Data { export namespace Kits { + export type KitComment = InferData + export namespace KitComment { + export type Variants = InferVariants + } export type KitRecord = InferData export namespace KitRecord { export type Variants = InferVariants diff --git a/.adonisjs/client/registry/index.ts b/.adonisjs/client/registry/index.ts index 65a9aec..fbf89f4 100644 --- a/.adonisjs/client/registry/index.ts +++ b/.adonisjs/client/registry/index.ts @@ -6,12 +6,42 @@ import type { ApiDefinition } from './tree.d.ts' const placeholder: any = {} const routes = { + 'event_stream': { + methods: ["GET","HEAD"], + pattern: '/__transmit/events', + tokens: [{"old":"/__transmit/events","type":0,"val":"__transmit","end":""},{"old":"/__transmit/events","type":0,"val":"events","end":""}], + types: placeholder as Registry['event_stream']['types'], + }, + 'subscribe': { + methods: ["POST"], + pattern: '/__transmit/subscribe', + tokens: [{"old":"/__transmit/subscribe","type":0,"val":"__transmit","end":""},{"old":"/__transmit/subscribe","type":0,"val":"subscribe","end":""}], + types: placeholder as Registry['subscribe']['types'], + }, + 'unsubscribe': { + methods: ["POST"], + pattern: '/__transmit/unsubscribe', + tokens: [{"old":"/__transmit/unsubscribe","type":0,"val":"__transmit","end":""},{"old":"/__transmit/unsubscribe","type":0,"val":"unsubscribe","end":""}], + types: placeholder as Registry['unsubscribe']['types'], + }, 'home': { methods: ["GET","HEAD"], pattern: '/', tokens: [{"old":"/","type":0,"val":"/","end":""}], types: placeholder as Registry['home']['types'], }, + 'stats': { + methods: ["GET","HEAD"], + pattern: '/stats', + tokens: [{"old":"/stats","type":0,"val":"stats","end":""}], + types: placeholder as Registry['stats']['types'], + }, + 'explore': { + methods: ["GET","HEAD"], + pattern: '/explore', + tokens: [{"old":"/explore","type":0,"val":"explore","end":""}], + types: placeholder as Registry['explore']['types'], + }, 'login': { methods: ["GET","HEAD"], pattern: '/login', @@ -90,6 +120,24 @@ const routes = { tokens: [{"old":"/profile/:handle/kit/:rkey","type":0,"val":"profile","end":""},{"old":"/profile/:handle/kit/:rkey","type":1,"val":"handle","end":""},{"old":"/profile/:handle/kit/:rkey","type":0,"val":"kit","end":""},{"old":"/profile/:handle/kit/:rkey","type":1,"val":"rkey","end":""}], types: placeholder as Registry['kit']['types'], }, + 'kits.comments.index': { + methods: ["GET","HEAD"], + pattern: '/profile/:handle/kit/:rkey/comments', + tokens: [{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"profile","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":1,"val":"handle","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"kit","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":1,"val":"rkey","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"comments","end":""}], + types: placeholder as Registry['kits.comments.index']['types'], + }, + 'kits.comments.store': { + methods: ["POST"], + pattern: '/profile/:handle/kit/:rkey/comments', + tokens: [{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"profile","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":1,"val":"handle","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"kit","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":1,"val":"rkey","end":""},{"old":"/profile/:handle/kit/:rkey/comments","type":0,"val":"comments","end":""}], + types: placeholder as Registry['kits.comments.store']['types'], + }, + 'kits.comments.destroy': { + methods: ["DELETE"], + pattern: '/profile/:handle/kit/:rkey/comments/:commentId', + tokens: [{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":0,"val":"profile","end":""},{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":1,"val":"handle","end":""},{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":0,"val":"kit","end":""},{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":1,"val":"rkey","end":""},{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":0,"val":"comments","end":""},{"old":"/profile/:handle/kit/:rkey/comments/:commentId","type":1,"val":"commentId","end":""}], + types: placeholder as Registry['kits.comments.destroy']['types'], + }, 'kits.like': { methods: ["POST"], pattern: '/profile/:handle/kit/:rkey/like', @@ -102,36 +150,6 @@ const routes = { tokens: [{"old":"/profile/:handle/kit/:rkey/like","type":0,"val":"profile","end":""},{"old":"/profile/:handle/kit/:rkey/like","type":1,"val":"handle","end":""},{"old":"/profile/:handle/kit/:rkey/like","type":0,"val":"kit","end":""},{"old":"/profile/:handle/kit/:rkey/like","type":1,"val":"rkey","end":""},{"old":"/profile/:handle/kit/:rkey/like","type":0,"val":"like","end":""}], types: placeholder as Registry['kits.unlike']['types'], }, - 'stats': { - methods: ["GET","HEAD"], - pattern: '/stats', - tokens: [{"old":"/stats","type":0,"val":"stats","end":""}], - types: placeholder as Registry['stats']['types'], - }, - 'explore': { - methods: ["GET","HEAD"], - pattern: '/explore', - tokens: [{"old":"/explore","type":0,"val":"explore","end":""}], - types: placeholder as Registry['explore']['types'], - }, - 'event_stream': { - methods: ["GET","HEAD"], - pattern: '/__transmit/events', - tokens: [{"old":"/__transmit/events","type":0,"val":"__transmit","end":""},{"old":"/__transmit/events","type":0,"val":"events","end":""}], - types: placeholder as Registry['event_stream']['types'], - }, - 'subscribe': { - methods: ["POST"], - pattern: '/__transmit/subscribe', - tokens: [{"old":"/__transmit/subscribe","type":0,"val":"__transmit","end":""},{"old":"/__transmit/subscribe","type":0,"val":"subscribe","end":""}], - types: placeholder as Registry['subscribe']['types'], - }, - 'unsubscribe': { - methods: ["POST"], - pattern: '/__transmit/unsubscribe', - tokens: [{"old":"/__transmit/unsubscribe","type":0,"val":"__transmit","end":""},{"old":"/__transmit/unsubscribe","type":0,"val":"unsubscribe","end":""}], - types: placeholder as Registry['unsubscribe']['types'], - }, } as const satisfies Record export { routes } diff --git a/.adonisjs/client/registry/schema.d.ts b/.adonisjs/client/registry/schema.d.ts index 94fe50d..df9f7d5 100644 --- a/.adonisjs/client/registry/schema.d.ts +++ b/.adonisjs/client/registry/schema.d.ts @@ -7,6 +7,42 @@ import type { InferInput, SimpleError } from '@vinejs/vine/types' export type ParamValue = string | number | bigint | boolean export interface Registry { + 'event_stream': { + methods: ["GET","HEAD"] + pattern: '/__transmit/events' + types: { + body: {} + paramsTuple: [] + params: {} + query: {} + response: unknown + errorResponse: unknown + } + } + 'subscribe': { + methods: ["POST"] + pattern: '/__transmit/subscribe' + types: { + body: {} + paramsTuple: [] + params: {} + query: {} + response: unknown + errorResponse: unknown + } + } + 'unsubscribe': { + methods: ["POST"] + pattern: '/__transmit/unsubscribe' + types: { + body: {} + paramsTuple: [] + params: {} + query: {} + response: unknown + errorResponse: unknown + } + } 'home': { methods: ["GET","HEAD"] pattern: '/' @@ -19,6 +55,30 @@ export interface Registry { errorResponse: ExtractErrorResponse>> } } + 'stats': { + methods: ["GET","HEAD"] + pattern: '/stats' + types: { + body: {} + paramsTuple: [] + params: {} + query: {} + response: ExtractResponse>> + errorResponse: ExtractErrorResponse>> + } + } + 'explore': { + methods: ["GET","HEAD"] + pattern: '/explore' + types: { + body: {} + paramsTuple: [] + params: {} + query: ExtractQueryForGet> + response: ExtractResponse>> + errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } + } + } 'login': { methods: ["GET","HEAD"] pattern: '/login' @@ -175,6 +235,42 @@ export interface Registry { errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } } } + 'kits.comments.index': { + methods: ["GET","HEAD"] + pattern: '/profile/:handle/kit/:rkey/comments' + types: { + body: {} + paramsTuple: [ParamValue, ParamValue] + params: { handle: ParamValue; rkey: ParamValue } + query: ExtractQueryForGet> + response: ExtractResponse>> + errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } + } + } + 'kits.comments.store': { + methods: ["POST"] + pattern: '/profile/:handle/kit/:rkey/comments' + types: { + body: ExtractBody|InferInput<(typeof import('#kits/validators/kit_comment').storeKitCommentValidator)>> + paramsTuple: [ParamValue, ParamValue] + params: { handle: ParamValue; rkey: ParamValue } + query: ExtractQuery|InferInput<(typeof import('#kits/validators/kit_comment').storeKitCommentValidator)>> + response: ExtractResponse>> + errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } + } + } + 'kits.comments.destroy': { + methods: ["DELETE"] + pattern: '/profile/:handle/kit/:rkey/comments/:commentId' + types: { + body: ExtractBody> + paramsTuple: [ParamValue, ParamValue, ParamValue] + params: { handle: ParamValue; rkey: ParamValue; commentId: ParamValue } + query: ExtractQuery> + response: ExtractResponse>> + errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } + } + } 'kits.like': { methods: ["POST"] pattern: '/profile/:handle/kit/:rkey/like' @@ -199,64 +295,4 @@ export interface Registry { errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } } } - 'stats': { - methods: ["GET","HEAD"] - pattern: '/stats' - types: { - body: {} - paramsTuple: [] - params: {} - query: {} - response: ExtractResponse>> - errorResponse: ExtractErrorResponse>> - } - } - 'explore': { - methods: ["GET","HEAD"] - pattern: '/explore' - types: { - body: {} - paramsTuple: [] - params: {} - query: ExtractQueryForGet> - response: ExtractResponse>> - errorResponse: ExtractErrorResponse>> | { status: 422; response: { errors: SimpleError[] } } - } - } - 'event_stream': { - methods: ["GET","HEAD"] - pattern: '/__transmit/events' - types: { - body: {} - paramsTuple: [] - params: {} - query: {} - response: unknown - errorResponse: unknown - } - } - 'subscribe': { - methods: ["POST"] - pattern: '/__transmit/subscribe' - types: { - body: {} - paramsTuple: [] - params: {} - query: {} - response: unknown - errorResponse: unknown - } - } - 'unsubscribe': { - methods: ["POST"] - pattern: '/__transmit/unsubscribe' - types: { - body: {} - paramsTuple: [] - params: {} - query: {} - response: unknown - errorResponse: unknown - } - } } diff --git a/.adonisjs/client/registry/tree.d.ts b/.adonisjs/client/registry/tree.d.ts index 51c09ac..ce9dd4e 100644 --- a/.adonisjs/client/registry/tree.d.ts +++ b/.adonisjs/client/registry/tree.d.ts @@ -2,7 +2,12 @@ import type { routes } from './index.ts' export interface ApiDefinition { + eventStream: typeof routes['event_stream'] + subscribe: typeof routes['subscribe'] + unsubscribe: typeof routes['unsubscribe'] home: typeof routes['home'] + stats: typeof routes['stats'] + explore: typeof routes['explore'] login: typeof routes['login'] oauth: { logout: typeof routes['oauth.logout'] @@ -17,14 +22,14 @@ export interface ApiDefinition { edit: typeof routes['kits.edit'] update: typeof routes['kits.update'] destroy: typeof routes['kits.destroy'] + comments: { + index: typeof routes['kits.comments.index'] + store: typeof routes['kits.comments.store'] + destroy: typeof routes['kits.comments.destroy'] + } like: typeof routes['kits.like'] unlike: typeof routes['kits.unlike'] } profile: typeof routes['profile'] kit: typeof routes['kit'] - stats: typeof routes['stats'] - explore: typeof routes['explore'] - eventStream: typeof routes['event_stream'] - subscribe: typeof routes['subscribe'] - unsubscribe: typeof routes['unsubscribe'] } diff --git a/.adonisjs/server/controllers.ts b/.adonisjs/server/controllers.ts index 72afe6b..f7273ce 100644 --- a/.adonisjs/server/controllers.ts +++ b/.adonisjs/server/controllers.ts @@ -18,6 +18,7 @@ export const controllers = { }, kits: { DestroyKit: () => import('#app/kits/controllers/destroy_kit_controller'), + KitComments: () => import('#app/kits/controllers/kit_comments_controller'), KitLikes: () => import('#app/kits/controllers/kit_likes_controller'), ListKits: () => import('#app/kits/controllers/list_kits_controller'), StoreKit: () => import('#app/kits/controllers/store_kit_controller'), diff --git a/.adonisjs/server/routes.d.ts b/.adonisjs/server/routes.d.ts index db33e8c..8743e7e 100644 --- a/.adonisjs/server/routes.d.ts +++ b/.adonisjs/server/routes.d.ts @@ -4,7 +4,12 @@ type ParamValue = string | number | bigint | boolean export type ScannedRoutes = { ALL: { + 'event_stream': { paramsTuple?: []; params?: {} } + 'subscribe': { paramsTuple?: []; params?: {} } + 'unsubscribe': { paramsTuple?: []; params?: {} } 'home': { paramsTuple?: []; params?: {} } + 'stats': { paramsTuple?: []; params?: {} } + 'explore': { paramsTuple?: []; params?: {} } 'login': { paramsTuple?: []; params?: {} } 'oauth.logout': { paramsTuple?: []; params?: {} } 'oauth.login': { paramsTuple?: []; params?: {} } @@ -18,16 +23,17 @@ export type ScannedRoutes = { 'kits.destroy': { paramsTuple: [ParamValue]; params: {'rkey': ParamValue} } 'profile': { paramsTuple: [ParamValue]; params: {'handle': ParamValue} } 'kit': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } + 'kits.comments.index': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } + 'kits.comments.store': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } + 'kits.comments.destroy': { paramsTuple: [ParamValue,ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue,'commentId': ParamValue} } 'kits.like': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } 'kits.unlike': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } - 'stats': { paramsTuple?: []; params?: {} } - 'explore': { paramsTuple?: []; params?: {} } - 'event_stream': { paramsTuple?: []; params?: {} } - 'subscribe': { paramsTuple?: []; params?: {} } - 'unsubscribe': { paramsTuple?: []; params?: {} } } GET: { + 'event_stream': { paramsTuple?: []; params?: {} } 'home': { paramsTuple?: []; params?: {} } + 'stats': { paramsTuple?: []; params?: {} } + 'explore': { paramsTuple?: []; params?: {} } 'login': { paramsTuple?: []; params?: {} } 'oauth.callback': { paramsTuple?: []; params?: {} } 'shelf': { paramsTuple?: []; params?: {} } @@ -35,12 +41,13 @@ export type ScannedRoutes = { 'kits.edit': { paramsTuple: [ParamValue]; params: {'rkey': ParamValue} } 'profile': { paramsTuple: [ParamValue]; params: {'handle': ParamValue} } 'kit': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } - 'stats': { paramsTuple?: []; params?: {} } - 'explore': { paramsTuple?: []; params?: {} } - 'event_stream': { paramsTuple?: []; params?: {} } + 'kits.comments.index': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } } HEAD: { + 'event_stream': { paramsTuple?: []; params?: {} } 'home': { paramsTuple?: []; params?: {} } + 'stats': { paramsTuple?: []; params?: {} } + 'explore': { paramsTuple?: []; params?: {} } 'login': { paramsTuple?: []; params?: {} } 'oauth.callback': { paramsTuple?: []; params?: {} } 'shelf': { paramsTuple?: []; params?: {} } @@ -48,24 +55,24 @@ export type ScannedRoutes = { 'kits.edit': { paramsTuple: [ParamValue]; params: {'rkey': ParamValue} } 'profile': { paramsTuple: [ParamValue]; params: {'handle': ParamValue} } 'kit': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } - 'stats': { paramsTuple?: []; params?: {} } - 'explore': { paramsTuple?: []; params?: {} } - 'event_stream': { paramsTuple?: []; params?: {} } + 'kits.comments.index': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } } POST: { + 'subscribe': { paramsTuple?: []; params?: {} } + 'unsubscribe': { paramsTuple?: []; params?: {} } 'oauth.logout': { paramsTuple?: []; params?: {} } 'oauth.login': { paramsTuple?: []; params?: {} } 'oauth.signup': { paramsTuple?: []; params?: {} } 'kits.store': { paramsTuple?: []; params?: {} } + 'kits.comments.store': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } 'kits.like': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } - 'subscribe': { paramsTuple?: []; params?: {} } - 'unsubscribe': { paramsTuple?: []; params?: {} } } PUT: { 'kits.update': { paramsTuple: [ParamValue]; params: {'rkey': ParamValue} } } DELETE: { 'kits.destroy': { paramsTuple: [ParamValue]; params: {'rkey': ParamValue} } + 'kits.comments.destroy': { paramsTuple: [ParamValue,ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue,'commentId': ParamValue} } 'kits.unlike': { paramsTuple: [ParamValue,ParamValue]; params: {'handle': ParamValue,'rkey': ParamValue} } } }