@vertikalx/vtx-backend-client 1.0.0-dev-daniel.230 → 1.0.0-dev-geo.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev-daniel.230",
3
+ "version": "1.0.0-dev-geo.47",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -1,4 +1,4 @@
1
- import { User, AddValuesResponse, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership, AthleteMembershipGenqlSelection, MembershipOrganizationReferenceGenqlSelection, MembershipOrganizationReference, CreateMembershipOrganizationDto, CreateAthleteMembershipDto, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, AWSS3DeleteUseTypeFileDto, EditPictureDto, Album } from '../client';
1
+ import { User, AddValuesResponse, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership, AthleteMembershipGenqlSelection, MembershipOrganizationReferenceGenqlSelection, MembershipOrganizationReference, CreateMembershipOrganizationDto, CreateAthleteMembershipDto, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, AWSS3DeleteUseTypeFileDto, EditPictureDto, Album, State, Country } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  export declare class VTXBaseAPI {
@@ -43,6 +43,8 @@ export declare class VTXBaseAPI {
43
43
  findCityById(cityId: string): Promise<ITypedBackendResponse<City>>;
44
44
  getSportLevels(): Promise<ITypedBackendResponse<SportLevel[]>>;
45
45
  getSports(): Promise<ITypedBackendResponse<Sport[]>>;
46
+ getStates(): Promise<ITypedBackendResponse<State[]>>;
47
+ getCountries(): Promise<ITypedBackendResponse<Country[]>>;
46
48
  loginUserFromCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<UserWithToken>>;
47
49
  validateUserCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<User>>;
48
50
  findAthleteForUser(loginEmail: string): Promise<ITypedBackendResponse<Athlete>>;
@@ -1788,6 +1788,74 @@ class VTXBaseAPI {
1788
1788
  }
1789
1789
  return retValue;
1790
1790
  }
1791
+ async getStates() {
1792
+ const client = (0, client_1.createClient)({
1793
+ url: this.backendUrl + "/graphql",
1794
+ headers: this.headers,
1795
+ });
1796
+ const fields = {
1797
+ _id: true,
1798
+ name: true,
1799
+ country: {
1800
+ _id: true,
1801
+ name: true
1802
+ }
1803
+ };
1804
+ let retValue;
1805
+ try {
1806
+ const response = await client.query({
1807
+ getStates: {
1808
+ __args: {},
1809
+ ...fields
1810
+ }
1811
+ });
1812
+ VTXBaseAPI.Logger.debug('getStates Response:');
1813
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
1814
+ retValue = (0, response_builder_1.buildResponse)(response, 'getStates', (r) => {
1815
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
1816
+ const isResponseOk = true && Array.isArray(response?.getStates);
1817
+ return isResponseOk;
1818
+ });
1819
+ }
1820
+ catch (err1) {
1821
+ VTXBaseAPI.Logger.error('getStates err1:');
1822
+ VTXBaseAPI.Logger.error(err1);
1823
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
1824
+ }
1825
+ return retValue;
1826
+ }
1827
+ async getCountries() {
1828
+ const client = (0, client_1.createClient)({
1829
+ url: this.backendUrl + "/graphql",
1830
+ headers: this.headers,
1831
+ });
1832
+ const fields = {
1833
+ _id: true,
1834
+ name: true,
1835
+ };
1836
+ let retValue;
1837
+ try {
1838
+ const response = await client.query({
1839
+ getCountries: {
1840
+ __args: {},
1841
+ ...fields
1842
+ }
1843
+ });
1844
+ VTXBaseAPI.Logger.debug('getCountries Response:');
1845
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
1846
+ retValue = (0, response_builder_1.buildResponse)(response, 'getCountries', (r) => {
1847
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
1848
+ const isResponseOk = true && Array.isArray(response?.getCountries);
1849
+ return isResponseOk;
1850
+ });
1851
+ }
1852
+ catch (err1) {
1853
+ VTXBaseAPI.Logger.error('getCountries err1:');
1854
+ VTXBaseAPI.Logger.error(err1);
1855
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
1856
+ }
1857
+ return retValue;
1858
+ }
1791
1859
  async loginUserFromCredentialsVtx(username, password) {
1792
1860
  const client = (0, client_1.createClient)({
1793
1861
  url: this.backendUrl + '/graphql',
@@ -4200,7 +4268,6 @@ class VTXBaseAPI {
4200
4268
  fundsRequired: true,
4201
4269
  initialFundsObtained: true,
4202
4270
  fundsObtained: true,
4203
- vtxComissionPct: true,
4204
4271
  location: {
4205
4272
  userProvidedLatitude: true,
4206
4273
  userProvidedLongitude: true,
@@ -5065,7 +5132,6 @@ class VTXBaseAPI {
5065
5132
  fundsRequired: true,
5066
5133
  initialFundsObtained: true,
5067
5134
  fundsObtained: true,
5068
- vtxComissionPct: true,
5069
5135
  location: {
5070
5136
  userProvidedLatitude: true,
5071
5137
  userProvidedLongitude: true,