@mikle7/litty-api-client
Version:
TypeScript client for Litty API with clean, semantic type definitions
360 lines (359 loc) • 16.4 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Litty API
* Complete API documentation for the Litty platform. ## Authentication Most endpoints require authentication via Supabase JWT tokens. Include the token in the Authorization header: `Bearer <token>` ## API Structure - **Contests**: Create and manage contests, entries, and settlements - **Markets**: Manage prediction markets within contests - **Transactions**: Handle financial transactions for contest entries and rewards - **Wallet**: Manage user wallet balances (cashable, points, tickets) - **Users**: User management and profiles - **Leaderboards**: Competition rankings and scoring - **Uploads**: File upload management - **Shows**: TV show and episode management (admin only) ## Response Formats All endpoints return JSON responses with consistent error handling. Error responses include `statusCode`, `message`, and `error` fields.
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShowsApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
*
*/
class ShowsApi extends runtime.BaseAPI {
/**
* Add a new cast member to a specific season
* Add cast member to season
*/
async addCastMemberToSeasonRaw(requestParameters, initOverrides) {
if (requestParameters['seasonId'] == null) {
throw new runtime.RequiredError('seasonId', 'Required parameter "seasonId" was null or undefined when calling addCastMemberToSeason().');
}
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling addCastMemberToSeason().');
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling addCastMemberToSeason().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/shows/{showId}/seasons/{seasonId}/cast`.replace(`{${"seasonId"}}`, encodeURIComponent(String(requestParameters['seasonId']))).replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'],
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateShow201ResponseFromJSON)(jsonValue));
}
/**
* Add a new cast member to a specific season
* Add cast member to season
*/
async addCastMemberToSeason(requestParameters, initOverrides) {
const response = await this.addCastMemberToSeasonRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Add a new episode to a specific season
* Add episode to season
*/
async addEpisodeToSeasonRaw(requestParameters, initOverrides) {
if (requestParameters['seasonId'] == null) {
throw new runtime.RequiredError('seasonId', 'Required parameter "seasonId" was null or undefined when calling addEpisodeToSeason().');
}
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling addEpisodeToSeason().');
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling addEpisodeToSeason().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/shows/{showId}/seasons/{seasonId}/episodes`.replace(`{${"seasonId"}}`, encodeURIComponent(String(requestParameters['seasonId']))).replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'],
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateShow201ResponseFromJSON)(jsonValue));
}
/**
* Add a new episode to a specific season
* Add episode to season
*/
async addEpisodeToSeason(requestParameters, initOverrides) {
const response = await this.addEpisodeToSeasonRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Add a new season to an existing show
* Add season to show
*/
async addSeasonToShowRaw(requestParameters, initOverrides) {
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling addSeasonToShow().');
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling addSeasonToShow().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/shows/{showId}/seasons`.replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'],
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateShow201ResponseFromJSON)(jsonValue));
}
/**
* Add a new season to an existing show
* Add season to show
*/
async addSeasonToShow(requestParameters, initOverrides) {
const response = await this.addSeasonToShowRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Creates a new TV show in the system
* Create a new show
*/
async createShowRaw(requestParameters, initOverrides) {
if (requestParameters['body'] == null) {
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling createShow().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/shows`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'],
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateShow201ResponseFromJSON)(jsonValue));
}
/**
* Creates a new TV show in the system
* Create a new show
*/
async createShow(requestParameters, initOverrides) {
const response = await this.createShowRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Delete an existing show
* Delete show
*/
async deleteShowRaw(requestParameters, initOverrides) {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteShow().');
}
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DeleteShow200ResponseFromJSON)(jsonValue));
}
/**
* Delete an existing show
* Delete show
*/
async deleteShow(requestParameters, initOverrides) {
const response = await this.deleteShowRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Retrieve a list of all shows
* Get all shows
*/
async getAllShowsRaw(initOverrides) {
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Retrieve a list of all shows
* Get all shows
*/
async getAllShows(initOverrides) {
await this.getAllShowsRaw(initOverrides);
}
/**
* Get all cast members for a specific season
* Get season cast members
*/
async getSeasonCastMembersRaw(requestParameters, initOverrides) {
if (requestParameters['seasonId'] == null) {
throw new runtime.RequiredError('seasonId', 'Required parameter "seasonId" was null or undefined when calling getSeasonCastMembers().');
}
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling getSeasonCastMembers().');
}
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows/{showId}/seasons/{seasonId}/cast`.replace(`{${"seasonId"}}`, encodeURIComponent(String(requestParameters['seasonId']))).replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Get all cast members for a specific season
* Get season cast members
*/
async getSeasonCastMembers(requestParameters, initOverrides) {
await this.getSeasonCastMembersRaw(requestParameters, initOverrides);
}
/**
* Get all episodes for a specific season
* Get season episodes
*/
async getSeasonEpisodesRaw(requestParameters, initOverrides) {
if (requestParameters['seasonId'] == null) {
throw new runtime.RequiredError('seasonId', 'Required parameter "seasonId" was null or undefined when calling getSeasonEpisodes().');
}
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling getSeasonEpisodes().');
}
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows/{showId}/seasons/{seasonId}/episodes`.replace(`{${"seasonId"}}`, encodeURIComponent(String(requestParameters['seasonId']))).replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Get all episodes for a specific season
* Get season episodes
*/
async getSeasonEpisodes(requestParameters, initOverrides) {
await this.getSeasonEpisodesRaw(requestParameters, initOverrides);
}
/**
* Retrieve a specific show by its ID
* Get show by ID
*/
async getShowByIdRaw(requestParameters, initOverrides) {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getShowById().');
}
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Retrieve a specific show by its ID
* Get show by ID
*/
async getShowById(requestParameters, initOverrides) {
await this.getShowByIdRaw(requestParameters, initOverrides);
}
/**
* Get all seasons for a specific show
* Get show seasons
*/
async getShowSeasonsRaw(requestParameters, initOverrides) {
if (requestParameters['showId'] == null) {
throw new runtime.RequiredError('showId', 'Required parameter "showId" was null or undefined when calling getShowSeasons().');
}
const queryParameters = {};
const headerParameters = {};
const response = await this.request({
path: `/shows/{showId}/seasons`.replace(`{${"showId"}}`, encodeURIComponent(String(requestParameters['showId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Get all seasons for a specific show
* Get show seasons
*/
async getShowSeasons(requestParameters, initOverrides) {
await this.getShowSeasonsRaw(requestParameters, initOverrides);
}
/**
* Update an existing show
* Update show
*/
async updateShowRaw(requestParameters, initOverrides) {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateShow().');
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling updateShow().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
const response = await this.request({
path: `/shows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'],
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DeleteShow200ResponseFromJSON)(jsonValue));
}
/**
* Update an existing show
* Update show
*/
async updateShow(requestParameters, initOverrides) {
const response = await this.updateShowRaw(requestParameters, initOverrides);
return await response.value();
}
}
exports.ShowsApi = ShowsApi;