@vertikalx/vtx-backend-client 1.0.0-dev-daniel.199 → 1.0.0-dev-geo.7
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 +1 -1
- package/src/api/vtx-base-api.d.ts +2 -3
- package/src/api/vtx-base-api.js +374 -69
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +6 -62
- package/src/client/schema.graphql +1 -29
- package/src/client/schema.js +1 -15
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +3 -31
- package/src/client/types.js +113 -185
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -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
|
|
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,6 +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
|
-
|
|
69
|
-
createAthleteStripeSession(desiredFields?: StripeSessionGenqlSelection): Promise<ITypedBackendResponse<StripeSession>>;
|
|
68
|
+
findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
70
69
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -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,80 +4652,396 @@ class VTXBaseAPI {
|
|
|
4663
4652
|
}
|
|
4664
4653
|
return retValue;
|
|
4665
4654
|
}
|
|
4666
|
-
async
|
|
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 ?? {
|
|
4672
|
-
_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
|
|
4681
|
-
};
|
|
4682
|
-
fields._id = true;
|
|
4683
4660
|
let retValue = {};
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4661
|
+
const fields = {
|
|
4662
|
+
_id: 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
|
+
}
|
|
4689
4693
|
},
|
|
4690
|
-
|
|
4694
|
+
latitude: true,
|
|
4695
|
+
longitude: true,
|
|
4696
|
+
timezone: true,
|
|
4691
4697
|
}
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
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
|
+
}
|
|
4718
5023
|
};
|
|
4719
|
-
fields.client_secret = true;
|
|
4720
|
-
let retValue = {};
|
|
4721
5024
|
try {
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
5025
|
+
let response = null;
|
|
5026
|
+
response = await client.query({
|
|
5027
|
+
findAthletebyIdpublic: {
|
|
5028
|
+
__args: {
|
|
5029
|
+
athleteId: id
|
|
5030
|
+
},
|
|
4725
5031
|
...fields
|
|
4726
5032
|
}
|
|
4727
5033
|
});
|
|
4728
|
-
VTXBaseAPI.Logger.debug('
|
|
5034
|
+
VTXBaseAPI.Logger.debug('findAthletebyIdpublic Response:');
|
|
4729
5035
|
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4730
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
4731
|
-
|
|
4732
|
-
const isResponseOk = true && response?.createAthleteStripeSession?.client_secret;
|
|
5036
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'findAthletebyIdpublic', (r) => {
|
|
5037
|
+
const isResponseOk = true && response?.findAthletebyIdpublic?._id;
|
|
4733
5038
|
return isResponseOk;
|
|
4734
5039
|
});
|
|
4735
5040
|
}
|
|
4736
|
-
catch (
|
|
4737
|
-
VTXBaseAPI.Logger.error('
|
|
4738
|
-
VTXBaseAPI.Logger.error(
|
|
4739
|
-
retValue = (0, response_builder_1.buildErrorResponse)(
|
|
5041
|
+
catch (err1) {
|
|
5042
|
+
VTXBaseAPI.Logger.error('findAthleteForUser err1:');
|
|
5043
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5044
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
4740
5045
|
}
|
|
4741
5046
|
return retValue;
|
|
4742
5047
|
}
|