@vertikalx/vtx-backend-client 1.0.0-dev-geo.2 → 1.0.0-dev-daniel.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/api/vtx-base-api.d.ts +3 -1
- package/src/api/vtx-base-api.js +269 -3
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +208 -57
- package/src/client/schema.graphql +128 -37
- package/src/client/schema.js +41 -6
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +132 -37
- package/src/client/types.js +366 -129
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { User, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership } from '../client';
|
|
1
|
+
import { User, UserToken, UserWithToken, Athlete, RegisterAthleteDto, Brand, CreateBrandDto, BrandGenqlSelection, AWSS3UploadUrl, AWSS3GetUploadDto, CreateTenantInput, Tenant, TenantWithUserLogin, RegisterUserToDomainFromEmailInput, DecodedToken, Sponsorship, SponsorshipGenqlSelection, CreateSponsorshipDto, SponsorAthleteInvitation, InviteAthletesDto, RegisterUserDto, VerificationCode, VerifyCodeDto, FindSponsorAthleteInvitationDto, FindVtxUserDto, City, SportLevel, Sport, UserImages, EditValueResponse, CreateAthleteCompetitionDto, AthleteCompetition, GetSportEventsDto, SportsEvent, CreateSportEventDto, GetAthleteCompetitionsDto, AthleteMembership, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
export declare class VTXBaseAPI {
|
|
@@ -58,4 +58,6 @@ export declare class VTXBaseAPI {
|
|
|
58
58
|
createSportsEvent(dto: CreateSportEventDto): Promise<ITypedBackendResponse<SportsEvent>>;
|
|
59
59
|
getAthleteCompetitions(dto: GetAthleteCompetitionsDto): Promise<ITypedBackendResponse<AthleteCompetition[]>>;
|
|
60
60
|
getAthleteMemberships(athleteId: string): Promise<ITypedBackendResponse<AthleteMembership[]>>;
|
|
61
|
+
deleteAthleteCompetition(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
62
|
+
createFundingCampaign(dto: CreateFundingCampaignDto): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
61
63
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -359,6 +359,10 @@ class VTXBaseAPI {
|
|
|
359
359
|
useType: true,
|
|
360
360
|
url: true,
|
|
361
361
|
key: true
|
|
362
|
+
},
|
|
363
|
+
preferences: {
|
|
364
|
+
_id: true,
|
|
365
|
+
showProfileHelper: true
|
|
362
366
|
}
|
|
363
367
|
};
|
|
364
368
|
try {
|
|
@@ -2057,6 +2061,89 @@ class VTXBaseAPI {
|
|
|
2057
2061
|
useType: true,
|
|
2058
2062
|
url: true,
|
|
2059
2063
|
key: true
|
|
2064
|
+
},
|
|
2065
|
+
preferences: {
|
|
2066
|
+
_id: true,
|
|
2067
|
+
showProfileHelper: true
|
|
2068
|
+
},
|
|
2069
|
+
currentCampaign: {
|
|
2070
|
+
_id: true,
|
|
2071
|
+
budgetMode: true,
|
|
2072
|
+
status: true,
|
|
2073
|
+
title: true,
|
|
2074
|
+
motivation: true,
|
|
2075
|
+
website: true,
|
|
2076
|
+
fundsRequired: true,
|
|
2077
|
+
initialFundsObtained: true,
|
|
2078
|
+
fundsObtained: true,
|
|
2079
|
+
location: {
|
|
2080
|
+
_id: true,
|
|
2081
|
+
userProvidedLatitude: true,
|
|
2082
|
+
userProvidedLongitude: true,
|
|
2083
|
+
cityNameGeocode: true,
|
|
2084
|
+
stateNameGeocode: true,
|
|
2085
|
+
countryIso2CodeGeocode: true,
|
|
2086
|
+
timeZoneGeocode: true,
|
|
2087
|
+
latitudeGeocode: true,
|
|
2088
|
+
longitudeGeocode: true,
|
|
2089
|
+
city: {
|
|
2090
|
+
_id: true,
|
|
2091
|
+
name: true,
|
|
2092
|
+
localizedName: true,
|
|
2093
|
+
state: {
|
|
2094
|
+
_id: true,
|
|
2095
|
+
name: true,
|
|
2096
|
+
country: {
|
|
2097
|
+
_id: true,
|
|
2098
|
+
name: true
|
|
2099
|
+
}
|
|
2100
|
+
},
|
|
2101
|
+
latitude: true,
|
|
2102
|
+
longitude: true,
|
|
2103
|
+
timezone: true,
|
|
2104
|
+
}
|
|
2105
|
+
},
|
|
2106
|
+
endingDate: true,
|
|
2107
|
+
budget: {
|
|
2108
|
+
_id: true,
|
|
2109
|
+
initialFunds: true,
|
|
2110
|
+
totalRequired: true,
|
|
2111
|
+
items: {
|
|
2112
|
+
_id: true,
|
|
2113
|
+
quantity: true,
|
|
2114
|
+
concept: true,
|
|
2115
|
+
itemCost: true
|
|
2116
|
+
}
|
|
2117
|
+
},
|
|
2118
|
+
competitions: {
|
|
2119
|
+
_id: true,
|
|
2120
|
+
event: {
|
|
2121
|
+
_id: true,
|
|
2122
|
+
name: true,
|
|
2123
|
+
eventWebSite: true,
|
|
2124
|
+
startDate: true,
|
|
2125
|
+
endDate: true,
|
|
2126
|
+
verified: true,
|
|
2127
|
+
banner: {
|
|
2128
|
+
_id: true,
|
|
2129
|
+
name: true,
|
|
2130
|
+
contentType: true,
|
|
2131
|
+
size: true,
|
|
2132
|
+
useType: true,
|
|
2133
|
+
url: true,
|
|
2134
|
+
key: true
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2137
|
+
participationDate: true,
|
|
2138
|
+
result: {
|
|
2139
|
+
_id: true,
|
|
2140
|
+
resultType: true,
|
|
2141
|
+
position: true,
|
|
2142
|
+
score: true,
|
|
2143
|
+
finishTimeMS: true,
|
|
2144
|
+
resultWebLink: true
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2060
2147
|
}
|
|
2061
2148
|
};
|
|
2062
2149
|
try {
|
|
@@ -2343,6 +2430,10 @@ class VTXBaseAPI {
|
|
|
2343
2430
|
useType: true,
|
|
2344
2431
|
url: true,
|
|
2345
2432
|
key: true
|
|
2433
|
+
},
|
|
2434
|
+
preferences: {
|
|
2435
|
+
_id: true,
|
|
2436
|
+
showProfileHelper: true
|
|
2346
2437
|
}
|
|
2347
2438
|
};
|
|
2348
2439
|
let retValue;
|
|
@@ -2566,6 +2657,10 @@ class VTXBaseAPI {
|
|
|
2566
2657
|
useType: true,
|
|
2567
2658
|
url: true,
|
|
2568
2659
|
key: true
|
|
2660
|
+
},
|
|
2661
|
+
preferences: {
|
|
2662
|
+
_id: true,
|
|
2663
|
+
showProfileHelper: true
|
|
2569
2664
|
}
|
|
2570
2665
|
};
|
|
2571
2666
|
let retValue;
|
|
@@ -2791,6 +2886,10 @@ class VTXBaseAPI {
|
|
|
2791
2886
|
useType: true,
|
|
2792
2887
|
url: true,
|
|
2793
2888
|
key: true
|
|
2889
|
+
},
|
|
2890
|
+
preferences: {
|
|
2891
|
+
_id: true,
|
|
2892
|
+
showProfileHelper: true
|
|
2794
2893
|
}
|
|
2795
2894
|
};
|
|
2796
2895
|
let retValue;
|
|
@@ -3016,6 +3115,10 @@ class VTXBaseAPI {
|
|
|
3016
3115
|
useType: true,
|
|
3017
3116
|
url: true,
|
|
3018
3117
|
key: true
|
|
3118
|
+
},
|
|
3119
|
+
preferences: {
|
|
3120
|
+
_id: true,
|
|
3121
|
+
showProfileHelper: true
|
|
3019
3122
|
}
|
|
3020
3123
|
};
|
|
3021
3124
|
let retValue;
|
|
@@ -3192,7 +3295,7 @@ class VTXBaseAPI {
|
|
|
3192
3295
|
finishTimeMS: true,
|
|
3193
3296
|
resultWebLink: true
|
|
3194
3297
|
},
|
|
3195
|
-
|
|
3298
|
+
fundRaisingCampaignIds: true
|
|
3196
3299
|
};
|
|
3197
3300
|
try {
|
|
3198
3301
|
const response = await client.mutation({
|
|
@@ -3345,7 +3448,18 @@ class VTXBaseAPI {
|
|
|
3345
3448
|
finishTimeMS: true,
|
|
3346
3449
|
resultWebLink: true
|
|
3347
3450
|
},
|
|
3348
|
-
|
|
3451
|
+
fundRaisingCampaignIds: true,
|
|
3452
|
+
budget: {
|
|
3453
|
+
_id: true,
|
|
3454
|
+
totalRequired: true,
|
|
3455
|
+
initialFunds: true,
|
|
3456
|
+
items: {
|
|
3457
|
+
_id: true,
|
|
3458
|
+
quantity: true,
|
|
3459
|
+
concept: true,
|
|
3460
|
+
itemCost: true
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3349
3463
|
};
|
|
3350
3464
|
let retValue;
|
|
3351
3465
|
try {
|
|
@@ -3541,17 +3655,169 @@ class VTXBaseAPI {
|
|
|
3541
3655
|
}
|
|
3542
3656
|
return retValue;
|
|
3543
3657
|
}
|
|
3658
|
+
async deleteAthleteCompetition(dto) {
|
|
3659
|
+
console.log('HEADERS:');
|
|
3660
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
3661
|
+
const client = (0, client_1.createClient)({
|
|
3662
|
+
url: this.backendUrl + '/graphql',
|
|
3663
|
+
headers: this.headers,
|
|
3664
|
+
});
|
|
3665
|
+
let retValue = {};
|
|
3666
|
+
const fields = {
|
|
3667
|
+
idToDelete: true,
|
|
3668
|
+
deleted: true,
|
|
3669
|
+
failureReason: {
|
|
3670
|
+
code: true,
|
|
3671
|
+
message: true
|
|
3672
|
+
}
|
|
3673
|
+
};
|
|
3674
|
+
try {
|
|
3675
|
+
const response = await client.mutation({
|
|
3676
|
+
deleteAthleteCompetition: {
|
|
3677
|
+
__args: {
|
|
3678
|
+
input: dto
|
|
3679
|
+
},
|
|
3680
|
+
...fields
|
|
3681
|
+
},
|
|
3682
|
+
});
|
|
3683
|
+
VTXBaseAPI.Logger.debug('deleteAthleteCompetition Response:');
|
|
3684
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3685
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteCompetition', (r) => {
|
|
3686
|
+
const isResponseOk = true && response?.deleteAthleteCompetition?.idToDelete;
|
|
3687
|
+
return isResponseOk;
|
|
3688
|
+
});
|
|
3689
|
+
}
|
|
3690
|
+
catch (err1) {
|
|
3691
|
+
VTXBaseAPI.Logger.error('deleteAthleteCompetition err1:');
|
|
3692
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3693
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3694
|
+
}
|
|
3695
|
+
return retValue;
|
|
3696
|
+
}
|
|
3697
|
+
async createFundingCampaign(dto) {
|
|
3698
|
+
console.log('HEADERS:');
|
|
3699
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
3700
|
+
const client = (0, client_1.createClient)({
|
|
3701
|
+
url: this.backendUrl + '/graphql',
|
|
3702
|
+
headers: this.headers,
|
|
3703
|
+
});
|
|
3704
|
+
let retValue = {};
|
|
3705
|
+
const fields = {
|
|
3706
|
+
_id: true,
|
|
3707
|
+
budgetMode: true,
|
|
3708
|
+
status: true,
|
|
3709
|
+
title: true,
|
|
3710
|
+
motivation: true,
|
|
3711
|
+
website: true,
|
|
3712
|
+
fundsRequired: true,
|
|
3713
|
+
initialFundsObtained: true,
|
|
3714
|
+
fundsObtained: true,
|
|
3715
|
+
location: {
|
|
3716
|
+
userProvidedLatitude: true,
|
|
3717
|
+
userProvidedLongitude: true,
|
|
3718
|
+
cityNameGeocode: true,
|
|
3719
|
+
stateNameGeocode: true,
|
|
3720
|
+
countryIso2CodeGeocode: true,
|
|
3721
|
+
timeZoneGeocode: true,
|
|
3722
|
+
latitudeGeocode: true,
|
|
3723
|
+
longitudeGeocode: true,
|
|
3724
|
+
city: {
|
|
3725
|
+
_id: true,
|
|
3726
|
+
name: true,
|
|
3727
|
+
localizedName: true,
|
|
3728
|
+
state: {
|
|
3729
|
+
_id: true,
|
|
3730
|
+
name: true,
|
|
3731
|
+
country: {
|
|
3732
|
+
_id: true,
|
|
3733
|
+
name: true
|
|
3734
|
+
}
|
|
3735
|
+
},
|
|
3736
|
+
latitude: true,
|
|
3737
|
+
longitude: true,
|
|
3738
|
+
timezone: true,
|
|
3739
|
+
}
|
|
3740
|
+
},
|
|
3741
|
+
endingDate: true,
|
|
3742
|
+
budget: {
|
|
3743
|
+
initialFunds: true,
|
|
3744
|
+
totalRequired: true,
|
|
3745
|
+
items: {
|
|
3746
|
+
_id: true,
|
|
3747
|
+
quantity: true,
|
|
3748
|
+
concept: true,
|
|
3749
|
+
itemCost: true
|
|
3750
|
+
}
|
|
3751
|
+
},
|
|
3752
|
+
competitions: {
|
|
3753
|
+
_id: true,
|
|
3754
|
+
event: {
|
|
3755
|
+
_id: true,
|
|
3756
|
+
name: true,
|
|
3757
|
+
eventWebSite: true,
|
|
3758
|
+
startDate: true,
|
|
3759
|
+
endDate: true,
|
|
3760
|
+
verified: true,
|
|
3761
|
+
banner: {
|
|
3762
|
+
_id: true,
|
|
3763
|
+
name: true,
|
|
3764
|
+
contentType: true,
|
|
3765
|
+
size: true,
|
|
3766
|
+
useType: true,
|
|
3767
|
+
url: true,
|
|
3768
|
+
key: true
|
|
3769
|
+
},
|
|
3770
|
+
},
|
|
3771
|
+
participationDate: true,
|
|
3772
|
+
competitionNumber: true,
|
|
3773
|
+
result: {
|
|
3774
|
+
resultType: true,
|
|
3775
|
+
position: true,
|
|
3776
|
+
score: true,
|
|
3777
|
+
finishTimeMS: true,
|
|
3778
|
+
resultWebLink: true
|
|
3779
|
+
},
|
|
3780
|
+
fundRaisingCampaignIds: true
|
|
3781
|
+
}
|
|
3782
|
+
};
|
|
3783
|
+
try {
|
|
3784
|
+
const response = await client.mutation({
|
|
3785
|
+
createFundingCampaign: {
|
|
3786
|
+
__args: {
|
|
3787
|
+
input: dto
|
|
3788
|
+
},
|
|
3789
|
+
...fields
|
|
3790
|
+
},
|
|
3791
|
+
});
|
|
3792
|
+
VTXBaseAPI.Logger.log("==================HERE=====================================");
|
|
3793
|
+
VTXBaseAPI.Logger.log('createFundingCampaign Response:');
|
|
3794
|
+
VTXBaseAPI.Logger.log(JSON.stringify(response, null, 2));
|
|
3795
|
+
VTXBaseAPI.Logger.log("==================DONE=====================================");
|
|
3796
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createFundingCampaign', (r) => {
|
|
3797
|
+
const isResponseOk = true && response?.createFundingCampaign?._id;
|
|
3798
|
+
return isResponseOk;
|
|
3799
|
+
});
|
|
3800
|
+
}
|
|
3801
|
+
catch (err1) {
|
|
3802
|
+
VTXBaseAPI.Logger.log("************** ERROR *******************************");
|
|
3803
|
+
VTXBaseAPI.Logger.log('createFundingCampaign err1:');
|
|
3804
|
+
VTXBaseAPI.Logger.log(err1);
|
|
3805
|
+
VTXBaseAPI.Logger.log("************** DONE ERROR **************************");
|
|
3806
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3807
|
+
}
|
|
3808
|
+
return retValue;
|
|
3809
|
+
}
|
|
3544
3810
|
}
|
|
3545
3811
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
3546
3812
|
VTXBaseAPI.Logger = {
|
|
3547
3813
|
debug: (str) => {
|
|
3548
3814
|
},
|
|
3549
3815
|
log: (str) => {
|
|
3816
|
+
console.log(str);
|
|
3550
3817
|
},
|
|
3551
3818
|
warn: (str) => {
|
|
3552
3819
|
},
|
|
3553
3820
|
error: (str) => {
|
|
3554
|
-
console.error(str);
|
|
3555
3821
|
},
|
|
3556
3822
|
};
|
|
3557
3823
|
//# sourceMappingURL=vtx-base-api.js.map
|