Skip to content

Commit

Permalink
working frontend bot selector with context
Browse files Browse the repository at this point in the history
  • Loading branch information
domino14 committed Jan 28, 2025
1 parent 5682197 commit eb08b02
Show file tree
Hide file tree
Showing 86 changed files with 4,903 additions and 7,963 deletions.
9 changes: 6 additions & 3 deletions api/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ managed:
value: github.com/woogles-io/liwords/rpc/api

plugins:
- remote: buf.build/protocolbuffers/go:v1.34.1
- remote: buf.build/protocolbuffers/go
out: ../rpc/api
opt:
- paths=source_relative
- remote: buf.build/connectrpc/go:v1.16.2
- remote: buf.build/connectrpc/go
out: ../rpc/api
opt:
- paths=source_relative
- remote: buf.build/bufbuild/es:v2.2.0
- remote: buf.build/bufbuild/es
out: ../liwords-ui/src/gen/api
include_imports: true
opt: target=ts
- remote: buf.build/connectrpc/query-es
out: ../liwords-ui/src/gen/api
opt: target=ts
10 changes: 10 additions & 0 deletions api/proto/user_service/user_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";
package user_service;

import "proto/ipc/chat.proto";
import "google/protobuf/timestamp.proto";

// User service contains an actual service for doing user-related things.
// For example, registering, changing passwords, logging in, logging out, and
Expand Down Expand Up @@ -66,6 +67,13 @@ message SocketTokenResponse {
string front_end_version = 3;
}

message GetSubscriptionCriteriaRequest {}
message GetSubscriptionCriteriaResponse {
string tier_name = 1;
bool entitled_to_bot_games = 2;
google.protobuf.Timestamp last_charge_date = 3;
}

message UserLogoutRequest {}
message LogoutResponse {}
message NotifyAccountClosureRequest { string password = 1; }
Expand All @@ -90,6 +98,8 @@ service AuthenticationService {
rpc InstallSignedCookie(SignedCookieResponse)
returns (InstallSignedCookieResponse);
rpc GetAPIKey(GetAPIKeyRequest) returns (GetAPIKeyResponse);
rpc GetSubscriptionCriteria(GetSubscriptionCriteriaRequest)
returns (GetSubscriptionCriteriaResponse);
}

message GetSignedCookieRequest {}
Expand Down
2 changes: 1 addition & 1 deletion cmd/liwords-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func main() {
oauthIntegrationService := integrations.NewOAuthIntegrationService(stores.SessionStore, stores.Queries, cfg)
integrationService := integrations.NewIntegrationService(stores.Queries)
authenticationService := auth.NewAuthenticationService(stores.UserStore, stores.SessionStore, stores.ConfigStore,
cfg.SecretKey, cfg.MailgunKey, cfg.DiscordToken, cfg.ArgonConfig)
cfg.SecretKey, cfg.MailgunKey, cfg.DiscordToken, cfg.ArgonConfig, stores.Queries)
registrationService := registration.NewRegistrationService(stores.UserStore, cfg.ArgonConfig)
gameService := gameplay.NewGameService(stores.UserStore, stores.GameStore, stores.GameDocumentStore, cfg)
profileService := pkgprofile.NewProfileService(stores.UserStore, userservices.NewS3Uploader(os.Getenv("AVATAR_UPLOAD_BUCKET"), s3Client))
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
Expand Down
117 changes: 116 additions & 1 deletion liwords-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions liwords-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
"@ant-design/icons": "^5.5.2",
"@bufbuild/protobuf": "^2.2.3",
"@connectrpc/connect": "^2.0.0",
"@connectrpc/connect-query": "^2.0.1",
"@connectrpc/connect-web": "^2.0.0",
"@connectrpc/protoc-gen-connect-query": "^2.0.1",
"@reduxjs/toolkit": "^2.5.0",
"@stripe/stripe-js": "^5.3.0",
"@tanstack/react-query": "^5.64.2",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"antd": "^5.22.4",
Expand Down
26 changes: 13 additions & 13 deletions liwords-ui/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -459,23 +459,23 @@ ul {
color: m($primary-midDark);
}
}
&:hover {
@include colorModed() {
background: m($off-background);
color: m($primary-dark);
.hover-help {
display: inline-block;
}
}
}
// &:hover {
// @include colorModed() {
// background: m($off-background);
// color: m($primary-dark);
// .hover-help {
// display: inline-block;
// }
// }
// }
}

