@pfdev/api-types 3.0.23 → 3.0.24

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/v3.ts +12 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pfdev/api-types",
3
- "version": "3.0.23",
3
+ "version": "3.0.24",
4
4
  "description": "TypeScript types for PF API V3",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
package/v3.ts CHANGED
@@ -97,6 +97,7 @@ export const CardSchema = Type.Object(
97
97
  setname: Type.String({ description: 'Name of the set' }),
98
98
  ...CardFilterFields,
99
99
  price: Type.Optional(Type.Number({ description: 'Price of the lowest-priced variant' })),
100
+ max_price: Type.Optional(Type.Number({ description: 'Price of the highest-priced non-hidden variant' })),
100
101
  change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
101
102
  change_1d_value: Type.Optional(Type.Number({ description: '1-day price change in dollars' })),
102
103
  price_variant_id: PriceVariantIdSchema,
@@ -133,8 +134,14 @@ export const CardListSortSchema = Type.Union([
133
134
  Type.Literal('price_asc'),
134
135
  Type.Literal('price_desc'),
135
136
  Type.Literal('change_asc'),
136
- Type.Literal('change_desc')
137
- ], { default: 'number_asc', description: 'Sort order. change_* sorts by 1-day percentage price change. Defaults to number_asc.' });
137
+ Type.Literal('change_desc'),
138
+ Type.Literal('release_desc'),
139
+ Type.Literal('release_asc'),
140
+ Type.Literal('release_desc_price_desc')
141
+ ], {
142
+ default: 'number_asc',
143
+ description: 'Sort order. change_* sorts by 1-day percentage price change. release_asc/desc sort by set release date, then card number. release_desc_price_desc sorts by newest set, then max_price descending. Cards from sets with no release date come last in every release sort. Defaults to number_asc.'
144
+ });
138
145
 
139
146
  export type CardListSort = Static<typeof CardListSortSchema>;
140
147
 
@@ -158,7 +165,7 @@ export const CardListQuerySchema = Type.Object(
158
165
  limit: Type.Optional(Type.Number({ minimum: 1, maximum: 250, default: 50, description: 'Max results to return' })),
159
166
  offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
160
167
  },
161
- { description: 'At least one of search, setid, rarity, language or variant_id must be provided' }
168
+ { description: 'With no search or filters, lists every card' }
162
169
  );
163
170
 
164
171
  export type CardListQuery = Static<typeof CardListQuerySchema>;
@@ -168,7 +175,7 @@ export const CardFacetsQuerySchema = Type.Object(
168
175
  ...CardListFilterFields,
169
176
  search: CardSearchField
170
177
  },
171
- { description: 'Same search and filters as /cards; at least one of them must be provided' }
178
+ { description: 'Same search and filters as /cards. With none, returns the facets for every card' }
172
179
  );
173
180
 
174
181
  export type CardFacetsQuery = Static<typeof CardFacetsQuerySchema>;
@@ -260,6 +267,7 @@ export const CardDetailSchema = Type.Object(
260
267
  price_variant_id: PriceVariantIdSchema,
261
268
  price_date: PriceDateSchema,
262
269
  price: Type.Optional(Type.Number({ description: 'Price of the lowest-priced variant' })),
270
+ max_price: Type.Optional(Type.Number({ description: 'Price of the highest-priced non-hidden variant' })),
263
271
  change_1d: Type.Optional(Type.Number({ description: '1-day price change as a percentage' })),
264
272
  change_1d_value: Type.Optional(Type.Number({ description: '1-day price change in dollars' })),
265
273
  variants: {