mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-06-13 16:19:18 +00:00
feature: Implement new Server infrastructure with GraphQL. (#132)
* Added new compiler to db Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Add compiled DB to artifacts Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Fixed space error Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Fixed? Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Update node.js.yml * Update node.js.yml * Made change so the db is no longer dependent on the SDK Signed-off-by: Avior <florian.bouillon@delta-wings.net> * f Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Fixed artifact Signed-off-by: Avior <florian.bouillon@delta-wings.net> * U Signed-off-by: Avior <florian.bouillon@delta-wings.net> * \Changed folder Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Fixede? Signed-off-by: Avior <florian.bouillon@delta-wings.net> * Try with everything * saved the file ;) * ignore compiler * Fixed prebuild being run again * Fixed public folder Signed-off-by: Avior <github@avior.me> * fixed graphql file Signed-off-by: Avior <github@avior.me> * fixed? Signed-off-by: Avior <github@avior.me> * Check tree because life is potato Signed-off-by: Avior <github@avior.me> * this is harder Signed-off-by: Avior <github@avior.me> * f Signed-off-by: Avior <github@avior.me> * Fixed? Signed-off-by: Avior <github@avior.me> * r Signed-off-by: Avior <github@avior.me> * fd Signed-off-by: Avior <github@avior.me> * added back context Signed-off-by: Avior <github@avior.me> * ah Signed-off-by: Avior <github@avior.me> * AAH Signed-off-by: Avior <github@avior.me> * AAAH Signed-off-by: Avior <github@avior.me> * ffffffffffffffffff Signed-off-by: Avior <github@avior.me> * fix: Changed the default builder Signed-off-by: Avior <github@avior.me> * Removed useless tree function Signed-off-by: Avior <github@avior.me>
This commit is contained in:
277
meta/definitions/api.d.ts
vendored
Normal file
277
meta/definitions/api.d.ts
vendored
Normal file
@ -0,0 +1,277 @@
|
||||
/**
|
||||
* This file define how the API is architectured for the Compiler and the Javascript/Typescript SDK
|
||||
*/
|
||||
|
||||
/**
|
||||
* /series endpoint
|
||||
*/
|
||||
export interface SerieResume {
|
||||
id: string;
|
||||
name: string;
|
||||
logo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* /series/:id endpoint
|
||||
*/
|
||||
export interface Serie extends SerieResume {
|
||||
sets: Array<SetResume>;
|
||||
}
|
||||
|
||||
interface variants {
|
||||
normal?: boolean;
|
||||
reverse?: boolean;
|
||||
holo?: boolean;
|
||||
firstEdition?: boolean;
|
||||
}
|
||||
|
||||
export interface SetResume {
|
||||
id: string;
|
||||
name: string;
|
||||
logo?: string;
|
||||
symbol?: string;
|
||||
cardCount: {
|
||||
/**
|
||||
* total of number of cards
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* number of cards officialy (on the bottom of each cards)
|
||||
*/
|
||||
official: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* /sets/:id
|
||||
*/
|
||||
export interface Set extends SetResume {
|
||||
serie: SerieResume;
|
||||
tcgOnline?: string;
|
||||
variants?: variants;
|
||||
releaseDate: string;
|
||||
/**
|
||||
* Designate if the set is usable in tournaments
|
||||
*
|
||||
* Note: this is specific to the set and if a
|
||||
* card is banned from the set it will still be true
|
||||
*/
|
||||
legal: {
|
||||
/**
|
||||
* Ability to play in standard tournaments
|
||||
*/
|
||||
standard: boolean;
|
||||
/**
|
||||
* Ability to play in expanded tournaments
|
||||
*/
|
||||
expanded: boolean;
|
||||
};
|
||||
cardCount: {
|
||||
/**
|
||||
* total of number of cards
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* number of cards officialy (on the bottom of each cards)
|
||||
*/
|
||||
official: number;
|
||||
/**
|
||||
* number of cards having a normal version
|
||||
*/
|
||||
normal: number;
|
||||
/**
|
||||
* number of cards having an reverse version
|
||||
*/
|
||||
reverse: number;
|
||||
/**
|
||||
* number of cards having an holo version
|
||||
*/
|
||||
holo: number;
|
||||
/**
|
||||
* Number of possible cards
|
||||
*/
|
||||
firstEd?: number;
|
||||
};
|
||||
cards: Array<CardResume>;
|
||||
}
|
||||
export interface CardResume {
|
||||
id: string;
|
||||
localId: string;
|
||||
/**
|
||||
* Card Name (Including the suffix if next to card name)
|
||||
*/
|
||||
name: string;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* /cards/:id
|
||||
* /sets/:set/:localId
|
||||
*/
|
||||
export interface Card extends CardResume {
|
||||
/**
|
||||
* Card illustrator
|
||||
*/
|
||||
illustrator?: string;
|
||||
/**
|
||||
* Card Rarity
|
||||
*
|
||||
* - None https://www.tcgdex.net/database/sm/smp/SM01
|
||||
* - Common https://www.tcgdex.net/database/xy/xy9/1
|
||||
* - Uncommon https://www.tcgdex.net/database/xy/xy9/2
|
||||
* - Rare https://www.tcgdex.net/database/xy/xy9/3
|
||||
* - Ultra Rare
|
||||
* - Secret Rare
|
||||
*/
|
||||
rarity: string;
|
||||
/**
|
||||
* Card Category
|
||||
*
|
||||
* - Pokemon
|
||||
* - Trainer
|
||||
* - Energy
|
||||
*/
|
||||
category: string;
|
||||
/**
|
||||
* Card Variants (Override Set Variants)
|
||||
*/
|
||||
variants?: variants;
|
||||
/**
|
||||
* Card Set
|
||||
*/
|
||||
set: SetResume;
|
||||
/**
|
||||
* Pokemon only elements
|
||||
*/
|
||||
/**
|
||||
* Pokemon Pokedex ID
|
||||
*/
|
||||
dexId?: Array<number>;
|
||||
/**
|
||||
* Pokemon HP
|
||||
*/
|
||||
hp?: number;
|
||||
/**
|
||||
* Pokemon Types
|
||||
* ex for multiple https://www.tcgdex.net/database/ex/ex13/17
|
||||
*/
|
||||
types?: Array<string>;
|
||||
/**
|
||||
* Pokemon Sub Evolution
|
||||
*/
|
||||
evolveFrom?: string;
|
||||
/**
|
||||
* Pokemon Weight
|
||||
*/
|
||||
weight?: string;
|
||||
/**
|
||||
* Pokemon Description
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* Level of the Pokemon
|
||||
*
|
||||
* NOTE: can be equal to 'X' when the pokemon is a LEVEL-UP one
|
||||
*/
|
||||
level?: number | string;
|
||||
/**
|
||||
* Pokemon Stage
|
||||
*
|
||||
* - Basic https://www.tcgdex.net/database/xy/xy9/1
|
||||
* - BREAK https://www.tcgdex.net/database/xy/xy9/18
|
||||
* - LEVEL-UP https://www.tcgdex.net/database/dp/dp1/121
|
||||
* - MEGA https://www.tcgdex.net/database/xy/xy1/2
|
||||
* - RESTORED https://www.tcgdex.net/database/bw/bw5/53
|
||||
* - Stage1 https://www.tcgdex.net/database/xy/xy9/2
|
||||
* - Stage2 https://www.tcgdex.net/database/xy/xy9/3
|
||||
* - VMAX https://www.tcgdex.net/database/swsh/swsh1/50
|
||||
*/
|
||||
stage?: string;
|
||||
/**
|
||||
* Card Suffix
|
||||
*
|
||||
* - EX https://www.tcgdex.net/database/ex/ex2/94
|
||||
* - GX https://www.tcgdex.net/database/sm/sm12/4
|
||||
* - V https://www.tcgdex.net/database/swsh/swsh1/1
|
||||
* - Legend https://www.tcgdex.net/database/hgss/hgss1/114
|
||||
* - Prime https://www.tcgdex.net/database/hgss/hgss2/85
|
||||
* - SP https://www.tcgdex.net/database/pl/pl1/7
|
||||
* - TAG TEAM-GX https://www.tcgdex.net/database/sm/sm12/226
|
||||
*/
|
||||
suffix?: string;
|
||||
/**
|
||||
* Pokemon Held Item
|
||||
*
|
||||
* ex https://www.tcgdex.net/database/dp/dp2/75
|
||||
*/
|
||||
item?: {
|
||||
name: string;
|
||||
effect: string;
|
||||
};
|
||||
/**
|
||||
* Pokemon Abilities
|
||||
*
|
||||
* multi abilities ex https://www.tcgdex.net/database/ex/ex15/10
|
||||
*/
|
||||
abilities?: Array<{
|
||||
type: string;
|
||||
name: string;
|
||||
effect: string;
|
||||
}>;
|
||||
/**
|
||||
* Pokemon Attacks
|
||||
*/
|
||||
attacks?: Array<{
|
||||
cost?: Array<string>;
|
||||
name: string;
|
||||
effect?: string;
|
||||
damage?: string | number;
|
||||
}>;
|
||||
/**
|
||||
* Pokemon Weaknesses
|
||||
*/
|
||||
weaknesses?: Array<{
|
||||
type: string;
|
||||
value?: string;
|
||||
}>;
|
||||
resistances?: Array<{
|
||||
type: string;
|
||||
value?: string;
|
||||
}>;
|
||||
retreat?: number;
|
||||
effect?: string;
|
||||
trainerType?: string;
|
||||
energyType?: string;
|
||||
/**
|
||||
* Define the rotation mark on cards >= Sword & Shield
|
||||
*/
|
||||
regulationMark?: string;
|
||||
/**
|
||||
* Card ability to be played in official tournaments
|
||||
*
|
||||
* Note: all cards are avaialable to play in unlimited tournaments
|
||||
*/
|
||||
legal: {
|
||||
/**
|
||||
* Ability to play in standard tournaments
|
||||
*/
|
||||
standard: boolean;
|
||||
/**
|
||||
* Ability to play in expanded tournaments
|
||||
*/
|
||||
expanded: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* String Endpoint List
|
||||
*/
|
||||
export declare type StringEndpointList = Array<string>;
|
||||
|
||||
/**
|
||||
* StringEndpoint
|
||||
*/
|
||||
export interface StringEndpoint {
|
||||
name: string;
|
||||
cards: Array<CardResume>;
|
||||
}
|
167
meta/definitions/graphql.gql
Normal file
167
meta/definitions/graphql.gql
Normal file
@ -0,0 +1,167 @@
|
||||
##################
|
||||
# Global #
|
||||
##################
|
||||
|
||||
# Locale Directive ex: {sets @locale(fr)}
|
||||
directive @locale (
|
||||
lang: String!
|
||||
) on FIELD
|
||||
|
||||
# Queries to use on the DB
|
||||
type Query {
|
||||
cards(filters: CardsFilters, pagination: Pagination): [Card]
|
||||
sets: [Set]
|
||||
series: [Serie]
|
||||
card(
|
||||
id: ID!,
|
||||
set: String
|
||||
): Card
|
||||
set(
|
||||
id: ID!
|
||||
): Set
|
||||
serie(
|
||||
id: ID!
|
||||
): Serie
|
||||
|
||||
}
|
||||
|
||||
# Pagination input
|
||||
input Pagination {
|
||||
page: Float!
|
||||
count: Float!
|
||||
}
|
||||
|
||||
##################
|
||||
# Card #
|
||||
##################
|
||||
|
||||
# Filters to be used with the Card query
|
||||
input CardsFilters {
|
||||
category: String
|
||||
description: String
|
||||
energyType: String
|
||||
evolveFrom: String
|
||||
hp: Float
|
||||
id: ID
|
||||
localId: String
|
||||
dexId: Float
|
||||
illustrator: String
|
||||
image: String
|
||||
level: Float
|
||||
levelId: String
|
||||
name: String
|
||||
rarity: String
|
||||
regulationMark: String
|
||||
stage: String
|
||||
suffix: String
|
||||
trainerType: String
|
||||
retreat: Float
|
||||
}
|
||||
|
||||
type Card {
|
||||
abilities: [AbilitiesListItem]
|
||||
attacks: [AttacksListItem]
|
||||
category: String!
|
||||
description: String
|
||||
dexId: [Float]
|
||||
energyType: String
|
||||
evolveFrom: String
|
||||
hp: Float
|
||||
id: String!
|
||||
illustrator: String
|
||||
image: String
|
||||
item: Item
|
||||
legal: Legal!
|
||||
level: Float
|
||||
localId: String!
|
||||
name: String!
|
||||
rarity: String!
|
||||
regulationMark: String
|
||||
resistances: [[WeakResListItem]]
|
||||
retreat: Float
|
||||
set: Set!
|
||||
stage: String
|
||||
suffix: String
|
||||
trainerType: String
|
||||
types: [String]
|
||||
variants: Variants
|
||||
weaknesses: [[WeakResListItem]]
|
||||
}
|
||||
|
||||
type AbilitiesListItem {
|
||||
effect: String
|
||||
name: String
|
||||
type: String
|
||||
}
|
||||
|
||||
type AttacksListItem {
|
||||
cost: [String]
|
||||
damage: String
|
||||
effect: String
|
||||
name: String!
|
||||
}
|
||||
|
||||
type Item {
|
||||
effect: String!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type Legal {
|
||||
expanded: Boolean
|
||||
standard: Boolean
|
||||
}
|
||||
|
||||
type WeakResListItem {
|
||||
type: String!
|
||||
value: String
|
||||
}
|
||||
|
||||
type Variants {
|
||||
firstEdition: Boolean!
|
||||
holo: Boolean!
|
||||
normal: Boolean!
|
||||
reverse: Boolean!
|
||||
}
|
||||
|
||||
##################
|
||||
# Set #
|
||||
##################
|
||||
|
||||
type Set {
|
||||
cardCount: CardCount!
|
||||
cards: [Card]!
|
||||
id: String!
|
||||
logo: String
|
||||
name: String!
|
||||
symbol: String
|
||||
serie: Serie!
|
||||
}
|
||||
|
||||
type CardCount {
|
||||
firstEd: Float
|
||||
holo: Float
|
||||
normal: Float
|
||||
official: Float!
|
||||
reverse: Float
|
||||
total: Float!
|
||||
}
|
||||
|
||||
##################
|
||||
# Serie #
|
||||
##################
|
||||
|
||||
type Serie {
|
||||
id: String!
|
||||
logo: String
|
||||
name: String!
|
||||
sets: [Set]!
|
||||
}
|
||||
|
||||
##################
|
||||
# StringEndpoint #
|
||||
##################
|
||||
|
||||
type StringEndpoint {
|
||||
cards: [Card]!
|
||||
name: String!
|
||||
}
|
Reference in New Issue
Block a user