Commit Graph

20 Commits (333329c631f91c9a22c91a6fea905c12f2b9ec0a)

Author SHA1 Message Date
Joey Hines 333329c631
Added local api server + geoffrey_cli
ci/woodpecker/push/woodpecker Pipeline failed Details
+ Local api server is designed to allow local access to Geoffrey without a token
+ Uses a unix domain socket, allowing permissions to be handled by the OS
+ Started work on a tool to exploit this, geoffrey-cli
2022-02-06 15:32:33 -07:00
Joey Hines a8f5f5d87b
Added global settings
ci/woodpecker/push/woodpecker Pipeline was successful Details
+ Usedful for the impls to retrieve settings without having to redefine them in each project
+ Start of models api
+ Bunch of small tweaks
+ clippy + fmt
2022-01-08 12:35:55 -07:00
Joey Hines 51d6ffb7be
Added report_out_of_stock command to bot
ci/woodpecker/push/woodpecker Pipeline was successful Details
+ Added params to the build_response function
+ Updated some commands with more helpful responses
+ Fixed issue with v4 migration
+ clippy + fmt
2022-01-06 18:49:49 -07:00
Joey Hines c6ec8467c1
report_out_of_stock command + new query system
continuous-integration/woodpecker the build was successful Details
+ report_out_of_stock can be used by a when an item is not in stock in a shop
+ Added new query system
  + Impl for both LocationDB and Player for now
  + Goal is to increase code re-use without a million functions for different queries
  + Should be expanded to more models
  + I Should really just rip out the DB and make it a generic thing
+ Clippy + fmt
2021-12-30 21:48:33 -06:00
Joey Hines 928e59a700
Added restock command
continuous-integration/woodpecker the build was successful Details
+ Discord command has not been tested
+ Clippy + Fmt
2021-12-26 21:36:32 -06:00
Joey Hines caf7212cca
Added string length validation (#4)
continuous-integration/woodpecker the build failed Details
+ Added a length check to string fields on add_item and add_location
+ Only doing length validation for now
+ Clippy + Fmt
2021-12-22 19:00:40 -07:00
Joey Hines 6bc80af865
Added info command
continuous-integration/woodpecker the build was successful Details
+ Clippy + Fmt
2021-12-19 15:16:22 -07:00
Joey Hines d9a3a05067
Added 'remove_item' command
continuous-integration/woodpecker the build was successful Details
+ Allows a user to remove an item from a shop
+ Clippy + fmt
2021-12-19 14:55:59 -07:00
Joey Hines 18a4373313
Added 'edit' commands
continuous-integration/woodpecker the build was successful Details
+ Allows a location's name or position to be updated
+ Added a bots commands for it, two for now as subcommands are not working right
+ Logging fix
+ Updated return messages for some bot commands
2021-12-19 14:06:56 -07:00
Joey Hines 48be50dd67
Added link command
continuous-integration/woodpecker the build was successful Details
+ Link provides a link code that a user can use to link other accounts
+ This places the main auth source into MC and the plugin
+ Refactored register to accept a link code
+ Clippy + fmt
2021-12-18 11:13:18 -07:00
Joey Hines 3711e7011c
Refactored parameter handling + added delete command
+ CommandRequest is now a struct that contains a generic parameter for the type
+ This streamlines adding new command parameters and reduces duplicate code
+ Added delete commands
2021-12-17 20:03:15 -07:00
Joey Hines 199516f3cc
Added set_portal to the API
+ Bumped DB version to 3
+ Renamed "tunnel" to "portal" on the location models
+ Added a new migration
+ Cargo + Clippy
2021-12-07 20:33:25 -07:00
Joey Hines e1b362aa1c
Implemented sorting an ordering for selling
+ Added parameter validation as well
+ Currently, Restock and Price are the two sorting methods available
2021-11-14 16:28:55 -07:00
Joey Hines 8e8798f509
First pass on shop/item handling
+ The `add_item` command adds items to a location of type `Shop`
+ `selling` allows items to be queried
  + Items are not sorted yet
  + The user will be able to apply optional sorting params
+ Allowed the `insert` function of the DB to be used to update a model already in the DB
+ Clippy + Fmt
2021-11-07 14:23:18 -07:00
Joey Hines 22ffe75422
Added API token handling
+ Tokens can be added by the add_token command or via the CLI
+ Tokens are checked for authorization before a command is run
+ Added an error message field to the GeoffreyApiResponse
+ Made tokens strings instead of u64s
  + Tokens are randomly generated 64 char long alphanumeric strings
+ Clippy + Fmt
2021-10-31 11:00:07 -06:00
Joey Hines b79db6029e
Fmt + Clippy 2021-10-24 13:21:30 -06:00
Joey Hines 8e6b652d5e
Added user_id checking to commands
+ Refactored to make CommandRequest a trait that all the parameter structs implment
+ Created handle_command to handle all the preprocessing needed before running the command
2021-10-24 13:20:15 -06:00
Joey Hines b3c0e2dcb0
Fmt + Clippy 2021-10-23 13:13:28 -06:00
Joey Hines f6b797b6c1
Added logging infrastructure
+ Using log and simple_logger libs
+ Added a command line argument to set the log level
2021-10-17 13:09:50 -06:00
Joey Hines b92308da67
First pass of an API
+ Implemented register, find, and add_location
+ Bunch of changes to the DB and the Models to make this work
+ API models are defined in GeoffreyModels so things that call the API don't need to define their own types
+ Still needs a lot of work, and need to design the api a bit more
+ Clippy + fmt
2021-10-03 14:03:32 -06:00