@pfdev/api-types 3.0.29 → 3.0.30

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 +19 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pfdev/api-types",
3
- "version": "3.0.29",
3
+ "version": "3.0.30",
4
4
  "description": "TypeScript types for PF API V3",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
package/v3.ts CHANGED
@@ -457,7 +457,7 @@ export const SealedItemSchema = Type.Object(
457
457
  set_name: Type.Optional(Type.String({ description: 'Name of the set' })),
458
458
  product_slug: Type.Optional(Type.String({ description: 'Product URL slug' })),
459
459
  set_slug: Type.Optional(Type.String({ description: 'Set URL slug' })),
460
- image: Type.Optional(Type.String({ description: 'Product image URL' })),
460
+ image: Type.Optional(Type.String({ description: 'Product image URL (WebP on the Pokefolio CDN). Not every product has an image there yet.' })),
461
461
  tcgp_id: Type.Optional(Type.Number({ description: 'TCGPlayer product ID' })),
462
462
  language: Type.Optional(Type.String({ description: 'Product language' })),
463
463
  price: Type.Optional(Type.Number({ description: 'Current market price' })),
@@ -755,12 +755,22 @@ const ComparisonRangeSchema = Type.Union(
755
755
  { description: 'Period the change was measured over. ALL is measured over 1Y, the longest past price available.' }
756
756
  );
757
757
 
758
- export const CollectionAllocationSchema = Type.Object(
758
+ const AllocationFields = {
759
+ value: Type.Number({ description: 'Market value in USD' }),
760
+ items: Type.Integer({ description: 'Items owned, counting each copy' }),
761
+ no_price_count: Type.Integer({ description: 'Copies with no current price, counted in items but adding nothing to value' })
762
+ };
763
+
764
+ export const CollectionAllocationSchema = Type.Object(AllocationFields, { title: 'CollectionAllocation' });
765
+
766
+ export const CollectionCardAllocationSchema = Type.Object(
759
767
  {
760
- value: Type.Number({ description: 'Market value in USD' }),
761
- items: Type.Integer({ description: 'Items owned, counting each copy' })
768
+ ...AllocationFields,
769
+ assumed_raw_count: Type.Integer({
770
+ description: 'Graded copies valued at the raw price because their grade has no current price'
771
+ })
762
772
  },
763
- { title: 'CollectionAllocation' }
773
+ { title: 'CollectionCardAllocation' }
764
774
  );
765
775
 
766
776
  export const CollectionSummaryResponseSchema = Type.Object(
@@ -768,7 +778,7 @@ export const CollectionSummaryResponseSchema = Type.Object(
768
778
  total_value: Type.Number({ description: 'Market value of everything owned, in USD' }),
769
779
  items: Type.Integer({ description: 'Items owned, counting each copy' }),
770
780
  allocation: Type.Object({
771
- cards: CollectionAllocationSchema,
781
+ cards: CollectionCardAllocationSchema,
772
782
  sealed: CollectionAllocationSchema
773
783
  })
774
784
  },
@@ -1129,6 +1139,9 @@ export const InventorySummaryItemSchema = Type.Object(
1129
1139
  status: Type.Union([Type.Number(), Type.Null()], {
1130
1140
  description: 'Numeric status code. <100 = active, >=100 = sold/past. Null when no details row exists yet.'
1131
1141
  }),
1142
+ grade: Type.Union([Type.String(), Type.Null()], {
1143
+ description: 'Grade of this copy (e.g. "PSA 10"), matching a key of variants[].graded. Null when ungraded or no details row exists yet.'
1144
+ }),
1132
1145
  acquired: Type.Union([Type.String(), Type.Null()], {
1133
1146
  description: 'User-entered acquired date. Null when not set or no details row exists yet.'
1134
1147
  }),