@pfdev/api-types 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/v3.ts +62 -0
package/package.json
CHANGED
package/v3.ts
CHANGED
|
@@ -7,6 +7,20 @@ import { Static, Type } from '@sinclair/typebox';
|
|
|
7
7
|
// ============= CARDS =============
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
const VariantPriceSchema = Type.Object(
|
|
11
|
+
{
|
|
12
|
+
variant: Type.String({ description: 'Variant name' }),
|
|
13
|
+
current_price: Type.Optional(Type.Number({ description: 'Current price for this variant' })),
|
|
14
|
+
change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
|
|
15
|
+
change_7d: Type.Optional(Type.Number({ description: '7-day price change as a percentage' })),
|
|
16
|
+
change_1m: Type.Optional(Type.Number({ description: '30-day price change as a percentage' })),
|
|
17
|
+
change_3m: Type.Optional(Type.Number({ description: '90-day price change as a percentage' })),
|
|
18
|
+
change_6m: Type.Optional(Type.Number({ description: '180-day price change as a percentage' })),
|
|
19
|
+
change_1y: Type.Optional(Type.Number({ description: '1-year price change as a percentage' }))
|
|
20
|
+
},
|
|
21
|
+
{ title: 'VariantPrice' }
|
|
22
|
+
);
|
|
23
|
+
|
|
10
24
|
const CardImagesSchema = Type.Object(
|
|
11
25
|
{
|
|
12
26
|
small: Type.String({ format: 'uri', description: 'Small card image URL' }),
|
|
@@ -63,6 +77,54 @@ export const CardListQuerySchema = Type.Object(
|
|
|
63
77
|
|
|
64
78
|
export type CardListQuery = Static<typeof CardListQuerySchema>;
|
|
65
79
|
|
|
80
|
+
export const CardDetailSchema = Type.Object(
|
|
81
|
+
{
|
|
82
|
+
cardid: Type.String({ description: 'Unique card identifier' }),
|
|
83
|
+
name: Type.String({ description: 'Card name' }),
|
|
84
|
+
number: Type.String({ description: 'Card number within set' }),
|
|
85
|
+
rarity: Type.Optional(Type.String({ description: 'Card rarity' })),
|
|
86
|
+
images: CardImagesSchema,
|
|
87
|
+
setid: Type.String({ description: 'Set this card belongs to' }),
|
|
88
|
+
setname: Type.String({ description: 'Name of the set' }),
|
|
89
|
+
supertype: Type.Optional(Type.String({ description: 'Supertype (Pokémon, Trainer, Energy)' })),
|
|
90
|
+
subtypes: Type.Optional(Type.Array(Type.String(), { description: 'Card subtypes' })),
|
|
91
|
+
hp: Type.Optional(Type.String({ description: 'Hit points' })),
|
|
92
|
+
types: Type.Optional(Type.Array(Type.String(), { description: 'Card types' })),
|
|
93
|
+
evolvesFrom: Type.Optional(Type.String({ description: 'Pokémon this evolves from' })),
|
|
94
|
+
evolvesTo: Type.Optional(Type.Array(Type.String(), { description: 'Pokémon this can evolve into' })),
|
|
95
|
+
rules: Type.Optional(Type.Array(Type.String(), { description: 'Card rules text' })),
|
|
96
|
+
ancientTrait: Type.Optional(Type.Any({ description: 'Ancient trait object' })),
|
|
97
|
+
abilities: Type.Optional(Type.Array(Type.Any(), { description: 'Card abilities' })),
|
|
98
|
+
attacks: Type.Optional(Type.Array(Type.Any(), { description: 'Card attacks' })),
|
|
99
|
+
weaknesses: Type.Optional(Type.Array(Type.Any(), { description: 'Card weaknesses' })),
|
|
100
|
+
resistances: Type.Optional(Type.Array(Type.Any(), { description: 'Card resistances' })),
|
|
101
|
+
retreatCost: Type.Optional(Type.Array(Type.String(), { description: 'Retreat cost energies' })),
|
|
102
|
+
convertedRetreatCost: Type.Optional(Type.Number({ description: 'Numeric retreat cost' })),
|
|
103
|
+
artist: Type.Optional(Type.String({ description: 'Card artist' })),
|
|
104
|
+
flavorText: Type.Optional(Type.String({ description: 'Flavor text' })),
|
|
105
|
+
nationalPokedexNumbers: Type.Optional(Type.Array(Type.Number(), { description: 'National Pokédex numbers' })),
|
|
106
|
+
legalities: Type.Optional(Type.Any({ description: 'Format legalities' })),
|
|
107
|
+
regulationMark: Type.Optional(Type.String({ description: 'Regulation mark' })),
|
|
108
|
+
price: Type.Optional(Type.Number({ description: 'Lowest price across all variants' })),
|
|
109
|
+
change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
|
|
110
|
+
change_1d_value: Type.Optional(Type.Number({ description: '1-day price change in dollars' })),
|
|
111
|
+
variants: Type.Optional(Type.Array(Type.String(), { description: 'Available variants for this card' })),
|
|
112
|
+
variant_prices: Type.Optional(Type.Array(VariantPriceSchema, { description: 'Per-variant prices with extended period changes' }))
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: 'CardDetail',
|
|
116
|
+
description: 'Full details of a Pokemon card'
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export type CardDetail = Static<typeof CardDetailSchema>;
|
|
121
|
+
|
|
122
|
+
export const CardDetailParamSchema = Type.Object({
|
|
123
|
+
cardid: Type.String({ description: 'Card ID' })
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export type CardDetailParam = Static<typeof CardDetailParamSchema>;
|
|
127
|
+
|
|
66
128
|
// ============= SETS =============
|
|
67
129
|
|
|
68
130
|
|