@pfdev/api-types 3.0.25 → 3.0.27
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 +85 -1
package/package.json
CHANGED
package/v3.ts
CHANGED
|
@@ -669,7 +669,7 @@ export const ListSchema = Type.Object(
|
|
|
669
669
|
icon: Type.Union([Type.String(), Type.Null()]),
|
|
670
670
|
color: Type.Union([Type.String(), Type.Null()]),
|
|
671
671
|
is_private: Type.Boolean(),
|
|
672
|
-
type:
|
|
672
|
+
type: ListTypeSchema,
|
|
673
673
|
binder_config: Type.Union([Type.Number(), Type.Null()], {
|
|
674
674
|
description: 'Binder layout preset. Only set for binders.'
|
|
675
675
|
}),
|
|
@@ -733,6 +733,90 @@ export const ListPatchRequestSchema = Type.Object(
|
|
|
733
733
|
|
|
734
734
|
export type ListPatchRequest = Static<typeof ListPatchRequestSchema>;
|
|
735
735
|
|
|
736
|
+
export const ListEntrySchema = Type.Object(
|
|
737
|
+
{
|
|
738
|
+
uuid: Type.String({ format: 'uuid', description: 'Unique ID of this entry' }),
|
|
739
|
+
list_uuid: Type.String({ format: 'uuid' }),
|
|
740
|
+
cardid: Type.String(),
|
|
741
|
+
variant_id: Type.Union([Type.Integer(), Type.Null()], { description: 'Variant id (pfdata_variant_definitions.id); matches variants[].id on cards. Null when the variant has no definition.' }),
|
|
742
|
+
added_at: Type.String({ description: 'When this entry was added' }),
|
|
743
|
+
slot: Type.Union([Type.Integer(), Type.Null()], { description: 'Binder slot. Null for lists.' }),
|
|
744
|
+
inventory_uuid: Type.Union([Type.String({ format: 'uuid' }), Type.Null()], { description: 'Inventory copy linked to this binder slot. Null for lists and unlinked slots.' })
|
|
745
|
+
},
|
|
746
|
+
{ title: 'ListEntry' }
|
|
747
|
+
);
|
|
748
|
+
|
|
749
|
+
export type ListEntry = Static<typeof ListEntrySchema>;
|
|
750
|
+
|
|
751
|
+
export const ListEntriesResponseSchema = Type.Array(ListEntrySchema, {
|
|
752
|
+
title: 'ListEntriesResponse',
|
|
753
|
+
description: 'Entries in the order they were added.'
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
const MAX_BATCH = 500;
|
|
757
|
+
|
|
758
|
+
export const ListEntriesAddRequestSchema = Type.Object(
|
|
759
|
+
{
|
|
760
|
+
cards: Type.Array(
|
|
761
|
+
Type.Object({
|
|
762
|
+
cardid: Type.String({ minLength: 1 }),
|
|
763
|
+
variant_id: Type.Integer({ minimum: 1, description: 'Variant id (variants[].id on the card). Must be one of the card\'s variants and not hidden.' })
|
|
764
|
+
}),
|
|
765
|
+
{ minItems: 1, maxItems: MAX_BATCH }
|
|
766
|
+
)
|
|
767
|
+
},
|
|
768
|
+
{ title: 'ListEntriesAddRequest', additionalProperties: false }
|
|
769
|
+
);
|
|
770
|
+
|
|
771
|
+
export type ListEntriesAddRequest = Static<typeof ListEntriesAddRequestSchema>;
|
|
772
|
+
|
|
773
|
+
export const ListEntryParamSchema = Type.Object({
|
|
774
|
+
uuid: Type.String({ format: 'uuid', description: 'UUID of the list' }),
|
|
775
|
+
entry_uuid: Type.String({ format: 'uuid', description: 'UUID of the entry' })
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
export type ListEntryParam = Static<typeof ListEntryParamSchema>;
|
|
779
|
+
|
|
780
|
+
export const ListEntriesDeleteRequestSchema = Type.Object(
|
|
781
|
+
{
|
|
782
|
+
uuids: Type.Array(Type.String({ format: 'uuid' }), { minItems: 1, maxItems: MAX_BATCH })
|
|
783
|
+
},
|
|
784
|
+
{ title: 'ListEntriesDeleteRequest', additionalProperties: false }
|
|
785
|
+
);
|
|
786
|
+
|
|
787
|
+
export type ListEntriesDeleteRequest = Static<typeof ListEntriesDeleteRequestSchema>;
|
|
788
|
+
|
|
789
|
+
export const ListCardLimitErrorSchema = Type.Object(
|
|
790
|
+
{
|
|
791
|
+
error: Type.String(),
|
|
792
|
+
message: Type.String(),
|
|
793
|
+
code: Type.Literal('LIST_CARD_LIMIT'),
|
|
794
|
+
limit: Type.Integer(),
|
|
795
|
+
used: Type.Integer({ description: 'Entries currently in the list' }),
|
|
796
|
+
remaining: Type.Integer({ description: 'Entries that can still be added. 0 when the list is at or over its limit.' })
|
|
797
|
+
},
|
|
798
|
+
{ title: 'ListCardLimitError' }
|
|
799
|
+
);
|
|
800
|
+
|
|
801
|
+
export type ListCardLimitError = Static<typeof ListCardLimitErrorSchema>;
|
|
802
|
+
|
|
803
|
+
const UsageCountSchema = Type.Object({
|
|
804
|
+
used: Type.Integer(),
|
|
805
|
+
limit: Type.Integer({ description: '-1 = unlimited' })
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
export const ListUsageResponseSchema = Type.Object(
|
|
809
|
+
{
|
|
810
|
+
lists: UsageCountSchema,
|
|
811
|
+
binders: UsageCountSchema,
|
|
812
|
+
cards_per_list: Type.Integer({ description: '-1 = unlimited' }),
|
|
813
|
+
cards_per_binder: Type.Integer({ description: '-1 = unlimited' })
|
|
814
|
+
},
|
|
815
|
+
{ title: 'ListUsageResponse' }
|
|
816
|
+
);
|
|
817
|
+
|
|
818
|
+
export type ListUsageResponse = Static<typeof ListUsageResponseSchema>;
|
|
819
|
+
|
|
736
820
|
// ============= USERS =============
|
|
737
821
|
|
|
738
822
|
|