Paperclip/pkg/internal/server/api/index.go

44 lines
1.8 KiB
Go
Raw Normal View History

package api
2024-10-27 05:13:40 +00:00
import (
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"github.com/gofiber/fiber/v2"
)
2024-07-16 09:02:16 +00:00
func MapAPIs(app *fiber.App, baseURL string) {
app.Get("/.well-known/destinations", getDestinations)
2024-07-16 09:02:16 +00:00
api := app.Group(baseURL).Name("API")
{
2024-08-18 04:01:41 +00:00
api.Get("/pools", listPost)
api.Get("/pools/:id", getPool)
2024-10-27 05:13:40 +00:00
api.Post("/pools", sec.ValidatorMiddleware, createPool)
api.Put("/pools/:id", sec.ValidatorMiddleware, updatePool)
api.Delete("/pools/:id", sec.ValidatorMiddleware, deletePool)
2024-08-18 04:01:41 +00:00
2024-07-25 14:12:00 +00:00
api.Get("/attachments", listAttachment)
api.Get("/attachments/:id/meta", getAttachmentMeta)
api.Get("/attachments/:id", openAttachment)
2024-10-27 05:13:40 +00:00
api.Post("/attachments", sec.ValidatorMiddleware, createAttachmentDirectly)
api.Put("/attachments/:id", sec.ValidatorMiddleware, updateAttachmentMeta)
api.Delete("/attachments/:id", sec.ValidatorMiddleware, deleteAttachment)
2024-08-03 07:43:15 +00:00
2024-10-27 05:13:40 +00:00
api.Post("/attachments/multipart", sec.ValidatorMiddleware, createAttachmentMultipartPlaceholder)
api.Post("/attachments/multipart/:file/:chunk", sec.ValidatorMiddleware, uploadAttachmentMultipart)
2024-08-20 09:08:40 +00:00
api.Get("/stickers/lookup", lookupStickerBatch)
api.Get("/stickers/lookup/:alias", lookupSticker)
2024-08-03 07:43:15 +00:00
api.Get("/stickers/packs", listStickerPacks)
api.Get("/stickers/packs/:packId", getStickerPack)
2024-10-27 05:13:40 +00:00
api.Post("/stickers/packs", sec.ValidatorMiddleware, createStickerPack)
api.Put("/stickers/packs/:packId", sec.ValidatorMiddleware, updateStickerPack)
api.Delete("/stickers/packs/:packId", sec.ValidatorMiddleware, deleteStickerPack)
2024-08-03 07:43:15 +00:00
2024-08-03 08:16:14 +00:00
api.Get("/stickers", listStickers)
2024-08-03 07:43:15 +00:00
api.Get("/stickers/:stickerId", getSticker)
2024-10-27 05:13:40 +00:00
api.Post("/stickers", sec.ValidatorMiddleware, createSticker)
api.Put("/stickers/:stickerId", sec.ValidatorMiddleware, updateSticker)
api.Delete("/stickers/:stickerId", sec.ValidatorMiddleware, deleteSticker)
}
}