@pfdev/api-types 3.0.15 → 3.0.17

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 +24 -31
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.17",
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,51 +70,39 @@ 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
+ Type.Literal('change_asc'),
81
+ Type.Literal('change_desc')
82
+ ], { default: 'number_asc', description: 'Sort order. change_* sorts by 1-day percentage price change. Defaults to number_asc.' });
83
+
84
+ export type CardListSort = Static<typeof CardListSortSchema>;
85
+
72
86
  export const CardListQuerySchema = Type.Object(
73
87
  {
74
88
  setid: Type.Optional(Type.String({ description: 'Filter by set ID' })),
75
- name: Type.Optional(Type.String({ description: 'Search by card name' })),
89
+ 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.' })),
90
+ sort: Type.Optional(CardListSortSchema),
76
91
  include: Type.Optional(Type.Literal('variant_prices', { description: 'Include per-variant prices and period changes on each card' })),
77
92
  limit: Type.Optional(Type.Number({ minimum: 1, maximum: 250, default: 50, description: 'Max results to return' })),
78
93
  offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
79
94
  },
80
- { description: 'At least one of setid or name must be provided' }
95
+ { description: 'At least one of setid or search must be provided' }
81
96
  );
82
97
 
83
98
  export type CardListQuery = Static<typeof CardListQuerySchema>;
84
99
 
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
100
  export const CardBatchQuerySchema = Type.Object({
113
101
  ids: Type.String({
114
102
  minLength: 1,
115
103
  description: 'Comma-separated list of card IDs (e.g. "xy1-2,base1-4"). Duplicates are deduped. Max 200 IDs per request.'
116
- })
104
+ }),
105
+ include: Type.Optional(Type.Literal('variant_prices', { description: 'Include per-variant prices and period changes on each card' }))
117
106
  });
118
107
 
119
108
  export type CardBatchQuery = Static<typeof CardBatchQuerySchema>;
@@ -581,7 +570,11 @@ export const InventorySummaryItemSchema = Type.Object(
581
570
  variant: Type.String({ description: 'Card variant (e.g. Normal, Holofoil, Reverse Holofoil)' }),
582
571
  status: Type.Union([Type.Number(), Type.Null()], {
583
572
  description: 'Numeric status code. <100 = active, >=100 = sold/past. Null when no details row exists yet.'
584
- })
573
+ }),
574
+ acquired: Type.Union([Type.String(), Type.Null()], {
575
+ description: 'User-entered acquired date. Null when not set or no details row exists yet.'
576
+ }),
577
+ created_at: Type.String({ description: 'When this inventory row was created' })
585
578
  },
586
579
  { title: 'InventorySummaryItem' }
587
580
  );