|
|
@ -1,31 +1,28 @@ |
|
|
|
import { |
|
|
|
import { |
|
|
|
Album, |
|
|
|
Album, |
|
|
|
AlbumBaseWithRefs, |
|
|
|
|
|
|
|
AlbumWithRefs, |
|
|
|
|
|
|
|
Artist, |
|
|
|
Artist, |
|
|
|
ArtistBaseWithRefs, |
|
|
|
|
|
|
|
ArtistWithRefs, |
|
|
|
|
|
|
|
IntegrationData, |
|
|
|
IntegrationData, |
|
|
|
IntegrationDataWithId, |
|
|
|
IntegrationDataWithId, |
|
|
|
IntegrationDataWithSecret, |
|
|
|
IntegrationDataWithSecret, |
|
|
|
isAlbumBaseWithRefs, |
|
|
|
|
|
|
|
isAlbumWithRefs, |
|
|
|
|
|
|
|
isArtistBaseWithRefs, |
|
|
|
|
|
|
|
isArtistWithRefs, |
|
|
|
|
|
|
|
isIntegrationData, |
|
|
|
isIntegrationData, |
|
|
|
isPartialIntegrationData, |
|
|
|
isPartialIntegrationData, |
|
|
|
isTagBaseWithRefs, |
|
|
|
|
|
|
|
isTagWithRefs, |
|
|
|
|
|
|
|
isTrackBaseWithRefs, |
|
|
|
|
|
|
|
isTrackWithRefs, |
|
|
|
|
|
|
|
PartialIntegrationData, |
|
|
|
PartialIntegrationData, |
|
|
|
Tag, |
|
|
|
Tag, |
|
|
|
TagBaseWithRefs, |
|
|
|
|
|
|
|
TagWithRefs, |
|
|
|
|
|
|
|
Track, |
|
|
|
Track, |
|
|
|
TrackBaseWithRefs, |
|
|
|
TrackRefs, |
|
|
|
TrackWithDetails, |
|
|
|
ArtistRefs, |
|
|
|
TrackWithRefs |
|
|
|
AlbumRefs, |
|
|
|
|
|
|
|
TagRefs, |
|
|
|
|
|
|
|
isTrackRefs, |
|
|
|
|
|
|
|
isAlbumRefs, |
|
|
|
|
|
|
|
isArtistRefs, |
|
|
|
|
|
|
|
isTagRefs, |
|
|
|
|
|
|
|
isName, |
|
|
|
|
|
|
|
Name, |
|
|
|
|
|
|
|
isTrack, |
|
|
|
|
|
|
|
isArtist, |
|
|
|
|
|
|
|
isAlbum, |
|
|
|
|
|
|
|
isTag, |
|
|
|
} from "../types/resources"; |
|
|
|
} from "../types/resources"; |
|
|
|
|
|
|
|
|
|
|
|
// The API supports RESTful access to single API resources:
|
|
|
|
// The API supports RESTful access to single API resources:
|
|
|
@ -68,27 +65,27 @@ export type GetIntegrationResponse = IntegrationData; |
|
|
|
|
|
|
|
|
|
|
|
// Post new track (POST).
|
|
|
|
// Post new track (POST).
|
|
|
|
export const PostTrackEndpoint = "/track"; |
|
|
|
export const PostTrackEndpoint = "/track"; |
|
|
|
export type PostTrackRequest = TrackWithRefs; |
|
|
|
export type PostTrackRequest = (Track & TrackRefs & Name); |
|
|
|
export interface PostTrackResponse { id: number }; |
|
|
|
export interface PostTrackResponse { id: number }; |
|
|
|
export const checkPostTrackRequest: (v: any) => boolean = isTrackWithRefs; |
|
|
|
export const checkPostTrackRequest: (v: any) => boolean = (v: any) => isTrackRefs(v) && isName(v); |
|
|
|
|
|
|
|
|
|
|
|
// Post new artist (POST).
|
|
|
|
// Post new artist (POST).
|
|
|
|
export const PostArtistEndpoint = "/artist"; |
|
|
|
export const PostArtistEndpoint = "/artist"; |
|
|
|
export type PostArtistRequest = ArtistWithRefs; |
|
|
|
export type PostArtistRequest = (Artist & ArtistRefs & Name); |
|
|
|
export interface PostArtistResponse { id: number }; |
|
|
|
export interface PostArtistResponse { id: number }; |
|
|
|
export const checkPostArtistRequest: (v: any) => boolean = isArtistWithRefs; |
|
|
|
export const checkPostArtistRequest: (v: any) => boolean = (v: any) => isArtistRefs(v) && isName(v); |
|
|
|
|
|
|
|
|
|
|
|
// Post new album (POST).
|
|
|
|
// Post new album (POST).
|
|
|
|
export const PostAlbumEndpoint = "/album"; |
|
|
|
export const PostAlbumEndpoint = "/album"; |
|
|
|
export type PostAlbumRequest = AlbumWithRefs; |
|
|
|
export type PostAlbumRequest = (Album & AlbumRefs & Name); |
|
|
|
export interface PostAlbumResponse { id: number }; |
|
|
|
export interface PostAlbumResponse { id: number }; |
|
|
|
export const checkPostAlbumRequest: (v: any) => boolean = isAlbumWithRefs; |
|
|
|
export const checkPostAlbumRequest: (v: any) => boolean = (v: any) => isAlbumRefs(v) && isName(v); |
|
|
|
|
|
|
|
|
|
|
|
// Post new tag (POST).
|
|
|
|
// Post new tag (POST).
|
|
|
|
export const PostTagEndpoint = "/tag"; |
|
|
|
export const PostTagEndpoint = "/tag"; |
|
|
|
export type PostTagRequest = TagWithRefs; |
|
|
|
export type PostTagRequest = (Tag & TagRefs & Name); |
|
|
|
export interface PostTagResponse { id: number }; |
|
|
|
export interface PostTagResponse { id: number }; |
|
|
|
export const checkPostTagRequest: (v: any) => boolean = isTagWithRefs; |
|
|
|
export const checkPostTagRequest: (v: any) => boolean = (v: any) => isTagRefs(v) && isName(v); |
|
|
|
|
|
|
|
|
|
|
|
// Post new integration (POST).
|
|
|
|
// Post new integration (POST).
|
|
|
|
export const PostIntegrationEndpoint = "/integration"; |
|
|
|
export const PostIntegrationEndpoint = "/integration"; |
|
|
@ -98,27 +95,27 @@ export const checkPostIntegrationRequest: (v: any) => boolean = isIntegrationDat |
|
|
|
|
|
|
|
|
|
|
|
// Replace track (PUT).
|
|
|
|
// Replace track (PUT).
|
|
|
|
export const PutTrackEndpoint = "/track/:id"; |
|
|
|
export const PutTrackEndpoint = "/track/:id"; |
|
|
|
export type PutTrackRequest = TrackWithRefs; |
|
|
|
export type PutTrackRequest = (Track & TrackRefs & Name); |
|
|
|
export type PutTrackResponse = void; |
|
|
|
export type PutTrackResponse = void; |
|
|
|
export const checkPutTrackRequest: (v: any) => boolean = isTrackWithRefs; |
|
|
|
export const checkPutTrackRequest: (v: any) => boolean = (v: any) => isTrackRefs(v) && isName(v); |
|
|
|
|
|
|
|
|
|
|
|
// Replace artist (PUT).
|
|
|
|
// Replace artist (PUT).
|
|
|
|
export const PutArtistEndpoint = "/artist/:id"; |
|
|
|
export const PutArtistEndpoint = "/artist/:id"; |
|
|
|
export type PutArtistRequest = ArtistWithRefs; |
|
|
|
export type PutArtistRequest = (Artist & ArtistRefs); |
|
|
|
export type PutArtistResponse = void; |
|
|
|
export type PutArtistResponse = void; |
|
|
|
export const checkPutArtistRequest: (v: any) => boolean = isArtistWithRefs; |
|
|
|
export const checkPutArtistRequest: (v: any) => boolean = (v: any) => isArtistRefs(v) && isName(v);; |
|
|
|
|
|
|
|
|
|
|
|
// Replace album (PUT).
|
|
|
|
// Replace album (PUT).
|
|
|
|
export const PutAlbumEndpoint = "/album/:id"; |
|
|
|
export const PutAlbumEndpoint = "/album/:id"; |
|
|
|
export type PutAlbumRequest = AlbumWithRefs; |
|
|
|
export type PutAlbumRequest = (Album & AlbumRefs); |
|
|
|
export type PutAlbumResponse = void; |
|
|
|
export type PutAlbumResponse = void; |
|
|
|
export const checkPutAlbumRequest: (v: any) => boolean = isAlbumWithRefs; |
|
|
|
export const checkPutAlbumRequest: (v: any) => boolean = (v: any) => isAlbumRefs(v) && isName(v);; |
|
|
|
|
|
|
|
|
|
|
|
// Replace tag (PUT).
|
|
|
|
// Replace tag (PUT).
|
|
|
|
export const PutTagEndpoint = "/tag/:id"; |
|
|
|
export const PutTagEndpoint = "/tag/:id"; |
|
|
|
export type PutTagRequest = TagWithRefs; |
|
|
|
export type PutTagRequest = (Tag & TagRefs); |
|
|
|
export type PutTagResponse = void; |
|
|
|
export type PutTagResponse = void; |
|
|
|
export const checkPutTagRequest: (v: any) => boolean = isTagWithRefs; |
|
|
|
export const checkPutTagRequest: (v: any) => boolean = (v: any) => isTagRefs(v) && isName(v);; |
|
|
|
|
|
|
|
|
|
|
|
// Replace integration (PUT).
|
|
|
|
// Replace integration (PUT).
|
|
|
|
export const PutIntegrationEndpoint = "/integration/:id"; |
|
|
|
export const PutIntegrationEndpoint = "/integration/:id"; |
|
|
@ -128,27 +125,27 @@ export const checkPutIntegrationRequest: (v: any) => boolean = isIntegrationData |
|
|
|
|
|
|
|
|
|
|
|
// Modify track (PATCH).
|
|
|
|
// Modify track (PATCH).
|
|
|
|
export const PatchTrackEndpoint = "/track/:id"; |
|
|
|
export const PatchTrackEndpoint = "/track/:id"; |
|
|
|
export type PatchTrackRequest = TrackBaseWithRefs; |
|
|
|
export type PatchTrackRequest = Track; |
|
|
|
export type PatchTrackResponse = void; |
|
|
|
export type PatchTrackResponse = void; |
|
|
|
export const checkPatchTrackRequest: (v: any) => boolean = isTrackBaseWithRefs; |
|
|
|
export const checkPatchTrackRequest: (v: any) => boolean = isTrack; |
|
|
|
|
|
|
|
|
|
|
|
// Modify artist (PATCH).
|
|
|
|
// Modify artist (PATCH).
|
|
|
|
export const PatchArtistEndpoint = "/artist/:id"; |
|
|
|
export const PatchArtistEndpoint = "/artist/:id"; |
|
|
|
export type PatchArtistRequest = ArtistBaseWithRefs; |
|
|
|
export type PatchArtistRequest = Artist; |
|
|
|
export type PatchArtistResponse = void; |
|
|
|
export type PatchArtistResponse = void; |
|
|
|
export const checkPatchArtistRequest: (v: any) => boolean = isArtistBaseWithRefs; |
|
|
|
export const checkPatchArtistRequest: (v: any) => boolean = isArtist; |
|
|
|
|
|
|
|
|
|
|
|
// Modify album (PATCH).
|
|
|
|
// Modify album (PATCH).
|
|
|
|
export const PatchAlbumEndpoint = "/album/:id"; |
|
|
|
export const PatchAlbumEndpoint = "/album/:id"; |
|
|
|
export type PatchAlbumRequest = AlbumBaseWithRefs; |
|
|
|
export type PatchAlbumRequest = Album; |
|
|
|
export type PatchAlbumResponse = void; |
|
|
|
export type PatchAlbumResponse = void; |
|
|
|
export const checkPatchAlbumRequest: (v: any) => boolean = isAlbumBaseWithRefs; |
|
|
|
export const checkPatchAlbumRequest: (v: any) => boolean = isAlbum; |
|
|
|
|
|
|
|
|
|
|
|
// Modify tag (PATCH).
|
|
|
|
// Modify tag (PATCH).
|
|
|
|
export const PatchTagEndpoint = "/tag/:id"; |
|
|
|
export const PatchTagEndpoint = "/tag/:id"; |
|
|
|
export type PatchTagRequest = TagBaseWithRefs; |
|
|
|
export type PatchTagRequest = Tag; |
|
|
|
export type PatchTagResponse = void; |
|
|
|
export type PatchTagResponse = void; |
|
|
|
export const checkPatchTagRequest: (v: any) => boolean = isTagBaseWithRefs; |
|
|
|
export const checkPatchTagRequest: (v: any) => boolean = isTag; |
|
|
|
|
|
|
|
|
|
|
|
// Modify integration (PATCH).
|
|
|
|
// Modify integration (PATCH).
|
|
|
|
export const PatchIntegrationEndpoint = "/integration/:id"; |
|
|
|
export const PatchIntegrationEndpoint = "/integration/:id"; |
|
|
|