Skip to content
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
4,916 changes: 4,856 additions & 60 deletions generated/schema.graphql

Large diffs are not rendered by default.

4,913 changes: 4,903 additions & 10 deletions generated/schema.ts

Large diffs are not rendered by default.

47,110 changes: 26,934 additions & 20,176 deletions generated/types.ts

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions hasura/enums/draft-game-captain-selection.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
insert into e_draft_game_captain_selection ("value", "description") values
('TopEloTwo', 'Top 2 by Rank'),
('HostAndNext', 'Host and Next Highest'),
('RandomTwo', 'Random Two')
on conflict(value) do update set "description" = EXCLUDED."description"
4 changes: 4 additions & 0 deletions hasura/enums/draft-game-draft-order.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
insert into e_draft_game_draft_order ("value", "description") values
('Snake', 'Snake (1-2-2-2-1)'),
('Alternating', 'Alternating')
on conflict(value) do update set "description" = EXCLUDED."description"
6 changes: 6 additions & 0 deletions hasura/enums/draft-game-modes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
insert into e_draft_game_mode ("value", "description") values
('Captains', 'Two Captains Draft'),
('Host', 'Host Assigns Teams'),
('Pug', 'Auto-Split Teams'),
('Teams', 'Pre-Made Teams')
on conflict(value) do update set "description" = EXCLUDED."description"
9 changes: 9 additions & 0 deletions hasura/enums/draft-game-statuses.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
insert into e_draft_game_status ("value", "description") values
('Open', 'Accepting Players'),
('Filled', 'Lobby Full'),
('SelectingCaptains', 'Selecting Captains'),
('Drafting', 'Drafting Players'),
('CreatingMatch', 'Creating Match'),
('Completed', 'Completed'),
('Canceled', 'Canceled')
on conflict(value) do update set "description" = EXCLUDED."description"
4 changes: 4 additions & 0 deletions hasura/metadata/actions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ type Mutation {
scanOrphanedDemos: ScanStartedOutput
}

type Mutation {
rescanTldrNews: SuccessOutput
}

