glitch-javascript-sdk
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -122,22 +122,46 @@ import Response from "../util/Response"; | ||
/** | ||
* Upload main image | ||
* Updates the main image for the event using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the main image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>; | ||
static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Upload banner image | ||
* Updates the banner image for the competition using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>; | ||
static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the banner image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Invites | ||
@@ -189,3 +213,3 @@ * | ||
*/ | ||
static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>; | ||
static createBracjet<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -212,3 +236,3 @@ * Show round bracket | ||
*/ | ||
static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>; | ||
static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -242,3 +266,3 @@ * Delete bracket | ||
*/ | ||
static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createRound<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -263,3 +287,3 @@ * Retrieve the information for a single round. | ||
*/ | ||
static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>; | ||
static updateRound<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -292,3 +316,3 @@ * Deletes the round for the competition. | ||
*/ | ||
static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createCompetitionTeam<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -313,3 +337,3 @@ * Display the contents of a single team associated with the competition. | ||
*/ | ||
static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>; | ||
static updateTeam<T>(competition_id: string, team_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -342,3 +366,3 @@ * Removes the team from the competition. | ||
*/ | ||
static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createCompetitionUser<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -363,3 +387,3 @@ * Show a single user by its ID. | ||
*/ | ||
static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>; | ||
static updateCompetitionUser<T>(competition_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -392,3 +416,3 @@ * Remove the associated user from the competition. | ||
*/ | ||
static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createVenue<T>(competition_id: string, data: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -413,3 +437,3 @@ * Show a single venue by its ID. | ||
*/ | ||
static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>; | ||
static updateVenue<T>(competition_id: string, venue_id: string, data: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -426,12 +450,24 @@ * Deletes the venue from the competition. | ||
/** | ||
* Upload venue main image to storage. | ||
* Updates the main image for the venue using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the main image for the venue using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param competition_id | ||
* @param venue_id | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>; | ||
static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
} | ||
export default Competitions; |
@@ -231,22 +231,46 @@ import { AxiosPromise } from 'axios'; | ||
/** | ||
* Upload main image | ||
* Updates the main image for the event using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the main image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadMainImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>; | ||
static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Upload banner image | ||
* Updates the banner image for the competition using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadBannerImage<T>(competition_id: string, image: string): AxiosPromise<Response<T>>; | ||
static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the banner image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Invites | ||
@@ -298,3 +322,3 @@ * | ||
*/ | ||
static bracketStore<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>; | ||
static createBracjet<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -321,3 +345,3 @@ * Show round bracket | ||
*/ | ||
static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number): AxiosPromise<Response<T>>; | ||
static updateBracket<T>(competition_id: string, round_id: number, bracket_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -351,3 +375,3 @@ * Delete bracket | ||
*/ | ||
static roundStore<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createRound<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -372,3 +396,3 @@ * Retrieve the information for a single round. | ||
*/ | ||
static updateRound<T>(competition_id: string, round_id: number): AxiosPromise<Response<T>>; | ||
static updateRound<T>(competition_id: string, round_id: number, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -401,3 +425,3 @@ * Deletes the round for the competition. | ||
*/ | ||
static teamStore<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createCompetitionTeam<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -422,3 +446,3 @@ * Display the contents of a single team associated with the competition. | ||
*/ | ||
static updateTeam<T>(competition_id: string, team_id: string): AxiosPromise<Response<T>>; | ||
static updateTeam<T>(competition_id: string, team_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -451,3 +475,3 @@ * Removes the team from the competition. | ||
*/ | ||
static competitionUser<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createCompetitionUser<T>(competition_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -472,3 +496,3 @@ * Show a single user by its ID. | ||
*/ | ||
static updateCompetitionUser<T>(competition_id: string, user_id: string): AxiosPromise<Response<T>>; | ||
static updateCompetitionUser<T>(competition_id: string, user_id: string, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -501,3 +525,3 @@ * Remove the associated user from the competition. | ||
*/ | ||
static newVenue<T>(competition_id: string): AxiosPromise<Response<T>>; | ||
static createVenue<T>(competition_id: string, data: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -522,3 +546,3 @@ * Show a single venue by its ID. | ||
*/ | ||
static updateVenue<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>; | ||
static updateVenue<T>(competition_id: string, venue_id: string, data: object): AxiosPromise<Response<T>>; | ||
/** | ||
@@ -535,11 +559,23 @@ * Deletes the venue from the competition. | ||
/** | ||
* Upload venue main image to storage. | ||
* Updates the main image for the venue using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>>; | ||
/** | ||
* Updates the main image for the venue using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param competition_id | ||
* @param venue_id | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
static uploadVenueMainImage<T>(competition_id: string, venue_id: string): AxiosPromise<Response<T>>; | ||
static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>>; | ||
} | ||
@@ -546,0 +582,0 @@ |
{ | ||
"name": "glitch-javascript-sdk", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Javascript SDK for Glitch", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -166,28 +166,70 @@ import CompetitionRoutes from "../routes/CompetitionRoute"; | ||
/** | ||
* Upload main image | ||
* Updates the main image for the event using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadCompetitionMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadFile(url, 'image', file, data); | ||
} | ||
/** | ||
* Updates the main image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadMainImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadMainImage<T>(competition_id : string, image : string) : AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.uploadMainImage, {competition_id : competition_id}, {image : image}); | ||
public static uploadCompetitionMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadMainImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadBlob(url, 'image', blob, data); | ||
} | ||
/** | ||
* Upload banner image | ||
* Updates the banner image for the competition using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param competition_id | ||
* @param image | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadBannerImage<T>(competition_id : string, image : string) : AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.uploadBannerImage, {competition_id : competition_id}, {image : image}); | ||
public static uploadCompetitionBannerImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadFile(url, 'image', file, data); | ||
} | ||
/** | ||
* Updates the banner image for the competition using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadBannerImage | ||
* | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadCompetitionsBannerImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadBannerImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadBlob(url, 'image', blob, data); | ||
} | ||
/** | ||
* Invites | ||
@@ -239,3 +281,3 @@ * | ||
public static brackets<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.brackets, {competition_id : competition_id}, {round_id : round_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.brackets, {}, {round_id : round_id, competition_id : competition_id}); | ||
} | ||
@@ -252,4 +294,4 @@ | ||
*/ | ||
public static bracketStore<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.bracketStore, {competition_id : competition_id}, {round_id : round_id}); | ||
public static createBracjet<T>(competition_id : string, round_id : number, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.bracketStore, data, {round_id : round_id, competition_id : competition_id}); | ||
} | ||
@@ -268,3 +310,3 @@ | ||
public static showBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.showBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.showBracket, {}, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id}); | ||
} | ||
@@ -282,4 +324,4 @@ | ||
*/ | ||
public static updateBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id}); | ||
public static updateBracket<T>(competition_id : string, round_id : number, bracket_id : number, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id}); | ||
} | ||
@@ -298,3 +340,3 @@ | ||
public static destroyBracket<T>(competition_id : string, round_id : number, bracket_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {competition_id : competition_id}, {round_id : round_id, bracket_id : bracket_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyBracket, {}, {round_id : round_id, bracket_id : bracket_id, competition_id : competition_id}); | ||
} | ||
@@ -311,3 +353,3 @@ | ||
public static rounds<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.rounds, {competition_id : competition_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.rounds, {}, {competition_id : competition_id}); | ||
} | ||
@@ -323,4 +365,4 @@ | ||
*/ | ||
public static roundStore<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.roundStore, {competition_id : competition_id}); | ||
public static createRound<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.roundStore, data, {competition_id : competition_id}); | ||
} | ||
@@ -338,3 +380,3 @@ | ||
public static showRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.showRound, {competition_id : competition_id}, {round_id : round_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.showRound, {}, {round_id : round_id, competition_id : competition_id}); | ||
} | ||
@@ -351,4 +393,4 @@ | ||
*/ | ||
public static updateRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, {competition_id : competition_id}, {round_id : round_id}); | ||
public static updateRound<T>(competition_id : string, round_id : number, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateBracket, data, {round_id : round_id, competition_id : competition_id}); | ||
} | ||
@@ -366,3 +408,3 @@ | ||
public static destroyRound<T>(competition_id : string, round_id : number): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {competition_id : competition_id}, {round_id : round_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyRound, {}, {round_id : round_id, competition_id : competition_id}); | ||
} | ||
@@ -379,3 +421,3 @@ | ||
public static team<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.team, {competition_id : competition_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.team, {}, {competition_id : competition_id}); | ||
} | ||
@@ -391,4 +433,4 @@ | ||
*/ | ||
public static teamStore<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.teamStore, {competition_id : competition_id}); | ||
public static createCompetitionTeam<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.teamStore, data, {competition_id : competition_id}); | ||
} | ||
@@ -418,4 +460,4 @@ | ||
*/ | ||
public static updateTeam<T>(competition_id : string, team_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateTeam, {competition_id : competition_id}, {team_id : team_id}); | ||
public static updateTeam<T>(competition_id : string, team_id : string, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateTeam, data, {team_id : team_id, competition_id : competition_id}); | ||
} | ||
@@ -433,3 +475,3 @@ | ||
public static destroyTeam<T>(competition_id : string, team_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {competition_id : competition_id}, {team_id : team_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyTeam, {}, {team_id : team_id, competition_id : competition_id}); | ||
} | ||
@@ -446,3 +488,3 @@ | ||
public static users<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.users, {competition_id : competition_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.users, {}, {competition_id : competition_id}); | ||
} | ||
@@ -458,4 +500,4 @@ | ||
*/ | ||
public static competitionUser<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.competitionUser, {competition_id : competition_id}); | ||
public static createCompetitionUser<T>(competition_id : string, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.competitionUser, {}, {competition_id : competition_id}); | ||
} | ||
@@ -473,3 +515,3 @@ | ||
public static showCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {competition_id : competition_id}, {user_id : user_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.showCompetitionUser, {}, {user_id : user_id, competition_id : competition_id}); | ||
} | ||
@@ -486,4 +528,4 @@ | ||
*/ | ||
public static updateCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, {competition_id : competition_id}, {user_id : user_id}); | ||
public static updateCompetitionUser<T>(competition_id : string, user_id : string, data?: object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateCompetitionUser, data, {user_id : user_id, competition_id : competition_id}); | ||
} | ||
@@ -501,3 +543,3 @@ | ||
public static destroyCompetitionUser<T>(competition_id : string, user_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {competition_id : competition_id}, {user_id : user_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyCompetitionUser, {}, {user_id : user_id, competition_id : competition_id}); | ||
} | ||
@@ -514,3 +556,3 @@ | ||
public static venues<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.venues, {competition_id : competition_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.venues, {}, {competition_id : competition_id}); | ||
} | ||
@@ -526,4 +568,4 @@ | ||
*/ | ||
public static newVenue<T>(competition_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.newVenue, {competition_id : competition_id}); | ||
public static createVenue<T>(competition_id : string, data : object ): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.newVenue, data, {competition_id : competition_id}); | ||
} | ||
@@ -541,3 +583,3 @@ | ||
public static showVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.showVenue, {competition_id : competition_id}, {venue_id : venue_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.showVenue, {}, {venue_id : venue_id, competition_id : competition_id}); | ||
} | ||
@@ -554,4 +596,4 @@ | ||
*/ | ||
public static updateVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateVenue, {competition_id : competition_id}, {venue_id : venue_id}); | ||
public static updateVenue<T>(competition_id : string, venue_id : string, data : object): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.updateVenue, data, {competition_id : competition_id, venue_id : venue_id}); | ||
} | ||
@@ -569,16 +611,37 @@ | ||
public static destroyVenue<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {competition_id : competition_id}, {venue_id : venue_id}); | ||
return Requests.processRoute(CompetitionRoutes.routes.destroyVenue, {}, {competition_id : competition_id, venue_id : venue_id}); | ||
} | ||
/** | ||
* Upload venue main image to storage. | ||
* Updates the main image for the venue using a File object. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param file The file object to upload. | ||
* @param data Any additional data to pass along to the upload. | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadVenueMainImageFile<T>(competition_id: string, file: File, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadFile(url, 'image', file, data); | ||
} | ||
/** | ||
* Updates the main image for the venue using a Blob. | ||
* | ||
* @see https://api.glitch.fun/api/documentation#/Competitions%20Route/uploadVenueMainImage | ||
* | ||
* @param competition_id | ||
* @param venue_id | ||
* @param blob The blob to upload. | ||
* @param data Any additional data to pass along to the upload | ||
* | ||
* @returns promise | ||
*/ | ||
public static uploadVenueMainImage<T>(competition_id : string, venue_id : string): AxiosPromise<Response<T>>{ | ||
return Requests.processRoute(CompetitionRoutes.routes.uploadVenueMainImage, {competition_id : competition_id}, {venue_id : venue_id}); | ||
public static uploadVenueMainImageBlob<T>(competition_id: string, blob: Blob, data?: object): AxiosPromise<Response<T>> { | ||
let url = CompetitionRoutes.routes.uploadVenueMainImage.url.replace('{competition_id}', competition_id); | ||
return Requests.uploadBlob(url, 'image', blob, data); | ||
} | ||
@@ -585,0 +648,0 @@ } |
@@ -197,3 +197,3 @@ import EventsRoutes from "../routes/EventsRoute"; | ||
let url = EventsRoutes.routes.uploadBannerImage.url.replace('{event_id}', event_id); | ||
return Requests.uploadFile(url, 'image', file, data); | ||
@@ -257,3 +257,3 @@ } | ||
*/ | ||
public static sendOnScreenContent<T>(event_id: string, data : object): AxiosPromise<Response<T>> { | ||
public static sendOnScreenContent<T>(event_id: string, data: object): AxiosPromise<Response<T>> { | ||
@@ -277,3 +277,3 @@ return Requests.processRoute(EventsRoutes.routes.enableLivestreamMode, data, { event_id: event_id }); | ||
let url = EventsRoutes.routes.addOverlay.url.replace('{event_id}', event_id); | ||
return Requests.uploadFile(url, 'image', file, data); | ||
@@ -296,3 +296,3 @@ } | ||
let url = EventsRoutes.routes.addOverlay.url.replace('{event_id}', event_id); | ||
return Requests.uploadBlob(url, 'image', blob, data); | ||
@@ -311,5 +311,5 @@ } | ||
*/ | ||
public static removeOverlay<T>(event_id: string, overlay_id : string): AxiosPromise<Response<T>> { | ||
public static removeOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>> { | ||
return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid : overlay_id }); | ||
return Requests.processRoute(EventsRoutes.routes.removeOverlay, {}, { event_id: event_id, subid: overlay_id }); | ||
} | ||
@@ -327,5 +327,5 @@ | ||
*/ | ||
public static enableOverlay<T>(event_id: string, overlay_id : string): AxiosPromise<Response<T>> { | ||
public static enableOverlay<T>(event_id: string, overlay_id: string): AxiosPromise<Response<T>> { | ||
return Requests.processRoute(EventsRoutes.routes.enableOverlay, {}, { event_id: event_id, subid : overlay_id }); | ||
return Requests.processRoute(EventsRoutes.routes.enableOverlay, {}, { event_id: event_id, subid: overlay_id }); | ||
} | ||
@@ -372,3 +372,3 @@ | ||
public static sendInvite<T>(event_id: string, data : object): AxiosPromise<Response<T>> { | ||
public static sendInvite<T>(event_id: string, data: object): AxiosPromise<Response<T>> { | ||
@@ -378,5 +378,5 @@ return Requests.processRoute(EventsRoutes.routes.sendInvite, data, { event_id: event_id }); | ||
public static acceptInvite<T>(event_id: string, token : string): AxiosPromise<Response<T>> { | ||
public static acceptInvite<T>(event_id: string, token: string): AxiosPromise<Response<T>> { | ||
return Requests.processRoute(EventsRoutes.routes.acceptInvite, {token : token}, { event_id: event_id }); | ||
return Requests.processRoute(EventsRoutes.routes.acceptInvite, { token: token }, { event_id: event_id }); | ||
} | ||
@@ -383,0 +383,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1981393
51300