@pfdev/api-types 3.0.14 → 3.0.15
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 +11 -4
package/package.json
CHANGED
package/v3.ts
CHANGED
|
@@ -37,10 +37,15 @@ export const CardSchema = Type.Object(
|
|
|
37
37
|
images: CardImagesSchema,
|
|
38
38
|
setid: Type.String({ description: 'Set this card belongs to' }),
|
|
39
39
|
setname: Type.String({ description: 'Name of the set' }),
|
|
40
|
-
price: Type.Optional(Type.Number({ description: '
|
|
40
|
+
price: Type.Optional(Type.Number({ description: 'Price of the lowest-priced variant' })),
|
|
41
41
|
change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
|
|
42
42
|
change_1d_value: Type.Optional(Type.Number({ description: '1-day price change in dollars' })),
|
|
43
|
-
variants: Type.Optional(Type.Array(Type.String(), { description: 'Available variants for this card' }))
|
|
43
|
+
variants: Type.Optional(Type.Array(Type.String(), { description: 'Available variants for this card' })),
|
|
44
|
+
variant_prices: Type.Optional(
|
|
45
|
+
Type.Record(Type.String(), PriceStatsSchema, {
|
|
46
|
+
description: 'Prices and period changes keyed by variant name. Only present when requested via include=variant_prices. Variants without price data map to an empty object.'
|
|
47
|
+
})
|
|
48
|
+
)
|
|
44
49
|
},
|
|
45
50
|
{
|
|
46
51
|
title: 'Card',
|
|
@@ -68,6 +73,7 @@ export const CardListQuerySchema = Type.Object(
|
|
|
68
73
|
{
|
|
69
74
|
setid: Type.Optional(Type.String({ description: 'Filter by set ID' })),
|
|
70
75
|
name: Type.Optional(Type.String({ description: 'Search by card name' })),
|
|
76
|
+
include: Type.Optional(Type.Literal('variant_prices', { description: 'Include per-variant prices and period changes on each card' })),
|
|
71
77
|
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 250, default: 50, description: 'Max results to return' })),
|
|
72
78
|
offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
|
|
73
79
|
},
|
|
@@ -140,7 +146,7 @@ export const CardDetailSchema = Type.Object(
|
|
|
140
146
|
nationalPokedexNumbers: Type.Optional(Type.Array(Type.Number(), { description: 'National Pokédex numbers' })),
|
|
141
147
|
legalities: Type.Optional(Type.Any({ description: 'Format legalities' })),
|
|
142
148
|
regulationMark: Type.Optional(Type.String({ description: 'Regulation mark' })),
|
|
143
|
-
price: Type.Optional(Type.Number({ description: '
|
|
149
|
+
price: Type.Optional(Type.Number({ description: 'Price of the lowest-priced variant' })),
|
|
144
150
|
change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
|
|
145
151
|
change_1d_value: Type.Optional(Type.Number({ description: '1-day price change in dollars' })),
|
|
146
152
|
variants: Type.Optional(Type.Array(Type.String(), { description: 'Available variants for this card' })),
|
|
@@ -735,7 +741,8 @@ const DetectedCardSchema = Type.Object(
|
|
|
735
741
|
|
|
736
742
|
const MatchedCardSchema = Type.Intersect(
|
|
737
743
|
[
|
|
738
|
-
CardSchema
|
|
744
|
+
// Vision returns variant_prices as an array, not CardSchema's map
|
|
745
|
+
Type.Omit(CardSchema, ['variant_prices']),
|
|
739
746
|
Type.Object({
|
|
740
747
|
score: Type.Number({ description: 'Fuzzy match score — higher is a better match' }),
|
|
741
748
|
variant_prices: Type.Array(VariantPriceSchema, { description: 'Per-variant prices with extended period changes' })
|