type Mutation {
orphanedDemosScanResult: OrphanScanResultOutput
}
Expand Down
8 changes: 8 additions & 0 deletions hasura/metadata/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@ actions:
permissions:
- role: administrator
comment: Scan S3 for objects not referenced in the database (admin only). Runs in the background; results land in the logs and orphanedDemosScanResult.
- name: rescanTldrNews
definition:
kind: synchronous
handler: '{{HASURA_GRAPHQL_ACTIONS_HOOK}}'
forward_client_headers: true
permissions:
- role: administrator
comment: Re-scan tl;dr for new news articles (admin only). Enqueues a background scrape job; no-op if the integration is disabled.
- name: orphanedDemosScanResult
definition:
kind: synchronous
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
table:
name: draft_game_picks
schema: public
object_relationships:
- name: draft_game
using:
foreign_key_constraint_on: draft_game_id
- name: captain
using:
foreign_key_constraint_on: captain_steam_id
- name: picked
using:
foreign_key_constraint_on: picked_steam_id
select_permissions:
- role: user
permission:
columns:
- id
- draft_game_id
- captain_steam_id
- picked_steam_id
- lineup
- auto_picked
- created_at
filter:
draft_game:
_or:
- access:
_eq: Open
- host_steam_id:
_eq: X-Hasura-User-Id
- players:
steam_id:
_eq: X-Hasura-User-Id
- _and:
- access:
_eq: Friends
- players:
player:
friends:
steam_id:
_eq: X-Hasura-User-Id
comment: ""
- role: guest
permission:
columns:
- id
- draft_game_id
- captain_steam_id
- picked_steam_id
- lineup
- auto_picked
- created_at
filter:
draft_game:
access:
_eq: Open
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
table:
name: draft_game_players
schema: public
object_relationships:
- name: draft_game
using:
foreign_key_constraint_on: draft_game_id
- name: e_draft_game_player_status
using:
foreign_key_constraint_on: status
- name: player
using:
foreign_key_constraint_on: steam_id
select_permissions:
- role: user
permission:
columns:
- draft_game_id
- steam_id
- status
- joined_at
- elo_snapshot
- is_captain
- lineup
- pick_order
filter:
_or:
- steam_id:
_eq: X-Hasura-User-Id
- draft_game:
_or:
- access:
_eq: Open
- host_steam_id:
_eq: X-Hasura-User-Id
- players:
steam_id:
_eq: X-Hasura-User-Id
- _and:
- access:
_eq: Friends
- players:
player:
friends:
steam_id:
_eq: X-Hasura-User-Id
comment: ""
- role: guest
permission:
columns:
- draft_game_id
- steam_id
- status
- joined_at
- elo_snapshot
- is_captain
- lineup
- pick_order
filter:
draft_game:
access:
_eq: Open
comment: ""
130 changes: 130 additions & 0 deletions hasura/metadata/databases/default/tables/public_draft_games.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
table:
name: draft_games
schema: public
object_relationships:
- name: host
using:
foreign_key_constraint_on: host_steam_id
- name: match
using:
foreign_key_constraint_on: match_id
- name: map_pool
using:
foreign_key_constraint_on: map_pool_id
- name: e_draft_game_status
using:
foreign_key_constraint_on: status
- name: e_draft_game_captain_selection
using:
foreign_key_constraint_on: captain_selection
- name: e_draft_game_draft_order
using:
foreign_key_constraint_on: draft_order
- name: e_draft_game_mode
using:
foreign_key_constraint_on: mode
- name: e_lobby_access
using:
foreign_key_constraint_on: access
- name: options
using:
foreign_key_constraint_on: match_options_id
- name: team_1
using:
foreign_key_constraint_on: team_1_id
- name: team_2
using:
foreign_key_constraint_on: team_2_id
array_relationships:
- name: players
using:
foreign_key_constraint_on:
column: draft_game_id
table:
name: draft_game_players
schema: public
- name: picks
using:
foreign_key_constraint_on:
column: draft_game_id
table:
name: draft_game_picks
schema: public
select_permissions:
- role: user
permission:
columns:
- id
- host_steam_id
- status
- type
- access
- invite_code
- regions
- map_pool_id
- match_options_id
- team_1_id
- team_2_id
- captain_selection
- draft_order
- mode
- require_approval
- min_elo
- max_elo
- capacity
- inner_squad
- match_id
- current_pick_lineup
- pick_deadline
- created_at
- updated_at
filter:
_or:
- access:
_eq: Open
- host_steam_id:
_eq: X-Hasura-User-Id
- players:
steam_id:
_eq: X-Hasura-User-Id
- _and:
- access:
_eq: Friends
- players:
player:
friends:
steam_id:
_eq: X-Hasura-User-Id
allow_aggregations: true
comment: ""
- role: guest
permission:
columns:
- id
- host_steam_id
- status
- type
- access
- regions
- map_pool_id
- match_options_id
- team_1_id
- team_2_id
- captain_selection
- draft_order
- mode
- require_approval
- min_elo
- max_elo
- capacity
- inner_squad
- match_id
- current_pick_lineup
- pick_deadline
- created_at
- updated_at
filter:
access:
_eq: Open
allow_aggregations: true
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: e_draft_game_captain_selection
schema: public
is_enum: true
select_permissions:
- role: guest
permission:
columns:
- description
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: e_draft_game_draft_order
schema: public
is_enum: true
select_permissions:
- role: guest
permission:
columns:
- description
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: e_draft_game_mode
schema: public
is_enum: true
select_permissions:
- role: guest
permission:
columns:
- description
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: e_draft_game_player_status
schema: public
is_enum: true
select_permissions:
- role: guest
permission:
columns:
- description
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table:
name: e_draft_game_status
schema: public
is_enum: true
select_permissions:
- role: guest
permission:
columns:
- description
- value
filter: {}
comment: ""
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ select_permissions:
lineup_players:
steam_id:
_eq: X-Hasura-User-Id
allow_aggregations: true
comment: ""
7 changes: 7 additions & 0 deletions hasura/metadata/databases/default/tables/public_matches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ array_relationships:
remote_table:
name: v_player_elo
schema: public
- name: draft_games
using:
foreign_key_constraint_on:
column: match_id
table:
name: draft_games
schema: public
- name: invites
using:
foreign_key_constraint_on:
Expand Down
Loading