@mikle7/litty-api-client
Version:
TypeScript client for Litty API with clean, semantic type definitions
128 lines (127 loc) • 5.35 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionResponseDtoToJSONTyped = exports.TransactionResponseDtoToJSON = exports.TransactionResponseDtoFromJSONTyped = exports.TransactionResponseDtoFromJSON = exports.instanceOfTransactionResponseDto = exports.TransactionResponseDtoStatusEnum = exports.TransactionResponseDtoSourceEnum = exports.TransactionResponseDtoCurrencyEnum = exports.TransactionResponseDtoTypeEnum = void 0;
/**
* @export
*/
exports.TransactionResponseDtoTypeEnum = {
Credit: 'credit',
Debit: 'debit'
};
/**
* @export
*/
exports.TransactionResponseDtoCurrencyEnum = {
Points: 'points',
Tickets: 'tickets',
Cashable: 'cashable'
};
/**
* @export
*/
exports.TransactionResponseDtoSourceEnum = {
ContestEntry: 'contest_entry',
ContestWinning: 'contest_winning',
AdminAdjustment: 'admin_adjustment',
Promotion: 'promotion'
};
/**
* @export
*/
exports.TransactionResponseDtoStatusEnum = {
Pending: 'pending',
Completed: 'completed',
Failed: 'failed'
};
/**
* Check if a given object implements the TransactionResponseDto interface.
*/
function instanceOfTransactionResponseDto(value) {
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('walletId' in value) || value['walletId'] === undefined)
return false;
if (!('userId' in value) || value['userId'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
if (!('currency' in value) || value['currency'] === undefined)
return false;
if (!('amount' in value) || value['amount'] === undefined)
return false;
if (!('source' in value) || value['source'] === undefined)
return false;
if (!('reason' in value) || value['reason'] === undefined)
return false;
if (!('status' in value) || value['status'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
return false;
return true;
}
exports.instanceOfTransactionResponseDto = instanceOfTransactionResponseDto;
function TransactionResponseDtoFromJSON(json) {
return TransactionResponseDtoFromJSONTyped(json, false);
}
exports.TransactionResponseDtoFromJSON = TransactionResponseDtoFromJSON;
function TransactionResponseDtoFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'id': json['id'],
'walletId': json['walletId'],
'userId': json['userId'],
'type': json['type'],
'currency': json['currency'],
'amount': json['amount'],
'source': json['source'],
'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],
'reason': json['reason'],
'status': json['status'],
'metadata': json['metadata'] == null ? undefined : json['metadata'],
'createdAt': (new Date(json['createdAt'])),
'updatedAt': (new Date(json['updatedAt'])),
};
}
exports.TransactionResponseDtoFromJSONTyped = TransactionResponseDtoFromJSONTyped;
function TransactionResponseDtoToJSON(json) {
return TransactionResponseDtoToJSONTyped(json, false);
}
exports.TransactionResponseDtoToJSON = TransactionResponseDtoToJSON;
function TransactionResponseDtoToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'id': value['id'],
'walletId': value['walletId'],
'userId': value['userId'],
'type': value['type'],
'currency': value['currency'],
'amount': value['amount'],
'source': value['source'],
'sourceId': value['sourceId'],
'reason': value['reason'],
'status': value['status'],
'metadata': value['metadata'],
'createdAt': ((value['createdAt']).toISOString()),
'updatedAt': ((value['updatedAt']).toISOString()),
};
}
exports.TransactionResponseDtoToJSONTyped = TransactionResponseDtoToJSONTyped;