.ant-select-item-option-active:not(.ant-select-item-option-disabled),
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
@include colorModed() {
background: m($gray-subtle);
color: m($primary-dark);
}
// @include colorModed() {
// background: m($gray-subtle);
// color: m($primary-dark);
// }
.hover-help {
display: inline-block;
}
Expand Down
Binary file added liwords-ui/src/assets/badges/CHIHUAHUA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added liwords-ui/src/assets/badges/DALMATIAN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added liwords-ui/src/assets/badges/GOLDEN_RETRIEVER.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions liwords-ui/src/assets/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// @generated by protoc-gen-connect-query v2.0.1 with parameter "target=ts"
// @generated from file proto/comments_service/comments_service.proto (package comments_service, syntax proto3)
/* eslint-disable */

import { GameCommentService } from "./comments_service_pb";

/**
* @generated from rpc comments_service.GameCommentService.AddGameComment
*/
export const addGameComment = GameCommentService.method.addGameComment;

/**
* @generated from rpc comments_service.GameCommentService.GetGameComments
*/
export const getGameComments = GameCommentService.method.getGameComments;

/**
* @generated from rpc comments_service.GameCommentService.EditGameComment
*/
export const editGameComment = GameCommentService.method.editGameComment;

/**
* @generated from rpc comments_service.GameCommentService.DeleteGameComment
*/
export const deleteGameComment = GameCommentService.method.deleteGameComment;

/**
* @generated from rpc comments_service.GameCommentService.GetCommentsForAllGames
*/
export const getCommentsForAllGames = GameCommentService.method.getCommentsForAllGames;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
// @generated by protoc-gen-es v2.2.3 with parameter "target=ts"
// @generated from file proto/comments_service/comments_service.proto (package comments_service, syntax proto3)
/* eslint-disable */

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// @generated by protoc-gen-connect-query v2.0.1 with parameter "target=ts"
// @generated from file proto/config_service/config_service.proto (package config_service, syntax proto3)
/* eslint-disable */

import { ConfigService } from "./config_service_pb";

/**
* @generated from rpc config_service.ConfigService.SetGamesEnabled
*/
export const setGamesEnabled = ConfigService.method.setGamesEnabled;

/**
* @generated from rpc config_service.ConfigService.SetFEHash
*/
export const setFEHash = ConfigService.method.setFEHash;

/**
* @generated from rpc config_service.ConfigService.SetUserPermissions
*/
export const setUserPermissions = ConfigService.method.setUserPermissions;

/**
* @generated from rpc config_service.ConfigService.GetUserDetails
*/
export const getUserDetails = ConfigService.method.getUserDetails;

/**
* @generated from rpc config_service.ConfigService.SetAnnouncements
*/
export const setAnnouncements = ConfigService.method.setAnnouncements;

/**
* @generated from rpc config_service.ConfigService.GetAnnouncements
*/
export const getAnnouncements = ConfigService.method.getAnnouncements;

/**
* @generated from rpc config_service.ConfigService.SetSingleAnnouncement
*/
export const setSingleAnnouncement = ConfigService.method.setSingleAnnouncement;

/**
* @generated from rpc config_service.ConfigService.SetGlobalIntegration
*/
export const setGlobalIntegration = ConfigService.method.setGlobalIntegration;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v2.2.0 with parameter "target=ts"
// @generated by protoc-gen-es v2.2.3 with parameter "target=ts"
// @generated from file proto/config_service/config_service.proto (package config_service, syntax proto3)
/* eslint-disable */

Expand Down
Loading

0 comments on commit eb08b02

Please sign in to comment.