@vertikalx/vtx-backend-client 1.0.0-dev.84 → 1.0.0-dev.85

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.84",
3
+ "version": "1.0.0-dev.85",
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 } 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 } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  export declare class VTXBaseAPI {
@@ -76,4 +76,9 @@ export declare class VTXBaseAPI {
76
76
  editPicture(newPicDto: EditPictureDto): Promise<ITypedBackendResponse<EditPictureResponse>>;
77
77
  DeletePictureFromBuket(deleteDto: AWSS3DeleteUseTypeFileDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
78
78
  addAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<AddValuesResponse>>;
79
+ createAthleteAlbum(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
80
+ deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
81
+ getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
82
+ getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
83
+ queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
79
84
  }
@@ -5718,6 +5718,478 @@ class VTXBaseAPI {
5718
5718
  console.log(JSON.stringify(retValue, null, 2));
5719
5719
  return retValue;
5720
5720
  }
5721
+ async createAthleteAlbum(dto) {
5722
+ console.log('HEADERS:');
5723
+ console.log(JSON.stringify(this.headers, null, 2));
5724
+ const client = (0, client_1.createClient)({
5725
+ url: this.backendUrl + '/graphql',
5726
+ headers: this.headers,
5727
+ });
5728
+ let retValue = {};
5729
+ const fields = {
5730
+ label: true,
5731
+ description: true,
5732
+ photos: {
5733
+ _id: true,
5734
+ photo: {
5735
+ _id: true,
5736
+ name: true,
5737
+ contentType: true,
5738
+ size: true,
5739
+ useType: true,
5740
+ url: true,
5741
+ }
5742
+ }
5743
+ };
5744
+ try {
5745
+ const response = await client.mutation({
5746
+ createAthleteAlbum: {
5747
+ __args: {
5748
+ input: dto
5749
+ },
5750
+ ...fields
5751
+ },
5752
+ });
5753
+ console.log('createAthleteAlbum Response:');
5754
+ console.log(JSON.stringify(response, null, 2));
5755
+ retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
5756
+ const isResponseOk = response?.createAthleteAlbum?._id;
5757
+ return isResponseOk;
5758
+ });
5759
+ }
5760
+ catch (err1) {
5761
+ console.error('createAthleteAlbum err1:');
5762
+ console.error(err1);
5763
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5764
+ }
5765
+ console.log('retValue:');
5766
+ console.log(JSON.stringify(retValue, null, 2));
5767
+ return retValue;
5768
+ }
5769
+ async deleteAthleteAlbum(dto) {
5770
+ console.log('HEADERS:');
5771
+ console.log(JSON.stringify(this.headers, null, 2));
5772
+ const client = (0, client_1.createClient)({
5773
+ url: this.backendUrl + '/graphql',
5774
+ headers: this.headers,
5775
+ });
5776
+ let retValue = {};
5777
+ const fields = {
5778
+ idToDelete: true,
5779
+ deleted: true,
5780
+ failureReason: {
5781
+ code: true,
5782
+ message: true
5783
+ }
5784
+ };
5785
+ try {
5786
+ const response = await client.mutation({
5787
+ deleteAthleteAlbum: {
5788
+ __args: {
5789
+ input: dto
5790
+ },
5791
+ ...fields
5792
+ },
5793
+ });
5794
+ console.log('deleteAthleteAlbum Response:');
5795
+ console.log(JSON.stringify(response, null, 2));
5796
+ retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteAlbum', (r) => {
5797
+ const isResponseOk = response?.deleteAthleteAlbum?.deleted;
5798
+ return isResponseOk;
5799
+ });
5800
+ }
5801
+ catch (err1) {
5802
+ console.error('createAthleteAlbum err1:');
5803
+ console.error(err1);
5804
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5805
+ }
5806
+ console.log('retValue:');
5807
+ console.log(JSON.stringify(retValue, null, 2));
5808
+ return retValue;
5809
+ }
5810
+ async getAthleteAlbums() {
5811
+ console.log('HEADERS:');
5812
+ console.log(JSON.stringify(this.headers, null, 2));
5813
+ const client = (0, client_1.createClient)({
5814
+ url: this.backendUrl + '/graphql',
5815
+ headers: this.headers,
5816
+ });
5817
+ let retValue = {};
5818
+ const fields = {
5819
+ label: true,
5820
+ description: true,
5821
+ photos: {
5822
+ _id: true,
5823
+ photo: {
5824
+ _id: true,
5825
+ name: true,
5826
+ contentType: true,
5827
+ size: true,
5828
+ useType: true,
5829
+ url: true,
5830
+ }
5831
+ }
5832
+ };
5833
+ try {
5834
+ const response = await client.query({
5835
+ getAthleteAlbums: {
5836
+ __args: {},
5837
+ ...fields
5838
+ },
5839
+ });
5840
+ console.log('getAthleteAlbums Response:');
5841
+ console.log(JSON.stringify(response, null, 2));
5842
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
5843
+ const isResponseOk = response?.getAthleteAlbums?.length > 0;
5844
+ return isResponseOk;
5845
+ });
5846
+ }
5847
+ catch (err1) {
5848
+ console.error('getAthleteAlbums err1:');
5849
+ console.error(err1);
5850
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5851
+ }
5852
+ console.log('retValue:');
5853
+ console.log(JSON.stringify(retValue, null, 2));
5854
+ return retValue;
5855
+ }
5856
+ async getAthleteAlbumsById() {
5857
+ console.log('HEADERS:');
5858
+ console.log(JSON.stringify(this.headers, null, 2));
5859
+ const client = (0, client_1.createClient)({
5860
+ url: this.backendUrl + '/graphql',
5861
+ headers: this.headers,
5862
+ });
5863
+ let retValue = {};
5864
+ const fields = {
5865
+ label: true,
5866
+ description: true,
5867
+ photos: {
5868
+ _id: true,
5869
+ photo: {
5870
+ _id: true,
5871
+ name: true,
5872
+ contentType: true,
5873
+ size: true,
5874
+ useType: true,
5875
+ url: true,
5876
+ }
5877
+ }
5878
+ };
5879
+ try {
5880
+ const response = await client.query({
5881
+ getAthleteAlbums: {
5882
+ __args: {},
5883
+ ...fields
5884
+ },
5885
+ });
5886
+ console.log('getAthleteAlbums Response:');
5887
+ console.log(JSON.stringify(response, null, 2));
5888
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
5889
+ const isResponseOk = response?.getAthleteAlbums?.length > 0;
5890
+ return isResponseOk;
5891
+ });
5892
+ }
5893
+ catch (err1) {
5894
+ console.error('getAthleteAlbums err1:');
5895
+ console.error(err1);
5896
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5897
+ }
5898
+ console.log('retValue:');
5899
+ console.log(JSON.stringify(retValue, null, 2));
5900
+ return retValue;
5901
+ }
5902
+ async queryAthletesWithFilters(dto) {
5903
+ const client = (0, client_1.createClient)({
5904
+ url: this.backendUrl + "/graphql",
5905
+ headers: this.headers,
5906
+ });
5907
+ const fieldsAthlete = {
5908
+ _id: true,
5909
+ firstName: true,
5910
+ lastName: true,
5911
+ screenName: true,
5912
+ dob: true,
5913
+ lgbt: true,
5914
+ competitionGender: true,
5915
+ country: {
5916
+ _id: true,
5917
+ name: true
5918
+ },
5919
+ location: {
5920
+ userProvidedLatitude: true,
5921
+ userProvidedLongitude: true,
5922
+ cityNameGeocode: true,
5923
+ stateNameGeocode: true,
5924
+ countryIso2CodeGeocode: true,
5925
+ timeZoneGeocode: true,
5926
+ latitudeGeocode: true,
5927
+ longitudeGeocode: true,
5928
+ city: {
5929
+ _id: true,
5930
+ name: true,
5931
+ localizedName: true,
5932
+ state: {
5933
+ _id: true,
5934
+ name: true,
5935
+ country: {
5936
+ _id: true,
5937
+ name: true
5938
+ }
5939
+ },
5940
+ latitude: true,
5941
+ longitude: true,
5942
+ timezone: true,
5943
+ }
5944
+ },
5945
+ trainer: true,
5946
+ trainerUrl: true,
5947
+ aboutMe: true,
5948
+ mainSport: {
5949
+ _id: true,
5950
+ name: true
5951
+ },
5952
+ mainSportLevel: {
5953
+ _id: true,
5954
+ label: true,
5955
+ index: true
5956
+ },
5957
+ scores: {
5958
+ vtxScore: true,
5959
+ socialScore: true,
5960
+ trainingScore: true,
5961
+ competitionScore: true
5962
+ },
5963
+ competitions: {
5964
+ _id: true,
5965
+ event: {
5966
+ _id: true,
5967
+ name: true,
5968
+ mainSport: {
5969
+ _id: true,
5970
+ name: true
5971
+ },
5972
+ eventWebSite: true,
5973
+ startDate: true,
5974
+ endDate: true,
5975
+ verified: true,
5976
+ banner: {
5977
+ _id: true,
5978
+ name: true,
5979
+ contentType: true,
5980
+ size: true,
5981
+ useType: true,
5982
+ url: true,
5983
+ key: true
5984
+ },
5985
+ location: {
5986
+ _id: true,
5987
+ userProvidedLatitude: true,
5988
+ userProvidedLongitude: true,
5989
+ cityNameGeocode: true,
5990
+ stateNameGeocode: true,
5991
+ countryIso2CodeGeocode: true,
5992
+ timeZoneGeocode: true,
5993
+ latitudeGeocode: true,
5994
+ longitudeGeocode: true,
5995
+ city: {
5996
+ _id: true,
5997
+ name: true,
5998
+ localizedName: true,
5999
+ state: {
6000
+ _id: true,
6001
+ name: true,
6002
+ country: {
6003
+ _id: true,
6004
+ name: true
6005
+ }
6006
+ },
6007
+ latitude: true,
6008
+ longitude: true,
6009
+ timezone: true,
6010
+ }
6011
+ },
6012
+ },
6013
+ participationDate: true,
6014
+ result: {
6015
+ _id: true,
6016
+ resultType: true,
6017
+ position: true,
6018
+ score: true,
6019
+ finishTimeMS: true,
6020
+ resultWebLink: true
6021
+ }
6022
+ },
6023
+ totalUpcomingCompetitions: true,
6024
+ totalPastCompetitions: true,
6025
+ profilePicture: {
6026
+ _id: true,
6027
+ name: true,
6028
+ contentType: true,
6029
+ size: true,
6030
+ useType: true,
6031
+ url: true,
6032
+ key: true
6033
+ },
6034
+ cardPicture: {
6035
+ _id: true,
6036
+ name: true,
6037
+ contentType: true,
6038
+ size: true,
6039
+ useType: true,
6040
+ url: true,
6041
+ key: true
6042
+ },
6043
+ currentCampaign: {
6044
+ _id: true,
6045
+ budgetMode: true,
6046
+ status: true,
6047
+ title: true,
6048
+ motivation: true,
6049
+ website: true,
6050
+ fundsRequired: true,
6051
+ initialFundsObtained: true,
6052
+ fundsObtained: true,
6053
+ location: {
6054
+ _id: true,
6055
+ userProvidedLatitude: true,
6056
+ userProvidedLongitude: true,
6057
+ cityNameGeocode: true,
6058
+ stateNameGeocode: true,
6059
+ countryIso2CodeGeocode: true,
6060
+ timeZoneGeocode: true,
6061
+ latitudeGeocode: true,
6062
+ longitudeGeocode: true,
6063
+ city: {
6064
+ _id: true,
6065
+ name: true,
6066
+ localizedName: true,
6067
+ state: {
6068
+ _id: true,
6069
+ name: true,
6070
+ country: {
6071
+ _id: true,
6072
+ name: true
6073
+ }
6074
+ },
6075
+ latitude: true,
6076
+ longitude: true,
6077
+ timezone: true,
6078
+ }
6079
+ },
6080
+ endingDate: true,
6081
+ budget: {
6082
+ _id: true,
6083
+ initialFunds: true,
6084
+ totalRequired: true,
6085
+ items: {
6086
+ _id: true,
6087
+ quantity: true,
6088
+ concept: true,
6089
+ itemCost: true
6090
+ }
6091
+ },
6092
+ competitions: {
6093
+ _id: true,
6094
+ event: {
6095
+ _id: true,
6096
+ name: true,
6097
+ mainSport: {
6098
+ _id: true,
6099
+ name: true
6100
+ },
6101
+ eventWebSite: true,
6102
+ startDate: true,
6103
+ endDate: true,
6104
+ verified: true,
6105
+ banner: {
6106
+ _id: true,
6107
+ name: true,
6108
+ contentType: true,
6109
+ size: true,
6110
+ useType: true,
6111
+ url: true,
6112
+ key: true
6113
+ },
6114
+ location: {
6115
+ _id: true,
6116
+ userProvidedLatitude: true,
6117
+ userProvidedLongitude: true,
6118
+ cityNameGeocode: true,
6119
+ stateNameGeocode: true,
6120
+ countryIso2CodeGeocode: true,
6121
+ timeZoneGeocode: true,
6122
+ latitudeGeocode: true,
6123
+ longitudeGeocode: true,
6124
+ city: {
6125
+ _id: true,
6126
+ name: true,
6127
+ localizedName: true,
6128
+ state: {
6129
+ _id: true,
6130
+ name: true,
6131
+ country: {
6132
+ _id: true,
6133
+ name: true
6134
+ }
6135
+ },
6136
+ latitude: true,
6137
+ longitude: true,
6138
+ timezone: true,
6139
+ }
6140
+ },
6141
+ },
6142
+ participationDate: true,
6143
+ result: {
6144
+ _id: true,
6145
+ resultType: true,
6146
+ position: true,
6147
+ score: true,
6148
+ finishTimeMS: true,
6149
+ resultWebLink: true
6150
+ }
6151
+ }
6152
+ }
6153
+ };
6154
+ const fields = {
6155
+ athletes: fieldsAthlete,
6156
+ cursor: {
6157
+ sort: {
6158
+ sortField: true,
6159
+ order: true
6160
+ },
6161
+ initialCursorId: true,
6162
+ nextCursorId: true,
6163
+ initialCursorValue: true,
6164
+ nextCursorValue: true,
6165
+ limit: true,
6166
+ retrieved: true,
6167
+ isLastPage: true
6168
+ }
6169
+ };
6170
+ let retValue;
6171
+ try {
6172
+ const response = await client.query({
6173
+ queryAthleteWithFilter: {
6174
+ __args: { input: dto },
6175
+ ...fields
6176
+ }
6177
+ });
6178
+ VTXBaseAPI.Logger.debug('queryAthletesWithFilters Response:');
6179
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
6180
+ retValue = (0, response_builder_1.buildResponse)(response, 'queryAthletesWithFilters', (r) => {
6181
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
6182
+ const isResponseOk = true && Array.isArray(response?.queryAthletesWithFilters?.athletes);
6183
+ return isResponseOk;
6184
+ });
6185
+ }
6186
+ catch (err1) {
6187
+ VTXBaseAPI.Logger.error('queryAthleteFundingCampaigns err1:');
6188
+ VTXBaseAPI.Logger.error(err1);
6189
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
6190
+ }
6191
+ return retValue;
6192
+ }
5721
6193
  }
5722
6194
  exports.VTXBaseAPI = VTXBaseAPI;
5723
6195
  VTXBaseAPI.Logger = {