@pfdev/api-types 3.0.13 → 3.0.14
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.
- package/package.json +1 -1
- package/v3.ts +145 -0
package/package.json
CHANGED
package/v3.ts
CHANGED
|
@@ -103,6 +103,15 @@ export const CardSearchQuerySchema = Type.Object({
|
|
|
103
103
|
|
|
104
104
|
export type CardSearchQuery = Static<typeof CardSearchQuerySchema>;
|
|
105
105
|
|
|
106
|
+
export const CardBatchQuerySchema = Type.Object({
|
|
107
|
+
ids: Type.String({
|
|
108
|
+
minLength: 1,
|
|
109
|
+
description: 'Comma-separated list of card IDs (e.g. "xy1-2,base1-4"). Duplicates are deduped. Max 200 IDs per request.'
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export type CardBatchQuery = Static<typeof CardBatchQuerySchema>;
|
|
114
|
+
|
|
106
115
|
export const CardDetailSchema = Type.Object(
|
|
107
116
|
{
|
|
108
117
|
cardid: Type.String({ description: 'Unique card identifier' }),
|
|
@@ -559,6 +568,142 @@ export type DexCollectionItem = Static<typeof DexCollectionItemSchema>;
|
|
|
559
568
|
|
|
560
569
|
export const DexCollectionResponseSchema = Type.Array(DexCollectionItemSchema);
|
|
561
570
|
|
|
571
|
+
export const InventorySummaryItemSchema = Type.Object(
|
|
572
|
+
{
|
|
573
|
+
uuid: Type.String({ description: 'Unique ID of this inventory row' }),
|
|
574
|
+
cardid: Type.String({ description: 'Card ID this inventory row belongs to' }),
|
|
575
|
+
variant: Type.String({ description: 'Card variant (e.g. Normal, Holofoil, Reverse Holofoil)' }),
|
|
576
|
+
status: Type.Union([Type.Number(), Type.Null()], {
|
|
577
|
+
description: 'Numeric status code. <100 = active, >=100 = sold/past. Null when no details row exists yet.'
|
|
578
|
+
})
|
|
579
|
+
},
|
|
580
|
+
{ title: 'InventorySummaryItem' }
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
export type InventorySummaryItem = Static<typeof InventorySummaryItemSchema>;
|
|
584
|
+
|
|
585
|
+
export const InventorySummaryResponseSchema = Type.Array(InventorySummaryItemSchema, {
|
|
586
|
+
title: 'InventorySummaryResponse',
|
|
587
|
+
description: 'Lightweight ownership rows for the authenticated user. One entry per physical card owned. Suitable for a global client store.'
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
export type InventorySummaryResponse = Static<typeof InventorySummaryResponseSchema>;
|
|
591
|
+
|
|
592
|
+
export const InventoryAddRequestSchema = Type.Object(
|
|
593
|
+
{
|
|
594
|
+
cardid: Type.String({ minLength: 1, description: 'Card ID to add to inventory' }),
|
|
595
|
+
variant: Type.String({ minLength: 1, description: 'Card variant (e.g. Normal, Holofoil, Reverse Holofoil)' })
|
|
596
|
+
},
|
|
597
|
+
{ title: 'InventoryAddRequest' }
|
|
598
|
+
);
|
|
599
|
+
|
|
600
|
+
export type InventoryAddRequest = Static<typeof InventoryAddRequestSchema>;
|
|
601
|
+
|
|
602
|
+
export const InventoryDeleteParamSchema = Type.Object({
|
|
603
|
+
uuid: Type.String({ format: 'uuid', description: 'UUID of the inventory row to delete' })
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
export type InventoryDeleteParam = Static<typeof InventoryDeleteParamSchema>;
|
|
607
|
+
|
|
608
|
+
export const InventoryTransactionSchema = Type.Object(
|
|
609
|
+
{
|
|
610
|
+
tx_uuid: Type.String({ format: 'uuid' }),
|
|
611
|
+
transaction_type: Type.Number({ description: '100-199 = cost, 200-299 = income' }),
|
|
612
|
+
transaction_date: Type.String({ description: 'ISO date string' }),
|
|
613
|
+
amount: Type.Number(),
|
|
614
|
+
currency: Type.String(),
|
|
615
|
+
amount_usd: Type.Union([Type.Number(), Type.Null()]),
|
|
616
|
+
rate: Type.Union([Type.Number(), Type.Null()]),
|
|
617
|
+
description: Type.Union([Type.String(), Type.Null()]),
|
|
618
|
+
source_platform: Type.Union([Type.String(), Type.Null()])
|
|
619
|
+
},
|
|
620
|
+
{ title: 'InventoryTransaction' }
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
export type InventoryTransaction = Static<typeof InventoryTransactionSchema>;
|
|
624
|
+
|
|
625
|
+
export const InventoryItemDetailSchema = Type.Object(
|
|
626
|
+
{
|
|
627
|
+
uuid: Type.String({ format: 'uuid' }),
|
|
628
|
+
cardid: Type.String(),
|
|
629
|
+
variant: Type.String(),
|
|
630
|
+
status: Type.Union([Type.Number(), Type.Null()]),
|
|
631
|
+
grade: Type.Union([Type.String(), Type.Null()]),
|
|
632
|
+
acquired: Type.Union([Type.String(), Type.Null()]),
|
|
633
|
+
sold_date: Type.Union([Type.String(), Type.Null()]),
|
|
634
|
+
notes: Type.Union([Type.String(), Type.Null()]),
|
|
635
|
+
total_cost_usd: Type.Number(),
|
|
636
|
+
total_income_usd: Type.Number(),
|
|
637
|
+
profit_loss_usd: Type.Number(),
|
|
638
|
+
transactions: Type.Array(InventoryTransactionSchema)
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
title: 'InventoryItemDetail',
|
|
642
|
+
description: 'Full detail of a single inventory row, including transactions and aggregated totals.'
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
export type InventoryItemDetail = Static<typeof InventoryItemDetailSchema>;
|
|
647
|
+
|
|
648
|
+
export const InventoryItemsResponseSchema = Type.Array(InventoryItemDetailSchema, {
|
|
649
|
+
title: 'InventoryItemsResponse',
|
|
650
|
+
description: 'Full-detail inventory items for a specific cardid.'
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
export type InventoryItemsResponse = Static<typeof InventoryItemsResponseSchema>;
|
|
654
|
+
|
|
655
|
+
export const InventoryItemsQuerySchema = Type.Object({
|
|
656
|
+
cardid: Type.String({ minLength: 1, description: 'Card ID to fetch inventory items for' })
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
export type InventoryItemsQuery = Static<typeof InventoryItemsQuerySchema>;
|
|
660
|
+
|
|
661
|
+
export const InventoryItemParamSchema = Type.Object({
|
|
662
|
+
uuid: Type.String({ format: 'uuid', description: 'UUID of the inventory row' })
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
export type InventoryItemParam = Static<typeof InventoryItemParamSchema>;
|
|
666
|
+
|
|
667
|
+
export const InventoryPatchTransactionSchema = Type.Object(
|
|
668
|
+
{
|
|
669
|
+
tx_uuid: Type.Optional(Type.String({ format: 'uuid', description: 'Present for updates, omitted for new transactions' })),
|
|
670
|
+
transaction_type: Type.Number(),
|
|
671
|
+
transaction_date: Type.String({ description: 'ISO date (YYYY-MM-DD)' }),
|
|
672
|
+
amount: Type.Number(),
|
|
673
|
+
currency: Type.Optional(Type.String({ minLength: 3, maxLength: 3, default: 'USD' })),
|
|
674
|
+
description: Type.Optional(Type.String()),
|
|
675
|
+
source_platform: Type.Optional(Type.String())
|
|
676
|
+
},
|
|
677
|
+
{ title: 'InventoryPatchTransaction' }
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
export type InventoryPatchTransaction = Static<typeof InventoryPatchTransactionSchema>;
|
|
681
|
+
|
|
682
|
+
export const InventoryPatchParamSchema = Type.Object({
|
|
683
|
+
uuid: Type.String({ format: 'uuid', description: 'UUID of the inventory row to update' })
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
export type InventoryPatchParam = Static<typeof InventoryPatchParamSchema>;
|
|
687
|
+
|
|
688
|
+
export const InventoryPatchRequestSchema = Type.Object(
|
|
689
|
+
{
|
|
690
|
+
grade: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
691
|
+
status: Type.Optional(Type.Union([Type.Number(), Type.Null()])),
|
|
692
|
+
notes: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
693
|
+
acquired: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
694
|
+
sold_date: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
695
|
+
transactions: Type.Optional(Type.Array(InventoryPatchTransactionSchema, {
|
|
696
|
+
description: 'Authoritative — any existing transaction not in this list is deleted.'
|
|
697
|
+
}))
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
title: 'InventoryPatchRequest',
|
|
701
|
+
description: 'Fields omitted from the body are left unchanged. Fields set to null are cleared.'
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
|
|
705
|
+
export type InventoryPatchRequest = Static<typeof InventoryPatchRequestSchema>;
|
|
706
|
+
|
|
562
707
|
// ============= VISION =============
|
|
563
708
|
|
|
564
709
|
|