@@ -5,13 +5,11 @@ import { ApiError, ApiSuccess } from './api';
55export const CollectionUserProjection = z . object ( {
66 isFavorited : z . boolean ( ) ,
77} ) ;
8- export type CollectionUserProjection = z . infer < typeof CollectionUserProjection > ;
98
109export const CollectionMap = z . object ( {
1110 mapId : z . string ( ) ,
1211 position : z . number ( ) ,
1312} ) ;
14- export type CollectionMap = z . infer < typeof CollectionMap > ;
1513
1614export const Collection = z . object ( {
1715 id : z . string ( ) ,
@@ -24,31 +22,26 @@ export const Collection = z.object({
2422 favorites : z . number ( ) ,
2523 userProjection : CollectionUserProjection . optional ( ) ,
2624} ) ;
27- export type Collection = z . infer < typeof Collection > ;
2825
2926/* GET getCollection */
3027export const GetCollectionSuccess = ApiSuccess . extend ( {
3128 collection : Collection ,
3229} ) ;
33- export type GetCollectionSuccess = z . infer < typeof GetCollectionSuccess > ;
3430
3531export const GetCollectionResponse = z . discriminatedUnion ( 'success' , [
3632 GetCollectionSuccess ,
3733 ApiError ,
3834] ) ;
39- export type GetCollectionResponse = z . infer < typeof GetCollectionResponse > ;
4035
4136/* GET findCollections */
4237export const FindCollectionsSuccess = ApiSuccess . extend ( {
4338 collections : z . array ( Collection ) ,
4439} ) ;
45- export type FindCollectionsSuccess = z . infer < typeof FindCollectionsSuccess > ;
4640
4741export const FindCollectionsResponse = z . discriminatedUnion ( 'success' , [
4842 FindCollectionsSuccess ,
4943 ApiError ,
5044] ) ;
51- export type FindCollectionsResponse = z . infer < typeof FindCollectionsResponse > ;
5245
5346/* POST createCollection */
5447export const CreateCollectionRequest = z . object ( {
@@ -57,18 +50,15 @@ export const CreateCollectionRequest = z.object({
5750 albumArt : z . string ( ) . optional ( ) ,
5851 mapIds : z . array ( z . string ( ) ) . optional ( ) ,
5952} ) ;
60- export type CreateCollectionRequest = z . infer < typeof CreateCollectionRequest > ;
6153
6254export const CreateCollectionSuccess = ApiSuccess . extend ( {
6355 id : z . string ( ) ,
6456} ) ;
65- export type CreateCollectionSuccess = z . infer < typeof CreateCollectionSuccess > ;
6657
6758export const CreateCollectionResponse = z . discriminatedUnion ( 'success' , [
6859 CreateCollectionSuccess ,
6960 ApiError ,
7061] ) ;
71- export type CreateCollectionResponse = z . infer < typeof CreateCollectionResponse > ;
7262
7363/* PUT updateCollection */
7464export const UpdateCollectionRequest = z . object ( {
@@ -78,35 +68,47 @@ export const UpdateCollectionRequest = z.object({
7868 albumArt : z . string ( ) . optional ( ) ,
7969 mapIds : z . array ( z . string ( ) ) . optional ( ) ,
8070} ) ;
81- export type UpdateCollectionRequest = z . infer < typeof UpdateCollectionRequest > ;
8271
8372export const UpdateCollectionResponse = z . discriminatedUnion ( 'success' , [ ApiSuccess , ApiError ] ) ;
84- export type UpdateCollectionResponse = z . infer < typeof UpdateCollectionResponse > ;
8573
8674/* DELETE deleteCollection */
8775export const DeleteCollectionSuccess = ApiSuccess . extend ( { } ) ;
88- export type DeleteCollectionSuccess = z . infer < typeof DeleteCollectionSuccess > ;
8976
9077export const DeleteCollectionResponse = z . discriminatedUnion ( 'success' , [
9178 DeleteCollectionSuccess ,
9279 ApiError ,
9380] ) ;
94- export type DeleteCollectionResponse = z . infer < typeof DeleteCollectionResponse > ;
9581
9682/* Collection Favorites */
9783export const SetCollectionFavoritesRequest = z . object ( {
9884 collectionIds : z . array ( z . string ( ) ) ,
9985 isFavorite : z . boolean ( ) ,
10086} ) ;
101- export type SetCollectionFavoritesRequest = z . infer < typeof SetCollectionFavoritesRequest > ;
10287
10388export const GetFavoriteCollectionsSuccess = ApiSuccess . extend ( {
10489 collections : z . array ( Collection ) ,
10590} ) ;
106- export type GetFavoriteCollectionsSuccess = z . infer < typeof GetFavoriteCollectionsSuccess > ;
10791
10892export const GetFavoriteCollectionsResponse = z . discriminatedUnion ( 'success' , [
10993 GetFavoriteCollectionsSuccess ,
11094 ApiError ,
11195] ) ;
96+
97+ /* Inferred types */
98+ export type CollectionUserProjection = z . infer < typeof CollectionUserProjection > ;
99+ export type CollectionMap = z . infer < typeof CollectionMap > ;
100+ export type Collection = z . infer < typeof Collection > ;
101+ export type GetCollectionSuccess = z . infer < typeof GetCollectionSuccess > ;
102+ export type GetCollectionResponse = z . infer < typeof GetCollectionResponse > ;
103+ export type FindCollectionsSuccess = z . infer < typeof FindCollectionsSuccess > ;
104+ export type FindCollectionsResponse = z . infer < typeof FindCollectionsResponse > ;
105+ export type CreateCollectionRequest = z . infer < typeof CreateCollectionRequest > ;
106+ export type CreateCollectionSuccess = z . infer < typeof CreateCollectionSuccess > ;
107+ export type CreateCollectionResponse = z . infer < typeof CreateCollectionResponse > ;
108+ export type UpdateCollectionRequest = z . infer < typeof UpdateCollectionRequest > ;
109+ export type UpdateCollectionResponse = z . infer < typeof UpdateCollectionResponse > ;
110+ export type DeleteCollectionSuccess = z . infer < typeof DeleteCollectionSuccess > ;
111+ export type DeleteCollectionResponse = z . infer < typeof DeleteCollectionResponse > ;
112+ export type SetCollectionFavoritesRequest = z . infer < typeof SetCollectionFavoritesRequest > ;
113+ export type GetFavoriteCollectionsSuccess = z . infer < typeof GetFavoriteCollectionsSuccess > ;
112114export type GetFavoriteCollectionsResponse = z . infer < typeof GetFavoriteCollectionsResponse > ;
0 commit comments