-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
399 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
src/v2/routes/auth/asset-categories/assetCategoryRoutes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createAssetCategory } from "./createAssetCategory" | ||
import { deleteAssetCategory } from "./deleteAssetCategory" | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
|
||
const assetCategoryRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
assetCategoryRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
assetCategoryRoute.post("/create", async (c) => { | ||
return createAssetCategory(c) | ||
}) | ||
|
||
assetCategoryRoute.post("/delete", async (c) => { | ||
return deleteAssetCategory(c) | ||
}) | ||
|
||
export default assetCategoryRoute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { approveAsset } from "./approveAsset" | ||
import { getUnapprovedAssets } from "./getUnapprovedAssets" | ||
import { modifyAssetData } from "./modifyAsset" | ||
import { uploadAsset } from "./uploadAsset" | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
import collectionsRoute from "./collections/collectionsRoutes" | ||
import favoriteAssetRoute from "./favorite/favoriteAssetRoutes" | ||
|
||
const assetRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
assetRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
assetRoute.get("/unapproved", async (c) => { | ||
return getUnapprovedAssets(c) | ||
}) | ||
|
||
assetRoute.post("/approve/:assetIdToApprove", async (c) => { | ||
return approveAsset(c) | ||
}) | ||
|
||
assetRoute.post("/modify/:assetIdToModify", async (c) => { | ||
return modifyAssetData(c) | ||
}) | ||
|
||
assetRoute.post("/upload", async (c) => { | ||
return uploadAsset(c) | ||
}) | ||
|
||
assetRoute.route("/collections", collectionsRoute) | ||
assetRoute.route("/favorite", favoriteAssetRoute) | ||
|
||
export default assetRoute |
44 changes: 44 additions & 0 deletions
44
src/v2/routes/auth/assets/collections/collectionsRoutes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { addAssetToCollection } from "./addAssetToCollection" | ||
import { createAssetCollection } from "./createAssetCollection" | ||
import { deleteAssetCollection } from "./deleteAssetCollection" | ||
import { deleteAssetFromCollection } from "./deleteAssetFromCollection" | ||
import { viewAssetCollection } from "./viewAssetCollection" | ||
import { viewAssetCollections } from "./viewAssetCollections" | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
|
||
const collectionsRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
collectionsRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
collectionsRoute.post("/create", async (c) => { | ||
return createAssetCollection(c) | ||
}) | ||
|
||
collectionsRoute.post("/delete", async (c) => { | ||
return deleteAssetCollection(c) | ||
}) | ||
|
||
collectionsRoute.post("/add", async (c) => { | ||
return addAssetToCollection(c) | ||
}) | ||
|
||
collectionsRoute.post("/remove", async (c) => { | ||
return deleteAssetFromCollection(c) | ||
}) | ||
|
||
collectionsRoute.get("/all", async (c) => { | ||
return viewAssetCollections(c) | ||
}) | ||
|
||
collectionsRoute.get("/:collectionId", async (c) => { | ||
return viewAssetCollection(c) | ||
}) | ||
|
||
export default collectionsRoute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
import { favoriteAsset } from "./addFavoriteAsset" | ||
import { removeFavoriteAsset } from "./removeFavoriteAsset" | ||
import { viewFavoriteAssets } from "./viewFavoriteAssets" | ||
|
||
const favoriteAssetRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
favoriteAssetRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
favoriteAssetRoute.post("/add", async (c) => { | ||
return favoriteAsset(c) | ||
}) | ||
|
||
favoriteAssetRoute.post("/remove", async (c) => { | ||
return removeFavoriteAsset(c) | ||
}) | ||
|
||
favoriteAssetRoute.get("/all", async (c) => { | ||
return viewFavoriteAssets(c) | ||
}) | ||
|
||
export default favoriteAssetRoute |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Hono } from "hono" | ||
import { login } from "./login" | ||
import { logout } from "./logout" | ||
import { signup } from "./signup" | ||
import { cors } from "hono/cors" | ||
import { validate } from "./validate" | ||
import assetCategoryRoute from "./asset-categories/assetCategoryRoutes" | ||
import assetRoute from "./assets/assetRoutes" | ||
import ocGeneratorRoute from "./oc-generators/ocGeneratorRoutes" | ||
import gameRoute from "./games/gameRoutes" | ||
import tagRoute from "./tags/tagRoutes" | ||
import userAttributesRoute from "./user-attributes/userAttributesRoutes" | ||
|
||
const authRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
authRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
authRoute.post("/login", async (c) => { | ||
return login(c) | ||
}) | ||
|
||
authRoute.get("/validate", async (c) => { | ||
return validate(c) | ||
}) | ||
|
||
authRoute.post("/logout", async (c) => { | ||
return logout(c) | ||
}) | ||
|
||
authRoute.post("/signup", async (c) => { | ||
return signup(c) | ||
}) | ||
|
||
authRoute.route("/assets", assetRoute) | ||
authRoute.route("/asset-categories", assetCategoryRoute) | ||
authRoute.route("/oc-generators", ocGeneratorRoute) | ||
authRoute.route("/games", gameRoute) | ||
authRoute.route("/tags", tagRoute) | ||
authRoute.route("/user-attributes", userAttributesRoute) | ||
|
||
export default authRoute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createGame } from "./createGame" | ||
import { deleteGame } from "./deleteGame" | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
|
||
const gameRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
gameRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
gameRoute.post("/create", async (c) => { | ||
return createGame(c) | ||
}) | ||
|
||
gameRoute.post("/delete", async (c) => { | ||
return deleteGame(c) | ||
}) | ||
|
||
export default gameRoute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { saveOCGeneratorResponse } from "./saveOCGeneratorResponse" | ||
import { deleteOCGeneratorResponse } from "./deleteOCGeneratorResponse" | ||
import { viewOCGeneratorResponses } from "./viewOCGeneratorResponses" | ||
import { Hono } from "hono" | ||
import { cors } from "hono/cors" | ||
|
||
const ocGeneratorRoute = new Hono<{ Bindings: Bindings }>() | ||
|
||
ocGeneratorRoute.use( | ||
"*", | ||
cors({ | ||
credentials: true, | ||
origin: ["http://localhost:3000"], // TODO: update this - temporary | ||
}) | ||
) | ||
|
||
ocGeneratorRoute.post("/save", async (c) => { | ||
return saveOCGeneratorResponse(c) | ||
}) | ||
|
||
ocGeneratorRoute.post("/delete", async (c) => { | ||
return deleteOCGeneratorResponse(c) | ||
}) | ||
|
||
ocGeneratorRoute.get("/all", async (c) => { | ||
return viewOCGeneratorResponses(c) | ||
}) | ||
|
||
export default ocGeneratorRoute |
Oops, something went wrong.