@vertikalx/vtx-backend-client 1.0.0-dev-david.2 → 1.0.0-dev-carlos.28
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 +9 -10
- package/src/api/vtx-base-api.js +215 -186
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +191 -74
- package/src/client/schema.js +65 -16
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +77 -36
- package/src/client/types.js +323 -224
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult,
|
|
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, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
|
-
import { VerificationCodeType } from '@stackbus/common-types';
|
|
5
4
|
export declare class VTXBaseAPI {
|
|
6
5
|
protected headers: APICallHeaders;
|
|
7
6
|
protected backendUrl: string;
|
|
@@ -77,18 +76,18 @@ export declare class VTXBaseAPI {
|
|
|
77
76
|
setFundingStatus(dto: SetFundingStatusDto, desiredFields?: FundRaisingCampaignGenqlSelection): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
78
77
|
findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
79
78
|
editPicture(newPicDto: EditPictureDto): Promise<ITypedBackendResponse<EditPictureResponse>>;
|
|
79
|
+
DeletePictureFromBuket(deleteDto: AWSS3DeleteUseTypeFileDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
80
80
|
addAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<AddValuesResponse>>;
|
|
81
81
|
createAthleteAlbum(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
|
|
82
82
|
deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
83
83
|
getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
|
|
84
|
-
getAthleteAlbumsById(
|
|
85
|
-
getAndSetAlbumById(albumId: string): Promise<ITypedBackendResponse<Album>>;
|
|
84
|
+
getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
|
|
86
85
|
queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
getAthleteStravaIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
87
|
+
getAthleteInstagramIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
88
|
+
getAthleteIntegrations(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
89
|
+
updateAthleteIntegration(type: string): Promise<ITypedBackendResponse<boolean>>;
|
|
89
90
|
deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
|
|
93
|
-
resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
91
|
+
saveAthleteCompetitionResult(dto: SetCompetitionResultDto): Promise<ITypedBackendResponse<AthleteCompetitionResult>>;
|
|
92
|
+
updateAthleteTpiScore(): Promise<ITypedBackendResponse<Athlete>>;
|
|
94
93
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -1829,11 +1829,11 @@ class VTXBaseAPI {
|
|
|
1829
1829
|
url: this.backendUrl + "/graphql",
|
|
1830
1830
|
headers: this.headers,
|
|
1831
1831
|
});
|
|
1832
|
-
let retValue;
|
|
1833
1832
|
const fields = {
|
|
1834
1833
|
_id: true,
|
|
1835
1834
|
name: true,
|
|
1836
1835
|
};
|
|
1836
|
+
let retValue;
|
|
1837
1837
|
try {
|
|
1838
1838
|
const response = await client.query({
|
|
1839
1839
|
getCountries: {
|
|
@@ -2229,12 +2229,7 @@ class VTXBaseAPI {
|
|
|
2229
2229
|
},
|
|
2230
2230
|
preferences: {
|
|
2231
2231
|
_id: true,
|
|
2232
|
-
showProfileHelper: true
|
|
2233
|
-
defaultAlbum: {
|
|
2234
|
-
_id: true,
|
|
2235
|
-
label: true,
|
|
2236
|
-
description: true,
|
|
2237
|
-
}
|
|
2232
|
+
showProfileHelper: true
|
|
2238
2233
|
},
|
|
2239
2234
|
currentCampaign: {
|
|
2240
2235
|
_id: true,
|
|
@@ -5712,6 +5707,45 @@ class VTXBaseAPI {
|
|
|
5712
5707
|
}
|
|
5713
5708
|
return retValue;
|
|
5714
5709
|
}
|
|
5710
|
+
async DeletePictureFromBuket(deleteDto) {
|
|
5711
|
+
console.log('HEADERS:');
|
|
5712
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5713
|
+
const client = (0, client_1.createClient)({
|
|
5714
|
+
url: this.backendUrl + '/graphql',
|
|
5715
|
+
headers: this.headers,
|
|
5716
|
+
});
|
|
5717
|
+
let retValue = {};
|
|
5718
|
+
const fields = {
|
|
5719
|
+
idToDelete: true,
|
|
5720
|
+
deleted: true,
|
|
5721
|
+
failureReason: {
|
|
5722
|
+
code: true,
|
|
5723
|
+
message: true
|
|
5724
|
+
}
|
|
5725
|
+
};
|
|
5726
|
+
try {
|
|
5727
|
+
const response = await client.mutation({
|
|
5728
|
+
DeletePictureBuket: {
|
|
5729
|
+
__args: {
|
|
5730
|
+
input: deleteDto
|
|
5731
|
+
},
|
|
5732
|
+
...fields
|
|
5733
|
+
},
|
|
5734
|
+
});
|
|
5735
|
+
VTXBaseAPI.Logger.debug('deletePicture Response:');
|
|
5736
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5737
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'DeletePictureBuket', (r) => {
|
|
5738
|
+
const isResponseOk = true && response?.DeletePictureBuket?.idToDelete;
|
|
5739
|
+
return isResponseOk;
|
|
5740
|
+
});
|
|
5741
|
+
}
|
|
5742
|
+
catch (err1) {
|
|
5743
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
5744
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5745
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5746
|
+
}
|
|
5747
|
+
return retValue;
|
|
5748
|
+
}
|
|
5715
5749
|
async addAlbumsPictures(dto) {
|
|
5716
5750
|
console.log('HEADERS:');
|
|
5717
5751
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
@@ -5789,7 +5823,7 @@ class VTXBaseAPI {
|
|
|
5789
5823
|
console.log('createAthleteAlbum Response:');
|
|
5790
5824
|
console.log(JSON.stringify(response, null, 2));
|
|
5791
5825
|
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
|
|
5792
|
-
const isResponseOk = response?.createAthleteAlbum?.
|
|
5826
|
+
const isResponseOk = response?.createAthleteAlbum?._id;
|
|
5793
5827
|
return isResponseOk;
|
|
5794
5828
|
});
|
|
5795
5829
|
}
|
|
@@ -5850,9 +5884,8 @@ class VTXBaseAPI {
|
|
|
5850
5884
|
url: this.backendUrl + '/graphql',
|
|
5851
5885
|
headers: this.headers,
|
|
5852
5886
|
});
|
|
5853
|
-
let retValue;
|
|
5887
|
+
let retValue = {};
|
|
5854
5888
|
const fields = {
|
|
5855
|
-
_id: true,
|
|
5856
5889
|
label: true,
|
|
5857
5890
|
description: true,
|
|
5858
5891
|
photos: {
|
|
@@ -5877,7 +5910,7 @@ class VTXBaseAPI {
|
|
|
5877
5910
|
console.log('getAthleteAlbums Response:');
|
|
5878
5911
|
console.log(JSON.stringify(response, null, 2));
|
|
5879
5912
|
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5880
|
-
const isResponseOk = response?.getAthleteAlbums
|
|
5913
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
5881
5914
|
return isResponseOk;
|
|
5882
5915
|
});
|
|
5883
5916
|
}
|
|
@@ -5890,7 +5923,7 @@ class VTXBaseAPI {
|
|
|
5890
5923
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5891
5924
|
return retValue;
|
|
5892
5925
|
}
|
|
5893
|
-
async getAthleteAlbumsById(
|
|
5926
|
+
async getAthleteAlbumsById() {
|
|
5894
5927
|
console.log('HEADERS:');
|
|
5895
5928
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5896
5929
|
const client = (0, client_1.createClient)({
|
|
@@ -5915,71 +5948,20 @@ class VTXBaseAPI {
|
|
|
5915
5948
|
};
|
|
5916
5949
|
try {
|
|
5917
5950
|
const response = await client.query({
|
|
5918
|
-
|
|
5919
|
-
__args: {
|
|
5920
|
-
input: albumId
|
|
5921
|
-
},
|
|
5922
|
-
...fields
|
|
5923
|
-
},
|
|
5924
|
-
});
|
|
5925
|
-
console.log('getAthleteAlbumId Response:');
|
|
5926
|
-
console.log(JSON.stringify(response, null, 2));
|
|
5927
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
|
|
5928
|
-
const isResponseOk = response?.getAthleteAlbumId?._id;
|
|
5929
|
-
return isResponseOk;
|
|
5930
|
-
});
|
|
5931
|
-
}
|
|
5932
|
-
catch (err1) {
|
|
5933
|
-
console.error('getAthleteAlbumId err1:');
|
|
5934
|
-
console.error(err1);
|
|
5935
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5936
|
-
}
|
|
5937
|
-
console.log('retValue:');
|
|
5938
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
5939
|
-
return retValue;
|
|
5940
|
-
}
|
|
5941
|
-
async getAndSetAlbumById(albumId) {
|
|
5942
|
-
console.log('HEADERS:');
|
|
5943
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
5944
|
-
const client = (0, client_1.createClient)({
|
|
5945
|
-
url: this.backendUrl + '/graphql',
|
|
5946
|
-
headers: this.headers,
|
|
5947
|
-
});
|
|
5948
|
-
let retValue = {};
|
|
5949
|
-
const fields = {
|
|
5950
|
-
_id: true,
|
|
5951
|
-
label: true,
|
|
5952
|
-
description: true,
|
|
5953
|
-
photos: {
|
|
5954
|
-
_id: true,
|
|
5955
|
-
photo: {
|
|
5956
|
-
_id: true,
|
|
5957
|
-
name: true,
|
|
5958
|
-
contentType: true,
|
|
5959
|
-
size: true,
|
|
5960
|
-
useType: true,
|
|
5961
|
-
url: true,
|
|
5962
|
-
}
|
|
5963
|
-
}
|
|
5964
|
-
};
|
|
5965
|
-
try {
|
|
5966
|
-
const response = await client.query({
|
|
5967
|
-
getAndSetAlbumById: {
|
|
5968
|
-
__args: {
|
|
5969
|
-
input: albumId
|
|
5970
|
-
},
|
|
5951
|
+
getAthleteAlbums: {
|
|
5952
|
+
__args: {},
|
|
5971
5953
|
...fields
|
|
5972
5954
|
},
|
|
5973
5955
|
});
|
|
5974
|
-
console.log('
|
|
5956
|
+
console.log('getAthleteAlbums Response:');
|
|
5975
5957
|
console.log(JSON.stringify(response, null, 2));
|
|
5976
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5977
|
-
const isResponseOk = response?.
|
|
5958
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5959
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
5978
5960
|
return isResponseOk;
|
|
5979
5961
|
});
|
|
5980
5962
|
}
|
|
5981
5963
|
catch (err1) {
|
|
5982
|
-
console.error('
|
|
5964
|
+
console.error('getAthleteAlbums err1:');
|
|
5983
5965
|
console.error(err1);
|
|
5984
5966
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5985
5967
|
}
|
|
@@ -6278,7 +6260,7 @@ class VTXBaseAPI {
|
|
|
6278
6260
|
}
|
|
6279
6261
|
return retValue;
|
|
6280
6262
|
}
|
|
6281
|
-
async
|
|
6263
|
+
async getAthleteStravaIntegration() {
|
|
6282
6264
|
const client = (0, client_1.createClient)({
|
|
6283
6265
|
url: this.backendUrl + '/graphql',
|
|
6284
6266
|
headers: this.headers,
|
|
@@ -6310,12 +6292,12 @@ class VTXBaseAPI {
|
|
|
6310
6292
|
};
|
|
6311
6293
|
try {
|
|
6312
6294
|
const response = await client.query({
|
|
6313
|
-
|
|
6295
|
+
getAthleteStravaIntegration: {
|
|
6314
6296
|
...fields
|
|
6315
6297
|
},
|
|
6316
6298
|
});
|
|
6317
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6318
|
-
const isResponseOk = !!response?.
|
|
6299
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
|
|
6300
|
+
const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
|
|
6319
6301
|
return isResponseOk;
|
|
6320
6302
|
});
|
|
6321
6303
|
}
|
|
@@ -6324,18 +6306,64 @@ class VTXBaseAPI {
|
|
|
6324
6306
|
}
|
|
6325
6307
|
return retValue;
|
|
6326
6308
|
}
|
|
6327
|
-
async
|
|
6309
|
+
async getAthleteInstagramIntegration() {
|
|
6328
6310
|
const client = (0, client_1.createClient)({
|
|
6329
6311
|
url: this.backendUrl + '/graphql',
|
|
6330
6312
|
headers: this.headers,
|
|
6331
6313
|
});
|
|
6332
6314
|
let retValue = {};
|
|
6315
|
+
const fields = {
|
|
6316
|
+
_id: true,
|
|
6317
|
+
athlete: {
|
|
6318
|
+
_id: true,
|
|
6319
|
+
},
|
|
6320
|
+
hasInstagramIntegration: true,
|
|
6321
|
+
instagramTokenExpires: true,
|
|
6322
|
+
instagramUserData: {
|
|
6323
|
+
user_id: true,
|
|
6324
|
+
username: true,
|
|
6325
|
+
name: true,
|
|
6326
|
+
account_type: true,
|
|
6327
|
+
followers_count: true,
|
|
6328
|
+
media_count: true
|
|
6329
|
+
},
|
|
6330
|
+
instagramMediaData: {
|
|
6331
|
+
data: {
|
|
6332
|
+
id: true,
|
|
6333
|
+
caption: true,
|
|
6334
|
+
media_type: true,
|
|
6335
|
+
media_url: true,
|
|
6336
|
+
permalink: true,
|
|
6337
|
+
thumbnail_url: true,
|
|
6338
|
+
timestamp: true,
|
|
6339
|
+
username: true,
|
|
6340
|
+
like_count: true,
|
|
6341
|
+
comments_count: true,
|
|
6342
|
+
insights: {
|
|
6343
|
+
data: {
|
|
6344
|
+
name: true,
|
|
6345
|
+
period: true,
|
|
6346
|
+
values: true
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
},
|
|
6350
|
+
paging: {
|
|
6351
|
+
cursors: {
|
|
6352
|
+
before: true,
|
|
6353
|
+
after: true
|
|
6354
|
+
},
|
|
6355
|
+
next: true
|
|
6356
|
+
}
|
|
6357
|
+
}
|
|
6358
|
+
};
|
|
6333
6359
|
try {
|
|
6334
|
-
const response = await client.
|
|
6335
|
-
|
|
6360
|
+
const response = await client.query({
|
|
6361
|
+
getAthleteInstagramIntegration: {
|
|
6362
|
+
...fields
|
|
6363
|
+
},
|
|
6336
6364
|
});
|
|
6337
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6338
|
-
const isResponseOk = response?.
|
|
6365
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
|
|
6366
|
+
const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
|
|
6339
6367
|
return isResponseOk;
|
|
6340
6368
|
});
|
|
6341
6369
|
}
|
|
@@ -6344,83 +6372,115 @@ class VTXBaseAPI {
|
|
|
6344
6372
|
}
|
|
6345
6373
|
return retValue;
|
|
6346
6374
|
}
|
|
6347
|
-
async
|
|
6348
|
-
console.log('HEADERS:');
|
|
6349
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6375
|
+
async getAthleteIntegrations() {
|
|
6350
6376
|
const client = (0, client_1.createClient)({
|
|
6351
6377
|
url: this.backendUrl + '/graphql',
|
|
6352
6378
|
headers: this.headers,
|
|
6353
6379
|
});
|
|
6354
6380
|
let retValue = {};
|
|
6355
6381
|
const fields = {
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6382
|
+
_id: true,
|
|
6383
|
+
athlete: {
|
|
6384
|
+
_id: true,
|
|
6385
|
+
},
|
|
6386
|
+
hasStravaIntegration: true,
|
|
6387
|
+
stravaTokenExpires: true,
|
|
6388
|
+
stravaAthleteData: {
|
|
6389
|
+
id: true,
|
|
6390
|
+
username: true,
|
|
6391
|
+
firstname: true,
|
|
6392
|
+
lastname: true,
|
|
6393
|
+
bio: true,
|
|
6394
|
+
city: true,
|
|
6395
|
+
state: true,
|
|
6396
|
+
country: true,
|
|
6397
|
+
sex: true,
|
|
6398
|
+
premium: true,
|
|
6399
|
+
profile: true,
|
|
6400
|
+
created_at: true,
|
|
6401
|
+
updated_at: true,
|
|
6402
|
+
weight: true
|
|
6403
|
+
},
|
|
6404
|
+
hasInstagramIntegration: true,
|
|
6405
|
+
instagramTokenExpires: true,
|
|
6406
|
+
instagramUserData: {
|
|
6407
|
+
user_id: true,
|
|
6408
|
+
username: true,
|
|
6409
|
+
name: true,
|
|
6410
|
+
account_type: true,
|
|
6411
|
+
followers_count: true,
|
|
6412
|
+
media_count: true
|
|
6413
|
+
},
|
|
6414
|
+
instagramMediaData: {
|
|
6415
|
+
data: {
|
|
6416
|
+
id: true,
|
|
6417
|
+
caption: true,
|
|
6418
|
+
media_type: true,
|
|
6419
|
+
media_url: true,
|
|
6420
|
+
permalink: true,
|
|
6421
|
+
thumbnail_url: true,
|
|
6422
|
+
timestamp: true,
|
|
6423
|
+
username: true,
|
|
6424
|
+
like_count: true,
|
|
6425
|
+
comments_count: true,
|
|
6426
|
+
insights: {
|
|
6427
|
+
data: {
|
|
6428
|
+
name: true,
|
|
6429
|
+
period: true,
|
|
6430
|
+
values: true
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
},
|
|
6434
|
+
paging: {
|
|
6435
|
+
cursors: {
|
|
6436
|
+
before: true,
|
|
6437
|
+
after: true
|
|
6438
|
+
},
|
|
6439
|
+
next: true
|
|
6440
|
+
}
|
|
6441
|
+
}
|
|
6360
6442
|
};
|
|
6361
6443
|
try {
|
|
6362
|
-
const response = await client.
|
|
6363
|
-
|
|
6364
|
-
__args: {
|
|
6365
|
-
input: dto
|
|
6366
|
-
},
|
|
6444
|
+
const response = await client.query({
|
|
6445
|
+
getAthleteIntegrations: {
|
|
6367
6446
|
...fields
|
|
6368
6447
|
},
|
|
6369
6448
|
});
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6373
|
-
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6449
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6450
|
+
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6374
6451
|
return isResponseOk;
|
|
6375
6452
|
});
|
|
6376
6453
|
}
|
|
6377
|
-
catch (
|
|
6378
|
-
|
|
6379
|
-
console.error(err1);
|
|
6380
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6454
|
+
catch (err) {
|
|
6455
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6381
6456
|
}
|
|
6382
|
-
console.log('retValue:');
|
|
6383
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6384
6457
|
return retValue;
|
|
6385
6458
|
}
|
|
6386
|
-
async
|
|
6387
|
-
console.log('HEADERS:');
|
|
6388
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6459
|
+
async updateAthleteIntegration(type) {
|
|
6389
6460
|
const client = (0, client_1.createClient)({
|
|
6390
6461
|
url: this.backendUrl + '/graphql',
|
|
6391
6462
|
headers: this.headers,
|
|
6392
6463
|
});
|
|
6393
6464
|
let retValue = {};
|
|
6394
|
-
const fields = {
|
|
6395
|
-
field: true,
|
|
6396
|
-
changed: true,
|
|
6397
|
-
};
|
|
6398
6465
|
try {
|
|
6399
6466
|
const response = await client.mutation({
|
|
6400
|
-
|
|
6467
|
+
updateAthleteIntegration: {
|
|
6401
6468
|
__args: {
|
|
6402
|
-
|
|
6469
|
+
type: type
|
|
6403
6470
|
},
|
|
6404
|
-
|
|
6405
|
-
},
|
|
6471
|
+
}
|
|
6406
6472
|
});
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6410
|
-
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6473
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteIntegration', (r) => {
|
|
6474
|
+
const isResponseOk = response?.updateAthleteIntegration === true;
|
|
6411
6475
|
return isResponseOk;
|
|
6412
6476
|
});
|
|
6413
6477
|
}
|
|
6414
|
-
catch (
|
|
6415
|
-
|
|
6416
|
-
console.error(err1);
|
|
6417
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6478
|
+
catch (err) {
|
|
6479
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6418
6480
|
}
|
|
6419
|
-
console.log('retValue:');
|
|
6420
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6421
6481
|
return retValue;
|
|
6422
6482
|
}
|
|
6423
|
-
async
|
|
6483
|
+
async deleteUploadedTypeKeyFile(dto) {
|
|
6424
6484
|
console.log('HEADERS:');
|
|
6425
6485
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
6426
6486
|
const client = (0, client_1.createClient)({
|
|
@@ -6429,31 +6489,29 @@ class VTXBaseAPI {
|
|
|
6429
6489
|
});
|
|
6430
6490
|
let retValue = {};
|
|
6431
6491
|
const fields = {
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
isExpired: true,
|
|
6437
|
-
createdDate: true,
|
|
6492
|
+
httpStatus: true,
|
|
6493
|
+
result: true,
|
|
6494
|
+
message: true,
|
|
6495
|
+
errors: true
|
|
6438
6496
|
};
|
|
6439
6497
|
try {
|
|
6440
|
-
const response = await client.
|
|
6441
|
-
|
|
6498
|
+
const response = await client.mutation({
|
|
6499
|
+
deleteUploadedTypeKeyFile: {
|
|
6442
6500
|
__args: {
|
|
6443
|
-
input:
|
|
6501
|
+
input: dto
|
|
6444
6502
|
},
|
|
6445
6503
|
...fields
|
|
6446
6504
|
},
|
|
6447
6505
|
});
|
|
6448
|
-
console.log('
|
|
6506
|
+
console.log('deleteUploadedTypeKeyFile Response:');
|
|
6449
6507
|
console.log(JSON.stringify(response, null, 2));
|
|
6450
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6451
|
-
const isResponseOk = response?.
|
|
6508
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6509
|
+
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6452
6510
|
return isResponseOk;
|
|
6453
6511
|
});
|
|
6454
6512
|
}
|
|
6455
6513
|
catch (err1) {
|
|
6456
|
-
console.error('
|
|
6514
|
+
console.error('deleteUploadedTypeKeyFile err1:');
|
|
6457
6515
|
console.error(err1);
|
|
6458
6516
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6459
6517
|
}
|
|
@@ -6461,90 +6519,61 @@ class VTXBaseAPI {
|
|
|
6461
6519
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6462
6520
|
return retValue;
|
|
6463
6521
|
}
|
|
6464
|
-
async
|
|
6465
|
-
console.log('HEADERS:');
|
|
6466
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6522
|
+
async saveAthleteCompetitionResult(dto) {
|
|
6467
6523
|
const client = (0, client_1.createClient)({
|
|
6468
6524
|
url: this.backendUrl + '/graphql',
|
|
6469
6525
|
headers: this.headers,
|
|
6470
6526
|
});
|
|
6471
6527
|
let retValue = {};
|
|
6472
6528
|
const fields = {
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
isExpired: true,
|
|
6480
|
-
createdDate: true,
|
|
6481
|
-
},
|
|
6482
|
-
error: {
|
|
6483
|
-
errorCode: true,
|
|
6484
|
-
errorMessage: true,
|
|
6485
|
-
}
|
|
6529
|
+
_id: true,
|
|
6530
|
+
resultType: true,
|
|
6531
|
+
position: true,
|
|
6532
|
+
score: true,
|
|
6533
|
+
finishTimeMS: true,
|
|
6534
|
+
resultWebLink: true,
|
|
6486
6535
|
};
|
|
6487
6536
|
try {
|
|
6488
|
-
const response = await client.
|
|
6489
|
-
|
|
6537
|
+
const response = await client.mutation({
|
|
6538
|
+
saveAthleteCompetitionResult: {
|
|
6490
6539
|
__args: {
|
|
6491
|
-
input:
|
|
6540
|
+
input: dto
|
|
6492
6541
|
},
|
|
6493
6542
|
...fields
|
|
6494
6543
|
},
|
|
6495
6544
|
});
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6499
|
-
const isResponseOk =
|
|
6545
|
+
VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
|
|
6546
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
6547
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
|
|
6548
|
+
const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
|
|
6500
6549
|
return isResponseOk;
|
|
6501
6550
|
});
|
|
6502
6551
|
}
|
|
6503
6552
|
catch (err1) {
|
|
6504
|
-
|
|
6505
|
-
|
|
6553
|
+
VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
|
|
6554
|
+
VTXBaseAPI.Logger.error(err1);
|
|
6506
6555
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6507
6556
|
}
|
|
6508
|
-
console.log('retValue:');
|
|
6509
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6510
6557
|
return retValue;
|
|
6511
6558
|
}
|
|
6512
|
-
async
|
|
6513
|
-
console.log('HEADERS:');
|
|
6514
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6559
|
+
async updateAthleteTpiScore() {
|
|
6515
6560
|
const client = (0, client_1.createClient)({
|
|
6516
6561
|
url: this.backendUrl + '/graphql',
|
|
6517
6562
|
headers: this.headers,
|
|
6518
6563
|
});
|
|
6519
6564
|
let retValue = {};
|
|
6520
|
-
const fields = {
|
|
6521
|
-
field: true,
|
|
6522
|
-
changed: true,
|
|
6523
|
-
};
|
|
6524
6565
|
try {
|
|
6525
6566
|
const response = await client.mutation({
|
|
6526
|
-
|
|
6527
|
-
__args: {
|
|
6528
|
-
input: input
|
|
6529
|
-
},
|
|
6530
|
-
...fields
|
|
6531
|
-
},
|
|
6567
|
+
updateAthleteTpiScore: {},
|
|
6532
6568
|
});
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'resetUserPassword', (r) => {
|
|
6536
|
-
const isResponseOk = response?.resetUserPassword?.changed;
|
|
6537
|
-
;
|
|
6569
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteTpiScore', (r) => {
|
|
6570
|
+
const isResponseOk = !!response?.updateAthleteTpiScore?._id;
|
|
6538
6571
|
return isResponseOk;
|
|
6539
6572
|
});
|
|
6540
6573
|
}
|
|
6541
|
-
catch (
|
|
6542
|
-
|
|
6543
|
-
console.error(err1);
|
|
6544
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6574
|
+
catch (err) {
|
|
6575
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6545
6576
|
}
|
|
6546
|
-
console.log('retValue:');
|
|
6547
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6548
6577
|
return retValue;
|
|
6549
6578
|
}
|
|
6550
6579
|
}
|