@vertikalx/vtx-backend-client 1.0.0-dev-geo.78 → 1.0.0-dev-carlos.31
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 -12
- package/src/api/vtx-base-api.js +206 -274
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +209 -104
- package/src/client/schema.js +72 -23
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +85 -50
- package/src/client/types.js +339 -258
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
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,
|
|
@@ -5310,22 +5305,6 @@ class VTXBaseAPI {
|
|
|
5310
5305
|
timezone: true,
|
|
5311
5306
|
}
|
|
5312
5307
|
},
|
|
5313
|
-
albums: {
|
|
5314
|
-
_id: true,
|
|
5315
|
-
label: true,
|
|
5316
|
-
description: true,
|
|
5317
|
-
photos: {
|
|
5318
|
-
photo: {
|
|
5319
|
-
_id: true,
|
|
5320
|
-
name: true,
|
|
5321
|
-
contentType: true,
|
|
5322
|
-
size: true,
|
|
5323
|
-
useType: true,
|
|
5324
|
-
url: true,
|
|
5325
|
-
key: true,
|
|
5326
|
-
},
|
|
5327
|
-
},
|
|
5328
|
-
},
|
|
5329
5308
|
trainer: true,
|
|
5330
5309
|
trainerUrl: true,
|
|
5331
5310
|
aboutMe: true,
|
|
@@ -5728,7 +5707,7 @@ class VTXBaseAPI {
|
|
|
5728
5707
|
}
|
|
5729
5708
|
return retValue;
|
|
5730
5709
|
}
|
|
5731
|
-
async
|
|
5710
|
+
async DeletePictureFromBuket(deleteDto) {
|
|
5732
5711
|
console.log('HEADERS:');
|
|
5733
5712
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5734
5713
|
const client = (0, client_1.createClient)({
|
|
@@ -5737,40 +5716,37 @@ class VTXBaseAPI {
|
|
|
5737
5716
|
});
|
|
5738
5717
|
let retValue = {};
|
|
5739
5718
|
const fields = {
|
|
5740
|
-
|
|
5741
|
-
|
|
5719
|
+
idToDelete: true,
|
|
5720
|
+
deleted: true,
|
|
5742
5721
|
failureReason: {
|
|
5743
5722
|
code: true,
|
|
5744
5723
|
message: true
|
|
5745
|
-
}
|
|
5746
|
-
result: true,
|
|
5724
|
+
}
|
|
5747
5725
|
};
|
|
5748
5726
|
try {
|
|
5749
5727
|
const response = await client.mutation({
|
|
5750
|
-
|
|
5728
|
+
DeletePictureBuket: {
|
|
5751
5729
|
__args: {
|
|
5752
|
-
input:
|
|
5730
|
+
input: deleteDto
|
|
5753
5731
|
},
|
|
5754
5732
|
...fields
|
|
5755
5733
|
},
|
|
5756
5734
|
});
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5760
|
-
const isResponseOk =
|
|
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;
|
|
5761
5739
|
return isResponseOk;
|
|
5762
5740
|
});
|
|
5763
5741
|
}
|
|
5764
5742
|
catch (err1) {
|
|
5765
|
-
|
|
5766
|
-
|
|
5743
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
5744
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5767
5745
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5768
5746
|
}
|
|
5769
|
-
console.log('retValue:');
|
|
5770
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
5771
5747
|
return retValue;
|
|
5772
5748
|
}
|
|
5773
|
-
async
|
|
5749
|
+
async addAlbumsPictures(dto) {
|
|
5774
5750
|
console.log('HEADERS:');
|
|
5775
5751
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5776
5752
|
const client = (0, client_1.createClient)({
|
|
@@ -5779,38 +5755,32 @@ class VTXBaseAPI {
|
|
|
5779
5755
|
});
|
|
5780
5756
|
let retValue = {};
|
|
5781
5757
|
const fields = {
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
contentType: true,
|
|
5790
|
-
size: true,
|
|
5791
|
-
useType: true,
|
|
5792
|
-
url: true,
|
|
5793
|
-
}
|
|
5794
|
-
}
|
|
5758
|
+
added: true,
|
|
5759
|
+
failedToAdd: true,
|
|
5760
|
+
failureReason: {
|
|
5761
|
+
code: true,
|
|
5762
|
+
message: true
|
|
5763
|
+
},
|
|
5764
|
+
result: true,
|
|
5795
5765
|
};
|
|
5796
5766
|
try {
|
|
5797
5767
|
const response = await client.mutation({
|
|
5798
|
-
|
|
5768
|
+
AddAlbumPictures: {
|
|
5799
5769
|
__args: {
|
|
5800
5770
|
input: dto
|
|
5801
5771
|
},
|
|
5802
5772
|
...fields
|
|
5803
5773
|
},
|
|
5804
5774
|
});
|
|
5805
|
-
console.log('
|
|
5775
|
+
console.log('AddAlbumsPictures Response:');
|
|
5806
5776
|
console.log(JSON.stringify(response, null, 2));
|
|
5807
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5808
|
-
const isResponseOk = response?.
|
|
5777
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'AddAlbumPictures', (r) => {
|
|
5778
|
+
const isResponseOk = response?.AddAlbumPictures?.result === 'success' || response?.AddAlbumPictures?.result === 'partial';
|
|
5809
5779
|
return isResponseOk;
|
|
5810
5780
|
});
|
|
5811
5781
|
}
|
|
5812
5782
|
catch (err1) {
|
|
5813
|
-
console.error('
|
|
5783
|
+
console.error('addPictures err1:');
|
|
5814
5784
|
console.error(err1);
|
|
5815
5785
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5816
5786
|
}
|
|
@@ -5853,7 +5823,7 @@ class VTXBaseAPI {
|
|
|
5853
5823
|
console.log('createAthleteAlbum Response:');
|
|
5854
5824
|
console.log(JSON.stringify(response, null, 2));
|
|
5855
5825
|
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
|
|
5856
|
-
const isResponseOk = response?.createAthleteAlbum?.
|
|
5826
|
+
const isResponseOk = response?.createAthleteAlbum?._id;
|
|
5857
5827
|
return isResponseOk;
|
|
5858
5828
|
});
|
|
5859
5829
|
}
|
|
@@ -5914,9 +5884,8 @@ class VTXBaseAPI {
|
|
|
5914
5884
|
url: this.backendUrl + '/graphql',
|
|
5915
5885
|
headers: this.headers,
|
|
5916
5886
|
});
|
|
5917
|
-
let retValue;
|
|
5887
|
+
let retValue = {};
|
|
5918
5888
|
const fields = {
|
|
5919
|
-
_id: true,
|
|
5920
5889
|
label: true,
|
|
5921
5890
|
description: true,
|
|
5922
5891
|
photos: {
|
|
@@ -5941,7 +5910,7 @@ class VTXBaseAPI {
|
|
|
5941
5910
|
console.log('getAthleteAlbums Response:');
|
|
5942
5911
|
console.log(JSON.stringify(response, null, 2));
|
|
5943
5912
|
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5944
|
-
const isResponseOk = response?.getAthleteAlbums
|
|
5913
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
5945
5914
|
return isResponseOk;
|
|
5946
5915
|
});
|
|
5947
5916
|
}
|
|
@@ -5954,7 +5923,7 @@ class VTXBaseAPI {
|
|
|
5954
5923
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5955
5924
|
return retValue;
|
|
5956
5925
|
}
|
|
5957
|
-
async getAthleteAlbumsById(
|
|
5926
|
+
async getAthleteAlbumsById() {
|
|
5958
5927
|
console.log('HEADERS:');
|
|
5959
5928
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5960
5929
|
const client = (0, client_1.createClient)({
|
|
@@ -5979,71 +5948,20 @@ class VTXBaseAPI {
|
|
|
5979
5948
|
};
|
|
5980
5949
|
try {
|
|
5981
5950
|
const response = await client.query({
|
|
5982
|
-
|
|
5983
|
-
__args: {
|
|
5984
|
-
input: albumId
|
|
5985
|
-
},
|
|
5986
|
-
...fields
|
|
5987
|
-
},
|
|
5988
|
-
});
|
|
5989
|
-
console.log('getAthleteAlbumId Response:');
|
|
5990
|
-
console.log(JSON.stringify(response, null, 2));
|
|
5991
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
|
|
5992
|
-
const isResponseOk = response?.getAthleteAlbumId?._id;
|
|
5993
|
-
return isResponseOk;
|
|
5994
|
-
});
|
|
5995
|
-
}
|
|
5996
|
-
catch (err1) {
|
|
5997
|
-
console.error('getAthleteAlbumId err1:');
|
|
5998
|
-
console.error(err1);
|
|
5999
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6000
|
-
}
|
|
6001
|
-
console.log('retValue:');
|
|
6002
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6003
|
-
return retValue;
|
|
6004
|
-
}
|
|
6005
|
-
async getAndSetAlbumById(albumId) {
|
|
6006
|
-
console.log('HEADERS:');
|
|
6007
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6008
|
-
const client = (0, client_1.createClient)({
|
|
6009
|
-
url: this.backendUrl + '/graphql',
|
|
6010
|
-
headers: this.headers,
|
|
6011
|
-
});
|
|
6012
|
-
let retValue = {};
|
|
6013
|
-
const fields = {
|
|
6014
|
-
_id: true,
|
|
6015
|
-
label: true,
|
|
6016
|
-
description: true,
|
|
6017
|
-
photos: {
|
|
6018
|
-
_id: true,
|
|
6019
|
-
photo: {
|
|
6020
|
-
_id: true,
|
|
6021
|
-
name: true,
|
|
6022
|
-
contentType: true,
|
|
6023
|
-
size: true,
|
|
6024
|
-
useType: true,
|
|
6025
|
-
url: true,
|
|
6026
|
-
}
|
|
6027
|
-
}
|
|
6028
|
-
};
|
|
6029
|
-
try {
|
|
6030
|
-
const response = await client.query({
|
|
6031
|
-
getAndSetAlbumById: {
|
|
6032
|
-
__args: {
|
|
6033
|
-
input: albumId
|
|
6034
|
-
},
|
|
5951
|
+
getAthleteAlbums: {
|
|
5952
|
+
__args: {},
|
|
6035
5953
|
...fields
|
|
6036
5954
|
},
|
|
6037
5955
|
});
|
|
6038
|
-
console.log('
|
|
5956
|
+
console.log('getAthleteAlbums Response:');
|
|
6039
5957
|
console.log(JSON.stringify(response, null, 2));
|
|
6040
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6041
|
-
const isResponseOk = response?.
|
|
5958
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5959
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
6042
5960
|
return isResponseOk;
|
|
6043
5961
|
});
|
|
6044
5962
|
}
|
|
6045
5963
|
catch (err1) {
|
|
6046
|
-
console.error('
|
|
5964
|
+
console.error('getAthleteAlbums err1:');
|
|
6047
5965
|
console.error(err1);
|
|
6048
5966
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6049
5967
|
}
|
|
@@ -6342,7 +6260,7 @@ class VTXBaseAPI {
|
|
|
6342
6260
|
}
|
|
6343
6261
|
return retValue;
|
|
6344
6262
|
}
|
|
6345
|
-
async
|
|
6263
|
+
async getAthleteStravaIntegration() {
|
|
6346
6264
|
const client = (0, client_1.createClient)({
|
|
6347
6265
|
url: this.backendUrl + '/graphql',
|
|
6348
6266
|
headers: this.headers,
|
|
@@ -6374,12 +6292,12 @@ class VTXBaseAPI {
|
|
|
6374
6292
|
};
|
|
6375
6293
|
try {
|
|
6376
6294
|
const response = await client.query({
|
|
6377
|
-
|
|
6295
|
+
getAthleteStravaIntegration: {
|
|
6378
6296
|
...fields
|
|
6379
6297
|
},
|
|
6380
6298
|
});
|
|
6381
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6382
|
-
const isResponseOk = !!response?.
|
|
6299
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
|
|
6300
|
+
const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
|
|
6383
6301
|
return isResponseOk;
|
|
6384
6302
|
});
|
|
6385
6303
|
}
|
|
@@ -6388,144 +6306,181 @@ class VTXBaseAPI {
|
|
|
6388
6306
|
}
|
|
6389
6307
|
return retValue;
|
|
6390
6308
|
}
|
|
6391
|
-
async
|
|
6392
|
-
const client = (0, client_1.createClient)({
|
|
6393
|
-
url: this.backendUrl + '/graphql',
|
|
6394
|
-
headers: this.headers,
|
|
6395
|
-
});
|
|
6396
|
-
let retValue = {};
|
|
6397
|
-
try {
|
|
6398
|
-
const response = await client.mutation({
|
|
6399
|
-
deleteAthleteIntegration: true
|
|
6400
|
-
});
|
|
6401
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteIntegration', (r) => {
|
|
6402
|
-
const isResponseOk = response?.deleteAthleteIntegration === true;
|
|
6403
|
-
return isResponseOk;
|
|
6404
|
-
});
|
|
6405
|
-
}
|
|
6406
|
-
catch (err) {
|
|
6407
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6408
|
-
}
|
|
6409
|
-
return retValue;
|
|
6410
|
-
}
|
|
6411
|
-
async deleteUploadedTypeKeyFile(dto) {
|
|
6412
|
-
console.log('HEADERS:');
|
|
6413
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6309
|
+
async getAthleteInstagramIntegration() {
|
|
6414
6310
|
const client = (0, client_1.createClient)({
|
|
6415
6311
|
url: this.backendUrl + '/graphql',
|
|
6416
6312
|
headers: this.headers,
|
|
6417
6313
|
});
|
|
6418
6314
|
let retValue = {};
|
|
6419
6315
|
const fields = {
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
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
|
+
}
|
|
6424
6358
|
};
|
|
6425
6359
|
try {
|
|
6426
|
-
const response = await client.
|
|
6427
|
-
|
|
6428
|
-
__args: {
|
|
6429
|
-
input: dto
|
|
6430
|
-
},
|
|
6360
|
+
const response = await client.query({
|
|
6361
|
+
getAthleteInstagramIntegration: {
|
|
6431
6362
|
...fields
|
|
6432
6363
|
},
|
|
6433
6364
|
});
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6437
|
-
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6365
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
|
|
6366
|
+
const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
|
|
6438
6367
|
return isResponseOk;
|
|
6439
6368
|
});
|
|
6440
6369
|
}
|
|
6441
|
-
catch (
|
|
6442
|
-
|
|
6443
|
-
console.error(err1);
|
|
6444
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6370
|
+
catch (err) {
|
|
6371
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6445
6372
|
}
|
|
6446
|
-
console.log('retValue:');
|
|
6447
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6448
6373
|
return retValue;
|
|
6449
6374
|
}
|
|
6450
|
-
async
|
|
6451
|
-
console.log('HEADERS:');
|
|
6452
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6375
|
+
async getAthleteIntegrations() {
|
|
6453
6376
|
const client = (0, client_1.createClient)({
|
|
6454
6377
|
url: this.backendUrl + '/graphql',
|
|
6455
6378
|
headers: this.headers,
|
|
6456
6379
|
});
|
|
6457
6380
|
let retValue = {};
|
|
6458
6381
|
const fields = {
|
|
6459
|
-
|
|
6460
|
-
|
|
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
|
+
}
|
|
6461
6442
|
};
|
|
6462
6443
|
try {
|
|
6463
|
-
const response = await client.
|
|
6464
|
-
|
|
6465
|
-
__args: {
|
|
6466
|
-
input: email
|
|
6467
|
-
},
|
|
6444
|
+
const response = await client.query({
|
|
6445
|
+
getAthleteIntegrations: {
|
|
6468
6446
|
...fields
|
|
6469
6447
|
},
|
|
6470
6448
|
});
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6474
|
-
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6449
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6450
|
+
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6475
6451
|
return isResponseOk;
|
|
6476
6452
|
});
|
|
6477
6453
|
}
|
|
6478
|
-
catch (
|
|
6479
|
-
|
|
6480
|
-
console.error(err1);
|
|
6481
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6454
|
+
catch (err) {
|
|
6455
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6482
6456
|
}
|
|
6483
|
-
console.log('retValue:');
|
|
6484
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6485
6457
|
return retValue;
|
|
6486
6458
|
}
|
|
6487
|
-
async
|
|
6488
|
-
console.log('HEADERS:');
|
|
6489
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6459
|
+
async updateAthleteIntegration(type) {
|
|
6490
6460
|
const client = (0, client_1.createClient)({
|
|
6491
6461
|
url: this.backendUrl + '/graphql',
|
|
6492
6462
|
headers: this.headers,
|
|
6493
6463
|
});
|
|
6494
6464
|
let retValue = {};
|
|
6495
|
-
const fields = {
|
|
6496
|
-
_id: true,
|
|
6497
|
-
type: true,
|
|
6498
|
-
recipient: true,
|
|
6499
|
-
expires: true,
|
|
6500
|
-
isExpired: true,
|
|
6501
|
-
createdDate: true,
|
|
6502
|
-
};
|
|
6503
6465
|
try {
|
|
6504
|
-
const response = await client.
|
|
6505
|
-
|
|
6466
|
+
const response = await client.mutation({
|
|
6467
|
+
updateAthleteIntegration: {
|
|
6506
6468
|
__args: {
|
|
6507
|
-
|
|
6469
|
+
type: type
|
|
6508
6470
|
},
|
|
6509
|
-
|
|
6510
|
-
},
|
|
6471
|
+
}
|
|
6511
6472
|
});
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
|
|
6515
|
-
const isResponseOk = response?.getResetVerificationCode?.changed;
|
|
6473
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteIntegration', (r) => {
|
|
6474
|
+
const isResponseOk = response?.updateAthleteIntegration === true;
|
|
6516
6475
|
return isResponseOk;
|
|
6517
6476
|
});
|
|
6518
6477
|
}
|
|
6519
|
-
catch (
|
|
6520
|
-
|
|
6521
|
-
console.error(err1);
|
|
6522
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6478
|
+
catch (err) {
|
|
6479
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6523
6480
|
}
|
|
6524
|
-
console.log('retValue:');
|
|
6525
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6526
6481
|
return retValue;
|
|
6527
6482
|
}
|
|
6528
|
-
async
|
|
6483
|
+
async deleteUploadedTypeKeyFile(dto) {
|
|
6529
6484
|
console.log('HEADERS:');
|
|
6530
6485
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
6531
6486
|
const client = (0, client_1.createClient)({
|
|
@@ -6534,38 +6489,29 @@ class VTXBaseAPI {
|
|
|
6534
6489
|
});
|
|
6535
6490
|
let retValue = {};
|
|
6536
6491
|
const fields = {
|
|
6492
|
+
httpStatus: true,
|
|
6537
6493
|
result: true,
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
type: true,
|
|
6541
|
-
recipient: true,
|
|
6542
|
-
expires: true,
|
|
6543
|
-
isExpired: true,
|
|
6544
|
-
createdDate: true,
|
|
6545
|
-
},
|
|
6546
|
-
error: {
|
|
6547
|
-
errorCode: true,
|
|
6548
|
-
errorMessage: true,
|
|
6549
|
-
}
|
|
6494
|
+
message: true,
|
|
6495
|
+
errors: true
|
|
6550
6496
|
};
|
|
6551
6497
|
try {
|
|
6552
|
-
const response = await client.
|
|
6553
|
-
|
|
6498
|
+
const response = await client.mutation({
|
|
6499
|
+
deleteUploadedTypeKeyFile: {
|
|
6554
6500
|
__args: {
|
|
6555
|
-
input:
|
|
6501
|
+
input: dto
|
|
6556
6502
|
},
|
|
6557
6503
|
...fields
|
|
6558
6504
|
},
|
|
6559
6505
|
});
|
|
6560
|
-
console.log('
|
|
6506
|
+
console.log('deleteUploadedTypeKeyFile Response:');
|
|
6561
6507
|
console.log(JSON.stringify(response, null, 2));
|
|
6562
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6563
|
-
const isResponseOk = response?.
|
|
6508
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6509
|
+
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6564
6510
|
return isResponseOk;
|
|
6565
6511
|
});
|
|
6566
6512
|
}
|
|
6567
6513
|
catch (err1) {
|
|
6568
|
-
console.error('
|
|
6514
|
+
console.error('deleteUploadedTypeKeyFile err1:');
|
|
6569
6515
|
console.error(err1);
|
|
6570
6516
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6571
6517
|
}
|
|
@@ -6573,84 +6519,70 @@ class VTXBaseAPI {
|
|
|
6573
6519
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6574
6520
|
return retValue;
|
|
6575
6521
|
}
|
|
6576
|
-
async
|
|
6577
|
-
console.log('HEADERS:');
|
|
6578
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6522
|
+
async saveAthleteCompetitionResult(dto) {
|
|
6579
6523
|
const client = (0, client_1.createClient)({
|
|
6580
6524
|
url: this.backendUrl + '/graphql',
|
|
6581
6525
|
headers: this.headers,
|
|
6582
6526
|
});
|
|
6583
6527
|
let retValue = {};
|
|
6584
6528
|
const fields = {
|
|
6585
|
-
|
|
6586
|
-
|
|
6529
|
+
_id: true,
|
|
6530
|
+
resultType: true,
|
|
6531
|
+
position: true,
|
|
6532
|
+
score: true,
|
|
6533
|
+
finishTimeMS: true,
|
|
6534
|
+
resultWebLink: true,
|
|
6587
6535
|
};
|
|
6588
6536
|
try {
|
|
6589
6537
|
const response = await client.mutation({
|
|
6590
|
-
|
|
6538
|
+
saveAthleteCompetitionResult: {
|
|
6591
6539
|
__args: {
|
|
6592
|
-
input:
|
|
6540
|
+
input: dto
|
|
6593
6541
|
},
|
|
6594
6542
|
...fields
|
|
6595
6543
|
},
|
|
6596
6544
|
});
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6600
|
-
const isResponseOk = response?.
|
|
6601
|
-
;
|
|
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;
|
|
6602
6549
|
return isResponseOk;
|
|
6603
6550
|
});
|
|
6604
6551
|
}
|
|
6605
6552
|
catch (err1) {
|
|
6606
|
-
|
|
6607
|
-
|
|
6553
|
+
VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
|
|
6554
|
+
VTXBaseAPI.Logger.error(err1);
|
|
6608
6555
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6609
6556
|
}
|
|
6610
|
-
console.log('retValue:');
|
|
6611
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6612
6557
|
return retValue;
|
|
6613
6558
|
}
|
|
6614
|
-
async
|
|
6615
|
-
console.log('HEADERS:');
|
|
6616
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6559
|
+
async updateAthleteTpiScore() {
|
|
6617
6560
|
const client = (0, client_1.createClient)({
|
|
6618
6561
|
url: this.backendUrl + '/graphql',
|
|
6619
6562
|
headers: this.headers,
|
|
6620
6563
|
});
|
|
6621
6564
|
let retValue = {};
|
|
6622
|
-
const fields = {
|
|
6623
|
-
deleted: true,
|
|
6624
|
-
failedToDelete: true,
|
|
6625
|
-
failureReason: {
|
|
6626
|
-
code: true,
|
|
6627
|
-
message: true
|
|
6628
|
-
},
|
|
6629
|
-
result: true,
|
|
6630
|
-
};
|
|
6631
6565
|
try {
|
|
6632
6566
|
const response = await client.mutation({
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6567
|
+
updateAthleteTpiScore: {
|
|
6568
|
+
_id: true,
|
|
6569
|
+
firstName: true,
|
|
6570
|
+
lastName: true,
|
|
6571
|
+
scores: {
|
|
6572
|
+
vtxScore: true,
|
|
6573
|
+
socialScore: true,
|
|
6574
|
+
trainingScore: true
|
|
6575
|
+
}
|
|
6638
6576
|
},
|
|
6639
6577
|
});
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthletePhotos', (r) => {
|
|
6643
|
-
const isResponseOk = response?.deleteAthletePhotos?.deleted.length > 0;
|
|
6578
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteTpiScore', (r) => {
|
|
6579
|
+
const isResponseOk = !!response?.updateAthleteTpiScore?._id;
|
|
6644
6580
|
return isResponseOk;
|
|
6645
6581
|
});
|
|
6646
6582
|
}
|
|
6647
|
-
catch (
|
|
6648
|
-
|
|
6649
|
-
console.error(err1);
|
|
6650
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6583
|
+
catch (err) {
|
|
6584
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6651
6585
|
}
|
|
6652
|
-
console.log('retValue:');
|
|
6653
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6654
6586
|
return retValue;
|
|
6655
6587
|
}
|
|
6656
6588
|
}
|