Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ REST Api #98

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions api-spec/Buy Item.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Buy Item
type: http
seq: 6
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/buyItem/{{ITEM_NAME}}
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
ITEM_NAME: frostHammer
}
16 changes: 16 additions & 0 deletions api-spec/Craft Recipe.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Craft Recipe
type: http
seq: 10
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/craft/{{RECIPE_ID}}
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
RECIPE_ID: 14
}
11 changes: 11 additions & 0 deletions api-spec/Create Game.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Create Game
type: http
seq: 1
}

post {
url: {{BASE_URL}}/api/rest/game
body: none
auth: none
}
11 changes: 11 additions & 0 deletions api-spec/Current User.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Current User
type: http
seq: 2
}

get {
url: {{BASE_URL}}/api/rest/user
body: none
auth: none
}
15 changes: 15 additions & 0 deletions api-spec/Fight.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Fight
type: http
seq: 9
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/fight
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
}
11 changes: 11 additions & 0 deletions api-spec/Get All Items.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get All Items
type: http
seq: 12
}

get {
url: {{BASE_URL}}/api/rest/items
body: none
auth: none
}
11 changes: 11 additions & 0 deletions api-spec/Get All Recipes.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: Get All Recipes
type: http
seq: 13
}

get {
url: {{BASE_URL}}/api/rest/recipes
body: none
auth: none
}
15 changes: 15 additions & 0 deletions api-spec/Get Available Recipes.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Get Available Recipes
type: http
seq: 11
}

get {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/craft
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
}
15 changes: 15 additions & 0 deletions api-spec/Get Game By Id.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Get Game By Id
type: http
seq: 3
}

get {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}
body: none
auth: none
}

vars:pre-request {
GAME_ID: k3f46r6egmy1jiiqr5kk3p9a
}
15 changes: 15 additions & 0 deletions api-spec/Reroll Shop.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Reroll Shop
type: http
seq: 5
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/reroll
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
}
16 changes: 16 additions & 0 deletions api-spec/Reserve Item.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Reserve Item
type: http
seq: 8
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/reserveItem/{{ITEM_NAME}}
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
ITEM_NAME: cursedPiggyBank
}
16 changes: 16 additions & 0 deletions api-spec/Sell Item.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Sell Item
type: http
seq: 7
}

post {
url: {{BASE_URL}}/api/rest/game/{{GAME_ID}}/sellItem/{{ITEM_NAME}}
body: none
auth: none
}

vars:pre-request {
GAME_ID: v7n9x4p8jriutz77kagrl7fk
ITEM_NAME: dagger
}
9 changes: 9 additions & 0 deletions api-spec/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "Auto Cards",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
7 changes: 7 additions & 0 deletions api-spec/collection.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
headers {
x-api-key: ac_yCtQ25Xp7DrFRNEh
}

vars:pre-request {
BASE_URL: http://localhost:3000
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"jotai": "^2.8.0",
"lodash-es": "^4.17.21",
"lucide-react": "^0.427.0",
"nanoid": "^5.0.7",
"next": "14.2.7",
"next-auth": "5.0.0-beta.16",
"next-themes": "^0.2.1",
Expand Down
Loading