@vertikalx/vtx-backend-client 1.0.0-preprod.3 → 1.0.0-preprod.4
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/response-builder.js +2 -3
- package/src/api/response-builder.js.map +1 -1
- package/src/api/vtx-base-api.d.ts +26 -6
- package/src/api/vtx-base-api.js +1301 -24
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/runtime/generateGraphqlOperation.d.ts +1 -1
- package/src/client/schema.d.ts +535 -35
- package/src/client/schema.js +108 -10
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +257 -22
- package/src/client/types.js +927 -290
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
- package/libs/vtx-backend-client/package.json +0 -16
- package/libs/vtx-backend-client/src/api/api-call-headers.d.ts +0 -16
- package/libs/vtx-backend-client/src/api/api-call-headers.js +0 -20
- package/libs/vtx-backend-client/src/api/api-call-headers.js.map +0 -1
- package/libs/vtx-backend-client/src/api/backend-response.d.ts +0 -10
- package/libs/vtx-backend-client/src/api/backend-response.js +0 -3
- package/libs/vtx-backend-client/src/api/backend-response.js.map +0 -1
- package/libs/vtx-backend-client/src/api/domains.d.ts +0 -3
- package/libs/vtx-backend-client/src/api/domains.js +0 -7
- package/libs/vtx-backend-client/src/api/domains.js.map +0 -1
- package/libs/vtx-backend-client/src/api/response-builder.d.ts +0 -4
- package/libs/vtx-backend-client/src/api/response-builder.js +0 -123
- package/libs/vtx-backend-client/src/api/response-builder.js.map +0 -1
- package/libs/vtx-backend-client/src/api/types.d.ts +0 -2
- package/libs/vtx-backend-client/src/api/types.js +0 -3
- package/libs/vtx-backend-client/src/api/types.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.d.ts +0 -6
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js +0 -19
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-base-api.d.ts +0 -82
- package/libs/vtx-backend-client/src/api/vtx-base-api.js +0 -5725
- package/libs/vtx-backend-client/src/api/vtx-base-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.d.ts +0 -6
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js +0 -27
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.d.ts +0 -7
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js +0 -36
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.d.ts +0 -7
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js +0 -33
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js.map +0 -1
- package/libs/vtx-backend-client/src/client/index.d.ts +0 -25
- package/libs/vtx-backend-client/src/client/index.js +0 -44
- package/libs/vtx-backend-client/src/client/index.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/batcher.d.ts +0 -36
- package/libs/vtx-backend-client/src/client/runtime/batcher.js +0 -123
- package/libs/vtx-backend-client/src/client/runtime/batcher.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/createClient.d.ts +0 -17
- package/libs/vtx-backend-client/src/client/runtime/createClient.js +0 -28
- package/libs/vtx-backend-client/src/client/runtime/createClient.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/error.d.ts +0 -15
- package/libs/vtx-backend-client/src/client/runtime/error.js +0 -19
- package/libs/vtx-backend-client/src/client/runtime/error.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/fetcher.d.ts +0 -10
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js +0 -68
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.d.ts +0 -30
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js +0 -134
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/index.d.ts +0 -11
- package/libs/vtx-backend-client/src/client/runtime/index.js +0 -17
- package/libs/vtx-backend-client/src/client/runtime/index.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.d.ts +0 -9
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js +0 -95
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.d.ts +0 -28
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js +0 -3
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/types.d.ts +0 -55
- package/libs/vtx-backend-client/src/client/runtime/types.js +0 -3
- package/libs/vtx-backend-client/src/client/runtime/types.js.map +0 -1
- package/libs/vtx-backend-client/src/client/schema.d.ts +0 -3444
- package/libs/vtx-backend-client/src/client/schema.js +0 -748
- package/libs/vtx-backend-client/src/client/schema.js.map +0 -1
- package/libs/vtx-backend-client/src/client/types.d.ts +0 -1876
- package/libs/vtx-backend-client/src/client/types.js +0 -4870
- package/libs/vtx-backend-client/src/client/types.js.map +0 -1
- package/libs/vtx-backend-client/src/index.d.ts +0 -11
- package/libs/vtx-backend-client/src/index.js +0 -28
- package/libs/vtx-backend-client/src/index.js.map +0 -1
- package/src/api/dto/edit-picture.dto.d.ts +0 -5
- package/src/api/dto/edit-picture.dto.js +0 -31
- package/src/api/dto/edit-picture.dto.js.map +0 -1
- package/src/api/types/add-values-response.type.d.ts +0 -7
- package/src/api/types/add-values-response.type.js +0 -42
- package/src/api/types/add-values-response.type.js.map +0 -1
- package/src/api/types/delete-single-value-response.type.d.ts +0 -6
- package/src/api/types/delete-single-value-response.type.js +0 -36
- package/src/api/types/delete-single-value-response.type.js.map +0 -1
- package/src/api/types/edit-picture-response.type.d.ts +0 -7
- package/src/api/types/edit-picture-response.type.js +0 -39
- package/src/api/types/edit-picture-response.type.js.map +0 -1
- package/src/api/types/error.type.d.ts +0 -4
- package/src/api/types/error.type.js +0 -28
- package/src/api/types/error.type.js.map +0 -1
- package/src/client/schema.graphql +0 -1705
package/src/api/vtx-base-api.js
CHANGED
|
@@ -1788,6 +1788,74 @@ class VTXBaseAPI {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
return retValue;
|
|
1790
1790
|
}
|
|
1791
|
+
async getStates() {
|
|
1792
|
+
const client = (0, client_1.createClient)({
|
|
1793
|
+
url: this.backendUrl + "/graphql",
|
|
1794
|
+
headers: this.headers,
|
|
1795
|
+
});
|
|
1796
|
+
const fields = {
|
|
1797
|
+
_id: true,
|
|
1798
|
+
name: true,
|
|
1799
|
+
country: {
|
|
1800
|
+
_id: true,
|
|
1801
|
+
name: true
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
let retValue;
|
|
1805
|
+
try {
|
|
1806
|
+
const response = await client.query({
|
|
1807
|
+
getStates: {
|
|
1808
|
+
__args: {},
|
|
1809
|
+
...fields
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
VTXBaseAPI.Logger.debug('getStates Response:');
|
|
1813
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1814
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getStates', (r) => {
|
|
1815
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1816
|
+
const isResponseOk = true && Array.isArray(response?.getStates);
|
|
1817
|
+
return isResponseOk;
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
catch (err1) {
|
|
1821
|
+
VTXBaseAPI.Logger.error('getStates err1:');
|
|
1822
|
+
VTXBaseAPI.Logger.error(err1);
|
|
1823
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
1824
|
+
}
|
|
1825
|
+
return retValue;
|
|
1826
|
+
}
|
|
1827
|
+
async getCountries() {
|
|
1828
|
+
const client = (0, client_1.createClient)({
|
|
1829
|
+
url: this.backendUrl + "/graphql",
|
|
1830
|
+
headers: this.headers,
|
|
1831
|
+
});
|
|
1832
|
+
let retValue;
|
|
1833
|
+
const fields = {
|
|
1834
|
+
_id: true,
|
|
1835
|
+
name: true,
|
|
1836
|
+
};
|
|
1837
|
+
try {
|
|
1838
|
+
const response = await client.query({
|
|
1839
|
+
getCountries: {
|
|
1840
|
+
__args: {},
|
|
1841
|
+
...fields
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
VTXBaseAPI.Logger.debug('getCountries Response:');
|
|
1845
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1846
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getCountries', (r) => {
|
|
1847
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1848
|
+
const isResponseOk = true && Array.isArray(response?.getCountries);
|
|
1849
|
+
return isResponseOk;
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
catch (err1) {
|
|
1853
|
+
VTXBaseAPI.Logger.error('getCountries err1:');
|
|
1854
|
+
VTXBaseAPI.Logger.error(err1);
|
|
1855
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
1856
|
+
}
|
|
1857
|
+
return retValue;
|
|
1858
|
+
}
|
|
1791
1859
|
async loginUserFromCredentialsVtx(username, password) {
|
|
1792
1860
|
const client = (0, client_1.createClient)({
|
|
1793
1861
|
url: this.backendUrl + '/graphql',
|
|
@@ -2150,9 +2218,23 @@ class VTXBaseAPI {
|
|
|
2150
2218
|
url: true,
|
|
2151
2219
|
key: true
|
|
2152
2220
|
},
|
|
2221
|
+
bannerPicture: {
|
|
2222
|
+
_id: true,
|
|
2223
|
+
name: true,
|
|
2224
|
+
contentType: true,
|
|
2225
|
+
size: true,
|
|
2226
|
+
useType: true,
|
|
2227
|
+
url: true,
|
|
2228
|
+
key: true
|
|
2229
|
+
},
|
|
2153
2230
|
preferences: {
|
|
2154
2231
|
_id: true,
|
|
2155
|
-
showProfileHelper: true
|
|
2232
|
+
showProfileHelper: true,
|
|
2233
|
+
defaultAlbum: {
|
|
2234
|
+
_id: true,
|
|
2235
|
+
label: true,
|
|
2236
|
+
description: true,
|
|
2237
|
+
}
|
|
2156
2238
|
},
|
|
2157
2239
|
currentCampaign: {
|
|
2158
2240
|
_id: true,
|
|
@@ -4191,6 +4273,7 @@ class VTXBaseAPI {
|
|
|
4191
4273
|
fundsRequired: true,
|
|
4192
4274
|
initialFundsObtained: true,
|
|
4193
4275
|
fundsObtained: true,
|
|
4276
|
+
vtxComissionPct: true,
|
|
4194
4277
|
location: {
|
|
4195
4278
|
userProvidedLatitude: true,
|
|
4196
4279
|
userProvidedLongitude: true,
|
|
@@ -5055,6 +5138,7 @@ class VTXBaseAPI {
|
|
|
5055
5138
|
fundsRequired: true,
|
|
5056
5139
|
initialFundsObtained: true,
|
|
5057
5140
|
fundsObtained: true,
|
|
5141
|
+
vtxComissionPct: true,
|
|
5058
5142
|
location: {
|
|
5059
5143
|
userProvidedLatitude: true,
|
|
5060
5144
|
userProvidedLongitude: true,
|
|
@@ -5436,9 +5520,23 @@ class VTXBaseAPI {
|
|
|
5436
5520
|
url: true,
|
|
5437
5521
|
key: true
|
|
5438
5522
|
},
|
|
5523
|
+
bannerPicture: {
|
|
5524
|
+
_id: true,
|
|
5525
|
+
name: true,
|
|
5526
|
+
contentType: true,
|
|
5527
|
+
size: true,
|
|
5528
|
+
useType: true,
|
|
5529
|
+
url: true,
|
|
5530
|
+
key: true
|
|
5531
|
+
},
|
|
5439
5532
|
preferences: {
|
|
5440
5533
|
_id: true,
|
|
5441
|
-
showProfileHelper: true
|
|
5534
|
+
showProfileHelper: true,
|
|
5535
|
+
defaultAlbum: {
|
|
5536
|
+
_id: true,
|
|
5537
|
+
label: true,
|
|
5538
|
+
description: true,
|
|
5539
|
+
}
|
|
5442
5540
|
},
|
|
5443
5541
|
currentCampaign: {
|
|
5444
5542
|
_id: true,
|
|
@@ -5549,7 +5647,7 @@ class VTXBaseAPI {
|
|
|
5549
5647
|
resultWebLink: true
|
|
5550
5648
|
}
|
|
5551
5649
|
}
|
|
5552
|
-
}
|
|
5650
|
+
},
|
|
5553
5651
|
};
|
|
5554
5652
|
try {
|
|
5555
5653
|
let response = null;
|
|
@@ -5628,7 +5726,7 @@ class VTXBaseAPI {
|
|
|
5628
5726
|
}
|
|
5629
5727
|
return retValue;
|
|
5630
5728
|
}
|
|
5631
|
-
async
|
|
5729
|
+
async addAlbumsPictures(dto) {
|
|
5632
5730
|
console.log('HEADERS:');
|
|
5633
5731
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5634
5732
|
const client = (0, client_1.createClient)({
|
|
@@ -5637,37 +5735,88 @@ class VTXBaseAPI {
|
|
|
5637
5735
|
});
|
|
5638
5736
|
let retValue = {};
|
|
5639
5737
|
const fields = {
|
|
5640
|
-
|
|
5641
|
-
|
|
5738
|
+
added: true,
|
|
5739
|
+
failedToAdd: true,
|
|
5642
5740
|
failureReason: {
|
|
5643
5741
|
code: true,
|
|
5644
5742
|
message: true
|
|
5743
|
+
},
|
|
5744
|
+
result: true,
|
|
5745
|
+
};
|
|
5746
|
+
try {
|
|
5747
|
+
const response = await client.mutation({
|
|
5748
|
+
AddAlbumPictures: {
|
|
5749
|
+
__args: {
|
|
5750
|
+
input: dto
|
|
5751
|
+
},
|
|
5752
|
+
...fields
|
|
5753
|
+
},
|
|
5754
|
+
});
|
|
5755
|
+
console.log('AddAlbumsPictures Response:');
|
|
5756
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5757
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'AddAlbumPictures', (r) => {
|
|
5758
|
+
const isResponseOk = response?.AddAlbumPictures?.result === 'success' || response?.AddAlbumPictures?.result === 'partial';
|
|
5759
|
+
return isResponseOk;
|
|
5760
|
+
});
|
|
5761
|
+
}
|
|
5762
|
+
catch (err1) {
|
|
5763
|
+
console.error('addPictures err1:');
|
|
5764
|
+
console.error(err1);
|
|
5765
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5766
|
+
}
|
|
5767
|
+
console.log('retValue:');
|
|
5768
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5769
|
+
return retValue;
|
|
5770
|
+
}
|
|
5771
|
+
async editAlbumsPictures(dto) {
|
|
5772
|
+
console.log('HEADERS:');
|
|
5773
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5774
|
+
const client = (0, client_1.createClient)({
|
|
5775
|
+
url: this.backendUrl + '/graphql',
|
|
5776
|
+
headers: this.headers,
|
|
5777
|
+
});
|
|
5778
|
+
let retValue = {};
|
|
5779
|
+
const fields = {
|
|
5780
|
+
label: true,
|
|
5781
|
+
description: true,
|
|
5782
|
+
photos: {
|
|
5783
|
+
_id: true,
|
|
5784
|
+
photo: {
|
|
5785
|
+
_id: true,
|
|
5786
|
+
name: true,
|
|
5787
|
+
contentType: true,
|
|
5788
|
+
size: true,
|
|
5789
|
+
useType: true,
|
|
5790
|
+
url: true,
|
|
5791
|
+
}
|
|
5645
5792
|
}
|
|
5646
5793
|
};
|
|
5647
5794
|
try {
|
|
5648
5795
|
const response = await client.mutation({
|
|
5649
|
-
|
|
5796
|
+
editAlbum: {
|
|
5650
5797
|
__args: {
|
|
5651
|
-
input:
|
|
5798
|
+
input: dto
|
|
5652
5799
|
},
|
|
5653
5800
|
...fields
|
|
5654
5801
|
},
|
|
5655
5802
|
});
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5659
|
-
const isResponseOk =
|
|
5803
|
+
console.log('editAlbum Response:');
|
|
5804
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5805
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editAlbum', (r) => {
|
|
5806
|
+
const isResponseOk = response?.editAlbum?.label;
|
|
5660
5807
|
return isResponseOk;
|
|
5661
5808
|
});
|
|
5662
5809
|
}
|
|
5663
5810
|
catch (err1) {
|
|
5664
|
-
|
|
5665
|
-
|
|
5811
|
+
console.error('editAlbum err1:');
|
|
5812
|
+
console.error(err1);
|
|
5666
5813
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5667
5814
|
}
|
|
5815
|
+
console.log('retValue:');
|
|
5816
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5668
5817
|
return retValue;
|
|
5669
5818
|
}
|
|
5670
|
-
async
|
|
5819
|
+
async createAthleteAlbum(dto) {
|
|
5671
5820
|
console.log('HEADERS:');
|
|
5672
5821
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5673
5822
|
const client = (0, client_1.createClient)({
|
|
@@ -5676,32 +5825,1160 @@ class VTXBaseAPI {
|
|
|
5676
5825
|
});
|
|
5677
5826
|
let retValue = {};
|
|
5678
5827
|
const fields = {
|
|
5679
|
-
|
|
5680
|
-
|
|
5828
|
+
label: true,
|
|
5829
|
+
description: true,
|
|
5830
|
+
photos: {
|
|
5831
|
+
_id: true,
|
|
5832
|
+
photo: {
|
|
5833
|
+
_id: true,
|
|
5834
|
+
name: true,
|
|
5835
|
+
contentType: true,
|
|
5836
|
+
size: true,
|
|
5837
|
+
useType: true,
|
|
5838
|
+
url: true,
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
};
|
|
5842
|
+
try {
|
|
5843
|
+
const response = await client.mutation({
|
|
5844
|
+
createAthleteAlbum: {
|
|
5845
|
+
__args: {
|
|
5846
|
+
input: dto
|
|
5847
|
+
},
|
|
5848
|
+
...fields
|
|
5849
|
+
},
|
|
5850
|
+
});
|
|
5851
|
+
console.log('createAthleteAlbum Response:');
|
|
5852
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5853
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
|
|
5854
|
+
const isResponseOk = response?.createAthleteAlbum?.label;
|
|
5855
|
+
return isResponseOk;
|
|
5856
|
+
});
|
|
5857
|
+
}
|
|
5858
|
+
catch (err1) {
|
|
5859
|
+
console.error('createAthleteAlbum err1:');
|
|
5860
|
+
console.error(err1);
|
|
5861
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5862
|
+
}
|
|
5863
|
+
console.log('retValue:');
|
|
5864
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5865
|
+
return retValue;
|
|
5866
|
+
}
|
|
5867
|
+
async deleteAthleteAlbum(dto) {
|
|
5868
|
+
console.log('HEADERS:');
|
|
5869
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5870
|
+
const client = (0, client_1.createClient)({
|
|
5871
|
+
url: this.backendUrl + '/graphql',
|
|
5872
|
+
headers: this.headers,
|
|
5873
|
+
});
|
|
5874
|
+
let retValue = {};
|
|
5875
|
+
const fields = {
|
|
5876
|
+
idToDelete: true,
|
|
5877
|
+
deleted: true,
|
|
5681
5878
|
failureReason: {
|
|
5682
5879
|
code: true,
|
|
5683
5880
|
message: true
|
|
5684
|
-
}
|
|
5685
|
-
result: true,
|
|
5881
|
+
}
|
|
5686
5882
|
};
|
|
5687
5883
|
try {
|
|
5688
5884
|
const response = await client.mutation({
|
|
5689
|
-
|
|
5885
|
+
deleteAthleteAlbum: {
|
|
5690
5886
|
__args: {
|
|
5691
5887
|
input: dto
|
|
5692
5888
|
},
|
|
5693
5889
|
...fields
|
|
5694
5890
|
},
|
|
5695
5891
|
});
|
|
5696
|
-
console.log('
|
|
5892
|
+
console.log('deleteAthleteAlbum Response:');
|
|
5697
5893
|
console.log(JSON.stringify(response, null, 2));
|
|
5698
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5699
|
-
const isResponseOk = response?.
|
|
5894
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteAlbum', (r) => {
|
|
5895
|
+
const isResponseOk = response?.deleteAthleteAlbum?.deleted;
|
|
5700
5896
|
return isResponseOk;
|
|
5701
5897
|
});
|
|
5702
5898
|
}
|
|
5703
5899
|
catch (err1) {
|
|
5704
|
-
console.error('
|
|
5900
|
+
console.error('createAthleteAlbum err1:');
|
|
5901
|
+
console.error(err1);
|
|
5902
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5903
|
+
}
|
|
5904
|
+
console.log('retValue:');
|
|
5905
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5906
|
+
return retValue;
|
|
5907
|
+
}
|
|
5908
|
+
async getAthleteAlbums() {
|
|
5909
|
+
console.log('HEADERS:');
|
|
5910
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5911
|
+
const client = (0, client_1.createClient)({
|
|
5912
|
+
url: this.backendUrl + '/graphql',
|
|
5913
|
+
headers: this.headers,
|
|
5914
|
+
});
|
|
5915
|
+
let retValue;
|
|
5916
|
+
const fields = {
|
|
5917
|
+
_id: true,
|
|
5918
|
+
label: true,
|
|
5919
|
+
description: true,
|
|
5920
|
+
photos: {
|
|
5921
|
+
_id: true,
|
|
5922
|
+
photo: {
|
|
5923
|
+
_id: true,
|
|
5924
|
+
name: true,
|
|
5925
|
+
contentType: true,
|
|
5926
|
+
size: true,
|
|
5927
|
+
useType: true,
|
|
5928
|
+
url: true,
|
|
5929
|
+
}
|
|
5930
|
+
}
|
|
5931
|
+
};
|
|
5932
|
+
try {
|
|
5933
|
+
const response = await client.query({
|
|
5934
|
+
getAthleteAlbums: {
|
|
5935
|
+
__args: {},
|
|
5936
|
+
...fields
|
|
5937
|
+
},
|
|
5938
|
+
});
|
|
5939
|
+
console.log('getAthleteAlbums Response:');
|
|
5940
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5941
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5942
|
+
const isResponseOk = response?.getAthleteAlbums.length > 0;
|
|
5943
|
+
return isResponseOk;
|
|
5944
|
+
});
|
|
5945
|
+
}
|
|
5946
|
+
catch (err1) {
|
|
5947
|
+
console.error('getAthleteAlbums err1:');
|
|
5948
|
+
console.error(err1);
|
|
5949
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5950
|
+
}
|
|
5951
|
+
console.log('retValue:');
|
|
5952
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5953
|
+
return retValue;
|
|
5954
|
+
}
|
|
5955
|
+
async getPublicAthleteAlbums(athleteId) {
|
|
5956
|
+
console.log('HEADERS:');
|
|
5957
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5958
|
+
const client = (0, client_1.createClient)({
|
|
5959
|
+
url: this.backendUrl + '/graphql',
|
|
5960
|
+
headers: this.headers,
|
|
5961
|
+
});
|
|
5962
|
+
let retValue;
|
|
5963
|
+
const fields = {
|
|
5964
|
+
_id: true,
|
|
5965
|
+
label: true,
|
|
5966
|
+
description: true,
|
|
5967
|
+
photos: {
|
|
5968
|
+
_id: true,
|
|
5969
|
+
photo: {
|
|
5970
|
+
_id: true,
|
|
5971
|
+
name: true,
|
|
5972
|
+
contentType: true,
|
|
5973
|
+
size: true,
|
|
5974
|
+
useType: true,
|
|
5975
|
+
url: true,
|
|
5976
|
+
}
|
|
5977
|
+
}
|
|
5978
|
+
};
|
|
5979
|
+
try {
|
|
5980
|
+
const response = await client.query({
|
|
5981
|
+
getPublicAthleteAlbums: {
|
|
5982
|
+
__args: {
|
|
5983
|
+
athleteId: athleteId
|
|
5984
|
+
},
|
|
5985
|
+
...fields
|
|
5986
|
+
},
|
|
5987
|
+
});
|
|
5988
|
+
console.log('getPublicAthleteAlbums Response:');
|
|
5989
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5990
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getPublicAthleteAlbums', (r) => {
|
|
5991
|
+
const isResponseOk = response?.getPublicAthleteAlbums.length > 0;
|
|
5992
|
+
return isResponseOk;
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5995
|
+
catch (err1) {
|
|
5996
|
+
console.error('getPublicAthleteAlbums err1:');
|
|
5997
|
+
console.error(err1);
|
|
5998
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5999
|
+
}
|
|
6000
|
+
console.log('retValue:');
|
|
6001
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6002
|
+
return retValue;
|
|
6003
|
+
}
|
|
6004
|
+
async getAthleteAlbumsById(albumId) {
|
|
6005
|
+
console.log('HEADERS:');
|
|
6006
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6007
|
+
const client = (0, client_1.createClient)({
|
|
6008
|
+
url: this.backendUrl + '/graphql',
|
|
6009
|
+
headers: this.headers,
|
|
6010
|
+
});
|
|
6011
|
+
let retValue = {};
|
|
6012
|
+
const fields = {
|
|
6013
|
+
label: true,
|
|
6014
|
+
description: true,
|
|
6015
|
+
photos: {
|
|
6016
|
+
_id: true,
|
|
6017
|
+
photo: {
|
|
6018
|
+
_id: true,
|
|
6019
|
+
name: true,
|
|
6020
|
+
contentType: true,
|
|
6021
|
+
size: true,
|
|
6022
|
+
useType: true,
|
|
6023
|
+
url: true,
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
};
|
|
6027
|
+
try {
|
|
6028
|
+
const response = await client.query({
|
|
6029
|
+
getAthleteAlbumId: {
|
|
6030
|
+
__args: {
|
|
6031
|
+
input: albumId
|
|
6032
|
+
},
|
|
6033
|
+
...fields
|
|
6034
|
+
},
|
|
6035
|
+
});
|
|
6036
|
+
console.log('getAthleteAlbumId Response:');
|
|
6037
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6038
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
|
|
6039
|
+
const isResponseOk = response?.getAthleteAlbumId?._id;
|
|
6040
|
+
return isResponseOk;
|
|
6041
|
+
});
|
|
6042
|
+
}
|
|
6043
|
+
catch (err1) {
|
|
6044
|
+
console.error('getAthleteAlbumId err1:');
|
|
6045
|
+
console.error(err1);
|
|
6046
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6047
|
+
}
|
|
6048
|
+
console.log('retValue:');
|
|
6049
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6050
|
+
return retValue;
|
|
6051
|
+
}
|
|
6052
|
+
async getAndSetAlbumById(albumId) {
|
|
6053
|
+
console.log('HEADERS:');
|
|
6054
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6055
|
+
const client = (0, client_1.createClient)({
|
|
6056
|
+
url: this.backendUrl + '/graphql',
|
|
6057
|
+
headers: this.headers,
|
|
6058
|
+
});
|
|
6059
|
+
let retValue = {};
|
|
6060
|
+
const fields = {
|
|
6061
|
+
_id: true,
|
|
6062
|
+
label: true,
|
|
6063
|
+
description: true,
|
|
6064
|
+
photos: {
|
|
6065
|
+
_id: true,
|
|
6066
|
+
photo: {
|
|
6067
|
+
_id: true,
|
|
6068
|
+
name: true,
|
|
6069
|
+
contentType: true,
|
|
6070
|
+
size: true,
|
|
6071
|
+
useType: true,
|
|
6072
|
+
url: true,
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
6075
|
+
};
|
|
6076
|
+
try {
|
|
6077
|
+
const response = await client.query({
|
|
6078
|
+
getAndSetAlbumById: {
|
|
6079
|
+
__args: {
|
|
6080
|
+
input: albumId
|
|
6081
|
+
},
|
|
6082
|
+
...fields
|
|
6083
|
+
},
|
|
6084
|
+
});
|
|
6085
|
+
console.log('getAndSetAlbumById Response:');
|
|
6086
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6087
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAndSetAlbumById', (r) => {
|
|
6088
|
+
const isResponseOk = response?.getAndSetAlbumById?._id;
|
|
6089
|
+
return isResponseOk;
|
|
6090
|
+
});
|
|
6091
|
+
}
|
|
6092
|
+
catch (err1) {
|
|
6093
|
+
console.error('getAndSetAlbumById err1:');
|
|
6094
|
+
console.error(err1);
|
|
6095
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6096
|
+
}
|
|
6097
|
+
console.log('retValue:');
|
|
6098
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6099
|
+
return retValue;
|
|
6100
|
+
}
|
|
6101
|
+
async queryAthletesWithFilters(dto) {
|
|
6102
|
+
const client = (0, client_1.createClient)({
|
|
6103
|
+
url: this.backendUrl + "/graphql",
|
|
6104
|
+
headers: this.headers,
|
|
6105
|
+
});
|
|
6106
|
+
const fieldsAthlete = {
|
|
6107
|
+
_id: true,
|
|
6108
|
+
firstName: true,
|
|
6109
|
+
lastName: true,
|
|
6110
|
+
screenName: true,
|
|
6111
|
+
dob: true,
|
|
6112
|
+
lgbt: true,
|
|
6113
|
+
competitionGender: true,
|
|
6114
|
+
country: {
|
|
6115
|
+
_id: true,
|
|
6116
|
+
name: true
|
|
6117
|
+
},
|
|
6118
|
+
location: {
|
|
6119
|
+
userProvidedLatitude: true,
|
|
6120
|
+
userProvidedLongitude: true,
|
|
6121
|
+
cityNameGeocode: true,
|
|
6122
|
+
stateNameGeocode: true,
|
|
6123
|
+
countryIso2CodeGeocode: true,
|
|
6124
|
+
timeZoneGeocode: true,
|
|
6125
|
+
latitudeGeocode: true,
|
|
6126
|
+
longitudeGeocode: true,
|
|
6127
|
+
city: {
|
|
6128
|
+
_id: true,
|
|
6129
|
+
name: true,
|
|
6130
|
+
localizedName: true,
|
|
6131
|
+
state: {
|
|
6132
|
+
_id: true,
|
|
6133
|
+
name: true,
|
|
6134
|
+
country: {
|
|
6135
|
+
_id: true,
|
|
6136
|
+
name: true
|
|
6137
|
+
}
|
|
6138
|
+
},
|
|
6139
|
+
latitude: true,
|
|
6140
|
+
longitude: true,
|
|
6141
|
+
timezone: true,
|
|
6142
|
+
}
|
|
6143
|
+
},
|
|
6144
|
+
trainer: true,
|
|
6145
|
+
trainerUrl: true,
|
|
6146
|
+
aboutMe: true,
|
|
6147
|
+
mainSport: {
|
|
6148
|
+
_id: true,
|
|
6149
|
+
name: true
|
|
6150
|
+
},
|
|
6151
|
+
mainSportLevel: {
|
|
6152
|
+
_id: true,
|
|
6153
|
+
label: true,
|
|
6154
|
+
index: true
|
|
6155
|
+
},
|
|
6156
|
+
scores: {
|
|
6157
|
+
vtxScore: true,
|
|
6158
|
+
socialScore: true,
|
|
6159
|
+
trainingScore: true,
|
|
6160
|
+
competitionScore: true
|
|
6161
|
+
},
|
|
6162
|
+
competitions: {
|
|
6163
|
+
_id: true,
|
|
6164
|
+
event: {
|
|
6165
|
+
_id: true,
|
|
6166
|
+
name: true,
|
|
6167
|
+
mainSport: {
|
|
6168
|
+
_id: true,
|
|
6169
|
+
name: true
|
|
6170
|
+
},
|
|
6171
|
+
eventWebSite: true,
|
|
6172
|
+
startDate: true,
|
|
6173
|
+
endDate: true,
|
|
6174
|
+
verified: true,
|
|
6175
|
+
banner: {
|
|
6176
|
+
_id: true,
|
|
6177
|
+
name: true,
|
|
6178
|
+
contentType: true,
|
|
6179
|
+
size: true,
|
|
6180
|
+
useType: true,
|
|
6181
|
+
url: true,
|
|
6182
|
+
key: true
|
|
6183
|
+
},
|
|
6184
|
+
location: {
|
|
6185
|
+
_id: true,
|
|
6186
|
+
userProvidedLatitude: true,
|
|
6187
|
+
userProvidedLongitude: true,
|
|
6188
|
+
cityNameGeocode: true,
|
|
6189
|
+
stateNameGeocode: true,
|
|
6190
|
+
countryIso2CodeGeocode: true,
|
|
6191
|
+
timeZoneGeocode: true,
|
|
6192
|
+
latitudeGeocode: true,
|
|
6193
|
+
longitudeGeocode: true,
|
|
6194
|
+
city: {
|
|
6195
|
+
_id: true,
|
|
6196
|
+
name: true,
|
|
6197
|
+
localizedName: true,
|
|
6198
|
+
state: {
|
|
6199
|
+
_id: true,
|
|
6200
|
+
name: true,
|
|
6201
|
+
country: {
|
|
6202
|
+
_id: true,
|
|
6203
|
+
name: true
|
|
6204
|
+
}
|
|
6205
|
+
},
|
|
6206
|
+
latitude: true,
|
|
6207
|
+
longitude: true,
|
|
6208
|
+
timezone: true,
|
|
6209
|
+
}
|
|
6210
|
+
},
|
|
6211
|
+
},
|
|
6212
|
+
participationDate: true,
|
|
6213
|
+
result: {
|
|
6214
|
+
_id: true,
|
|
6215
|
+
resultType: true,
|
|
6216
|
+
position: true,
|
|
6217
|
+
score: true,
|
|
6218
|
+
finishTimeMS: true,
|
|
6219
|
+
resultWebLink: true
|
|
6220
|
+
}
|
|
6221
|
+
},
|
|
6222
|
+
totalUpcomingCompetitions: true,
|
|
6223
|
+
totalPastCompetitions: true,
|
|
6224
|
+
profilePicture: {
|
|
6225
|
+
_id: true,
|
|
6226
|
+
name: true,
|
|
6227
|
+
contentType: true,
|
|
6228
|
+
size: true,
|
|
6229
|
+
useType: true,
|
|
6230
|
+
url: true,
|
|
6231
|
+
key: true
|
|
6232
|
+
},
|
|
6233
|
+
cardPicture: {
|
|
6234
|
+
_id: true,
|
|
6235
|
+
name: true,
|
|
6236
|
+
contentType: true,
|
|
6237
|
+
size: true,
|
|
6238
|
+
useType: true,
|
|
6239
|
+
url: true,
|
|
6240
|
+
key: true
|
|
6241
|
+
},
|
|
6242
|
+
currentCampaign: {
|
|
6243
|
+
_id: true,
|
|
6244
|
+
budgetMode: true,
|
|
6245
|
+
status: true,
|
|
6246
|
+
title: true,
|
|
6247
|
+
motivation: true,
|
|
6248
|
+
website: true,
|
|
6249
|
+
fundsRequired: true,
|
|
6250
|
+
initialFundsObtained: true,
|
|
6251
|
+
fundsObtained: true,
|
|
6252
|
+
location: {
|
|
6253
|
+
_id: true,
|
|
6254
|
+
userProvidedLatitude: true,
|
|
6255
|
+
userProvidedLongitude: true,
|
|
6256
|
+
cityNameGeocode: true,
|
|
6257
|
+
stateNameGeocode: true,
|
|
6258
|
+
countryIso2CodeGeocode: true,
|
|
6259
|
+
timeZoneGeocode: true,
|
|
6260
|
+
latitudeGeocode: true,
|
|
6261
|
+
longitudeGeocode: true,
|
|
6262
|
+
city: {
|
|
6263
|
+
_id: true,
|
|
6264
|
+
name: true,
|
|
6265
|
+
localizedName: true,
|
|
6266
|
+
state: {
|
|
6267
|
+
_id: true,
|
|
6268
|
+
name: true,
|
|
6269
|
+
country: {
|
|
6270
|
+
_id: true,
|
|
6271
|
+
name: true
|
|
6272
|
+
}
|
|
6273
|
+
},
|
|
6274
|
+
latitude: true,
|
|
6275
|
+
longitude: true,
|
|
6276
|
+
timezone: true,
|
|
6277
|
+
}
|
|
6278
|
+
},
|
|
6279
|
+
endingDate: true,
|
|
6280
|
+
budget: {
|
|
6281
|
+
_id: true,
|
|
6282
|
+
initialFunds: true,
|
|
6283
|
+
totalRequired: true,
|
|
6284
|
+
items: {
|
|
6285
|
+
_id: true,
|
|
6286
|
+
quantity: true,
|
|
6287
|
+
concept: true,
|
|
6288
|
+
itemCost: true
|
|
6289
|
+
}
|
|
6290
|
+
},
|
|
6291
|
+
competitions: {
|
|
6292
|
+
_id: true,
|
|
6293
|
+
event: {
|
|
6294
|
+
_id: true,
|
|
6295
|
+
name: true,
|
|
6296
|
+
mainSport: {
|
|
6297
|
+
_id: true,
|
|
6298
|
+
name: true
|
|
6299
|
+
},
|
|
6300
|
+
eventWebSite: true,
|
|
6301
|
+
startDate: true,
|
|
6302
|
+
endDate: true,
|
|
6303
|
+
verified: true,
|
|
6304
|
+
banner: {
|
|
6305
|
+
_id: true,
|
|
6306
|
+
name: true,
|
|
6307
|
+
contentType: true,
|
|
6308
|
+
size: true,
|
|
6309
|
+
useType: true,
|
|
6310
|
+
url: true,
|
|
6311
|
+
key: true
|
|
6312
|
+
},
|
|
6313
|
+
location: {
|
|
6314
|
+
_id: true,
|
|
6315
|
+
userProvidedLatitude: true,
|
|
6316
|
+
userProvidedLongitude: true,
|
|
6317
|
+
cityNameGeocode: true,
|
|
6318
|
+
stateNameGeocode: true,
|
|
6319
|
+
countryIso2CodeGeocode: true,
|
|
6320
|
+
timeZoneGeocode: true,
|
|
6321
|
+
latitudeGeocode: true,
|
|
6322
|
+
longitudeGeocode: true,
|
|
6323
|
+
city: {
|
|
6324
|
+
_id: true,
|
|
6325
|
+
name: true,
|
|
6326
|
+
localizedName: true,
|
|
6327
|
+
state: {
|
|
6328
|
+
_id: true,
|
|
6329
|
+
name: true,
|
|
6330
|
+
country: {
|
|
6331
|
+
_id: true,
|
|
6332
|
+
name: true
|
|
6333
|
+
}
|
|
6334
|
+
},
|
|
6335
|
+
latitude: true,
|
|
6336
|
+
longitude: true,
|
|
6337
|
+
timezone: true,
|
|
6338
|
+
}
|
|
6339
|
+
},
|
|
6340
|
+
},
|
|
6341
|
+
participationDate: true,
|
|
6342
|
+
result: {
|
|
6343
|
+
_id: true,
|
|
6344
|
+
resultType: true,
|
|
6345
|
+
position: true,
|
|
6346
|
+
score: true,
|
|
6347
|
+
finishTimeMS: true,
|
|
6348
|
+
resultWebLink: true
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
}
|
|
6352
|
+
};
|
|
6353
|
+
const fields = {
|
|
6354
|
+
athletes: fieldsAthlete,
|
|
6355
|
+
cursor: {
|
|
6356
|
+
sort: {
|
|
6357
|
+
sortField: true,
|
|
6358
|
+
order: true
|
|
6359
|
+
},
|
|
6360
|
+
initialCursorId: true,
|
|
6361
|
+
nextCursorId: true,
|
|
6362
|
+
initialCursorValue: true,
|
|
6363
|
+
nextCursorValue: true,
|
|
6364
|
+
limit: true,
|
|
6365
|
+
retrieved: true,
|
|
6366
|
+
isLastPage: true
|
|
6367
|
+
}
|
|
6368
|
+
};
|
|
6369
|
+
let retValue;
|
|
6370
|
+
try {
|
|
6371
|
+
const response = await client.query({
|
|
6372
|
+
queryAthleteWithFilter: {
|
|
6373
|
+
__args: { input: dto },
|
|
6374
|
+
...fields
|
|
6375
|
+
}
|
|
6376
|
+
});
|
|
6377
|
+
VTXBaseAPI.Logger.debug('queryAthleteWithFilter Response:');
|
|
6378
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
6379
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'queryAthleteWithFilter', (r) => {
|
|
6380
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
6381
|
+
const isResponseOk = true && Array.isArray(response?.queryAthleteWithFilter?.athletes);
|
|
6382
|
+
return isResponseOk;
|
|
6383
|
+
});
|
|
6384
|
+
}
|
|
6385
|
+
catch (err1) {
|
|
6386
|
+
VTXBaseAPI.Logger.error('queryAthleteFundingCampaigns err1:');
|
|
6387
|
+
VTXBaseAPI.Logger.error(err1);
|
|
6388
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6389
|
+
}
|
|
6390
|
+
return retValue;
|
|
6391
|
+
}
|
|
6392
|
+
async getAthleteIntegrationsByAthlete() {
|
|
6393
|
+
const client = (0, client_1.createClient)({
|
|
6394
|
+
url: this.backendUrl + '/graphql',
|
|
6395
|
+
headers: this.headers,
|
|
6396
|
+
});
|
|
6397
|
+
let retValue = {};
|
|
6398
|
+
const fields = {
|
|
6399
|
+
_id: true,
|
|
6400
|
+
athlete: {
|
|
6401
|
+
_id: true,
|
|
6402
|
+
},
|
|
6403
|
+
hasInstagramIntegration: true,
|
|
6404
|
+
instagramTokenExpires: true,
|
|
6405
|
+
instagramUserData: {
|
|
6406
|
+
user_id: true,
|
|
6407
|
+
username: true,
|
|
6408
|
+
name: true,
|
|
6409
|
+
account_type: true,
|
|
6410
|
+
followers_count: true,
|
|
6411
|
+
media_count: true
|
|
6412
|
+
},
|
|
6413
|
+
instagramMediaData: {
|
|
6414
|
+
data: {
|
|
6415
|
+
id: true,
|
|
6416
|
+
caption: true,
|
|
6417
|
+
media_type: true,
|
|
6418
|
+
media_url: true,
|
|
6419
|
+
permalink: true,
|
|
6420
|
+
thumbnail_url: true,
|
|
6421
|
+
timestamp: true,
|
|
6422
|
+
username: true,
|
|
6423
|
+
like_count: true,
|
|
6424
|
+
comments_count: true,
|
|
6425
|
+
insights: {
|
|
6426
|
+
data: {
|
|
6427
|
+
name: true,
|
|
6428
|
+
period: true,
|
|
6429
|
+
values: true
|
|
6430
|
+
}
|
|
6431
|
+
}
|
|
6432
|
+
},
|
|
6433
|
+
paging: {
|
|
6434
|
+
cursors: {
|
|
6435
|
+
before: true,
|
|
6436
|
+
after: true
|
|
6437
|
+
},
|
|
6438
|
+
next: true
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
};
|
|
6442
|
+
try {
|
|
6443
|
+
const response = await client.query({
|
|
6444
|
+
getAthleteInstagramIntegration: {
|
|
6445
|
+
...fields
|
|
6446
|
+
},
|
|
6447
|
+
});
|
|
6448
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
|
|
6449
|
+
const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
|
|
6450
|
+
return isResponseOk;
|
|
6451
|
+
});
|
|
6452
|
+
}
|
|
6453
|
+
catch (err) {
|
|
6454
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6455
|
+
}
|
|
6456
|
+
return retValue;
|
|
6457
|
+
}
|
|
6458
|
+
async getAthleteStravaIntegration() {
|
|
6459
|
+
const client = (0, client_1.createClient)({
|
|
6460
|
+
url: this.backendUrl + '/graphql',
|
|
6461
|
+
headers: this.headers,
|
|
6462
|
+
});
|
|
6463
|
+
let retValue = {};
|
|
6464
|
+
const fields = {
|
|
6465
|
+
_id: true,
|
|
6466
|
+
athlete: {
|
|
6467
|
+
_id: true,
|
|
6468
|
+
},
|
|
6469
|
+
hasStravaIntegration: true,
|
|
6470
|
+
stravaTokenExpires: true,
|
|
6471
|
+
stravaAthleteData: {
|
|
6472
|
+
id: true,
|
|
6473
|
+
username: true,
|
|
6474
|
+
firstname: true,
|
|
6475
|
+
lastname: true,
|
|
6476
|
+
bio: true,
|
|
6477
|
+
city: true,
|
|
6478
|
+
state: true,
|
|
6479
|
+
country: true,
|
|
6480
|
+
sex: true,
|
|
6481
|
+
premium: true,
|
|
6482
|
+
profile: true,
|
|
6483
|
+
created_at: true,
|
|
6484
|
+
updated_at: true,
|
|
6485
|
+
weight: true
|
|
6486
|
+
}
|
|
6487
|
+
};
|
|
6488
|
+
try {
|
|
6489
|
+
const response = await client.query({
|
|
6490
|
+
getAthleteStravaIntegration: {
|
|
6491
|
+
...fields
|
|
6492
|
+
},
|
|
6493
|
+
});
|
|
6494
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
|
|
6495
|
+
const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
|
|
6496
|
+
return isResponseOk;
|
|
6497
|
+
});
|
|
6498
|
+
}
|
|
6499
|
+
catch (err) {
|
|
6500
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6501
|
+
}
|
|
6502
|
+
return retValue;
|
|
6503
|
+
}
|
|
6504
|
+
async getAthleteInstagramIntegration() {
|
|
6505
|
+
const client = (0, client_1.createClient)({
|
|
6506
|
+
url: this.backendUrl + '/graphql',
|
|
6507
|
+
headers: this.headers,
|
|
6508
|
+
});
|
|
6509
|
+
let retValue = {};
|
|
6510
|
+
const fields = {
|
|
6511
|
+
_id: true,
|
|
6512
|
+
athlete: {
|
|
6513
|
+
_id: true,
|
|
6514
|
+
},
|
|
6515
|
+
hasInstagramIntegration: true,
|
|
6516
|
+
instagramTokenExpires: true,
|
|
6517
|
+
instagramUserData: {
|
|
6518
|
+
user_id: true,
|
|
6519
|
+
username: true,
|
|
6520
|
+
name: true,
|
|
6521
|
+
account_type: true,
|
|
6522
|
+
followers_count: true,
|
|
6523
|
+
media_count: true
|
|
6524
|
+
},
|
|
6525
|
+
instagramMediaData: {
|
|
6526
|
+
data: {
|
|
6527
|
+
id: true,
|
|
6528
|
+
caption: true,
|
|
6529
|
+
media_type: true,
|
|
6530
|
+
media_url: true,
|
|
6531
|
+
permalink: true,
|
|
6532
|
+
thumbnail_url: true,
|
|
6533
|
+
timestamp: true,
|
|
6534
|
+
username: true,
|
|
6535
|
+
like_count: true,
|
|
6536
|
+
comments_count: true,
|
|
6537
|
+
insights: {
|
|
6538
|
+
data: {
|
|
6539
|
+
name: true,
|
|
6540
|
+
period: true,
|
|
6541
|
+
values: true
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
},
|
|
6545
|
+
paging: {
|
|
6546
|
+
cursors: {
|
|
6547
|
+
before: true,
|
|
6548
|
+
after: true
|
|
6549
|
+
},
|
|
6550
|
+
next: true
|
|
6551
|
+
}
|
|
6552
|
+
}
|
|
6553
|
+
};
|
|
6554
|
+
try {
|
|
6555
|
+
const response = await client.query({
|
|
6556
|
+
getAthleteInstagramIntegration: {
|
|
6557
|
+
...fields
|
|
6558
|
+
},
|
|
6559
|
+
});
|
|
6560
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
|
|
6561
|
+
const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
|
|
6562
|
+
return isResponseOk;
|
|
6563
|
+
});
|
|
6564
|
+
}
|
|
6565
|
+
catch (err) {
|
|
6566
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6567
|
+
}
|
|
6568
|
+
return retValue;
|
|
6569
|
+
}
|
|
6570
|
+
async getAthleteIntegrations() {
|
|
6571
|
+
const client = (0, client_1.createClient)({
|
|
6572
|
+
url: this.backendUrl + '/graphql',
|
|
6573
|
+
headers: this.headers,
|
|
6574
|
+
});
|
|
6575
|
+
let retValue = {};
|
|
6576
|
+
const fields = {
|
|
6577
|
+
_id: true,
|
|
6578
|
+
athlete: {
|
|
6579
|
+
_id: true,
|
|
6580
|
+
},
|
|
6581
|
+
hasStravaIntegration: true,
|
|
6582
|
+
stravaTokenExpires: true,
|
|
6583
|
+
stravaAthleteData: {
|
|
6584
|
+
id: true,
|
|
6585
|
+
username: true,
|
|
6586
|
+
firstname: true,
|
|
6587
|
+
lastname: true,
|
|
6588
|
+
bio: true,
|
|
6589
|
+
city: true,
|
|
6590
|
+
state: true,
|
|
6591
|
+
country: true,
|
|
6592
|
+
sex: true,
|
|
6593
|
+
premium: true,
|
|
6594
|
+
profile: true,
|
|
6595
|
+
created_at: true,
|
|
6596
|
+
updated_at: true,
|
|
6597
|
+
weight: true
|
|
6598
|
+
},
|
|
6599
|
+
hasInstagramIntegration: true,
|
|
6600
|
+
instagramTokenExpires: true,
|
|
6601
|
+
instagramUserData: {
|
|
6602
|
+
user_id: true,
|
|
6603
|
+
username: true,
|
|
6604
|
+
name: true,
|
|
6605
|
+
account_type: true,
|
|
6606
|
+
followers_count: true,
|
|
6607
|
+
media_count: true
|
|
6608
|
+
},
|
|
6609
|
+
instagramMediaData: {
|
|
6610
|
+
data: {
|
|
6611
|
+
id: true,
|
|
6612
|
+
caption: true,
|
|
6613
|
+
media_type: true,
|
|
6614
|
+
media_url: true,
|
|
6615
|
+
permalink: true,
|
|
6616
|
+
thumbnail_url: true,
|
|
6617
|
+
timestamp: true,
|
|
6618
|
+
username: true,
|
|
6619
|
+
like_count: true,
|
|
6620
|
+
comments_count: true,
|
|
6621
|
+
insights: {
|
|
6622
|
+
data: {
|
|
6623
|
+
name: true,
|
|
6624
|
+
period: true,
|
|
6625
|
+
values: true
|
|
6626
|
+
}
|
|
6627
|
+
}
|
|
6628
|
+
},
|
|
6629
|
+
paging: {
|
|
6630
|
+
cursors: {
|
|
6631
|
+
before: true,
|
|
6632
|
+
after: true
|
|
6633
|
+
},
|
|
6634
|
+
next: true
|
|
6635
|
+
}
|
|
6636
|
+
}
|
|
6637
|
+
};
|
|
6638
|
+
try {
|
|
6639
|
+
const response = await client.query({
|
|
6640
|
+
getAthleteIntegrations: {
|
|
6641
|
+
...fields
|
|
6642
|
+
},
|
|
6643
|
+
});
|
|
6644
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6645
|
+
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6646
|
+
return isResponseOk;
|
|
6647
|
+
});
|
|
6648
|
+
}
|
|
6649
|
+
catch (err) {
|
|
6650
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6651
|
+
}
|
|
6652
|
+
return retValue;
|
|
6653
|
+
}
|
|
6654
|
+
async updateAthleteIntegration(type) {
|
|
6655
|
+
const client = (0, client_1.createClient)({
|
|
6656
|
+
url: this.backendUrl + '/graphql',
|
|
6657
|
+
headers: this.headers,
|
|
6658
|
+
});
|
|
6659
|
+
let retValue = {};
|
|
6660
|
+
try {
|
|
6661
|
+
const response = await client.mutation({
|
|
6662
|
+
updateAthleteIntegration: {
|
|
6663
|
+
__args: {
|
|
6664
|
+
type: type
|
|
6665
|
+
},
|
|
6666
|
+
}
|
|
6667
|
+
});
|
|
6668
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteIntegration', (r) => {
|
|
6669
|
+
const isResponseOk = response?.updateAthleteIntegration === true;
|
|
6670
|
+
return isResponseOk;
|
|
6671
|
+
});
|
|
6672
|
+
}
|
|
6673
|
+
catch (err) {
|
|
6674
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6675
|
+
}
|
|
6676
|
+
return retValue;
|
|
6677
|
+
}
|
|
6678
|
+
async deleteUploadedTypeKeyFile(dto) {
|
|
6679
|
+
console.log('HEADERS:');
|
|
6680
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6681
|
+
const client = (0, client_1.createClient)({
|
|
6682
|
+
url: this.backendUrl + '/graphql',
|
|
6683
|
+
headers: this.headers,
|
|
6684
|
+
});
|
|
6685
|
+
let retValue = {};
|
|
6686
|
+
const fields = {
|
|
6687
|
+
httpStatus: true,
|
|
6688
|
+
result: true,
|
|
6689
|
+
message: true,
|
|
6690
|
+
errors: true
|
|
6691
|
+
};
|
|
6692
|
+
try {
|
|
6693
|
+
const response = await client.mutation({
|
|
6694
|
+
deleteUploadedTypeKeyFile: {
|
|
6695
|
+
__args: {
|
|
6696
|
+
input: dto
|
|
6697
|
+
},
|
|
6698
|
+
...fields
|
|
6699
|
+
},
|
|
6700
|
+
});
|
|
6701
|
+
console.log('deleteUploadedTypeKeyFile Response:');
|
|
6702
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6703
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6704
|
+
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6705
|
+
return isResponseOk;
|
|
6706
|
+
});
|
|
6707
|
+
}
|
|
6708
|
+
catch (err1) {
|
|
6709
|
+
console.error('deleteUploadedTypeKeyFile err1:');
|
|
6710
|
+
console.error(err1);
|
|
6711
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6712
|
+
}
|
|
6713
|
+
console.log('retValue:');
|
|
6714
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6715
|
+
return retValue;
|
|
6716
|
+
}
|
|
6717
|
+
async saveAthleteCompetitionResult(dto) {
|
|
6718
|
+
const client = (0, client_1.createClient)({
|
|
6719
|
+
url: this.backendUrl + '/graphql',
|
|
6720
|
+
headers: this.headers,
|
|
6721
|
+
});
|
|
6722
|
+
let retValue = {};
|
|
6723
|
+
const fields = {
|
|
6724
|
+
_id: true,
|
|
6725
|
+
resultType: true,
|
|
6726
|
+
position: true,
|
|
6727
|
+
score: true,
|
|
6728
|
+
finishTimeMS: true,
|
|
6729
|
+
resultWebLink: true,
|
|
6730
|
+
};
|
|
6731
|
+
try {
|
|
6732
|
+
const response = await client.mutation({
|
|
6733
|
+
saveAthleteCompetitionResult: {
|
|
6734
|
+
__args: {
|
|
6735
|
+
input: dto
|
|
6736
|
+
},
|
|
6737
|
+
...fields
|
|
6738
|
+
},
|
|
6739
|
+
});
|
|
6740
|
+
VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
|
|
6741
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
6742
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
|
|
6743
|
+
const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
|
|
6744
|
+
return isResponseOk;
|
|
6745
|
+
});
|
|
6746
|
+
}
|
|
6747
|
+
catch (err1) {
|
|
6748
|
+
VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
|
|
6749
|
+
VTXBaseAPI.Logger.error(err1);
|
|
6750
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6751
|
+
}
|
|
6752
|
+
return retValue;
|
|
6753
|
+
}
|
|
6754
|
+
async updateAthleteTpiScore() {
|
|
6755
|
+
const client = (0, client_1.createClient)({
|
|
6756
|
+
url: this.backendUrl + '/graphql',
|
|
6757
|
+
headers: this.headers,
|
|
6758
|
+
});
|
|
6759
|
+
let retValue = {};
|
|
6760
|
+
try {
|
|
6761
|
+
const response = await client.mutation({
|
|
6762
|
+
updateAthleteTpiScore: {
|
|
6763
|
+
_id: true,
|
|
6764
|
+
firstName: true,
|
|
6765
|
+
lastName: true,
|
|
6766
|
+
scores: {
|
|
6767
|
+
vtxScore: true,
|
|
6768
|
+
socialScore: true,
|
|
6769
|
+
trainingScore: true
|
|
6770
|
+
}
|
|
6771
|
+
},
|
|
6772
|
+
});
|
|
6773
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteTpiScore', (r) => {
|
|
6774
|
+
const isResponseOk = !!response?.updateAthleteTpiScore?._id;
|
|
6775
|
+
return isResponseOk;
|
|
6776
|
+
});
|
|
6777
|
+
}
|
|
6778
|
+
catch (err) {
|
|
6779
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6780
|
+
}
|
|
6781
|
+
return retValue;
|
|
6782
|
+
}
|
|
6783
|
+
async createResetPasswordCode(email) {
|
|
6784
|
+
console.log('HEADERS:');
|
|
6785
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6786
|
+
const client = (0, client_1.createClient)({
|
|
6787
|
+
url: this.backendUrl + '/graphql',
|
|
6788
|
+
headers: this.headers,
|
|
6789
|
+
});
|
|
6790
|
+
let retValue = {};
|
|
6791
|
+
const fields = {
|
|
6792
|
+
field: true,
|
|
6793
|
+
changed: true,
|
|
6794
|
+
};
|
|
6795
|
+
try {
|
|
6796
|
+
const response = await client.mutation({
|
|
6797
|
+
createResetPasswordCode: {
|
|
6798
|
+
__args: {
|
|
6799
|
+
input: email
|
|
6800
|
+
},
|
|
6801
|
+
...fields
|
|
6802
|
+
},
|
|
6803
|
+
});
|
|
6804
|
+
console.log('createResetPasswordCode Response:');
|
|
6805
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6806
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6807
|
+
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6808
|
+
return isResponseOk;
|
|
6809
|
+
});
|
|
6810
|
+
}
|
|
6811
|
+
catch (err1) {
|
|
6812
|
+
console.error('createResetPasswordCode err1:');
|
|
6813
|
+
console.error(err1);
|
|
6814
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6815
|
+
}
|
|
6816
|
+
console.log('retValue:');
|
|
6817
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6818
|
+
return retValue;
|
|
6819
|
+
}
|
|
6820
|
+
async getResetVerificationCode(id) {
|
|
6821
|
+
console.log('HEADERS:');
|
|
6822
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6823
|
+
const client = (0, client_1.createClient)({
|
|
6824
|
+
url: this.backendUrl + '/graphql',
|
|
6825
|
+
headers: this.headers,
|
|
6826
|
+
});
|
|
6827
|
+
let retValue = {};
|
|
6828
|
+
const fields = {
|
|
6829
|
+
_id: true,
|
|
6830
|
+
type: true,
|
|
6831
|
+
recipient: true,
|
|
6832
|
+
expires: true,
|
|
6833
|
+
isExpired: true,
|
|
6834
|
+
createdDate: true,
|
|
6835
|
+
};
|
|
6836
|
+
try {
|
|
6837
|
+
const response = await client.query({
|
|
6838
|
+
getResetVerificationCode: {
|
|
6839
|
+
__args: {
|
|
6840
|
+
input: id
|
|
6841
|
+
},
|
|
6842
|
+
...fields
|
|
6843
|
+
},
|
|
6844
|
+
});
|
|
6845
|
+
console.log('getResetVerificationCode Response:');
|
|
6846
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6847
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
|
|
6848
|
+
const isResponseOk = response?.getResetVerificationCode?.changed;
|
|
6849
|
+
return isResponseOk;
|
|
6850
|
+
});
|
|
6851
|
+
}
|
|
6852
|
+
catch (err1) {
|
|
6853
|
+
console.error('getResetVerificationCode err1:');
|
|
6854
|
+
console.error(err1);
|
|
6855
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6856
|
+
}
|
|
6857
|
+
console.log('retValue:');
|
|
6858
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6859
|
+
return retValue;
|
|
6860
|
+
}
|
|
6861
|
+
async verifyCode(input) {
|
|
6862
|
+
console.log('HEADERS:');
|
|
6863
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6864
|
+
const client = (0, client_1.createClient)({
|
|
6865
|
+
url: this.backendUrl + '/graphql',
|
|
6866
|
+
headers: this.headers,
|
|
6867
|
+
});
|
|
6868
|
+
let retValue = {};
|
|
6869
|
+
const fields = {
|
|
6870
|
+
result: true,
|
|
6871
|
+
code: {
|
|
6872
|
+
_id: true,
|
|
6873
|
+
type: true,
|
|
6874
|
+
recipient: true,
|
|
6875
|
+
expires: true,
|
|
6876
|
+
isExpired: true,
|
|
6877
|
+
createdDate: true,
|
|
6878
|
+
},
|
|
6879
|
+
error: {
|
|
6880
|
+
errorCode: true,
|
|
6881
|
+
errorMessage: true,
|
|
6882
|
+
}
|
|
6883
|
+
};
|
|
6884
|
+
try {
|
|
6885
|
+
const response = await client.query({
|
|
6886
|
+
verifyCode: {
|
|
6887
|
+
__args: {
|
|
6888
|
+
input: input
|
|
6889
|
+
},
|
|
6890
|
+
...fields
|
|
6891
|
+
},
|
|
6892
|
+
});
|
|
6893
|
+
console.log('verifyCode Response:');
|
|
6894
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6895
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'verifyCode', (r) => {
|
|
6896
|
+
const isResponseOk = response?.verifyCode?.result === 'success' || response?.verifyCode?.result === 'error';
|
|
6897
|
+
return isResponseOk;
|
|
6898
|
+
});
|
|
6899
|
+
}
|
|
6900
|
+
catch (err1) {
|
|
6901
|
+
console.error('verifyCode err1:');
|
|
6902
|
+
console.error(err1);
|
|
6903
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6904
|
+
}
|
|
6905
|
+
console.log('retValue:');
|
|
6906
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6907
|
+
return retValue;
|
|
6908
|
+
}
|
|
6909
|
+
async resetUserPassword(input) {
|
|
6910
|
+
console.log('HEADERS:');
|
|
6911
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6912
|
+
const client = (0, client_1.createClient)({
|
|
6913
|
+
url: this.backendUrl + '/graphql',
|
|
6914
|
+
headers: this.headers,
|
|
6915
|
+
});
|
|
6916
|
+
let retValue = {};
|
|
6917
|
+
const fields = {
|
|
6918
|
+
field: true,
|
|
6919
|
+
changed: true,
|
|
6920
|
+
};
|
|
6921
|
+
try {
|
|
6922
|
+
const response = await client.mutation({
|
|
6923
|
+
resetUserPassword: {
|
|
6924
|
+
__args: {
|
|
6925
|
+
input: input
|
|
6926
|
+
},
|
|
6927
|
+
...fields
|
|
6928
|
+
},
|
|
6929
|
+
});
|
|
6930
|
+
console.log('resetUserPassword Response:');
|
|
6931
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6932
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'resetUserPassword', (r) => {
|
|
6933
|
+
const isResponseOk = response?.resetUserPassword?.changed;
|
|
6934
|
+
;
|
|
6935
|
+
return isResponseOk;
|
|
6936
|
+
});
|
|
6937
|
+
}
|
|
6938
|
+
catch (err1) {
|
|
6939
|
+
console.error('resetUserPassword err1:');
|
|
6940
|
+
console.error(err1);
|
|
6941
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6942
|
+
}
|
|
6943
|
+
console.log('retValue:');
|
|
6944
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6945
|
+
return retValue;
|
|
6946
|
+
}
|
|
6947
|
+
async deleteAlbumFotos(dto) {
|
|
6948
|
+
console.log('HEADERS:');
|
|
6949
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6950
|
+
const client = (0, client_1.createClient)({
|
|
6951
|
+
url: this.backendUrl + '/graphql',
|
|
6952
|
+
headers: this.headers,
|
|
6953
|
+
});
|
|
6954
|
+
let retValue = {};
|
|
6955
|
+
const fields = {
|
|
6956
|
+
deleted: true,
|
|
6957
|
+
failedToDelete: true,
|
|
6958
|
+
failureReason: {
|
|
6959
|
+
code: true,
|
|
6960
|
+
message: true
|
|
6961
|
+
},
|
|
6962
|
+
result: true,
|
|
6963
|
+
};
|
|
6964
|
+
try {
|
|
6965
|
+
const response = await client.mutation({
|
|
6966
|
+
deleteAthletePhotos: {
|
|
6967
|
+
__args: {
|
|
6968
|
+
input: dto
|
|
6969
|
+
},
|
|
6970
|
+
...fields
|
|
6971
|
+
},
|
|
6972
|
+
});
|
|
6973
|
+
console.log('deleteAthletePhotos Response:');
|
|
6974
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6975
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthletePhotos', (r) => {
|
|
6976
|
+
const isResponseOk = response?.deleteAthletePhotos?.deleted.length > 0;
|
|
6977
|
+
return isResponseOk;
|
|
6978
|
+
});
|
|
6979
|
+
}
|
|
6980
|
+
catch (err1) {
|
|
6981
|
+
console.error('deleteAthletePhotos err1:');
|
|
5705
6982
|
console.error(err1);
|
|
5706
6983
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5707
6984
|
}
|