@vertikalx/vtx-backend-client 1.0.0-dev-daniel.198 → 1.0.0-dev-geo.6

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.198",
3
+ "version": "1.0.0-dev-geo.6",
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, 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, AthleteQueryDto, AthleteQueryResponse, StripeAccountGenqlSelection, CreateStripeAccountDto, StripeAccount } from '../client';
1
+ import { User, 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, AthleteQueryDto, AthleteQueryResponse } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  export declare class VTXBaseAPI {
@@ -65,5 +65,5 @@ export declare class VTXBaseAPI {
65
65
  createAthleteMembershipAffilation(dto: CreateAthleteMembershipDto, desiredFields?: AthleteMembershipGenqlSelection): Promise<ITypedBackendResponse<AthleteMembership>>;
66
66
  deleteMembershipAffiliation(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
67
67
  queryAthleteFundingCampaigns(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
68
- createStripeAccount(dto: CreateStripeAccountDto, desiredFields?: StripeAccountGenqlSelection): Promise<ITypedBackendResponse<StripeAccount>>;
68
+ findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
69
69
  }
@@ -2260,17 +2260,6 @@ class VTXBaseAPI {
2260
2260
  resultWebLink: true
2261
2261
  }
2262
2262
  }
2263
- },
2264
- stripeAccount: {
2265
- _id: true,
2266
- stripeAccountId: true,
2267
- email: true,
2268
- initialized: true,
2269
- needsUpdate: true,
2270
- countryId: true,
2271
- defaultCurrency: true,
2272
- created: true,
2273
- accountData: true
2274
2263
  }
2275
2264
  };
2276
2265
  try {
@@ -4663,45 +4652,396 @@ class VTXBaseAPI {
4663
4652
  }
4664
4653
  return retValue;
4665
4654
  }
