@pfdev/api-types 3.0.15 → 3.0.16

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 +15 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pfdev/api-types",
3
- "version": "3.0.15",
3
+ "version": "3.0.16",
4
4
  "description": "TypeScript types for PF API V3",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
package/v3.ts CHANGED
@@ -34,6 +34,7 @@ export const CardSchema = Type.Object(
34
34
  name: Type.String({ description: 'Card name' }),
35
35
  number: Type.String({ description: 'Card number within set' }),
36
36
  rarity: Type.Optional(Type.String({ description: 'Card rarity' })),
37
+ artist: Type.Optional(Type.String({ description: 'Card artist' })),
37
38
  images: CardImagesSchema,
38
39
  setid: Type.String({ description: 'Set this card belongs to' }),
39
40
  setname: Type.String({ description: 'Name of the set' }),
@@ -69,46 +70,31 @@ export const CardListResponseSchema = Type.Object(
69
70
 
70
71
  export type CardListResponse = Static<typeof CardListResponseSchema>;
71
72
 
73
+ export const CardListSortSchema = Type.Union([
74
+ Type.Literal('number_asc'),
75
+ Type.Literal('number_desc'),
76
+ Type.Literal('name_asc'),
77
+ Type.Literal('name_desc'),
78
+ Type.Literal('price_asc'),
79
+ Type.Literal('price_desc')
80
+ ], { default: 'number_asc', description: 'Sort order. Defaults to number_asc.' });
81
+
82
+ export type CardListSort = Static<typeof CardListSortSchema>;
83
+
72
84
  export const CardListQuerySchema = Type.Object(
73
85
  {
74
86
  setid: Type.Optional(Type.String({ description: 'Filter by set ID' })),
75
- name: Type.Optional(Type.String({ description: 'Search by card name' })),
87
+ search: Type.Optional(Type.String({ minLength: 1, description: 'Search by card name and/or number. Tokens with digits match card number; other tokens match card name.' })),
88
+ sort: Type.Optional(CardListSortSchema),
76
89
  include: Type.Optional(Type.Literal('variant_prices', { description: 'Include per-variant prices and period changes on each card' })),
77
90
  limit: Type.Optional(Type.Number({ minimum: 1, maximum: 250, default: 50, description: 'Max results to return' })),
78
91
  offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
79
92
  },
80
- { description: 'At least one of setid or name must be provided' }
93
+ { description: 'At least one of setid or search must be provided' }
81
94
  );
82
95
 
83
96
  export type CardListQuery = Static<typeof CardListQuerySchema>;
84
97
 
85
- export const CardSearchSortSchema = Type.Union([
86
- Type.Literal('number_asc'),
87
- Type.Literal('number_desc'),
88
- Type.Literal('name_asc'),
89
- Type.Literal('name_desc'),
90
- Type.Literal('price_asc'),
91
- Type.Literal('price_desc')
92
- ]);
93
-
94
- export type CardSearchSort = Static<typeof CardSearchSortSchema>;
95
-
96
- export const CardSearchQuerySchema = Type.Object({
97
- q: Type.String({ minLength: 1, description: 'Search query. Tokens with digits match card number; other tokens match card name.' }),
98
- sort: Type.Optional(Type.Union([
99
- Type.Literal('number_asc'),
100
- Type.Literal('number_desc'),
101
- Type.Literal('name_asc'),
102
- Type.Literal('name_desc'),
103
- Type.Literal('price_asc'),
104
- Type.Literal('price_desc')
105
- ], { default: 'number_asc', description: 'Sort order. Defaults to number_asc.' })),
106
- limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100, default: 25, description: 'Max results to return' })),
107
- offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
108
- });
109
-
110
- export type CardSearchQuery = Static<typeof CardSearchQuerySchema>;
111
-
112
98
  export const CardBatchQuerySchema = Type.Object({
113
99
  ids: Type.String({
114
100
  minLength: 1,