@vertikalx/vtx-backend-client
Version:
GraphQL API generated client for VTX
779 lines • 53.3 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VTXBaseAPI = void 0;
const package_json_1 = require("../../package.json");
const graphql_request_1 = require("graphql-request");
const graphql_1 = require("../generated/graphql");
const api_call_headers_1 = require("./api-call-headers");
const response_builder_1 = require("./response-builder");
const domains_1 = require("./domains");
const vtx_core_common_1 = require("@vertikalx/vtx-core-common");
class VTXBaseAPI {
constructor(backendUrl, headers, requestConfig) {
this.headers = headers ?? api_call_headers_1.DEFAULT_HEADERS;
this.backendUrl = backendUrl;
this.gqlClient = new graphql_request_1.GraphQLClient(backendUrl + '/graphql', {
headers: this.headers,
...(requestConfig?.fetch ? { fetch: requestConfig.fetch } : {}),
});
this.sdk = (0, graphql_1.getSdk)(this.gqlClient);
}
getHeaders() {
return this.headers;
}
setHeader(key, value) {
this.headers[key] = value;
this.gqlClient.setHeaders(this.headers);
}
static getVersion() {
return package_json_1.default?.version ?? '0.0.0';
}
static isBrowser() {
if (typeof process === 'object' && typeof require === 'function') {
return false;
}
if (typeof importScripts === 'function') {
return false;
}
if (typeof window === 'object') {
return true;
}
return false;
}
async execute(sdkCall, rootProperty, checker, logPrefix) {
let retValue = {};
try {
const response = await sdkCall();
VTXBaseAPI.Logger.debug(`${logPrefix} Response:`);
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
retValue = (0, response_builder_1.buildResponse)(response, rootProperty, checker);
}
catch (err1) {
VTXBaseAPI.Logger.error(`${logPrefix} err1:`);
VTXBaseAPI.Logger.error(err1);
retValue = (0, response_builder_1.buildErrorResponse)(err1);
}
return retValue;
}
async findUserByEmail(email) {
const curatedEmail = email.trim().toLocaleLowerCase();
return this.execute(() => this.sdk.FindUserByEmail({ email: curatedEmail }), 'findUserByEmail', (r) => !!r?.findUserByEmail?._id, 'findUserByEmail');
}
async loginUserFromEmail(loginEmail, loginMethod = "") {
const curatedEmail = loginEmail.trim().toLocaleLowerCase();
return this.execute(() => this.sdk.LoginUserFromEmail({ email: curatedEmail, loginMethod }), 'loginUserFromEmail', (r) => !!r?.loginUserFromEmail?.actualToken, 'loginUserFromEmail');
}
async createUserAndLogin(loginEmail) {
const curatedEmail = loginEmail.trim().toLowerCase();
const payload = { loginEmail: curatedEmail };
return this.execute(() => this.sdk.CreateUserAndLogin({ user: payload }), 'createUserAndLogin', (r) => !!r?.createUserAndLogin?._id, 'createUserAndLogin');
}
async registerMember(dto) {
return this.execute(() => this.sdk.RegisterMember({ input: dto }), 'registerMember', (r) => !!r?.registerMember?._id, 'registerMember');
}
async registerAthlete(payload) {
return this.execute(() => this.sdk.RegisterAthlete({ input: payload }), 'registerAthlete', (r) => !!r?.registerAthlete?._id, 'registerAthlete');
}
async findBrandByName(name, translations = false) {
return this.execute(() => this.sdk.FindBrandByName({ name, translations }), 'getBrandByName', (r) => !!r?.getBrandByName?._id, 'getBrandByName');
}
async createBrand(dto) {
return this.execute(() => this.sdk.CreateBrand({ input: dto }), 'createBrand', (r) => !!r?.createBrand?._id, 'createBrand');
}
async createSponsorship(dto, _desiredFields) {
return this.execute(() => this.sdk.CreateSponsorship({ input: dto }), 'createSponsorship', (r) => !!r?.createSponsorship?._id, 'createSponsorship');
}
async getS3UploadUrl(dto) {
return this.execute(() => this.sdk.GetS3UploadUrl({ input: dto }), 'getUploadUrl', (r) => r?.getUploadUrl?.uploadUrl !== undefined && r?.getUploadUrl?.uploadUrl !== null, 'getUploadUrl');
}
async getVtxS3UploadUrl(dto) {
return this.execute(() => this.sdk.GetVtxS3UploadUrl({ input: dto }), 'getS3UploadUrl', (r) => r?.getS3UploadUrl?.uploadUrl !== undefined && r?.getS3UploadUrl?.uploadUrl !== null, 'getVtxS3UploadUrl');
}
async refreshToken(currentToken, refreshToken) {
const dto = { refreshToken };
return this.execute(() => this.sdk.RefreshToken({ dto }), 'refreshToken', (r) => !!r?.refreshToken?.refreshToken, 'refreshToken');
}
async registerNewDomainTenant(input) {
return this.execute(() => this.sdk.RegisterNewDomainTenant({ tenant: input }), 'registerNewDomainTenant', (r) => !!r?.registerNewDomainTenant?._id, 'registerNewDomainTenant');
}
async registerNewDomainTenantWithLogin(input) {
return this.execute(() => this.sdk.RegisterNewDomainTenantWithLogin({ tenant: input }), 'TenantWithUserLogin', (r) => !!r?.TenantWithUserLogin?._id, 'registerNewDomainTenantWithLogin');
}
async registerUserToDomainFromEmail(input) {
return this.execute(() => this.sdk.RegisterUserToDomainFromEmail({ input }), 'registerUserToDomainFromEmail', (r) => !!r?.registerUserToDomainFromEmail?.loginEmail, 'registerUserToDomainFromEmail');
}
async getPublicSponsorships() {
return this.execute(() => this.sdk.GetPublicSponsorships(), 'getPublicSponsorships', (r) => Array.isArray(r?.getPublicSponsorships), 'getPublicSponsorships');
}
async getTenantSponsorshipsFromUri(tenantUri, token) {
if ((!tenantUri) || (tenantUri.trim() === "")) {
return {
error: {
httpStatus: 400,
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI.code,
message: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI.description
}
};
}
const credential = token.domains.find(c => {
if (c.tenant) {
if ((c.tenant.tenant_uri == tenantUri) && (c._id == domains_1.DOMAIN_SPONSOR)) {
return true;
}
}
return false;
});
if (!credential) {
return {
error: {
httpStatus: 400,
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI_FOR_SPONSOR.code,
message: "Tenant in domain SPONSOR not found in domains with URI " + tenantUri
}
};
}
const tenantId = credential.tenant?._id ?? null;
if ((!tenantId) || (tenantId == "ALL")) {
return {
error: {
httpStatus: 400,
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_ID.code,
message: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_ID.description
}
};
}
return this.getTenantSponsorships(tenantId);
}
async isUserSuspended(loginEmail) {
return this.execute(() => this.sdk.IsUserSuspended({ loginEmail }), 'isUserSuspended', (r) => r?.isUserSuspended !== undefined, 'isUserSuspended');
}
async getTenantSponsorships(tenantId) {
return this.execute(() => this.sdk.GetTenantSponsorships(), 'getTenantSponsorships', (r) => Array.isArray(r?.getTenantSponsorships), 'getTenantSponsorships');
}
async sendAthleteInvitations(input) {
return this.execute(() => this.sdk.SendAthleteInvitations({ input }), 'sendAthleteInvitations', (r) => Array.isArray(r?.sendAthleteInvitations), 'sendAthleteInvitations');
}
async registerSponsorUser(input) {
return this.execute(() => this.sdk.RegisterSponsorUser({ input }), 'registerSponsorUser', (r) => !!r?.registerSponsorUser?._id, 'registerSponsorUser');
}
async registerAthleteUser(input) {
return this.execute(() => this.sdk.RegisterAthleteUser({ input }), 'registerAthleteUser', (r) => !!r?.registerAthleteUser?._id, 'registerAthleteUser');
}
async preRegisterAthleteUser(input) {
return this.execute(() => this.sdk.PreRegisterAthleteUser({ input }), 'preRegisterAthleteUser', (r) => !!r?.preRegisterAthleteUser?._id, 'preRegisterAthleteUser');
}
async confirmAthleteUserRegistrationAndLogin(input) {
return this.execute(() => this.sdk.ConfirmAthleteUserRegistrationAndLogin({ input }), 'confirmAthleteUserRegistrationAndLogin', (r) => !!r?.confirmAthleteUserRegistrationAndLogin?._id, 'confirmAthleteUserRegistrationAndLogin');
}
async confirmAthleteUserRegistration(input) {
return this.execute(() => this.sdk.ConfirmAthleteUserRegistration({ input }), 'confirmAthleteUserRegistration', (r) => !!r?.confirmAthleteUserRegistration?._id, 'confirmAthleteUserRegistration');
}
async findSponsorAthleteInvitation(dto) {
return this.execute(() => this.sdk.FindSponsorAthleteInvitation({ input: dto }), 'findSponsorAthleteInvitation', (r) => !!r?.findSponsorAthleteInvitation?._id, 'findSponsorAthleteInvitation');
}
async findVtxUser(dto) {
return this.execute(() => this.sdk.FindVtxUser({ input: dto }), 'findVtxUser', (r) => !!r?.findVtxUser?._id, 'findVtxUser');
}
async findCitiesStartingWith(pattern) {
return this.execute(() => this.sdk.FindCitiesStartingWith({ text: pattern }), 'findCitiesStartingWith', (r) => Array.isArray(r?.findCitiesStartingWith), 'findCitiesStartingWith');
}
async findCityById(cityId) {
return this.execute(() => this.sdk.FindCityById({ cityId }), 'findCityById', (r) => !!r?.findCityById?._id, 'findCityById');
}
async getSportLevels() {
return this.execute(() => this.sdk.GetSportLevels(), 'getSportLevels', (r) => Array.isArray(r?.getSportLevels), 'getSportLevels');
}
async getSports() {
return this.execute(() => this.sdk.GetSports(), 'getSports', (r) => Array.isArray(r?.getSports), 'getSports');
}
async getSportsPaginated(args) {
return this.execute(() => this.sdk.GetSportsPaginated({ query: args.query }), 'getSportsPaginated', (r) => true, 'getSportsPaginated');
}
async getStates() {
return this.execute(() => this.sdk.GetStates(), 'getStates', (r) => Array.isArray(r?.getStates), 'getStates');
}
async getCountries() {
return this.execute(() => this.sdk.GetCountries(), 'getCountries', (r) => Array.isArray(r?.getCountries), 'getCountries');
}
async loginUserFromCredentialsVtx(username, password) {
const curatedEmail = username.trim().toLocaleLowerCase();
return this.execute(() => this.sdk.LoginUserFromCredentialsVtx({ username: curatedEmail, password }), 'loginUserFromCredentialsVtx', (r) => !!r?.loginUserFromCredentialsVtx?.actualToken, 'loginUserFromCredentialsVtx');
}
async validateUserCredentialsVtx(username, password) {
const curatedEmail = username.trim().toLocaleLowerCase();
return this.execute(() => this.sdk.ValidateUserCredentialsVtx({ username: curatedEmail, password }), 'validateUserCredentials', (r) => !!r?.validateUserCredentials?._id, 'validateUserCredentials');
}
async findAthleteForUser(loginEmail) {
return this.execute(() => this.sdk.FindAthleteForUser({ loginEmail }), 'findAthleteForUser', (r) => !!r?.findAthleteForUser?._id, 'findAthleteForUser');
}
async getBrands() {
return this.execute(() => this.sdk.GetBrands(), 'brands', (r) => Array.isArray(r?.brands), 'brands');
}
async getBrandsPaginated(args) {
return this.execute(() => this.sdk.GetBrandsPaginated({ query: args.query }), 'getBrandsPaginated', (r) => true, 'getBrandsPaginated');
}
async getAthletes() {
return this.execute(() => this.sdk.GetAthletes(), 'athletes', (r) => Array.isArray(r?.athletes), 'athletes');
}
async searchAthletes(searchString) {
return this.execute(() => this.sdk.SearchAthletes({ searchString }), 'searchAthletes', (r) => Array.isArray(r?.searchAthletes), 'searchAthletes');
}
async getRecommendedAthletes(loginEmail) {
return this.execute(() => this.sdk.GetRecommendedAthletes({ loginEmail }), 'getRecommendedAthletes', (r) => Array.isArray(r?.getRecommendedAthletes), 'getRecommendedAthletes');
}
async getSponsorAthletesForTenant() {
return this.execute(() => this.sdk.GetSponsorAthletesForTenant(), 'getSponsorAthletesForTenant', (r) => Array.isArray(r?.getSponsorAthletesForTenant), 'getSponsorAthletesForTenant');
}
async getUserImagesFromEmail(loginEmail) {
return this.execute(() => this.sdk.GetUserImagesFromEmail({ loginEmail }), 'getUserImagesFromEmail', (r) => !!r?.getUserImagesFromEmail, 'getUserImagesFromEmail');
}
async editAboutMe(newValue) {
const dto = { field: 'aboutMe', newValue };
return this.execute(() => this.sdk.EditAboutMe({ input: dto }), 'editProfileValue', (r) => !!r?.editProfileValue?.field, 'editProfileValue');
}
async editProfileValue(newValue, field) {
const dto = { field, newValue };
return this.execute(() => this.sdk.EditProfileValue({ input: dto }), 'editProfileValue', (r) => !!r?.editProfileValue?.field, 'editProfileValue');
}
async addAthleteCompetition(dto) {
return this.execute(() => this.sdk.AddAthleteCompetition({ input: dto }), 'addAthleteCompetition', (r) => !!r?.addAthleteCompetition?._id, 'addAthleteCompetition');
}
async getSportsEvents(dto) {
return this.execute(() => this.sdk.GetSportsEvents({ input: dto }), 'getSportsEvents', (r) => Array.isArray(r?.getSportsEvents), 'getSportsEvents');
}
async getSportsEventsPaginated(dto) {
return this.execute(() => this.sdk.GetSportsEventsPaginated({ query: dto.query }), 'getSportsEventsPaginated', (r) => true, 'getSportsEventsPaginated');
}
async createSportsEvent(dto) {
return this.execute(() => this.sdk.CreateSportsEvent({ input: dto }), 'createSportsEvent', (r) => !!r?.createSportsEvent?._id, 'createSportsEvent');
}
async updateSportsEvent(dto) {
return this.execute(() => this.sdk.UpdateSportsEvent({ input: dto.input }), 'updateSportsEvent', (r) => !!r?.updateSportsEvent?._id, 'updateSportsEvent');
}
async deleteSportsEvent(dto) {
return this.execute(() => this.sdk.DeleteSportsEvent({ eventId: dto.eventId }), 'deleteSportsEvent', (r) => !!r?.deleteSportsEvent?.idToDelete, 'deleteSportsEvent');
}
async mergeSportsEvents(dto) {
return this.execute(() => this.sdk.MergeSportsEvents({ input: dto }), 'mergeSportsEvents', (r) => !!r?.mergeSportsEvents, 'mergeSportsEvents');
}
async getAthleteCompetitions(dto) {
return this.execute(() => this.sdk.GetAthleteCompetitions({ input: dto }), 'getAthleteCompetitions', (r) => Array.isArray(r?.getAthleteCompetitions), 'getAthleteCompetitions');
}
async getAthleteMemberships(athleteId) {
return this.execute(() => this.sdk.GetAthleteMemberships({ athleteId }), 'getAthleteMemberships', (r) => Array.isArray(r?.getAthleteMemberships), 'getAthleteMemberships');
}
async deleteAthleteCompetition(dto) {
return this.execute(() => this.sdk.DeleteAthleteCompetition({ input: dto }), 'deleteAthleteCompetition', (r) => !!r?.deleteAthleteCompetition?.idToDelete, 'deleteAthleteCompetition');
}
async createFundingCampaign(dto) {
return this.execute(() => this.sdk.CreateFundingCampaign({ input: dto }), 'createFundingCampaign', (r) => !!r?.createFundingCampaign?._id, 'createFundingCampaign');
}
async createMembershipOrganization(dto) {
return this.execute(() => this.sdk.CreateMembershipOrganization({ input: dto }), 'createMembershipOrganization', (r) => !!r?.createMembershipOrganization?._id, 'createMembershipOrganization');
}
async getMembershipOrganizations() {
return this.execute(() => this.sdk.GetMembershipOrganizations(), 'getMembershipOrganizations', (r) => Array.isArray(r?.getMembershipOrganizations), 'getMembershipOrganizations');
}
async createAthleteMembershipAffilation(dto) {
return this.execute(() => this.sdk.CreateAthleteMembershipAffilation({ input: dto }), 'createAthleteMembershipAffilation', (r) => !!r?.createAthleteMembershipAffilation?._id, 'createAthleteMembershipAffilation');
}
async deleteMembershipAffiliation(dto) {
return this.execute(() => this.sdk.DeleteMembershipAffiliation({ input: dto }), 'deleteMembershipAffiliation', (r) => !!r?.deleteMembershipAffiliation?.idToDelete, 'deleteMembershipAffiliation');
}
async queryAthleteFundingCampaigns(dto) {
return this.execute(() => this.sdk.QueryAthleteFundingCampaigns({ input: dto }), 'queryAthleteFundingCampaigns', (r) => !!r?.queryAthleteFundingCampaigns, 'queryAthleteFundingCampaigns');
}
async createStripeAccount(dto) {
return this.execute(() => this.sdk.CreateStripeAccount({ input: dto }), 'createStripeAccount', (r) => !!r?.createStripeAccount?._id, 'createStripeAccount');
}
async createAthleteStripeSession() {
return this.execute(() => this.sdk.CreateAthleteStripeSession(), 'createAthleteStripeSession', (r) => !!r?.createAthleteStripeSession?.client_secret, 'createAthleteStripeSession');
}
async createStripeCheckoutSession(dto, _desiredFields) {
return this.execute(() => this.sdk.CreateStripeCheckoutSession({ input: dto }), 'createStripeCheckoutSession', (r) => !!r?.createStripeCheckoutSession?.client_secret, 'createStripeCheckoutSession');
}
async createStripeLoginLink() {
return this.execute(() => this.sdk.CreateStripeLoginLink(), 'createStripeLoginLink', (r) => !!r?.createStripeLoginLink, 'createStripeLoginLink');
}
async createStripeAccountLink() {
return this.execute(() => this.sdk.CreateStripeAccountLink(), 'createStripeAccountLink', (r) => !!r?.createStripeAccountLink, 'createStripeAccountLink');
}
async getStripeBalance() {
return this.execute(() => this.sdk.GetStripeBalance(), 'getStripeBalance', (r) => r?.getStripeBalance?.availableUSD !== undefined, 'getStripeBalance');
}
async getDatabaseTextFile(dto) {
return this.execute(() => this.sdk.GetDatabaseTextFile({ input: dto }), 'getDatabaseTextFile', (r) => !!r?.getDatabaseTextFile?._id, 'getDatabaseTextFile');
}
async getReceiptUrl(dto) {
return this.execute(() => this.sdk.GetReceiptUrl({ input: dto }), 'getReceiptUrl', (r) => !!r?.getReceiptUrl?.receiptId, 'getReceiptUrl');
}
async stripeQuery(dto) {
return this.execute(() => this.sdk.StripeQuery({ input: dto }), 'stripeQuery', (r) => !!r?.stripeQuery, 'stripeQuery');
}
async setFundingStatus(dto, _desiredFields) {
return this.execute(() => this.sdk.SetFundingStatus({ input: dto }), 'setFundingStatus', (r) => !!r?.setFundingStatus?._id, 'setFundingStatus');
}
async findAthleteForIdPublic(id) {
return this.execute(() => this.sdk.FindAthleteForIdPublic({ athleteId: id }), 'findAthletebyIdpublic', (r) => !!r?.findAthletebyIdpublic?._id, 'findAthletebyIdpublic');
}
async editPicture(newPicDto) {
console.log('HEADERS:');
console.log(JSON.stringify(this.headers, null, 2));
return this.execute(() => this.sdk.EditPicture({ input: newPicDto }), 'editPicture', (r) => !!r?.editPicture?.field, 'editPicture');
}
async addAlbumsPictures(dto) {
console.log('HEADERS:');
console.log(JSON.stringify(this.headers, null, 2));
let retValue = {};
try {
const response = await this.sdk.AddAlbumPictures({ input: dto });
console.log('AddAlbumsPictures Response:');
console.log(JSON.stringify(response, null, 2));
retValue = (0, response_builder_1.buildResponse)(response, 'AddAlbumPictures', (r) => {
return r?.AddAlbumPictures?.result === 'success' || r?.AddAlbumPictures?.result === 'partial';
});
}
catch (err1) {
console.error('addPictures err1:');
console.error(err1);
retValue = (0, response_builder_1.buildErrorResponse)(err1);
}
console.log('retValue:');
console.log(JSON.stringify(retValue, null, 2));
return retValue;
}
async editAlbumsPictures(dto) {
console.log('HEADERS:');
console.log(JSON.stringify(this.headers, null, 2));
let retValue = {};
try {
const response = await this.sdk.EditAlbumsPictures({ input: dto });
console.log('editAlbum Response:');
console.log(JSON.stringify(response, null, 2));
retValue = (0, response_builder_1.buildResponse)(response, 'editAlbum', (r) => !!r?.editAlbum?.label);
}
catch (err1) {
console.error('editAlbum err1:');
console.error(err1);
retValue = (0, response_builder_1.buildErrorResponse)(err1);
}
console.log('retValue:');
console.log(JSON.stringify(retValue, null, 2));
return retValue;
}
async createAthleteAlbum(dto) {
console.log('HEADERS:');
console.log(JSON.stringify(this.headers, null, 2));
let retValue = {};
try {
const response = await this.sdk.CreateAthleteAlbum({ input: dto });
console.log('createAthleteAlbum Response:');
console.log(JSON.stringify(response, null, 2));
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => !!r?.createAthleteAlbum?.label);
}
catch (err1) {
console.error('createAthleteAlbum err1:');
console.error(err1);
retValue = (0, response_builder_1.buildErrorResponse)(err1);
}
console.log('retValue:');
console.log(JSON.stringify(retValue, null, 2));
return retValue;
}
async deleteFundingCampaign(dto) {
return this.execute(() => this.sdk.DeleteFundingCampaign({ input: dto }), 'deleteFundingCampaign', (r) => !!r?.deleteFundingCampaign?.deleted, 'deleteFundingCampaign');
}
async deleteFundingCampaigns(dto) {
return this.execute(() => this.sdk.DeleteFundingCampaigns({ input: dto }), 'deleteFundingCampaigns', (r) => !!r?.deleteFundingCampaigns, 'deleteFundingCampaigns');
}
async updateFundingCampaign(dto) {
return this.execute(() => this.sdk.UpdateFundingCampaign({ input: dto }), 'updateFundingCampaign', (r) => !!r?.updateFundingCampaign?._id, 'updateFundingCampaign');
}
async setCurrentCampaign(dto) {
return this.execute(() => this.sdk.SetCurrentCampaign({ input: dto }), 'setCurrentCampaign', (r) => !!r?.setCurrentCampaign?._id, 'setCurrentCampaign');
}
async deleteAthleteAlbum(dto) {
return this.execute(() => this.sdk.DeleteAthleteAlbum({ input: dto }), 'deleteAthleteAlbum', (r) => !!r?.deleteAthleteAlbum?.deleted, 'deleteAthleteAlbum');
}
async getAthleteAlbums() {
return this.execute(() => this.sdk.GetAthleteAlbums(), 'getAthleteAlbums', (r) => Array.isArray(r?.getAthleteAlbums), 'getAthleteAlbums');
}
async reorderAlbums(dto) {
return this.execute(() => this.sdk.ReorderAlbums({ input: dto }), 'reorderAlbumIndex', (r) => r?.reorderAlbumIndex?.length > 0, 'reorderAlbumIndex');
}
async getPublicAthleteAlbums(athleteId) {
return this.execute(() => this.sdk.GetPublicAthleteAlbums({ athleteId }), 'getPublicAthleteAlbums', (r) => r?.getPublicAthleteAlbums?.length > 0, 'getPublicAthleteAlbums');
}
async getAthleteAlbumsById(albumId) {
return this.execute(() => this.sdk.GetAthleteAlbumsById({ input: albumId }), 'getAthleteAlbumId', (r) => !!r?.getAthleteAlbumId?._id, 'getAthleteAlbumId');
}
async getAndSetAlbumById(albumId) {
return this.execute(() => this.sdk.GetAndSetAlbumById({ input: albumId }), 'getAndSetAlbumById', (r) => !!r?.getAndSetAlbumById?._id, 'getAndSetAlbumById');
}
async queryAthletesWithFilters(dto) {
return this.execute(() => this.sdk.QueryAthletesWithFilters({ input: dto }), 'queryAthletesWithFilters', (r) => !!r?.queryAthletesWithFilters, 'queryAthletesWithFilters');
}
async getAthleteIntegrationsByAthlete() {
return this.execute(() => this.sdk.GetAthleteIntegrationsByAthlete(), 'getAthleteIntegrationsByAthlete', (r) => !!r?.getAthleteIntegrationsByAthlete, 'getAthleteIntegrationsByAthlete');
}
async deleteAthleteIntegration() {
return { error: { httpStatus: 501, code: 0, message: 'deleteAthleteIntegration not implemented' } };
}
async getAthleteStravaIntegration() {
return this.execute(() => this.sdk.GetAthleteStravaIntegration(), 'getAthleteStravaIntegration', (r) => !!r?.getAthleteStravaIntegration, 'getAthleteStravaIntegration');
}
async getAthleteInstagramIntegration() {
return this.execute(() => this.sdk.GetAthleteInstagramIntegration(), 'getAthleteInstagramIntegration', (r) => !!r?.getAthleteInstagramIntegration, 'getAthleteInstagramIntegration');
}
async getReceipt(dto) {
return this.execute(() => this.sdk.GetReceipt({ input: dto }), 'getReceipt', (r) => !!r?.getReceipt?._id, 'getReceipt');
}
async getAthleteIntegrations() {
return this.execute(() => this.sdk.GetAthleteIntegrations(), 'getAthleteIntegrations', (r) => !!r?.getAthleteIntegrations, 'getAthleteIntegrations');
}
async getAthleteCampaigns(dto) {
return this.execute(() => this.sdk.GetAthleteCampaigns({ input: dto }), 'getAthleteCampaigns', (r) => Array.isArray(r?.getAthleteCampaigns), 'getAthleteCampaigns');
}
async browseCampaigns(dto) {
return this.execute(() => this.sdk.BrowseCampaigns({ input: dto }), 'browseCampaigns', (r) => !!r?.browseCampaigns, 'browseCampaigns');
}
async updateAthleteIntegration(type) {
return this.execute(() => this.sdk.UpdateAthleteIntegration({ type }), 'updateAthleteIntegration', (r) => r?.updateAthleteIntegration === true, 'updateAthleteIntegration');
}
async deleteUploadedTypeKeyFile(dto) {
return this.execute(() => this.sdk.DeleteUploadedTypeKeyFile({ input: dto }), 'deleteUploadedTypeKeyFile', (r) => !!r?.deleteUploadedTypeKeyFile?.httpStatus, 'deleteUploadedTypeKeyFile');
}
async saveAthleteCompetitionResult(dto) {
return this.execute(() => this.sdk.SaveAthleteCompetitionResult({ input: dto }), 'saveAthleteCompetitionResult', (r) => !!r?.saveAthleteCompetitionResult?._id, 'saveAthleteCompetitionResult');
}
async updateAthleteScores() {
return this.execute(() => this.sdk.UpdateAthleteScores(), 'updateAthleteScores', (r) => !!r?.updateAthleteScores?._id, 'updateAthleteScores');
}
async updateAthleteCompetitionScores() {
return this.execute(() => this.sdk.UpdateAthleteCompetitionScores(), 'updateAthleteCompetitionScores', (r) => !!r?.updateAthleteCompetitionScores?._id, 'updateAthleteCompetitionScores');
}
async forceRefreshAthleteScores(athleteIds, options) {
return this.execute(() => this.sdk.ForceRefreshAthleteScores({ input: { athleteIds } }), 'forceRefreshAthleteScores', (r) => !!r?.forceRefreshAthleteScores, 'forceRefreshAthleteScores');
}
async checkScoreRefreshCapabilities(input) {
return this.execute(() => this.sdk.CheckScoreRefreshCapabilities({ input }), 'checkScoreRefreshCapabilities', (r) => !!r?.checkScoreRefreshCapabilities, 'checkScoreRefreshCapabilities');
}
async createResetPasswordCode(email) {
return this.execute(() => this.sdk.CreateResetPasswordCode({ input: email }), 'createResetPasswordCode', (r) => r?.createResetPasswordCode?.field !== null, 'createResetPasswordCode');
}
async getResetVerificationCode(id) {
return this.execute(() => this.sdk.GetResetVerificationCode({ input: id }), 'getResetVerificationCode', (r) => !!r?.getResetVerificationCode?.changed, 'getResetVerificationCode');
}
async verifyCode(input) {
return this.execute(() => this.sdk.VerifyCode({ input }), 'verifyCode', (r) => r?.verifyCode?.result === 'success' || r?.verifyCode?.result === 'error', 'verifyCode');
}
async resetUserPassword(input) {
return this.execute(() => this.sdk.ResetUserPassword({ input }), 'resetUserPassword', (r) => r?.resetUserPassword?.field !== null, 'resetUserPassword');
}
async deleteAlbumFotos(dto) {
return this.execute(() => this.sdk.DeleteAlbumFotos({ input: dto }), 'deleteAlbumFotos', (r) => !!r?.deleteAlbumFotos?.deleted, 'deleteAlbumFotos');
}
async screenNameAviability(dto) {
return this.execute(() => this.sdk.ScreenNameAvailability({ input: dto }), 'screenNameAviability', (r) => r?.screenNameAviability !== undefined, 'screenNameAviability');
}
async getBudgetsByAthlete() {
return this.execute(() => this.sdk.GetBudgetsByAthlete(), 'getBudgetsByAthlete', (r) => !!r?.getBudgetsByAthlete, 'getBudgetsByAthlete');
}
async deleteCompetitionBudget(competitionId) {
return this.execute(() => this.sdk.DeleteCompetitionBudget({ competitionId }), 'deleteCompetitionBudget', (r) => r?.deleteCompetitionBudget !== undefined, 'deleteCompetitionBudget');
}
async addCompetitionBudget(input) {
return this.execute(() => this.sdk.AddCompetitionBudget({ input }), 'addCompetitionBudget', (r) => r?.addCompetitionBudget !== undefined, 'addCompetitionBudget');
}
async editCompetitionBudget(input) {
return this.execute(() => this.sdk.EditCompetitionBudget({ input }), 'editCompetitionBudget', (r) => r?.editCompetitionBudget !== undefined, 'editCompetitionBudget');
}
async editCampaignBudget(input) {
return this.execute(() => this.sdk.EditCampaignBudget({ input }), 'editCampaignBudget', (r) => r?.editCampaignBudget !== undefined, 'editCampaignBudget');
}
async editCompetitionBudgetForCampaign(input) {
return this.execute(() => this.sdk.EditCompetitionBudgetForCampaign({ input }), 'editCompetitionBudgetForCampaign', (r) => r?.editCompetitionBudgetForCampaign !== undefined, 'editCompetitionBudgetForCampaign');
}
async getDonationsByAthlete() {
return this.execute(() => this.sdk.GetDonationsByAthlete(), 'getDonationsByAthlete', (r) => Array.isArray(r?.getDonationsByAthlete), 'getDonationsByAthlete');
}
async getDonationsByMember() {
return this.execute(() => this.sdk.GetDonationsByMember(), 'getDonationsByMember', (r) => Array.isArray(r?.getDonationsByMember), 'getDonationsByMember');
}
async findMemberForUser(loginEmail) {
return this.execute(() => this.sdk.FindMemberForUser({ loginEmail }), 'findMemberForUser', (r) => !!r?.findMemberForUser?._id, 'findMemberForUser');
}
async getBudgetConcepts() {
return this.execute(() => this.sdk.GetBudgetConcepts(), 'getBudgetConcepts', (r) => Array.isArray(r?.getBudgetConcepts), 'getBudgetConcepts');
}
async getBudgetItemsUnits() {
return this.execute(() => this.sdk.GetBudgetItemsUnits(), 'getBudgetItemsUnits', (r) => Array.isArray(r?.getBudgetItemsUnits), 'getBudgetItemsUnits');
}
async verifyAthleteCompetitionLinkedForDelete(dto) {
return this.execute(() => this.sdk.VerifyAthleteCompetitionLinkedForDelete({ input: dto }), 'verifyAthleteCompetitionLinkedForDelete', (r) => r?.verifyAthleteCompetitionLinkedForDelete !== undefined, 'verifyAthleteCompetitionLinkedForDelete');
}
async forceDeleteAthleteCompetition(dto) {
return this.execute(() => this.sdk.ForceDeleteAthleteCompetition({ input: dto }), 'forceDeleteAthleteCompetition', (r) => !!r?.forceDeleteAthleteCompetition?.idToDelete, 'forceDeleteAthleteCompetition');
}
async registerUser(input) {
return this.execute(() => this.sdk.RegisterUser({ input }), 'registerUser', (r) => !!r?.registerUser?._id, 'registerUser');
}
async getDonationsToAthlete(athleteId) {
return this.execute(() => this.sdk.GetDonationsToAthlete({ athleteId }), 'getDonationsToAthlete', (r) => Array.isArray(r?.getDonationsToAthlete), 'getDonationsToAthlete');
}
async getDonationsToMe() {
return this.execute(() => this.sdk.GetDonationsToMe(), 'getDonationsToMe', (r) => Array.isArray(r?.getDonationsToMe), 'getDonationsToMe');
}
async getDonationDatesForCalendar(campaignId) {
return this.execute(() => this.sdk.GetDonationDatesForCalendar({ campaignId }), 'getDonationDatesForCalendar', (r) => !!r?.getDonationDatesForCalendar, 'getDonationDatesForCalendar');
}
async getDonationsPaginated(query) {
return this.execute(() => this.sdk.GetDonationsPaginated({ query }), 'getDonationsPaginated', (r) => !!r?.getDonationsPaginated, 'getDonationsPaginated');
}
async getAthleteHistoricalScores(dto) {
return this.execute(() => this.sdk.GetAthleteHistoricalScores({ input: dto }), 'getAthleteHistoricalScores', (r) => Array.isArray(r?.getAthleteHistoricalScores), 'getAthleteHistoricalScores');
}
async getMyHistoricalScores(dto) {
return this.execute(() => this.sdk.GetMyHistoricalScores({ input: dto }), 'getMyHistoricalScores', (r) => Array.isArray(r?.getMyHistoricalScores), 'getMyHistoricalScores');
}
async getAthleteHistoricalScoresPeriod(dto) {
return this.execute(() => this.sdk.GetAthleteHistoricalScoresPeriod({ input: dto }), 'getAthleteHistoricalScoresPeriod', (r) => !!r?.getAthleteHistoricalScoresPeriod, 'getAthleteHistoricalScoresPeriod');
}
async getMyHistoricalScoresPeriod(dto) {
return this.execute(() => this.sdk.GetMyHistoricalScoresPeriod({ input: dto }), 'getMyHistoricalScoresPeriod', (r) => !!r?.getMyHistoricalScoresPeriod, 'getMyHistoricalScoresPeriod');
}
async getTransactionDetails(dto) {
return this.execute(() => this.sdk.GetTransactionDetails({ input: dto }), 'getTransactionDetails', (r) => !!r?.getTransactionDetails, 'getTransactionDetails');
}
async getAllUsers() {
return this.execute(() => this.sdk.GetAllUsers(), 'getAllUsers', (r) => Array.isArray(r?.getAllUsers), 'getAllUsers');
}
async getAllTransactions() {
return this.execute(() => this.sdk.GetAllTransactions(), 'getAllTransactions', (r) => Array.isArray(r?.getAllTransactions), 'getAllTransactions');
}
async getTransactionsPaginated(args = {}) {
return this.execute(() => this.sdk.GetTransactionsPaginated({ query: args.query }), 'getTransactionsPaginated', (r) => true, 'getTransactionsPaginated');
}
async getUsersPaginated(args) {
return this.execute(() => this.sdk.GetUsersPaginated({ query: args.query }), 'getUsersPaginated', (r) => true, 'getUsersPaginated');
}
async updateUserSuspendedStatus(dto) {
return this.execute(() => this.sdk.UpdateUserSuspendedStatus({ input: dto }), 'updateUserSuspendedStatus', (r) => r?.updateUserSuspendedStatus?.field !== null, 'updateUserSuspendedStatus');
}
async deleteVtxUser(dto) {
return this.execute(() => this.sdk.DeleteVtxUser({ input: dto }), 'deleteVtxUser', (r) => r?.deleteVtxUser?.success !== undefined, 'deleteVtxUser');
}
async deleteMyAccount() {
return this.execute(() => this.sdk.DeleteMyAccount(), 'deleteMyAccount', (r) => r?.deleteMyAccount?.success !== undefined, 'deleteMyAccount');
}
async createOffer(dto) {
return this.execute(() => this.sdk.CreateOffer({ input: dto }), 'createOffer', (r) => !!r?.createOffer?._id, 'createOffer');
}
async getOffers() {
return this.execute(() => this.sdk.GetOffers(), 'getOffers', (r) => Array.isArray(r?.getOffers), 'getOffers');
}
async getOffersPaginated(args) {
return this.execute(() => this.sdk.GetOffersPaginated({ query: args.query }), 'getOffersPaginated', (r) => true, 'getOffersPaginated');
}
async getOffersWithEligibility(args) {
return this.execute(() => this.sdk.OffersWithEligibility({ query: args.query }), 'offersWithEligibility', (r) => true, 'offersWithEligibility');
}
async getOfferById(id) {
return this.execute(() => this.sdk.GetOfferById({ id }), 'getOfferById', (r) => !!r?.getOfferById?._id, 'getOfferById');
}
async getOffersForAthlete(athleteId) {
return this.execute(() => this.sdk.GetOffersForAthlete({ athleteId }), 'getOffersForAthlete', (r) => Array.isArray(r?.getOffersForAthlete), 'getOffersForAthlete');
}
async updateOffer(id, dto) {
return this.execute(() => this.sdk.UpdateOffer({ id, input: dto }), 'updateOffer', (r) => !!r?.updateOffer?._id, 'updateOffer');
}
async deleteOffer(id) {
return this.execute(() => this.sdk.DeleteOffer({ id }), 'deleteOffer', (r) => r?.deleteOffer === true, 'deleteOffer');
}
async setOfferStatus(id, status) {
return this.execute(() => this.sdk.SetOfferStatus({ id, status }), 'setOfferStatus', (r) => !!r?.setOfferStatus?._id, 'setOfferStatus');
}
async activateOffer(id) {
return this.execute(() => this.sdk.ActivateOffer({ id }), 'activateOffer', (r) => !!r?.activateOffer?._id, 'activateOffer');
}
async deactivateOffer(id) {
return this.execute(() => this.sdk.DeactivateOffer({ id }), 'deactivateOffer', (r) => !!r?.deactivateOffer?._id, 'deactivateOffer');
}
async uploadCouponCodes(offerId, csvContent) {
return this.execute(() => this.sdk.UploadCouponCodes({ offerId, csvContent }), 'uploadCouponCodes', (r) => !!r?.uploadCouponCodes, 'uploadCouponCodes');
}
async claimOffer(offerId, athleteId) {
return this.execute(() => this.sdk.ClaimOffer({ offerId, athleteId }), 'claimOffer', (r) => !!r?.claimOffer?._id, 'claimOffer');
}
async getMyOfferClaims(args) {
return this.execute(() => this.sdk.GetMyOfferClaims({ athleteId: args.athleteId, query: args.query }), 'getMyOfferClaims', (r) => Array.isArray(r?.getMyOfferClaims), 'getMyOfferClaims');
}
async removeOfferClaim(claimId, athleteId) {
return this.execute(() => this.sdk.RemoveOfferClaim({ claimId, athleteId }), 'removeOfferClaim', (r) => r?.removeOfferClaim === true, 'removeOfferClaim');
}
async updateBrand(id, dto) {
return this.execute(() => this.sdk.UpdateBrand({ id, input: dto }), 'updateBrand', (r) => !!r?.updateBrand?._id, 'updateBrand');
}
async deleteBrand(id) {
return this.execute(() => this.sdk.DeleteBrand({ id }), 'deleteBrand', (r) => r?.deleteBrand === true, 'deleteBrand');
}
async linkBrandToSponsor(brandId, sponsorId) {
return this.execute(() => this.sdk.LinkBrandToSponsor({ brandId, sponsorId }), 'linkBrandToSponsor', (r) => !!r?.linkBrandToSponsor?._id, 'linkBrandToSponsor');
}
async unlinkBrandFromSponsor(brandId, sponsorId) {
return this.execute(() => this.sdk.UnlinkBrandFromSponsor({ brandId, sponsorId }), 'unlinkBrandFromSponsor', (r) => !!r?.unlinkBrandFromSponsor?._id, 'unlinkBrandFromSponsor');
}
async getSponsors() {
return this.execute(() => this.sdk.GetSponsors(), 'getSponsors', (r) => Array.isArray(r?.getSponsors), 'getSponsors');
}
async getSponsorsPaginated(args) {
return this.execute(() => this.sdk.GetSponsorsPaginated({ query: args.query }), 'getSponsorsPaginated', (r) => true, 'getSponsorsPaginated');
}
async createSponsor(dto) {
return this.execute(() => this.sdk.CreateSponsor({ input: dto }), 'createSponsor', (r) => !!r?.createSponsor?._id, 'createSponsor');
}
async updateSponsor(id, dto) {
return this.execute(() => this.sdk.UpdateSponsor({ id, input: dto }), 'updateSponsor', (r) => !!r?.updateSponsor?._id, 'updateSponsor');
}
async deleteSponsor(id) {
return this.execute(() => this.sdk.DeleteSponsor({ id }), 'deleteSponsor', (r) => r?.deleteSponsor === true, 'deleteSponsor');
}
async getLeaderboard(args) {
return this.execute(() => this.sdk.GetLeaderboard({ input: args?.input }), 'getLeaderboard', (r) => !!r?.getLeaderboard, 'getLeaderboard');
}
async getUserRank(args) {
return this.execute(() => this.sdk.GetUserRank({ input: args.input }), 'getUserRank', (r) => !!r?.getUserRank, 'getUserRank');
}
async rebuildLeaderboardCache() {
return this.execute(() => this.sdk.RebuildLeaderboardCache(), 'rebuildLeaderboardCache', (r) => r?.rebuildLeaderboardCache !== undefined, 'rebuildLeaderboardCache');
}
async getAthleteDashboard(athleteId) {
return this.execute(() => this.sdk.GetAthleteDashboard({ athleteId }), 'athleteDashboard', (r) => !!r?.athleteDashboard, 'getAthleteDashboard');
}
async getAthleteScoreHistory(args) {
return this.execute(() => this.sdk.GetAthleteScoreHistory({ input: args.input }), 'athleteScoreHistory', (r) => Array.isArray(r?.athleteScoreHistory), 'getAthleteScoreHistory');
}
async getAthleteRankHistory(args) {
return this.execute(() => this.sdk.GetAthleteRankHistory({ input: args.input }), 'athleteRankHistory', (r) => Array.isArray(r?.athleteRankHistory), 'getAthleteRankHistory');
}
async getAthleteRankContext(args) {
return this.execute(() => this.sdk.GetAthleteRankContext({ input: args.input }), 'athleteRankContext', (r) => !!r?.athleteRankContext, 'getAthleteRankContext');
}
async getAthleteActivities(args) {
return this.execute(() => this.sdk.GetAthleteActivities({ input: args.input }), 'athleteActivities', (r) => !!r?.athleteActivities, 'getAthleteActivities');
}
async getAthleteActivityDetail(args) {
return this.execute(() => this.sdk.GetAthleteActivityDetail({ input: args.input }), 'athleteActivityDetail', (r) => !!r?.athleteActivityDetail, 'getAthleteActivityDetail');
}
async getAthleteComponentSummary(args) {
return this.execute(() => this.sdk.GetAthleteComponentSummary({ input: args.input }), 'athleteComponentSummary', (r) => !!r?.athleteComponentSummary, 'getAthleteComponentSummary');
}
async getSocialAggregates(args) {
return this.execute(() => this.sdk.GetSocialAggregates({
athleteId: args.input.athleteId,
platform: args.input.platform,
range: { start: args.input.startDate, end: args.input.endDate },
periodType: args.input.periodType,
}), 'socialAggregates', (r) => r?.socialAggregates !== undefined, 'getSocialAggregates');
}
async getPostsWithComparison(args) {
return this.execute(() => this.sdk.GetPostsWithComparison({
athleteId: args.input.athleteId,
platform: args.input.platform,
options: {
sortBy: args.input.sortBy,
contentType: args.input.contentType,
limit: args.input.limit,
offset: args.input.offset,
comparisonWindowDays: args.input.comparisonWindowDays,
},
}), 'postsWithComparison', (r) => r?.postsWithComparison !== undefined, 'getPostsWithComparison');
}
async getAthleteActivityDates(athleteId) {
return this.execute(() => this.sdk.GetAthleteActivityDates({ input: { athleteId } }), 'athleteActivityDates', (r) => r?.athleteActivityDates?.dates !== undefined, 'getAthleteActivityDates');
}
async getMyNotifications(options) {
return this.execute(() => this.sdk.MyNotifications({ input: (options || {}) }), 'myNotifications', (r) => r?.myNotifications?.notifications !== undefined, 'getMyNotifications');
}
async getNotificationUnreadCount() {
return this.execute(() => this.sdk.NotificationUnreadCount(), 'notificationUnreadCount', (r) => r?.notificationUnreadCount?.count !== undefined, 'getNotificationUnreadCount');
}
async getMyNotificationPreferences() {
return this.execute(() => this.sdk.MyNotificationPreferences(), 'myNotificationPreferences', (r) => r?.myNotificationPreferences?.id !== undefined, 'getMyNotificationPreferences');
}
async markNotificationAsRead(notificationId) {
return this.execute(() => this.sdk.MarkNotificationAsRead({ input: { notificationId } }), 'markNotificationAsRead', (r) => r?.markNotificationAsRead?.id !== undefined, 'markNotificationAsRead');
}
async markAllNotificationsAsRead() {
return this.execute(() => this.sdk.MarkAllNotificationsAsRead(), 'markAllNotificationsAsRead', (r) => r?.markAllNotificationsAsRead !== undefined, 'markAllNotificationsAsRead');
}
async dismissNotification(notificationId) {
return this.execute(() => this.sdk.DismissNotification({ input: { notificationId } }), 'dismissNotification', (r) => r?.dismissNotification !== undefined, 'dismissNotification');
}
async registerDeviceToken(token, platform, deviceName) {
const input = { token, platform, deviceName };
return this.execute(() => this.sdk.RegisterDeviceToken({ input }), 'registerDeviceToken', (r) => r?.registerDeviceToken?.id !== undefined, 'registerDeviceToken');
}
async unregisterDeviceToken(token) {
const input = { token };
return this.execute(() => this.sdk.UnregisterDeviceToken({ input }), 'unregisterDeviceToken', (r) => r?.unregisterDeviceToken !== undefined, 'unregisterDeviceToken');
}
async updateNotificationPreferences(input) {
return this.execute(() => this.sdk.UpdateNotificationPreferences({ input: input }), 'updateNotificationPreferences', (r) => r?.updateNotificationPreferences?.id !== undefined, 'updateNotificationPreferences');
}
async followAthlete(athleteId) {
return this.execute(() => this.sdk.FollowAthlete({ input: { athleteId } }), 'followAthlete', (r) => r?.followAthlete !== undefined, 'followAthlete');
}
async unfollowAthlete(athleteId) {
return this.execute(() => this.sdk.UnfollowAthlete({ input: { athleteId } }), 'unfollowAthlete', (r) => r?.unfollowAthlete !== undefined, 'unfollowAthlete');
}
async isFollowingAthlete(athleteId) {
return this.execute(() => this.sdk.IsFollowingAthlete({ input: { athleteId } }), 'isFollowingAthlete', (r) => r?.isFollowingAthlete?.isFollowing !== undefined, 'isFollowingAthlete');
}
async getMyFollowedAthletes(options) {
return this.execute(() => this.sdk.MyFollowedAthletes({ input: (options || null) }), 'myFollowedAthletes', (r) => r?.myFollowedAthletes?.athletes !== undefined, 'getMyFollowedAthletes');
}
async deleteOnboardingAthlete() {
return this.execute(() => this.sdk.DeleteOnboardingAthlete(), 'deleteOnboardingAthlete', (r) => r?.deleteOnboardingAthlete?.success === true, 'deleteOnboardingAthlete');
}
async updateOnboardingProgress(step, complete) {
return this.execute(() => this.sdk.UpdateOnboardingProgress({ input: { step, complete } }), 'updateOnboardingProgress', (r) => r?.updateOnboardingProgress?.success === true, 'updateOnboardingProgress');
}
async getOnboardingProgress() {
return this.execute(() => this.sdk.GetOnboardingProgress(), 'getOnboardingProgress', (r) => r?.getOnboardingProgress?.success === true, 'getOnboardingProgress');
}
async getPublicAthleteIntegrationStatus(athleteId) {
return this.execute(() => this.sdk.GetPublicAthleteIntegrationStatus({ athleteId }), 'getPublicAthleteIntegrationStatus', (r) => r?.getPublicAthleteIntegrationStatus != null, 'getPublicAthleteIntegrationStatus');
}
async getEmailCampaigns(args) {
return this.execute(() => this.sdk.GetEmailCampaigns({ ...args }), 'getEmailCampaigns', (r) => r?.getEmailCampaigns?.campaigns != null, 'getEmailCampaigns');
}
async createEmailCampaign(input) {
return this.execute(() => this.sdk.CreateEmailCampaign({ input }), 'createEmailCampaign', (r) => !!r?.createEmailCampaign?._id, 'createEmailCampaign');
}
async updateEmailCampaign(id, input) {
return this.execute(() => this.sdk.UpdateEmailCampaign({ id, input }), 'updateEmailCampaign', (r) => !!r?.updateEmailCampaign?._id, 'updateEmailCampaign');
}
async deleteEmailCampaign(id) {
return this.execute(() => this.sdk.DeleteEmailCampaign({ id }), 'deleteEmailCampaign', (r) => r?.deleteEmailCampaign === true, 'deleteEmailCampaign');
}
async cloneEmailCampaign(id) {
return this.execute(() => this.sdk.CloneEmailCampaign({ id }), 'cloneEmailCampaign', (r) => !!r?.cloneEmailCampaign?._id, 'cloneEmailCampaign');
}
async sendTestEmail(campaignId, email) {
return this.execute(() => this.sdk.SendTestEmail({ campaignId, adminEmail: email }), 'sendTestEmail', (r) => !!r?.sendTestEmail, 'sendTestEmail');
}
async sendBulkEmail(campaignId) {
return this.execute(() => this.sdk.SendBulkEmail({ campaignId }), 'sendBulkEmail', (r) => !!r?.sendBulkEmail, 'sendBulkEmail');
}
async scheduleEmailCampaign(campaignId, scheduledFor) {
return this.execute(() => this.sdk.ScheduleEmailCampaign({ campaignId, scheduledFor }), 'scheduleEmailCampaign', (r) => !!r?.scheduleEmailCampaign?._id, 'scheduleEmailCampaign');
}
async cancelScheduledEmail(campaignId) {
return this.execute(() => this.sdk.CancelScheduledEmail({ campaignId }), 'cancelScheduledEmail', (r) => !!r?.cancelScheduledEmail?._id, 'cancelScheduledEmail');
}
async getAudiencePreview(filters) {
return this.execute(() => this.sdk.GetAudiencePreview({ filters }), 'getAudiencePreview', (r) => r?.getAudiencePreview?.total != null, 'getAudiencePreview');
}
async getSendGridTemplates() {
return this.execute(() => this.sdk.GetSendGridTemplates(), 'getSe