@vertikalx/vtx-backend-client 1.0.1-dev.0 → 2.0.0-dev-max.0
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/libs/vtx-backend-client/package.json +16 -0
- package/libs/vtx-backend-client/src/api/api-call-headers.d.ts +12 -0
- package/libs/vtx-backend-client/src/api/api-call-headers.js +16 -0
- package/libs/vtx-backend-client/src/api/api-call-headers.js.map +1 -0
- package/libs/vtx-backend-client/src/api/backend-response.d.ts +10 -0
- package/libs/vtx-backend-client/src/api/backend-response.js +3 -0
- package/libs/vtx-backend-client/src/api/backend-response.js.map +1 -0
- package/libs/vtx-backend-client/src/api/domains.d.ts +3 -0
- package/libs/vtx-backend-client/src/api/domains.js +7 -0
- package/libs/vtx-backend-client/src/api/domains.js.map +1 -0
- package/libs/vtx-backend-client/src/api/response-builder.d.ts +4 -0
- package/libs/vtx-backend-client/src/api/response-builder.js +123 -0
- package/libs/vtx-backend-client/src/api/response-builder.js.map +1 -0
- package/libs/vtx-backend-client/src/api/types.d.ts +2 -0
- package/libs/vtx-backend-client/src/api/types.js +3 -0
- package/libs/vtx-backend-client/src/api/types.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.d.ts +6 -0
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js +19 -0
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.d.ts +118 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.js +7442 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.d.ts +6 -0
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js +27 -0
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.d.ts +7 -0
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js +36 -0
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.d.ts +7 -0
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js +33 -0
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js.map +1 -0
- package/libs/vtx-backend-client/src/client/index.d.ts +25 -0
- package/libs/vtx-backend-client/src/client/index.js +44 -0
- package/libs/vtx-backend-client/src/client/index.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/batcher.d.ts +36 -0
- package/libs/vtx-backend-client/src/client/runtime/batcher.js +123 -0
- package/libs/vtx-backend-client/src/client/runtime/batcher.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/createClient.d.ts +17 -0
- package/libs/vtx-backend-client/src/client/runtime/createClient.js +28 -0
- package/libs/vtx-backend-client/src/client/runtime/createClient.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/error.d.ts +15 -0
- package/libs/vtx-backend-client/src/client/runtime/error.js +19 -0
- package/libs/vtx-backend-client/src/client/runtime/error.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/fetcher.d.ts +10 -0
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js +68 -0
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.d.ts +30 -0
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js +134 -0
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/index.d.ts +11 -0
- package/libs/vtx-backend-client/src/client/runtime/index.js +17 -0
- package/libs/vtx-backend-client/src/client/runtime/index.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.d.ts +9 -0
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js +95 -0
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.d.ts +28 -0
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js +3 -0
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/types.d.ts +55 -0
- package/libs/vtx-backend-client/src/client/runtime/types.js +3 -0
- package/libs/vtx-backend-client/src/client/runtime/types.js.map +1 -0
- package/libs/vtx-backend-client/src/client/schema.d.ts +4511 -0
- package/libs/vtx-backend-client/src/client/schema.js +981 -0
- package/libs/vtx-backend-client/src/client/schema.js.map +1 -0
- package/libs/vtx-backend-client/src/client/types.d.ts +2400 -0
- package/libs/vtx-backend-client/src/client/types.js +6253 -0
- package/libs/vtx-backend-client/src/client/types.js.map +1 -0
- package/libs/vtx-backend-client/src/index.d.ts +11 -0
- package/libs/vtx-backend-client/src/index.js +28 -0
- package/libs/vtx-backend-client/src/index.js.map +1 -0
- package/package.json +1 -1
- package/src/api/dto/create-budget.dto.d.ts +15 -0
- package/src/api/dto/create-budget.dto.js +72 -0
- package/src/api/dto/create-budget.dto.js.map +1 -0
- package/src/api/dto/create-funding-campaign.dto.d.ts +21 -0
- package/src/api/dto/create-funding-campaign.dto.js +97 -0
- package/src/api/dto/create-funding-campaign.dto.js.map +1 -0
- package/src/api/dto/get-athlete-campaigns.dto.d.ts +3 -0
- package/src/api/dto/get-athlete-campaigns.dto.js +26 -0
- package/src/api/dto/get-athlete-campaigns.dto.js.map +1 -0
- package/src/api/dto/set-current-campaign.dto.d.ts +3 -0
- package/src/api/dto/set-current-campaign.dto.js +26 -0
- package/src/api/dto/set-current-campaign.dto.js.map +1 -0
- package/src/api/response-builder.js +3 -2
- package/src/api/response-builder.js.map +1 -1
- package/src/api/vtx-base-api.d.ts +14 -1
- package/src/api/vtx-base-api.js +885 -157
- 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 +293 -19
- package/src/client/schema.js +76 -8
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +151 -7
- package/src/client/types.js +510 -144
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/src/api/vtx-base-api.js
CHANGED
|
@@ -2318,6 +2318,17 @@ 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
|
+
},
|
|
2321
2332
|
participationDate: true,
|
|
2322
2333
|
result: {
|
|
2323
2334
|
_id: true,
|
|
@@ -2755,7 +2766,7 @@ class VTXBaseAPI {
|
|
|
2755
2766
|
preferences: {
|
|
2756
2767
|
_id: true,
|
|
2757
2768
|
showProfileHelper: true
|
|
2758
|
-
}
|
|
2769
|
+
},
|
|
2759
2770
|
};
|
|
2760
2771
|
let retValue;
|
|
2761
2772
|
try {
|
|
@@ -4357,6 +4368,17 @@ class VTXBaseAPI {
|
|
|
4357
4368
|
finishTimeMS: true,
|
|
4358
4369
|
resultWebLink: true
|
|
4359
4370
|
},
|
|
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
|
+
},
|
|
4360
4382
|
fundRaisingCampaignIds: true
|
|
4361
4383
|
}
|
|
4362
4384
|
};
|
|
@@ -5476,7 +5498,18 @@ class VTXBaseAPI {
|
|
|
5476
5498
|
finishTimeMS: true,
|
|
5477
5499
|
resultWebLink: true,
|
|
5478
5500
|
totalParticipants: true,
|
|
5479
|
-
}
|
|
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
|
+
},
|
|
5480
5513
|
}
|
|
5481
5514
|
},
|
|
5482
5515
|
};
|
|
@@ -5695,7 +5728,7 @@ class VTXBaseAPI {
|
|
|
5695
5728
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5696
5729
|
return retValue;
|
|
5697
5730
|
}
|
|
5698
|
-
async
|
|
5731
|
+
async deleteFundingCampaign(dto) {
|
|
5699
5732
|
console.log('HEADERS:');
|
|
5700
5733
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5701
5734
|
const client = (0, client_1.createClient)({
|
|
@@ -5713,22 +5746,22 @@ class VTXBaseAPI {
|
|
|
5713
5746
|
};
|
|
5714
5747
|
try {
|
|
5715
5748
|
const response = await client.mutation({
|
|
5716
|
-
|
|
5749
|
+
deleteFundingCampaign: {
|
|
5717
5750
|
__args: {
|
|
5718
5751
|
input: dto
|
|
5719
5752
|
},
|
|
5720
5753
|
...fields
|
|
5721
5754
|
},
|
|
5722
5755
|
});
|
|
5723
|
-
console.log('
|
|
5756
|
+
console.log('deleteFundingCampaign Response:');
|
|
5724
5757
|
console.log(JSON.stringify(response, null, 2));
|
|
5725
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5726
|
-
const isResponseOk = response?.
|
|
5758
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteFundingCampaign', (r) => {
|
|
5759
|
+
const isResponseOk = response?.deleteFundingCampaign?.deleted;
|
|
5727
5760
|
return isResponseOk;
|
|
5728
5761
|
});
|
|
5729
5762
|
}
|
|
5730
5763
|
catch (err1) {
|
|
5731
|
-
console.error('
|
|
5764
|
+
console.error('deleteFundingCampaign err1:');
|
|
5732
5765
|
console.error(err1);
|
|
5733
5766
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5734
5767
|
}
|
|
@@ -5736,46 +5769,41 @@ class VTXBaseAPI {
|
|
|
5736
5769
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5737
5770
|
return retValue;
|
|
5738
5771
|
}
|
|
5739
|
-
async
|
|
5772
|
+
async deleteFundingCampaigns(dto) {
|
|
5740
5773
|
console.log('HEADERS:');
|
|
5741
5774
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5742
5775
|
const client = (0, client_1.createClient)({
|
|
5743
5776
|
url: this.backendUrl + '/graphql',
|
|
5744
5777
|
headers: this.headers,
|
|
5745
5778
|
});
|
|
5746
|
-
let retValue;
|
|
5779
|
+
let retValue = {};
|
|
5747
5780
|
const fields = {
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
name: true,
|
|
5756
|
-
contentType: true,
|
|
5757
|
-
size: true,
|
|
5758
|
-
useType: true,
|
|
5759
|
-
url: true,
|
|
5760
|
-
}
|
|
5761
|
-
}
|
|
5781
|
+
deleted: true,
|
|
5782
|
+
failedToDelete: true,
|
|
5783
|
+
failureReason: {
|
|
5784
|
+
code: true,
|
|
5785
|
+
message: true
|
|
5786
|
+
},
|
|
5787
|
+
result: true,
|
|
5762
5788
|
};
|
|
5763
5789
|
try {
|
|
5764
|
-
const response = await client.
|
|
5765
|
-
|
|
5766
|
-
__args: {
|
|
5790
|
+
const response = await client.mutation({
|
|
5791
|
+
deleteFundingCampaigns: {
|
|
5792
|
+
__args: {
|
|
5793
|
+
input: dto
|
|
5794
|
+
},
|
|
5767
5795
|
...fields
|
|
5768
|
-
}
|
|
5796
|
+
}
|
|
5769
5797
|
});
|
|
5770
|
-
console.log('
|
|
5798
|
+
console.log('deleteFundingCampaigns Response:');
|
|
5771
5799
|
console.log(JSON.stringify(response, null, 2));
|
|
5772
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5773
|
-
const isResponseOk = response?.
|
|
5800
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteFundingCampaigns', (r) => {
|
|
5801
|
+
const isResponseOk = response?.deleteFundingCampaigns?.every((item) => item.deleted);
|
|
5774
5802
|
return isResponseOk;
|
|
5775
5803
|
});
|
|
5776
5804
|
}
|
|
5777
5805
|
catch (err1) {
|
|
5778
|
-
console.error('
|
|
5806
|
+
console.error('deleteFundingCampaigns err1:');
|
|
5779
5807
|
console.error(err1);
|
|
5780
5808
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5781
5809
|
}
|
|
@@ -5783,96 +5811,142 @@ class VTXBaseAPI {
|
|
|
5783
5811
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5784
5812
|
return retValue;
|
|
5785
5813
|
}
|
|
5786
|
-
async
|
|
5814
|
+
async updateFundingCampaign(dto) {
|
|
5787
5815
|
console.log('HEADERS:');
|
|
5788
5816
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5789
5817
|
const client = (0, client_1.createClient)({
|
|
5790
5818
|
url: this.backendUrl + '/graphql',
|
|
5791
5819
|
headers: this.headers,
|
|
5792
5820
|
});
|
|
5793
|
-
let retValue;
|
|
5821
|
+
let retValue = {};
|
|
5794
5822
|
const fields = {
|
|
5795
5823
|
_id: true,
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5824
|
+
budgetMode: true,
|
|
5825
|
+
status: true,
|
|
5826
|
+
title: true,
|
|
5827
|
+
motivation: true,
|
|
5828
|
+
website: true,
|
|
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: {
|
|
5801
5843
|
_id: true,
|
|
5802
5844
|
name: true,
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
const response = await client.query({
|
|
5812
|
-
getPublicAthleteAlbums: {
|
|
5813
|
-
__args: {
|
|
5814
|
-
athleteId: athleteId
|
|
5845
|
+
localizedName: true,
|
|
5846
|
+
state: {
|
|
5847
|
+
_id: true,
|
|
5848
|
+
name: true,
|
|
5849
|
+
country: {
|
|
5850
|
+
_id: true,
|
|
5851
|
+
name: true
|
|
5852
|
+
}
|
|
5815
5853
|
},
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
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: {
|
|
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
|
|
5868
|
+
}
|
|
5869
|
+
},
|
|
5870
|
+
competitions: {
|
|
5847
5871
|
_id: true,
|
|
5848
|
-
|
|
5872
|
+
event: {
|
|
5849
5873
|
_id: true,
|
|
5850
5874
|
name: true,
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5875
|
+
mainSport: {
|
|
5876
|
+
_id: true,
|
|
5877
|
+
name: true
|
|
5878
|
+
},
|
|
5879
|
+
eventWebSite: true,
|
|
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
|
|
5856
5930
|
}
|
|
5857
5931
|
};
|
|
5858
5932
|
try {
|
|
5859
|
-
const response = await client.
|
|
5860
|
-
|
|
5933
|
+
const response = await client.mutation({
|
|
5934
|
+
updateFundingCampaign: {
|
|
5861
5935
|
__args: {
|
|
5862
|
-
input:
|
|
5936
|
+
input: dto
|
|
5863
5937
|
},
|
|
5864
5938
|
...fields
|
|
5865
5939
|
},
|
|
5866
5940
|
});
|
|
5867
|
-
console.log('
|
|
5941
|
+
console.log('updateFundingCampaign Response:');
|
|
5868
5942
|
console.log(JSON.stringify(response, null, 2));
|
|
5869
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5870
|
-
const isResponseOk = response?.
|
|
5943
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateFundingCampaign', (r) => {
|
|
5944
|
+
const isResponseOk = response?.updateFundingCampaign?._id;
|
|
5871
5945
|
return isResponseOk;
|
|
5872
5946
|
});
|
|
5873
5947
|
}
|
|
5874
5948
|
catch (err1) {
|
|
5875
|
-
console.error('
|
|
5949
|
+
console.error('updateFundingCampaign err1:');
|
|
5876
5950
|
console.error(err1);
|
|
5877
5951
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5878
5952
|
}
|
|
@@ -5880,7 +5954,7 @@ class VTXBaseAPI {
|
|
|
5880
5954
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5881
5955
|
return retValue;
|
|
5882
5956
|
}
|
|
5883
|
-
async
|
|
5957
|
+
async setCurrentCampaign(dto) {
|
|
5884
5958
|
console.log('HEADERS:');
|
|
5885
5959
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5886
5960
|
const client = (0, client_1.createClient)({
|
|
@@ -5890,29 +5964,357 @@ class VTXBaseAPI {
|
|
|
5890
5964
|
let retValue = {};
|
|
5891
5965
|
const fields = {
|
|
5892
5966
|
_id: true,
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
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) {
|
|
6286
|
+
console.log('HEADERS:');
|
|
6287
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6288
|
+
const client = (0, client_1.createClient)({
|
|
6289
|
+
url: this.backendUrl + '/graphql',
|
|
6290
|
+
headers: this.headers,
|
|
6291
|
+
});
|
|
6292
|
+
let retValue = {};
|
|
6293
|
+
const fields = {
|
|
6294
|
+
_id: true,
|
|
6295
|
+
label: true,
|
|
6296
|
+
description: true,
|
|
6297
|
+
photos: {
|
|
6298
|
+
_id: true,
|
|
6299
|
+
photo: {
|
|
6300
|
+
_id: true,
|
|
6301
|
+
name: true,
|
|
6302
|
+
contentType: true,
|
|
6303
|
+
size: true,
|
|
6304
|
+
useType: true,
|
|
6305
|
+
url: true,
|
|
6306
|
+
}
|
|
6307
|
+
}
|
|
6308
|
+
};
|
|
6309
|
+
try {
|
|
6310
|
+
const response = await client.query({
|
|
6311
|
+
getAndSetAlbumById: {
|
|
6312
|
+
__args: {
|
|
6313
|
+
input: albumId
|
|
6314
|
+
},
|
|
6315
|
+
...fields
|
|
6316
|
+
},
|
|
6317
|
+
});
|
|
5916
6318
|
console.log('getAndSetAlbumById Response:');
|
|
5917
6319
|
console.log(JSON.stringify(response, null, 2));
|
|
5918
6320
|
retValue = (0, response_builder_1.buildResponse)(response, 'getAndSetAlbumById', (r) => {
|
|
@@ -6257,58 +6659,204 @@ class VTXBaseAPI {
|
|
|
6257
6659
|
updated_at: true,
|
|
6258
6660
|
weight: true
|
|
6259
6661
|
},
|
|
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
|
|
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
|
+
}
|
|
6759
|
+
},
|
|
6760
|
+
createdDate: true,
|
|
6761
|
+
endingDate: true,
|
|
6762
|
+
budget: {
|
|
6763
|
+
initialFunds: true,
|
|
6764
|
+
totalRequired: true,
|
|
6765
|
+
items: {
|
|
6766
|
+
_id: true,
|
|
6767
|
+
quantity: true,
|
|
6768
|
+
concept: true,
|
|
6769
|
+
itemCost: true
|
|
6770
|
+
}
|
|
6269
6771
|
},
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6772
|
+
competitions: {
|
|
6773
|
+
_id: true,
|
|
6774
|
+
event: {
|
|
6775
|
+
_id: true,
|
|
6776
|
+
name: true,
|
|
6777
|
+
mainSport: {
|
|
6778
|
+
_id: true,
|
|
6779
|
+
name: true
|
|
6780
|
+
},
|
|
6781
|
+
eventWebSite: true,
|
|
6782
|
+
startDate: true,
|
|
6783
|
+
endDate: true,
|
|
6784
|
+
verified: true,
|
|
6785
|
+
banner: {
|
|
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,
|
|
6284
6806
|
name: true,
|
|
6285
|
-
|
|
6286
|
-
|
|
6807
|
+
localizedName: true,
|
|
6808
|
+
state: {
|
|
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,
|
|
6287
6819
|
}
|
|
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
|
|
6288
6832
|
}
|
|
6289
6833
|
},
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
}
|
|
6834
|
+
result: {
|
|
6835
|
+
resultType: true,
|
|
6836
|
+
position: true,
|
|
6837
|
+
score: true,
|
|
6838
|
+
finishTimeMS: true,
|
|
6839
|
+
resultWebLink: true
|
|
6840
|
+
},
|
|
6841
|
+
fundRaisingCampaignIds: true
|
|
6297
6842
|
}
|
|
6298
6843
|
};
|
|
6299
6844
|
try {
|
|
6300
6845
|
const response = await client.query({
|
|
6301
|
-
|
|
6846
|
+
getAthleteCampaigns: {
|
|
6847
|
+
__args: { input: dto },
|
|
6302
6848
|
...fields
|
|
6303
|
-
}
|
|
6849
|
+
}
|
|
6304
6850
|
});
|
|
6305
|
-
|
|
6306
|
-
|
|
6851
|
+
console.log('getAthleteCampaigns Response:');
|
|
6852
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6853
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteCampaigns', (r) => {
|
|
6854
|
+
const isResponseOk = true && Array.isArray(response?.getAthleteCampaigns);
|
|
6307
6855
|
return isResponseOk;
|
|
6308
6856
|
});
|
|
6309
6857
|
}
|
|
6310
|
-
catch (
|
|
6311
|
-
retValue = (0, response_builder_1.buildErrorResponse)(
|
|
6858
|
+
catch (err1) {
|
|
6859
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6312
6860
|
}
|
|
6313
6861
|
return retValue;
|
|
6314
6862
|
}
|
|
@@ -6687,6 +7235,186 @@ class VTXBaseAPI {
|
|
|
6687
7235
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6688
7236
|
return retValue;
|
|
6689
7237
|
}
|
|
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
|
+
}
|
|
6690
7418
|
}
|
|
6691
7419
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
6692
7420
|
VTXBaseAPI.Logger = {
|