@vertikalx/vtx-backend-client 1.0.1-dev-max.19 → 1.0.1-dev-daniel.12
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/LICENSE.md +0 -0
- 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 +1 -14
- package/src/api/vtx-base-api.js +139 -867
- 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 +80 -348
- package/src/client/schema.js +23 -98
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +37 -171
- package/src/client/types.js +252 -584
- 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 -12
- package/libs/vtx-backend-client/src/api/api-call-headers.js +0 -16
- 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 -118
- package/libs/vtx-backend-client/src/api/vtx-base-api.js +0 -7431
- 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 -4511
- package/libs/vtx-backend-client/src/client/schema.js +0 -981
- package/libs/vtx-backend-client/src/client/schema.js.map +0 -1
- package/libs/vtx-backend-client/src/client/types.d.ts +0 -2400
- package/libs/vtx-backend-client/src/client/types.js +0 -6253
- 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/create-budget.dto.d.ts +0 -15
- package/src/api/dto/create-budget.dto.js +0 -72
- package/src/api/dto/create-budget.dto.js.map +0 -1
- package/src/api/dto/create-funding-campaign.dto.d.ts +0 -21
- package/src/api/dto/create-funding-campaign.dto.js +0 -97
- package/src/api/dto/create-funding-campaign.dto.js.map +0 -1
- package/src/api/dto/get-athlete-campaigns.dto.d.ts +0 -3
- package/src/api/dto/get-athlete-campaigns.dto.js +0 -26
- package/src/api/dto/get-athlete-campaigns.dto.js.map +0 -1
- package/src/api/dto/set-current-campaign.dto.d.ts +0 -3
- package/src/api/dto/set-current-campaign.dto.js +0 -26
- package/src/api/dto/set-current-campaign.dto.js.map +0 -1
package/src/api/vtx-base-api.js
CHANGED
|
@@ -2318,17 +2318,6 @@ class VTXBaseAPI {
|
|
|
2318
2318
|
}
|
|
2319
2319
|
},
|
|
2320
2320
|
},
|
|
2321
|
-
budget: {
|
|
2322
|
-
_id: true,
|
|
2323
|
-
initialFunds: true,
|
|
2324
|
-
totalRequired: true,
|
|
2325
|
-
items: {
|
|
2326
|
-
_id: true,
|
|
2327
|
-
quantity: true,
|
|
2328
|
-
concept: true,
|
|
2329
|
-
itemCost: true
|
|
2330
|
-
}
|
|
2331
|
-
},
|
|
2332
2321
|
participationDate: true,
|
|
2333
2322
|
result: {
|
|
2334
2323
|
_id: true,
|
|
@@ -2766,7 +2755,7 @@ class VTXBaseAPI {
|
|
|
2766
2755
|
preferences: {
|
|
2767
2756
|
_id: true,
|
|
2768
2757
|
showProfileHelper: true
|
|
2769
|
-
}
|
|
2758
|
+
}
|
|
2770
2759
|
};
|
|
2771
2760
|
let retValue;
|
|
2772
2761
|
try {
|
|
@@ -4368,17 +4357,6 @@ class VTXBaseAPI {
|
|
|
4368
4357
|
finishTimeMS: true,
|
|
4369
4358
|
resultWebLink: true
|
|
4370
4359
|
},
|
|
4371
|
-
budget: {
|
|
4372
|
-
_id: true,
|
|
4373
|
-
initialFunds: true,
|
|
4374
|
-
totalRequired: true,
|
|
4375
|
-
items: {
|
|
4376
|
-
_id: true,
|
|
4377
|
-
quantity: true,
|
|
4378
|
-
concept: true,
|
|
4379
|
-
itemCost: true
|
|
4380
|
-
}
|
|
4381
|
-
},
|
|
4382
4360
|
fundRaisingCampaignIds: true
|
|
4383
4361
|
}
|
|
4384
4362
|
};
|
|
@@ -5498,18 +5476,7 @@ class VTXBaseAPI {
|
|
|
5498
5476
|
finishTimeMS: true,
|
|
5499
5477
|
resultWebLink: true,
|
|
5500
5478
|
totalParticipants: true,
|
|
5501
|
-
}
|
|
5502
|
-
budget: {
|
|
5503
|
-
_id: true,
|
|
5504
|
-
initialFunds: true,
|
|
5505
|
-
totalRequired: true,
|
|
5506
|
-
items: {
|
|
5507
|
-
_id: true,
|
|
5508
|
-
quantity: true,
|
|
5509
|
-
concept: true,
|
|
5510
|
-
itemCost: true
|
|
5511
|
-
}
|
|
5512
|
-
},
|
|
5479
|
+
}
|
|
5513
5480
|
}
|
|
5514
5481
|
},
|
|
5515
5482
|
};
|
|
@@ -5728,7 +5695,7 @@ class VTXBaseAPI {
|
|
|
5728
5695
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5729
5696
|
return retValue;
|
|
5730
5697
|
}
|
|
5731
|
-
async
|
|
5698
|
+
async deleteAthleteAlbum(dto) {
|
|
5732
5699
|
console.log('HEADERS:');
|
|
5733
5700
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5734
5701
|
const client = (0, client_1.createClient)({
|
|
@@ -5746,22 +5713,22 @@ class VTXBaseAPI {
|
|
|
5746
5713
|
};
|
|
5747
5714
|
try {
|
|
5748
5715
|
const response = await client.mutation({
|
|
5749
|
-
|
|
5716
|
+
deleteAthleteAlbum: {
|
|
5750
5717
|
__args: {
|
|
5751
5718
|
input: dto
|
|
5752
5719
|
},
|
|
5753
5720
|
...fields
|
|
5754
5721
|
},
|
|
5755
5722
|
});
|
|
5756
|
-
console.log('
|
|
5723
|
+
console.log('deleteAthleteAlbum Response:');
|
|
5757
5724
|
console.log(JSON.stringify(response, null, 2));
|
|
5758
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5759
|
-
const isResponseOk = response?.
|
|
5725
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteAlbum', (r) => {
|
|
5726
|
+
const isResponseOk = response?.deleteAthleteAlbum?.deleted;
|
|
5760
5727
|
return isResponseOk;
|
|
5761
5728
|
});
|
|
5762
5729
|
}
|
|
5763
5730
|
catch (err1) {
|
|
5764
|
-
console.error('
|
|
5731
|
+
console.error('createAthleteAlbum err1:');
|
|
5765
5732
|
console.error(err1);
|
|
5766
5733
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5767
5734
|
}
|
|
@@ -5769,41 +5736,46 @@ class VTXBaseAPI {
|
|
|
5769
5736
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5770
5737
|
return retValue;
|
|
5771
5738
|
}
|
|
5772
|
-
async
|
|
5739
|
+
async getAthleteAlbums() {
|
|
5773
5740
|
console.log('HEADERS:');
|
|
5774
5741
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5775
5742
|
const client = (0, client_1.createClient)({
|
|
5776
5743
|
url: this.backendUrl + '/graphql',
|
|
5777
5744
|
headers: this.headers,
|
|
5778
5745
|
});
|
|
5779
|
-
let retValue
|
|
5746
|
+
let retValue;
|
|
5780
5747
|
const fields = {
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5748
|
+
_id: true,
|
|
5749
|
+
label: true,
|
|
5750
|
+
description: true,
|
|
5751
|
+
photos: {
|
|
5752
|
+
_id: true,
|
|
5753
|
+
photo: {
|
|
5754
|
+
_id: true,
|
|
5755
|
+
name: true,
|
|
5756
|
+
contentType: true,
|
|
5757
|
+
size: true,
|
|
5758
|
+
useType: true,
|
|
5759
|
+
url: true,
|
|
5760
|
+
}
|
|
5761
|
+
}
|
|
5788
5762
|
};
|
|
5789
5763
|
try {
|
|
5790
|
-
const response = await client.
|
|
5791
|
-
|
|
5792
|
-
__args: {
|
|
5793
|
-
input: dto
|
|
5794
|
-
},
|
|
5764
|
+
const response = await client.query({
|
|
5765
|
+
getAthleteAlbums: {
|
|
5766
|
+
__args: {},
|
|
5795
5767
|
...fields
|
|
5796
|
-
}
|
|
5768
|
+
},
|
|
5797
5769
|
});
|
|
5798
|
-
console.log('
|
|
5770
|
+
console.log('getAthleteAlbums Response:');
|
|
5799
5771
|
console.log(JSON.stringify(response, null, 2));
|
|
5800
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5801
|
-
const isResponseOk = response?.
|
|
5772
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5773
|
+
const isResponseOk = response?.getAthleteAlbums.length > 0;
|
|
5802
5774
|
return isResponseOk;
|
|
5803
5775
|
});
|
|
5804
5776
|
}
|
|
5805
5777
|
catch (err1) {
|
|
5806
|
-
console.error('
|
|
5778
|
+
console.error('getAthleteAlbums err1:');
|
|
5807
5779
|
console.error(err1);
|
|
5808
5780
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5809
5781
|
}
|
|
@@ -5811,142 +5783,96 @@ class VTXBaseAPI {
|
|
|
5811
5783
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5812
5784
|
return retValue;
|
|
5813
5785
|
}
|
|
5814
|
-
async
|
|
5786
|
+
async getPublicAthleteAlbums(athleteId) {
|
|
5815
5787
|
console.log('HEADERS:');
|
|
5816
5788
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5817
5789
|
const client = (0, client_1.createClient)({
|
|
5818
5790
|
url: this.backendUrl + '/graphql',
|
|
5819
5791
|
headers: this.headers,
|
|
5820
5792
|
});
|
|
5821
|
-
let retValue
|
|
5793
|
+
let retValue;
|
|
5822
5794
|
const fields = {
|
|
5823
5795
|
_id: true,
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
fundsRequired: true,
|
|
5830
|
-
initialFundsObtained: true,
|
|
5831
|
-
fundsObtained: true,
|
|
5832
|
-
vtxComissionPct: true,
|
|
5833
|
-
location: {
|
|
5834
|
-
userProvidedLatitude: true,
|
|
5835
|
-
userProvidedLongitude: true,
|
|
5836
|
-
cityNameGeocode: true,
|
|
5837
|
-
stateNameGeocode: true,
|
|
5838
|
-
countryIso2CodeGeocode: true,
|
|
5839
|
-
timeZoneGeocode: true,
|
|
5840
|
-
latitudeGeocode: true,
|
|
5841
|
-
longitudeGeocode: true,
|
|
5842
|
-
city: {
|
|
5796
|
+
label: true,
|
|
5797
|
+
description: true,
|
|
5798
|
+
photos: {
|
|
5799
|
+
_id: true,
|
|
5800
|
+
photo: {
|
|
5843
5801
|
_id: true,
|
|
5844
5802
|
name: true,
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
country: {
|
|
5850
|
-
_id: true,
|
|
5851
|
-
name: true
|
|
5852
|
-
}
|
|
5853
|
-
},
|
|
5854
|
-
latitude: true,
|
|
5855
|
-
longitude: true,
|
|
5856
|
-
timezone: true,
|
|
5857
|
-
}
|
|
5858
|
-
},
|
|
5859
|
-
endingDate: true,
|
|
5860
|
-
budget: {
|
|
5861
|
-
initialFunds: true,
|
|
5862
|
-
totalRequired: true,
|
|
5863
|
-
items: {
|
|
5864
|
-
_id: true,
|
|
5865
|
-
quantity: true,
|
|
5866
|
-
concept: true,
|
|
5867
|
-
itemCost: true
|
|
5803
|
+
contentType: true,
|
|
5804
|
+
size: true,
|
|
5805
|
+
useType: true,
|
|
5806
|
+
url: true,
|
|
5868
5807
|
}
|
|
5869
|
-
}
|
|
5870
|
-
|
|
5808
|
+
}
|
|
5809
|
+
};
|
|
5810
|
+
try {
|
|
5811
|
+
const response = await client.query({
|
|
5812
|
+
getPublicAthleteAlbums: {
|
|
5813
|
+
__args: {
|
|
5814
|
+
athleteId: athleteId
|
|
5815
|
+
},
|
|
5816
|
+
...fields
|
|
5817
|
+
},
|
|
5818
|
+
});
|
|
5819
|
+
console.log('getPublicAthleteAlbums Response:');
|
|
5820
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5821
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getPublicAthleteAlbums', (r) => {
|
|
5822
|
+
const isResponseOk = response?.getPublicAthleteAlbums.length > 0;
|
|
5823
|
+
return isResponseOk;
|
|
5824
|
+
});
|
|
5825
|
+
}
|
|
5826
|
+
catch (err1) {
|
|
5827
|
+
console.error('getPublicAthleteAlbums err1:');
|
|
5828
|
+
console.error(err1);
|
|
5829
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5830
|
+
}
|
|
5831
|
+
console.log('retValue:');
|
|
5832
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5833
|
+
return retValue;
|
|
5834
|
+
}
|
|
5835
|
+
async getAthleteAlbumsById(albumId) {
|
|
5836
|
+
console.log('HEADERS:');
|
|
5837
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5838
|
+
const client = (0, client_1.createClient)({
|
|
5839
|
+
url: this.backendUrl + '/graphql',
|
|
5840
|
+
headers: this.headers,
|
|
5841
|
+
});
|
|
5842
|
+
let retValue = {};
|
|
5843
|
+
const fields = {
|
|
5844
|
+
label: true,
|
|
5845
|
+
description: true,
|
|
5846
|
+
photos: {
|
|
5871
5847
|
_id: true,
|
|
5872
|
-
|
|
5848
|
+
photo: {
|
|
5873
5849
|
_id: true,
|
|
5874
5850
|
name: true,
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
startDate: true,
|
|
5881
|
-
endDate: true,
|
|
5882
|
-
verified: true,
|
|
5883
|
-
banner: {
|
|
5884
|
-
_id: true,
|
|
5885
|
-
name: true,
|
|
5886
|
-
contentType: true,
|
|
5887
|
-
size: true,
|
|
5888
|
-
useType: true,
|
|
5889
|
-
url: true,
|
|
5890
|
-
key: true
|
|
5891
|
-
},
|
|
5892
|
-
location: {
|
|
5893
|
-
_id: true,
|
|
5894
|
-
userProvidedLatitude: true,
|
|
5895
|
-
userProvidedLongitude: true,
|
|
5896
|
-
cityNameGeocode: true,
|
|
5897
|
-
stateNameGeocode: true,
|
|
5898
|
-
countryIso2CodeGeocode: true,
|
|
5899
|
-
timeZoneGeocode: true,
|
|
5900
|
-
latitudeGeocode: true,
|
|
5901
|
-
longitudeGeocode: true,
|
|
5902
|
-
city: {
|
|
5903
|
-
_id: true,
|
|
5904
|
-
name: true,
|
|
5905
|
-
localizedName: true,
|
|
5906
|
-
state: {
|
|
5907
|
-
_id: true,
|
|
5908
|
-
name: true,
|
|
5909
|
-
country: {
|
|
5910
|
-
_id: true,
|
|
5911
|
-
name: true
|
|
5912
|
-
}
|
|
5913
|
-
},
|
|
5914
|
-
latitude: true,
|
|
5915
|
-
longitude: true,
|
|
5916
|
-
timezone: true,
|
|
5917
|
-
}
|
|
5918
|
-
},
|
|
5919
|
-
},
|
|
5920
|
-
participationDate: true,
|
|
5921
|
-
competitionNumber: true,
|
|
5922
|
-
result: {
|
|
5923
|
-
resultType: true,
|
|
5924
|
-
position: true,
|
|
5925
|
-
score: true,
|
|
5926
|
-
finishTimeMS: true,
|
|
5927
|
-
resultWebLink: true
|
|
5928
|
-
},
|
|
5929
|
-
fundRaisingCampaignIds: true
|
|
5851
|
+
contentType: true,
|
|
5852
|
+
size: true,
|
|
5853
|
+
useType: true,
|
|
5854
|
+
url: true,
|
|
5855
|
+
}
|
|
5930
5856
|
}
|
|
5931
5857
|
};
|
|
5932
5858
|
try {
|
|
5933
|
-
const response = await client.
|
|
5934
|
-
|
|
5859
|
+
const response = await client.query({
|
|
5860
|
+
getAthleteAlbumId: {
|
|
5935
5861
|
__args: {
|
|
5936
|
-
input:
|
|
5862
|
+
input: albumId
|
|
5937
5863
|
},
|
|
5938
5864
|
...fields
|
|
5939
5865
|
},
|
|
5940
5866
|
});
|
|
5941
|
-
console.log('
|
|
5867
|
+
console.log('getAthleteAlbumId Response:');
|
|
5942
5868
|
console.log(JSON.stringify(response, null, 2));
|
|
5943
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5944
|
-
const isResponseOk = response?.
|
|
5869
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
|
|
5870
|
+
const isResponseOk = response?.getAthleteAlbumId?._id;
|
|
5945
5871
|
return isResponseOk;
|
|
5946
5872
|
});
|
|
5947
5873
|
}
|
|
5948
5874
|
catch (err1) {
|
|
5949
|
-
console.error('
|
|
5875
|
+
console.error('getAthleteAlbumId err1:');
|
|
5950
5876
|
console.error(err1);
|
|
5951
5877
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5952
5878
|
}
|
|
@@ -5954,335 +5880,7 @@ class VTXBaseAPI {
|
|
|
5954
5880
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5955
5881
|
return retValue;
|
|
5956
5882
|
}
|
|
5957
|
-
async
|
|
5958
|
-
console.log('HEADERS:');
|
|
5959
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
5960
|
-
const client = (0, client_1.createClient)({
|
|
5961
|
-
url: this.backendUrl + '/graphql',
|
|
5962
|
-
headers: this.headers,
|
|
5963
|
-
});
|
|
5964
|
-
let retValue = {};
|
|
5965
|
-
const fields = {
|
|
5966
|
-
_id: true,
|
|
5967
|
-
budgetMode: true,
|
|
5968
|
-
status: true,
|
|
5969
|
-
title: true,
|
|
5970
|
-
motivation: true,
|
|
5971
|
-
website: true,
|
|
5972
|
-
fundsRequired: true,
|
|
5973
|
-
initialFundsObtained: true,
|
|
5974
|
-
fundsObtained: true,
|
|
5975
|
-
vtxComissionPct: true,
|
|
5976
|
-
location: {
|
|
5977
|
-
userProvidedLatitude: true,
|
|
5978
|
-
userProvidedLongitude: true,
|
|
5979
|
-
cityNameGeocode: true,
|
|
5980
|
-
stateNameGeocode: true,
|
|
5981
|
-
countryIso2CodeGeocode: true,
|
|
5982
|
-
timeZoneGeocode: true,
|
|
5983
|
-
latitudeGeocode: true,
|
|
5984
|
-
longitudeGeocode: true,
|
|
5985
|
-
city: {
|
|
5986
|
-
_id: true,
|
|
5987
|
-
name: true,
|
|
5988
|
-
localizedName: true,
|
|
5989
|
-
state: {
|
|
5990
|
-
_id: true,
|
|
5991
|
-
name: true,
|
|
5992
|
-
country: {
|
|
5993
|
-
_id: true,
|
|
5994
|
-
name: true
|
|
5995
|
-
}
|
|
5996
|
-
},
|
|
5997
|
-
latitude: true,
|
|
5998
|
-
longitude: true,
|
|
5999
|
-
timezone: true,
|
|
6000
|
-
}
|
|
6001
|
-
},
|
|
6002
|
-
endingDate: true,
|
|
6003
|
-
budget: {
|
|
6004
|
-
initialFunds: true,
|
|
6005
|
-
totalRequired: true,
|
|
6006
|
-
items: {
|
|
6007
|
-
_id: true,
|
|
6008
|
-
quantity: true,
|
|
6009
|
-
concept: true,
|
|
6010
|
-
itemCost: true
|
|
6011
|
-
}
|
|
6012
|
-
},
|
|
6013
|
-
competitions: {
|
|
6014
|
-
_id: true,
|
|
6015
|
-
event: {
|
|
6016
|
-
_id: true,
|
|
6017
|
-
name: true,
|
|
6018
|
-
mainSport: {
|
|
6019
|
-
_id: true,
|
|
6020
|
-
name: true
|
|
6021
|
-
},
|
|
6022
|
-
eventWebSite: true,
|
|
6023
|
-
startDate: true,
|
|
6024
|
-
endDate: true,
|
|
6025
|
-
verified: true,
|
|
6026
|
-
banner: {
|
|
6027
|
-
_id: true,
|
|
6028
|
-
name: true,
|
|
6029
|
-
contentType: true,
|
|
6030
|
-
size: true,
|
|
6031
|
-
useType: true,
|
|
6032
|
-
url: true,
|
|
6033
|
-
key: true
|
|
6034
|
-
},
|
|
6035
|
-
location: {
|
|
6036
|
-
_id: true,
|
|
6037
|
-
userProvidedLatitude: true,
|
|
6038
|
-
userProvidedLongitude: true,
|
|
6039
|
-
cityNameGeocode: true,
|
|
6040
|
-
stateNameGeocode: true,
|
|
6041
|
-
countryIso2CodeGeocode: true,
|
|
6042
|
-
timeZoneGeocode: true,
|
|
6043
|
-
latitudeGeocode: true,
|
|
6044
|
-
longitudeGeocode: true,
|
|
6045
|
-
city: {
|
|
6046
|
-
_id: true,
|
|
6047
|
-
name: true,
|
|
6048
|
-
localizedName: true,
|
|
6049
|
-
state: {
|
|
6050
|
-
_id: true,
|
|
6051
|
-
name: true,
|
|
6052
|
-
country: {
|
|
6053
|
-
_id: true,
|
|
6054
|
-
name: true
|
|
6055
|
-
}
|
|
6056
|
-
},
|
|
6057
|
-
latitude: true,
|
|
6058
|
-
longitude: true,
|
|
6059
|
-
timezone: true,
|
|
6060
|
-
}
|
|
6061
|
-
},
|
|
6062
|
-
},
|
|
6063
|
-
participationDate: true,
|
|
6064
|
-
competitionNumber: true,
|
|
6065
|
-
result: {
|
|
6066
|
-
resultType: true,
|
|
6067
|
-
position: true,
|
|
6068
|
-
score: true,
|
|
6069
|
-
finishTimeMS: true,
|
|
6070
|
-
resultWebLink: true
|
|
6071
|
-
},
|
|
6072
|
-
fundRaisingCampaignIds: true
|
|
6073
|
-
}
|
|
6074
|
-
};
|
|
6075
|
-
try {
|
|
6076
|
-
const response = await client.mutation({
|
|
6077
|
-
setCurrentCampaign: {
|
|
6078
|
-
__args: {
|
|
6079
|
-
input: dto
|
|
6080
|
-
},
|
|
6081
|
-
...fields
|
|
6082
|
-
},
|
|
6083
|
-
});
|
|
6084
|
-
console.log('setCurrentCampaign Response:');
|
|
6085
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6086
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'setCurrentCampaign', (r) => {
|
|
6087
|
-
const isResponseOk = response?.setCurrentCampaign?._id;
|
|
6088
|
-
return isResponseOk;
|
|
6089
|
-
});
|
|
6090
|
-
}
|
|
6091
|
-
catch (err1) {
|
|
6092
|
-
console.error('setCurrentCampaign err1:');
|
|
6093
|
-
console.error(err1);
|
|
6094
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6095
|
-
}
|
|
6096
|
-
console.log('retValue:');
|
|
6097
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6098
|
-
return retValue;
|
|
6099
|
-
}
|
|
6100
|
-
async deleteAthleteAlbum(dto) {
|
|
6101
|
-
console.log('HEADERS:');
|
|
6102
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6103
|
-
const client = (0, client_1.createClient)({
|
|
6104
|
-
url: this.backendUrl + '/graphql',
|
|
6105
|
-
headers: this.headers,
|
|
6106
|
-
});
|
|
6107
|
-
let retValue = {};
|
|
6108
|
-
const fields = {
|
|
6109
|
-
idToDelete: true,
|
|
6110
|
-
deleted: true,
|
|
6111
|
-
failureReason: {
|
|
6112
|
-
code: true,
|
|
6113
|
-
message: true
|
|
6114
|
-
}
|
|
6115
|
-
};
|
|
6116
|
-
try {
|
|
6117
|
-
const response = await client.mutation({
|
|
6118
|
-
deleteAthleteAlbum: {
|
|
6119
|
-
__args: {
|
|
6120
|
-
input: dto
|
|
6121
|
-
},
|
|
6122
|
-
...fields
|
|
6123
|
-
},
|
|
6124
|
-
});
|
|
6125
|
-
console.log('deleteAthleteAlbum Response:');
|
|
6126
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6127
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteAlbum', (r) => {
|
|
6128
|
-
const isResponseOk = response?.deleteAthleteAlbum?.deleted;
|
|
6129
|
-
return isResponseOk;
|
|
6130
|
-
});
|
|
6131
|
-
}
|
|
6132
|
-
catch (err1) {
|
|
6133
|
-
console.error('createAthleteAlbum err1:');
|
|
6134
|
-
console.error(err1);
|
|
6135
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6136
|
-
}
|
|
6137
|
-
console.log('retValue:');
|
|
6138
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6139
|
-
return retValue;
|
|
6140
|
-
}
|
|
6141
|
-
async getAthleteAlbums() {
|
|
6142
|
-
console.log('HEADERS:');
|
|
6143
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6144
|
-
const client = (0, client_1.createClient)({
|
|
6145
|
-
url: this.backendUrl + '/graphql',
|
|
6146
|
-
headers: this.headers,
|
|
6147
|
-
});
|
|
6148
|
-
let retValue;
|
|
6149
|
-
const fields = {
|
|
6150
|
-
_id: true,
|
|
6151
|
-
label: true,
|
|
6152
|
-
description: true,
|
|
6153
|
-
photos: {
|
|
6154
|
-
_id: true,
|
|
6155
|
-
photo: {
|
|
6156
|
-
_id: true,
|
|
6157
|
-
name: true,
|
|
6158
|
-
contentType: true,
|
|
6159
|
-
size: true,
|
|
6160
|
-
useType: true,
|
|
6161
|
-
url: true,
|
|
6162
|
-
}
|
|
6163
|
-
}
|
|
6164
|
-
};
|
|
6165
|
-
try {
|
|
6166
|
-
const response = await client.query({
|
|
6167
|
-
getAthleteAlbums: {
|
|
6168
|
-
__args: {},
|
|
6169
|
-
...fields
|
|
6170
|
-
},
|
|
6171
|
-
});
|
|
6172
|
-
console.log('getAthleteAlbums Response:');
|
|
6173
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6174
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
6175
|
-
const isResponseOk = response?.getAthleteAlbums.length > 0;
|
|
6176
|
-
return isResponseOk;
|
|
6177
|
-
});
|
|
6178
|
-
}
|
|
6179
|
-
catch (err1) {
|
|
6180
|
-
console.error('getAthleteAlbums err1:');
|
|
6181
|
-
console.error(err1);
|
|
6182
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6183
|
-
}
|
|
6184
|
-
console.log('retValue:');
|
|
6185
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6186
|
-
return retValue;
|
|
6187
|
-
}
|
|
6188
|
-
async getPublicAthleteAlbums(athleteId) {
|
|
6189
|
-
console.log('HEADERS:');
|
|
6190
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6191
|
-
const client = (0, client_1.createClient)({
|
|
6192
|
-
url: this.backendUrl + '/graphql',
|
|
6193
|
-
headers: this.headers,
|
|
6194
|
-
});
|
|
6195
|
-
let retValue;
|
|
6196
|
-
const fields = {
|
|
6197
|
-
_id: true,
|
|
6198
|
-
label: true,
|
|
6199
|
-
description: true,
|
|
6200
|
-
photos: {
|
|
6201
|
-
_id: true,
|
|
6202
|
-
photo: {
|
|
6203
|
-
_id: true,
|
|
6204
|
-
name: true,
|
|
6205
|
-
contentType: true,
|
|
6206
|
-
size: true,
|
|
6207
|
-
useType: true,
|
|
6208
|
-
url: true,
|
|
6209
|
-
}
|
|
6210
|
-
}
|
|
6211
|
-
};
|
|
6212
|
-
try {
|
|
6213
|
-
const response = await client.query({
|
|
6214
|
-
getPublicAthleteAlbums: {
|
|
6215
|
-
__args: {
|
|
6216
|
-
athleteId: athleteId
|
|
6217
|
-
},
|
|
6218
|
-
...fields
|
|
6219
|
-
},
|
|
6220
|
-
});
|
|
6221
|
-
console.log('getPublicAthleteAlbums Response:');
|
|
6222
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6223
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getPublicAthleteAlbums', (r) => {
|
|
6224
|
-
const isResponseOk = response?.getPublicAthleteAlbums.length > 0;
|
|
6225
|
-
return isResponseOk;
|
|
6226
|
-
});
|
|
6227
|
-
}
|
|
6228
|
-
catch (err1) {
|
|
6229
|
-
console.error('getPublicAthleteAlbums err1:');
|
|
6230
|
-
console.error(err1);
|
|
6231
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6232
|
-
}
|
|
6233
|
-
console.log('retValue:');
|
|
6234
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6235
|
-
return retValue;
|
|
6236
|
-
}
|
|
6237
|
-
async getAthleteAlbumsById(albumId) {
|
|
6238
|
-
console.log('HEADERS:');
|
|
6239
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6240
|
-
const client = (0, client_1.createClient)({
|
|
6241
|
-
url: this.backendUrl + '/graphql',
|
|
6242
|
-
headers: this.headers,
|
|
6243
|
-
});
|
|
6244
|
-
let retValue = {};
|
|
6245
|
-
const fields = {
|
|
6246
|
-
label: true,
|
|
6247
|
-
description: true,
|
|
6248
|
-
photos: {
|
|
6249
|
-
_id: true,
|
|
6250
|
-
photo: {
|
|
6251
|
-
_id: true,
|
|
6252
|
-
name: true,
|
|
6253
|
-
contentType: true,
|
|
6254
|
-
size: true,
|
|
6255
|
-
useType: true,
|
|
6256
|
-
url: true,
|
|
6257
|
-
}
|
|
6258
|
-
}
|
|
6259
|
-
};
|
|
6260
|
-
try {
|
|
6261
|
-
const response = await client.query({
|
|
6262
|
-
getAthleteAlbumId: {
|
|
6263
|
-
__args: {
|
|
6264
|
-
input: albumId
|
|
6265
|
-
},
|
|
6266
|
-
...fields
|
|
6267
|
-
},
|
|
6268
|
-
});
|
|
6269
|
-
console.log('getAthleteAlbumId Response:');
|
|
6270
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6271
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
|
|
6272
|
-
const isResponseOk = response?.getAthleteAlbumId?._id;
|
|
6273
|
-
return isResponseOk;
|
|
6274
|
-
});
|
|
6275
|
-
}
|
|
6276
|
-
catch (err1) {
|
|
6277
|
-
console.error('getAthleteAlbumId err1:');
|
|
6278
|
-
console.error(err1);
|
|
6279
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6280
|
-
}
|
|
6281
|
-
console.log('retValue:');
|
|
6282
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6283
|
-
return retValue;
|
|
6284
|
-
}
|
|
6285
|
-
async getAndSetAlbumById(albumId) {
|
|
5883
|
+
async getAndSetAlbumById(albumId) {
|
|
6286
5884
|
console.log('HEADERS:');
|
|
6287
5885
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
6288
5886
|
const client = (0, client_1.createClient)({
|
|
@@ -6653,210 +6251,64 @@ class VTXBaseAPI {
|
|
|
6653
6251
|
state: true,
|
|
6654
6252
|
country: true,
|
|
6655
6253
|
sex: true,
|
|
6656
|
-
premium: true,
|
|
6657
|
-
profile: true,
|
|
6658
|
-
created_at: true,
|
|
6659
|
-
updated_at: true,
|
|
6660
|
-
weight: true
|
|
6661
|
-
},
|
|
6662
|
-
hasInstagramIntegration: true,
|
|
6663
|
-
instagramTokenExpires: true,
|
|
6664
|
-
instagramUserData: {
|
|
6665
|
-
user_id: true,
|
|
6666
|
-
username: true,
|
|
6667
|
-
name: true,
|
|
6668
|
-
account_type: true,
|
|
6669
|
-
followers_count: true,
|
|
6670
|
-
media_count: true
|
|
6671
|
-
},
|
|
6672
|
-
instagramMediaData: {
|
|
6673
|
-
data: {
|
|
6674
|
-
id: true,
|
|
6675
|
-
caption: true,
|
|
6676
|
-
media_type: true,
|
|
6677
|
-
media_url: true,
|
|
6678
|
-
permalink: true,
|
|
6679
|
-
thumbnail_url: true,
|
|
6680
|
-
timestamp: true,
|
|
6681
|
-
username: true,
|
|
6682
|
-
like_count: true,
|
|
6683
|
-
comments_count: true,
|
|
6684
|
-
insights: {
|
|
6685
|
-
data: {
|
|
6686
|
-
name: true,
|
|
6687
|
-
period: true,
|
|
6688
|
-
values: true
|
|
6689
|
-
}
|
|
6690
|
-
}
|
|
6691
|
-
},
|
|
6692
|
-
paging: {
|
|
6693
|
-
cursors: {
|
|
6694
|
-
before: true,
|
|
6695
|
-
after: true
|
|
6696
|
-
},
|
|
6697
|
-
next: true
|
|
6698
|
-
}
|
|
6699
|
-
}
|
|
6700
|
-
};
|
|
6701
|
-
try {
|
|
6702
|
-
const response = await client.query({
|
|
6703
|
-
getAthleteIntegrations: {
|
|
6704
|
-
...fields
|
|
6705
|
-
},
|
|
6706
|
-
});
|
|
6707
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6708
|
-
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6709
|
-
return isResponseOk;
|
|
6710
|
-
});
|
|
6711
|
-
}
|
|
6712
|
-
catch (err) {
|
|
6713
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6714
|
-
}
|
|
6715
|
-
return retValue;
|
|
6716
|
-
}
|
|
6717
|
-
async getAthleteCampaigns(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
|
-
budgetMode: true,
|
|
6726
|
-
status: true,
|
|
6727
|
-
title: true,
|
|
6728
|
-
motivation: true,
|
|
6729
|
-
website: true,
|
|
6730
|
-
fundsRequired: true,
|
|
6731
|
-
initialFundsObtained: true,
|
|
6732
|
-
fundsObtained: true,
|
|
6733
|
-
vtxComissionPct: true,
|
|
6734
|
-
location: {
|
|
6735
|
-
userProvidedLatitude: true,
|
|
6736
|
-
userProvidedLongitude: true,
|
|
6737
|
-
cityNameGeocode: true,
|
|
6738
|
-
stateNameGeocode: true,
|
|
6739
|
-
countryIso2CodeGeocode: true,
|
|
6740
|
-
timeZoneGeocode: true,
|
|
6741
|
-
latitudeGeocode: true,
|
|
6742
|
-
longitudeGeocode: true,
|
|
6743
|
-
city: {
|
|
6744
|
-
_id: true,
|
|
6745
|
-
name: true,
|
|
6746
|
-
localizedName: true,
|
|
6747
|
-
state: {
|
|
6748
|
-
_id: true,
|
|
6749
|
-
name: true,
|
|
6750
|
-
country: {
|
|
6751
|
-
_id: true,
|
|
6752
|
-
name: true
|
|
6753
|
-
}
|
|
6754
|
-
},
|
|
6755
|
-
latitude: true,
|
|
6756
|
-
longitude: true,
|
|
6757
|
-
timezone: true,
|
|
6758
|
-
}
|
|
6254
|
+
premium: true,
|
|
6255
|
+
profile: true,
|
|
6256
|
+
created_at: true,
|
|
6257
|
+
updated_at: true,
|
|
6258
|
+
weight: true
|
|
6759
6259
|
},
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
itemCost: true
|
|
6770
|
-
}
|
|
6260
|
+
hasInstagramIntegration: true,
|
|
6261
|
+
instagramTokenExpires: true,
|
|
6262
|
+
instagramUserData: {
|
|
6263
|
+
user_id: true,
|
|
6264
|
+
username: true,
|
|
6265
|
+
name: true,
|
|
6266
|
+
account_type: true,
|
|
6267
|
+
followers_count: true,
|
|
6268
|
+
media_count: true
|
|
6771
6269
|
},
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
_id: true,
|
|
6787
|
-
name: true,
|
|
6788
|
-
contentType: true,
|
|
6789
|
-
size: true,
|
|
6790
|
-
useType: true,
|
|
6791
|
-
url: true,
|
|
6792
|
-
key: true
|
|
6793
|
-
},
|
|
6794
|
-
location: {
|
|
6795
|
-
_id: true,
|
|
6796
|
-
userProvidedLatitude: true,
|
|
6797
|
-
userProvidedLongitude: true,
|
|
6798
|
-
cityNameGeocode: true,
|
|
6799
|
-
stateNameGeocode: true,
|
|
6800
|
-
countryIso2CodeGeocode: true,
|
|
6801
|
-
timeZoneGeocode: true,
|
|
6802
|
-
latitudeGeocode: true,
|
|
6803
|
-
longitudeGeocode: true,
|
|
6804
|
-
city: {
|
|
6805
|
-
_id: true,
|
|
6270
|
+
instagramMediaData: {
|
|
6271
|
+
data: {
|
|
6272
|
+
id: true,
|
|
6273
|
+
caption: true,
|
|
6274
|
+
media_type: true,
|
|
6275
|
+
media_url: true,
|
|
6276
|
+
permalink: true,
|
|
6277
|
+
thumbnail_url: true,
|
|
6278
|
+
timestamp: true,
|
|
6279
|
+
username: true,
|
|
6280
|
+
like_count: true,
|
|
6281
|
+
comments_count: true,
|
|
6282
|
+
insights: {
|
|
6283
|
+
data: {
|
|
6806
6284
|
name: true,
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
_id: true,
|
|
6810
|
-
name: true,
|
|
6811
|
-
country: {
|
|
6812
|
-
_id: true,
|
|
6813
|
-
name: true
|
|
6814
|
-
}
|
|
6815
|
-
},
|
|
6816
|
-
latitude: true,
|
|
6817
|
-
longitude: true,
|
|
6818
|
-
timezone: true,
|
|
6285
|
+
period: true,
|
|
6286
|
+
values: true
|
|
6819
6287
|
}
|
|
6820
|
-
},
|
|
6821
|
-
},
|
|
6822
|
-
participationDate: true,
|
|
6823
|
-
competitionNumber: true,
|
|
6824
|
-
budget: {
|
|
6825
|
-
initialFunds: true,
|
|
6826
|
-
totalRequired: true,
|
|
6827
|
-
items: {
|
|
6828
|
-
_id: true,
|
|
6829
|
-
quantity: true,
|
|
6830
|
-
concept: true,
|
|
6831
|
-
itemCost: true
|
|
6832
6288
|
}
|
|
6833
6289
|
},
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
}
|
|
6841
|
-
fundRaisingCampaignIds: true
|
|
6290
|
+
paging: {
|
|
6291
|
+
cursors: {
|
|
6292
|
+
before: true,
|
|
6293
|
+
after: true
|
|
6294
|
+
},
|
|
6295
|
+
next: true
|
|
6296
|
+
}
|
|
6842
6297
|
}
|
|
6843
6298
|
};
|
|
6844
6299
|
try {
|
|
6845
6300
|
const response = await client.query({
|
|
6846
|
-
|
|
6847
|
-
__args: { input: dto },
|
|
6301
|
+
getAthleteIntegrations: {
|
|
6848
6302
|
...fields
|
|
6849
|
-
}
|
|
6303
|
+
},
|
|
6850
6304
|
});
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteCampaigns', (r) => {
|
|
6854
|
-
const isResponseOk = true && Array.isArray(response?.getAthleteCampaigns);
|
|
6305
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6306
|
+
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6855
6307
|
return isResponseOk;
|
|
6856
6308
|
});
|
|
6857
6309
|
}
|
|
6858
|
-
catch (
|
|
6859
|
-
retValue = (0, response_builder_1.buildErrorResponse)(
|
|
6310
|
+
catch (err) {
|
|
6311
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6860
6312
|
}
|
|
6861
6313
|
return retValue;
|
|
6862
6314
|
}
|
|
@@ -7235,186 +6687,6 @@ class VTXBaseAPI {
|
|
|
7235
6687
|
console.log(JSON.stringify(retValue, null, 2));
|
|
7236
6688
|
return retValue;
|
|
7237
6689
|
}
|
|
7238
|
-
async getBudgetsByAthlete() {
|
|
7239
|
-
const client = (0, client_1.createClient)({
|
|
7240
|
-
url: this.backendUrl + '/graphql',
|
|
7241
|
-
headers: this.headers,
|
|
7242
|
-
});
|
|
7243
|
-
let retValue = {};
|
|
7244
|
-
const fields = {
|
|
7245
|
-
competitions: {
|
|
7246
|
-
id: true,
|
|
7247
|
-
dateCreated: true,
|
|
7248
|
-
type: true,
|
|
7249
|
-
name: true,
|
|
7250
|
-
eventDate: true,
|
|
7251
|
-
budget: true,
|
|
7252
|
-
campaign: true,
|
|
7253
|
-
items: {
|
|
7254
|
-
_id: true,
|
|
7255
|
-
concept: true,
|
|
7256
|
-
quantity: true,
|
|
7257
|
-
itemCost: true,
|
|
7258
|
-
totalCost: true
|
|
7259
|
-
}
|
|
7260
|
-
},
|
|
7261
|
-
campaigns: {
|
|
7262
|
-
id: true,
|
|
7263
|
-
dateCreated: true,
|
|
7264
|
-
type: true,
|
|
7265
|
-
name: true,
|
|
7266
|
-
fundsRequired: true,
|
|
7267
|
-
initialFundsObtained: true,
|
|
7268
|
-
status: true,
|
|
7269
|
-
endingDate: true,
|
|
7270
|
-
budget: true,
|
|
7271
|
-
competitions: true,
|
|
7272
|
-
items: {
|
|
7273
|
-
_id: true,
|
|
7274
|
-
concept: true,
|
|
7275
|
-
quantity: true,
|
|
7276
|
-
itemCost: true,
|
|
7277
|
-
totalCost: true
|
|
7278
|
-
},
|
|
7279
|
-
competitionBudgets: {
|
|
7280
|
-
competitionId: true,
|
|
7281
|
-
eventName: true,
|
|
7282
|
-
budget: {
|
|
7283
|
-
_id: true,
|
|
7284
|
-
items: {
|
|
7285
|
-
_id: true,
|
|
7286
|
-
concept: true,
|
|
7287
|
-
quantity: true,
|
|
7288
|
-
itemCost: true,
|
|
7289
|
-
totalCost: true
|
|
7290
|
-
},
|
|
7291
|
-
totalAmount: true
|
|
7292
|
-
}
|
|
7293
|
-
}
|
|
7294
|
-
},
|
|
7295
|
-
};
|
|
7296
|
-
try {
|
|
7297
|
-
const response = await client.query({
|
|
7298
|
-
getBudgetsByAthlete: {
|
|
7299
|
-
...fields
|
|
7300
|
-
},
|
|
7301
|
-
});
|
|
7302
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getBudgetsByAthlete', (r) => {
|
|
7303
|
-
const isResponseOk = !!response?.getBudgetsByAthlete &&
|
|
7304
|
-
Array.isArray(response.getBudgetsByAthlete.campaigns) &&
|
|
7305
|
-
Array.isArray(response.getBudgetsByAthlete.competitions);
|
|
7306
|
-
return isResponseOk;
|
|
7307
|
-
});
|
|
7308
|
-
}
|
|
7309
|
-
catch (err) {
|
|
7310
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
7311
|
-
}
|
|
7312
|
-
return retValue;
|
|
7313
|
-
}
|
|
7314
|
-
async deleteCompetitionBudget(competitionId) {
|
|
7315
|
-
const client = (0, client_1.createClient)({
|
|
7316
|
-
url: this.backendUrl + '/graphql',
|
|
7317
|
-
headers: this.headers,
|
|
7318
|
-
});
|
|
7319
|
-
let retValue = {};
|
|
7320
|
-
try {
|
|
7321
|
-
const response = await client.mutation({
|
|
7322
|
-
deleteCompetitionBudget: {
|
|
7323
|
-
__args: {
|
|
7324
|
-
competitionId: competitionId
|
|
7325
|
-
},
|
|
7326
|
-
},
|
|
7327
|
-
});
|
|
7328
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteCompetitionBudget', (r) => {
|
|
7329
|
-
const isResponseOk = response?.deleteCompetitionBudget;
|
|
7330
|
-
return isResponseOk;
|
|
7331
|
-
});
|
|
7332
|
-
}
|
|
7333
|
-
catch (err1) {
|
|
7334
|
-
console.error('deleteCompetitionBudget err1:');
|
|
7335
|
-
console.error(err1);
|
|
7336
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
7337
|
-
}
|
|
7338
|
-
return retValue;
|
|
7339
|
-
}
|
|
7340
|
-
async addCompetitionBudget(input) {
|
|
7341
|
-
const client = (0, client_1.createClient)({
|
|
7342
|
-
url: this.backendUrl + '/graphql',
|
|
7343
|
-
headers: this.headers,
|
|
7344
|
-
});
|
|
7345
|
-
let retValue = {};
|
|
7346
|
-
try {
|
|
7347
|
-
const response = await client.mutation({
|
|
7348
|
-
addCompetitionBudget: {
|
|
7349
|
-
__args: {
|
|
7350
|
-
input: input
|
|
7351
|
-
},
|
|
7352
|
-
},
|
|
7353
|
-
});
|
|
7354
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'addCompetitionBudget', (r) => {
|
|
7355
|
-
const isResponseOk = response?.addCompetitionBudget;
|
|
7356
|
-
return isResponseOk;
|
|
7357
|
-
});
|
|
7358
|
-
}
|
|
7359
|
-
catch (err1) {
|
|
7360
|
-
console.error('addCompetitionBudget err1:');
|
|
7361
|
-
console.error(err1);
|
|
7362
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
7363
|
-
}
|
|
7364
|
-
return retValue;
|
|
7365
|
-
}
|
|
7366
|
-
async editCompetitionBudget(input) {
|
|
7367
|
-
const client = (0, client_1.createClient)({
|
|
7368
|
-
url: this.backendUrl + '/graphql',
|
|
7369
|
-
headers: this.headers,
|
|
7370
|
-
});
|
|
7371
|
-
let retValue = {};
|
|
7372
|
-
try {
|
|
7373
|
-
const response = await client.mutation({
|
|
7374
|
-
editCompetitionBudget: {
|
|
7375
|
-
__args: {
|
|
7376
|
-
input: input
|
|
7377
|
-
},
|
|
7378
|
-
},
|
|
7379
|
-
});
|
|
7380
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'editCompetitionBudget', (r) => {
|
|
7381
|
-
const isResponseOk = response?.editCompetitionBudget;
|
|
7382
|
-
return isResponseOk;
|
|
7383
|
-
});
|
|
7384
|
-
}
|
|
7385
|
-
catch (err1) {
|
|
7386
|
-
console.error('editCompetitionBudget err1:');
|
|
7387
|
-
console.error(err1);
|
|
7388
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
7389
|
-
}
|
|
7390
|
-
return retValue;
|
|
7391
|
-
}
|
|
7392
|
-
async editCampaignBudget(input) {
|
|
7393
|
-
const client = (0, client_1.createClient)({
|
|
7394
|
-
url: this.backendUrl + '/graphql',
|
|
7395
|
-
headers: this.headers,
|
|
7396
|
-
});
|
|
7397
|
-
let retValue = {};
|
|
7398
|
-
try {
|
|
7399
|
-
const response = await client.mutation({
|
|
7400
|
-
editCampaignBudget: {
|
|
7401
|
-
__args: {
|
|
7402
|
-
input: input
|
|
7403
|
-
},
|
|
7404
|
-
},
|
|
7405
|
-
});
|
|
7406
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'editCampaignBudget', (r) => {
|
|
7407
|
-
const isResponseOk = response?.editCampaignBudget;
|
|
7408
|
-
return isResponseOk;
|
|
7409
|
-
});
|
|
7410
|
-
}
|
|
7411
|
-
catch (err1) {
|
|
7412
|
-
console.error('editCampaignBudget err1:');
|
|
7413
|
-
console.error(err1);
|
|
7414
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
7415
|
-
}
|
|
7416
|
-
return retValue;
|
|
7417
|
-
}
|
|
7418
6690
|
}
|
|
7419
6691
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
7420
6692
|
VTXBaseAPI.Logger = {
|