Skip to content

Commit

Permalink
codegen fix and regen
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyagara committed May 3, 2024
1 parent 683cae2 commit c31e024
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 43 deletions.
2 changes: 1 addition & 1 deletion api/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package api
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// Regional routes, used in tournament services, Legends of Runeterra (LoR), and some other endpoints.
type RegionalRoute string
Expand Down
2 changes: 1 addition & 1 deletion clients/lol/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import "github.com/Kyagara/equinox/internal"

Expand Down
4 changes: 2 additions & 2 deletions clients/lol/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// LoL and TFT ranked tiers, such as gold, diamond, challenger, etc.
type Tier string
Expand Down Expand Up @@ -363,7 +363,7 @@ func (gameMode GameMode) String() string {
type QueueType string

const (
// 2v2v2v2 "Arena" games
// "Arena" games
CHERRY_QUEUETYPE QueueType = "CHERRY"
// 5v5 Ranked Flex games
RANKED_FLEX_SR QueueType = "RANKED_FLEX_SR"
Expand Down
2 changes: 1 addition & 1 deletion clients/lol/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import (
"context"
Expand Down
28 changes: 5 additions & 23 deletions clients/lol/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lol
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// lol-challenges-v1.ApexPlayerInfoDto
type ChallengesApexPlayerInfoV1DTO struct {
Expand Down Expand Up @@ -96,9 +96,7 @@ type ChampionMasteryV4DTO struct {
// Champion level for specified player and champion combination.
ChampionLevel int32 `json:"championLevel,omitempty"`
// Total number of champion points for this player and champion combination - they are used to determine championLevel.
ChampionPoints int32 `json:"championPoints,omitempty"`
ChampionSeasonMilestone int32 `json:"championSeasonMilestone,omitempty"`
MarkRequiredForNextLevel int32 `json:"markRequiredForNextLevel,omitempty"`
ChampionPoints int32 `json:"championPoints,omitempty"`
// The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0.
TokensEarned int32 `json:"tokensEarned,omitempty"`
// Is chest granted for this champion or not in current season.
Expand Down Expand Up @@ -762,27 +760,11 @@ type MatchTimelineInfoFrameParticipantFrameV5DTO struct {
XP int32 `json:"xp,omitempty"`
}

// match-v5.MatchTimelineInfoFrameParticipantFrames
type MatchTimelineInfoFrameParticipantFramesV5DTO struct {
X1 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"1,omitempty"`
// Possibly null for the Arena 2v2v2v2 (`CHERRY`) game mode.
X10 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"10,omitempty"`
X2 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"2,omitempty"`
X3 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"3,omitempty"`
X4 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"4,omitempty"`
X5 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"5,omitempty"`
X6 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"6,omitempty"`
X7 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"7,omitempty"`
X8 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"8,omitempty"`
// Possibly null for the Arena 2v2v2v2 (`CHERRY`) game mode.
X9 MatchTimelineInfoFrameParticipantFrameV5DTO `json:"9,omitempty"`
}

// match-v5.MatchTimelineInfoFrame
type MatchTimelineInfoFrameV5DTO struct {
Events []MatchTimelineInfoFrameEventV5DTO `json:"events,omitempty"`
ParticipantFrames MatchTimelineInfoFrameParticipantFramesV5DTO `json:"participantFrames,omitempty"`
Timestamp int32 `json:"timestamp,omitempty"`
ParticipantFrames map[int32]MatchTimelineInfoFrameParticipantFrameV5DTO `json:"participantFrames,omitempty"`
Events []MatchTimelineInfoFrameEventV5DTO `json:"events,omitempty"`
Timestamp int32 `json:"timestamp,omitempty"`
}

// match-v5.MatchTimelineInfoParticipant
Expand Down
2 changes: 1 addition & 1 deletion clients/lor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/lor/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/lor/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package lor
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// lor-deck-v1.NewDeckDto
type DeckNewDeckV1DTO struct {
Expand Down
2 changes: 1 addition & 1 deletion clients/riot/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/riot/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/riot/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package riot
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// account-v1.ActiveShardDto
type AccountActiveShardV1DTO struct {
Expand Down
2 changes: 1 addition & 1 deletion clients/tft/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/tft/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// LoL and TFT ranked tiers, such as gold, diamond, challenger, etc.
type Tier string
Expand Down
2 changes: 1 addition & 1 deletion clients/tft/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/tft/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package tft
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// tft-league-v1.LeagueEntryDTO
type LeagueEntryV1DTO struct {
Expand Down
2 changes: 1 addition & 1 deletion clients/val/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package val
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import "github.com/Kyagara/equinox/internal"

Expand Down
2 changes: 1 addition & 1 deletion clients/val/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package val
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// Platform routes for Valorant.
type PlatformRoute string
Expand Down
2 changes: 1 addition & 1 deletion clients/val/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package val
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion clients/val/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package val
// //
///////////////////////////////////////////////

// Spec version = 3d364f8efe1fc3090102af41f8d7fec1554abf45
// Spec version = a70746fcf353ba0ad0aceceafcc70d4ba8de4431

// val-content-v1.ActDto
type ContentActV1DTO struct {
Expand Down
7 changes: 6 additions & 1 deletion codegen/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ func cleanDTOPropType(prop gjson.Result, version string, endpoint string, propTy

if strings.Contains(propType, "map") {
match := mapTypeRegex.FindStringSubmatch(propType)
return strings.Replace(propType, "]"+match[1], "]"+endpoint+match[1], 1)
new := strings.Replace(propType, "]"+match[1], "]"+endpoint+match[1], 1)
// Replacing potential MatchMatchTimeline...
if strings.Contains(new, endpoint+endpoint) {
return strings.Replace(new, endpoint+endpoint, endpoint, 1)
}
return new
}

if endpoint == "TournamentStub" && strings.HasPrefix(propType, "Tournament") {
Expand Down

0 comments on commit c31e024

Please sign in to comment.