@pfdev/api-types 3.0.22 → 3.0.23

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 +11 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pfdev/api-types",
3
- "version": "3.0.22",
3
+ "version": "3.0.23",
4
4
  "description": "TypeScript types for PF API V3",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
package/v3.ts CHANGED
@@ -89,7 +89,8 @@ export const CardSchema = Type.Object(
89
89
  cardid: Type.String({ description: 'Unique card identifier' }),
90
90
  name: Type.String({ description: 'Card name' }),
91
91
  number: Type.String({ description: 'Card number within set' }),
92
- rarity: Type.Optional(Type.String({ description: 'Card rarity' })),
92
+ rarity: Type.Optional(Type.Union([Type.String(), Type.Null()], { description: 'Card rarity, the same for every language (no _JP suffix). None when the card has no rarity; null when not set.' })),
93
+ language: Type.Optional(Type.Union([Type.String(), Type.Null()], { description: 'Card language code (EN, JP)' })),
93
94
  artist: Type.Optional(Type.String({ description: 'Card artist' })),
94
95
  images: CardImagesSchema,
95
96
  setid: Type.String({ description: 'Set this card belongs to' }),
@@ -141,7 +142,8 @@ export type CardListSort = Static<typeof CardListSortSchema>;
141
142
  // values within one param match with OR, different params combine with AND.
142
143
  const CardListFilterFields = {
143
144
  setid: Type.Optional(Type.String({ description: 'Comma-separated set IDs (max 500). A single ID behaves as before.' })),
144
- rarity: Type.Optional(Type.String({ description: 'Comma-separated rarities (max 50), matched exactly' })),
145
+ rarity: Type.Optional(Type.String({ description: 'Comma-separated rarities (max 50), matched exactly. A rarity matches cards in every language.' })),
146
+ language: Type.Optional(Type.String({ description: 'Comma-separated language codes (EN, JP; max 50)' })),
145
147
  variant_id: Type.Optional(Type.String({ description: 'Comma-separated variant ids (variants[].id, max 50). Matches non-hidden variants only.' }))
146
148
  };
147
149
 
@@ -156,7 +158,7 @@ export const CardListQuerySchema = Type.Object(
156
158
  limit: Type.Optional(Type.Number({ minimum: 1, maximum: 250, default: 50, description: 'Max results to return' })),
157
159
  offset: Type.Optional(Type.Number({ minimum: 0, default: 0, description: 'Pagination offset' }))
158
160
  },
159
- { description: 'At least one of search, setid, rarity or variant_id must be provided' }
161
+ { description: 'At least one of search, setid, rarity, language or variant_id must be provided' }
160
162
  );
161
163
 
162
164
  export type CardListQuery = Static<typeof CardListQuerySchema>;
@@ -185,7 +187,7 @@ export const CardFacetOptionSchema = Type.Object(
185
187
  label: Type.String({ description: 'Label to show users' }),
186
188
  count: Type.Integer({ description: 'Cards this option matches, ignoring this facet\'s own selection' }),
187
189
  variant_count: Type.Integer({ description: 'Non-hidden variants on those cards, same counting rule. With variant_id, only the selected variants count.' }),
188
- order: Type.Optional(Type.Integer({ description: 'Display order, ascending: variant sort_order; sets by release date, newest first (0 = newest). Omitted for rarity.' })),
190
+ order: Type.Optional(Type.Integer({ description: 'Display order, ascending: variant sort_order; sets by release date, newest first (0 = newest); languages English first. Omitted for rarity.' })),
189
191
  group: Type.Optional(CardFacetGroupSchema)
190
192
  },
191
193
  { title: 'CardFacetOption' }
@@ -196,8 +198,10 @@ export type CardFacetOption = Static<typeof CardFacetOptionSchema>;
196
198
  export const CardFacetsResponseSchema = Type.Object(
197
199
  {
198
200
  total: Type.Integer({ description: 'Cards matching search and all filters' }),
201
+ variant_total: Type.Integer({ description: 'Non-hidden variants on those cards, counted like variant_count. With variant_id, only the selected variants count.' }),
199
202
  facets: Type.Object({
200
- rarity: Type.Array(CardFacetOptionSchema),
203
+ rarity: Type.Array(CardFacetOptionSchema, { description: 'Cards with no rarity have the value None, labelled "No rarity". Cards with rarity unset are counted in total but have no option.' }),
204
+ language: Type.Array(CardFacetOptionSchema, { description: 'Value is the language code, label its name (e.g. JP, Japanese)' }),
201
205
  variant: Type.Array(CardFacetOptionSchema),
202
206
  set: Type.Array(CardFacetOptionSchema, { description: 'Each option carries its series in group, omitted when the set has no series' })
203
207
  })
@@ -225,7 +229,8 @@ export const CardDetailSchema = Type.Object(
225
229
  cardid: Type.String({ description: 'Unique card identifier' }),
226
230
  name: Type.String({ description: 'Card name' }),
227
231
  number: Type.String({ description: 'Card number within set' }),
228
- rarity: Type.Optional(Type.String({ description: 'Card rarity' })),
232
+ rarity: Type.Optional(Type.Union([Type.String(), Type.Null()], { description: 'Card rarity, the same for every language (no _JP suffix). None when the card has no rarity; null when not set.' })),
233
+ language: Type.Optional(Type.Union([Type.String(), Type.Null()], { description: 'Card language code (EN, JP)' })),
229
234
  images: CardImagesSchema,
230
235
  setid: Type.String({ description: 'Set this card belongs to' }),
231
236
  setname: Type.String({ description: 'Name of the set' }),