4666
- async createStripeAccount(dto, desiredFields) {
4655
+ async findAthleteForIdPublic(id) {
4667
4656
  const client = (0, client_1.createClient)({
4668
4657
  url: this.backendUrl + "/graphql",
4669
4658
  headers: this.headers,
4670
4659
  });
4671
- const fields = desiredFields ?? {
4660
+ let retValue = {};
4661
+ const fields = {
4672
4662
  _id: true,
4673
- stripeAccountId: true,
4674
- email: true,
4675
- initialized: true,
4676
- needsUpdate: true,
4677
- countryId: true,
4678
- defaultCurrency: true,
4679
- created: true,
4680
- accountData: true
4663
+ firstName: true,
4664
+ lastName: true,
4665
+ screenName: true,
4666
+ dob: true,
4667
+ lgbt: true,
4668
+ competitionGender: true,
4669
+ country: {
4670
+ _id: true,
4671
+ name: true
4672
+ },
4673
+ location: {
4674
+ userProvidedLatitude: true,
4675
+ userProvidedLongitude: true,
4676
+ cityNameGeocode: true,
4677
+ stateNameGeocode: true,
4678
+ countryIso2CodeGeocode: true,
4679
+ timeZoneGeocode: true,
4680
+ latitudeGeocode: true,
4681
+ longitudeGeocode: true,
4682
+ city: {
4683
+ _id: true,
4684
+ name: true,
4685
+ localizedName: true,
4686
+ state: {
4687
+ _id: true,
4688
+ name: true,
4689
+ country: {
4690
+ _id: true,
4691
+ name: true
4692
+ }
4693
+ },
4694
+ latitude: true,
4695
+ longitude: true,
4696
+ timezone: true,
4697
+ }
4698
+ },
4699
+ trainer: true,
4700
+ trainerUrl: true,
4701
+ aboutMe: true,
4702
+ followStats: {
4703
+ followers: true,
4704
+ followed: true,
4705
+ raves: true,
4706
+ favorites: true
4707
+ },
4708
+ mainSport: {
4709
+ _id: true,
4710
+ name: true
4711
+ },
4712
+ mainSportLevel: {
4713
+ _id: true,
4714
+ label: true,
4715
+ index: true
4716
+ },
4717
+ scores: {
4718
+ vtxScore: true,
4719
+ socialScore: true,
4720
+ trainingScore: true,
4721
+ competitionScore: true
4722
+ },
4723
+ rankings: {
4724
+ worldRanking: {
4725
+ scope: true,
4726
+ scopeId: true,
4727
+ scopeName: true,
4728
+ position: true,
4729
+ total: true
4730
+ },
4731
+ countryRanking: {
4732
+ scope: true,
4733
+ scopeId: true,
4734
+ scopeName: true,
4735
+ position: true,
4736
+ total: true
4737
+ },
4738
+ stateRanking: {
4739
+ scope: true,
4740
+ scopeId: true,
4741
+ scopeName: true,
4742
+ position: true,
4743
+ total: true
4744
+ },
4745
+ cityRanking: {
4746
+ scope: true,
4747
+ scopeId: true,
4748
+ scopeName: true,
4749
+ position: true,
4750
+ total: true
4751
+ },
4752
+ },
4753
+ allSports: {
4754
+ _id: true,
4755
+ name: true
4756
+ },
4757
+ teams: {
4758
+ _id: true,
4759
+ name: true,
4760
+ description: true,
4761
+ approved: true,
4762
+ logo: {
4763
+ _id: true,
4764
+ name: true,
4765
+ contentType: true,
4766
+ size: true,
4767
+ useType: true,
4768
+ url: true,
4769
+ key: true
4770
+ },
4771
+ banner: {
4772
+ _id: true,
4773
+ name: true,
4774
+ contentType: true,
4775
+ size: true,
4776
+ useType: true,
4777
+ url: true,
4778
+ key: true
4779
+ }
4780
+ },
4781
+ sponsorBrands: {
4782
+ _id: true,
4783
+ name: true,
4784
+ slogan: true,
4785
+ website: true,
4786
+ description: true,
4787
+ approved: true,
4788
+ published: true,
4789
+ logo: {
4790
+ _id: true,
4791
+ name: true,
4792
+ contentType: true,
4793
+ size: true,
4794
+ useType: true,
4795
+ url: true,
4796
+ key: true
4797
+ },
4798
+ stats: {
4799
+ campaigns: true,
4800
+ sponsorships: true,
4801
+ sports: true,
4802
+ athletes: true
4803
+ },
4804
+ operatorIds: true,
4805
+ },
4806
+ competitions: {
4807
+ _id: true,
4808
+ event: {
4809
+ _id: true,
4810
+ name: true,
4811
+ mainSport: {
4812
+ _id: true,
4813
+ name: true
4814
+ },
4815
+ eventWebSite: true,
4816
+ startDate: true,
4817
+ endDate: true,
4818
+ verified: true,
4819
+ location: {
4820
+ _id: true,
4821
+ userProvidedLatitude: true,
4822
+ userProvidedLongitude: true,
4823
+ cityNameGeocode: true,
4824
+ stateNameGeocode: true,
4825
+ countryIso2CodeGeocode: true,
4826
+ timeZoneGeocode: true,
4827
+ latitudeGeocode: true,
4828
+ longitudeGeocode: true,
4829
+ city: {
4830
+ _id: true,
4831
+ name: true,
4832
+ localizedName: true,
4833
+ state: {
4834
+ _id: true,
4835
+ name: true,
4836
+ country: {
4837
+ _id: true,
4838
+ name: true
4839
+ }
4840
+ },
4841
+ latitude: true,
4842
+ longitude: true,
4843
+ timezone: true,
4844
+ }
4845
+ },
4846
+ banner: {
4847
+ _id: true,
4848
+ name: true,
4849
+ contentType: true,
4850
+ size: true,
4851
+ useType: true,
4852
+ url: true,
4853
+ key: true
4854
+ }
4855
+ },
4856
+ participationDate: true,
4857
+ result: {
4858
+ _id: true,
4859
+ resultType: true,
4860
+ position: true,
4861
+ score: true,
4862
+ finishTimeMS: true,
4863
+ resultWebLink: true
4864
+ }
4865
+ },
4866
+ affiliations: {
4867
+ _id: true,
4868
+ organization: {
4869
+ _id: true,
4870
+ shortName: true,
4871
+ acronym: true,
4872
+ fullName: true,
4873
+ website: true,
4874
+ logo: {
4875
+ _id: true,
4876
+ name: true,
4877
+ contentType: true,
4878
+ size: true,
4879
+ useType: true,
4880
+ url: true,
4881
+ key: true
4882
+ }
4883
+ },
4884
+ membershipNumber: true,
4885
+ membershipType: true,
4886
+ issueDate: true,
4887
+ expirationDate: true,
4888
+ },
4889
+ totalUpcomingCompetitions: true,
4890
+ totalPastCompetitions: true,
4891
+ profilePicture: {
4892
+ _id: true,
4893
+ name: true,
4894
+ contentType: true,
4895
+ size: true,
4896
+ useType: true,
4897
+ url: true,
4898
+ key: true
4899
+ },
4900
+ cardPicture: {
4901
+ _id: true,
4902
+ name: true,
4903
+ contentType: true,
4904
+ size: true,
4905
+ useType: true,
4906
+ url: true,
4907
+ key: true
4908
+ },
4909
+ preferences: {
4910
+ _id: true,
4911
+ showProfileHelper: true
4912
+ },
4913
+ currentCampaign: {
4914
+ _id: true,
4915
+ budgetMode: true,
4916
+ status: true,
4917
+ title: true,
4918
+ motivation: true,
4919
+ website: true,
4920
+ fundsRequired: true,
4921
+ initialFundsObtained: true,
4922
+ fundsObtained: true,
4923
+ location: {
4924
+ _id: true,
4925
+ userProvidedLatitude: true,
4926
+ userProvidedLongitude: true,
4927
+ cityNameGeocode: true,
4928
+ stateNameGeocode: true,
4929
+ countryIso2CodeGeocode: true,
4930
+ timeZoneGeocode: true,
4931
+ latitudeGeocode: true,
4932
+ longitudeGeocode: true,
4933
+ city: {
4934
+ _id: true,
4935
+ name: true,
4936
+ localizedName: true,
4937
+ state: {
4938
+ _id: true,
4939
+ name: true,
4940
+ country: {
4941
+ _id: true,
4942
+ name: true
4943
+ }
4944
+ },
4945
+ latitude: true,
4946
+ longitude: true,
4947
+ timezone: true,
4948
+ }
4949
+ },
4950
+ endingDate: true,
4951
+ budget: {
4952
+ _id: true,
4953
+ initialFunds: true,
4954
+ totalRequired: true,
4955
+ items: {
4956
+ _id: true,
4957
+ quantity: true,
4958
+ concept: true,
4959
+ itemCost: true
4960
+ }
4961
+ },
4962
+ competitions: {
4963
+ _id: true,
4964
+ event: {
4965
+ _id: true,
4966
+ name: true,
4967
+ mainSport: {
4968
+ _id: true,
4969
+ name: true
4970
+ },
4971
+ eventWebSite: true,
4972
+ startDate: true,
4973
+ endDate: true,
4974
+ verified: true,
4975
+ banner: {
4976
+ _id: true,
4977
+ name: true,
4978
+ contentType: true,
4979
+ size: true,
4980
+ useType: true,
4981
+ url: true,
4982
+ key: true
4983
+ },
4984
+ location: {
4985
+ _id: true,
4986
+ userProvidedLatitude: true,
4987
+ userProvidedLongitude: true,
4988
+ cityNameGeocode: true,
4989
+ stateNameGeocode: true,
4990
+ countryIso2CodeGeocode: true,
4991
+ timeZoneGeocode: true,
4992
+ latitudeGeocode: true,
4993
+ longitudeGeocode: true,
4994
+ city: {
4995
+ _id: true,
4996
+ name: true,
4997
+ localizedName: true,
4998
+ state: {
4999
+ _id: true,
5000
+ name: true,
5001
+ country: {
5002
+ _id: true,
5003
+ name: true
5004
+ }
5005
+ },
5006
+ latitude: true,
5007
+ longitude: true,
5008
+ timezone: true,
5009
+ }
5010
+ },
5011
+ },
5012
+ participationDate: true,
5013
+ result: {
5014
+ _id: true,
5015
+ resultType: true,
5016
+ position: true,
5017
+ score: true,
5018
+ finishTimeMS: true,
5019
+ resultWebLink: true
5020
+ }
5021
+ }
5022
+ }
4681
5023
  };
4682
- fields._id = true;
4683
- let retValue = {};
4684
5024
  try {
4685
- const response = await client.mutation({
4686
- createStripeAccount: {
5025
+ let response = null;
5026
+ response = await client.query({
5027
+ findAthletebyIdpublic: {
4687
5028
  __args: {
4688
- input: dto
5029
+ athleteId: id
4689
5030
  },
4690
5031
  ...fields
4691
5032
  }
4692
5033
  });
4693
- VTXBaseAPI.Logger.debug('createStripeAccount Response:');
5034
+ VTXBaseAPI.Logger.debug('findAthletebyIdpublic Response:');
4694
5035
  VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
4695
- retValue = (0, response_builder_1.buildResponse)(response, 'createStripeAccount', (r) => {
4696
- VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
4697
- const isResponseOk = true && response?.createStripeAccount?._id;
5036
+ retValue = (0, response_builder_1.buildResponse)(response, 'findAthletebyIdpublic', (r) => {
5037
+ const isResponseOk = true && response?.findAthletebyIdpublic?._id;
4698
5038
  return isResponseOk;
4699
5039
  });
4700
5040
  }
4701
- catch (error1) {
4702
- VTXBaseAPI.Logger.error('createStripeAccount err1:');
4703
- VTXBaseAPI.Logger.error(error1);
4704
- retValue = (0, response_builder_1.buildErrorResponse)(error1);
5041
+ catch (err1) {
5042
+ VTXBaseAPI.Logger.error('findAthleteForUser err1:');
5043
+ VTXBaseAPI.Logger.error(err1);
5044
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
4705
5045
  }
4706
5046
  return retValue;
4707
5047
  }