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