@vertikalx/vtx-backend-client 1.0.0-dev-daniel.179 → 1.0.0-dev-geo.1
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 +1 -3
- package/src/api/vtx-base-api.js +3 -190
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +58 -171
- package/src/client/schema.graphql +38 -107
- package/src/client/schema.js +6 -34
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +38 -111
- package/src/client/types.js +138 -317
- 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
|
|
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';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
export declare class VTXBaseAPI {
|
|
@@ -58,6 +58,4 @@ 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>>;
|
|
63
61
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -359,10 +359,6 @@ class VTXBaseAPI {
|
|
|
359
359
|
useType: true,
|
|
360
360
|
url: true,
|
|
361
361
|
key: true
|
|
362
|
-
},
|
|
363
|
-
preferences: {
|
|
364
|
-
_id: true,
|
|
365
|
-
showProfileHelper: true
|
|
366
362
|
}
|
|
367
363
|
};
|
|
368
364
|
try {
|
|
@@ -2061,10 +2057,6 @@ class VTXBaseAPI {
|
|
|
2061
2057
|
useType: true,
|
|
2062
2058
|
url: true,
|
|
2063
2059
|
key: true
|
|
2064
|
-
},
|
|
2065
|
-
preferences: {
|
|
2066
|
-
_id: true,
|
|
2067
|
-
showProfileHelper: true
|
|
2068
2060
|
}
|
|
2069
2061
|
};
|
|
2070
2062
|
try {
|
|
@@ -2351,10 +2343,6 @@ class VTXBaseAPI {
|
|
|
2351
2343
|
useType: true,
|
|
2352
2344
|
url: true,
|
|
2353
2345
|
key: true
|
|
2354
|
-
},
|
|
2355
|
-
preferences: {
|
|
2356
|
-
_id: true,
|
|
2357
|
-
showProfileHelper: true
|
|
2358
2346
|
}
|
|
2359
2347
|
};
|
|
2360
2348
|
let retValue;
|
|
@@ -2578,10 +2566,6 @@ class VTXBaseAPI {
|
|
|
2578
2566
|
useType: true,
|
|
2579
2567
|
url: true,
|
|
2580
2568
|
key: true
|
|
2581
|
-
},
|
|
2582
|
-
preferences: {
|
|
2583
|
-
_id: true,
|
|
2584
|
-
showProfileHelper: true
|
|
2585
2569
|
}
|
|
2586
2570
|
};
|
|
2587
2571
|
let retValue;
|
|
@@ -2807,10 +2791,6 @@ class VTXBaseAPI {
|
|
|
2807
2791
|
useType: true,
|
|
2808
2792
|
url: true,
|
|
2809
2793
|
key: true
|
|
2810
|
-
},
|
|
2811
|
-
preferences: {
|
|
2812
|
-
_id: true,
|
|
2813
|
-
showProfileHelper: true
|
|
2814
2794
|
}
|
|
2815
2795
|
};
|
|
2816
2796
|
let retValue;
|
|
@@ -3036,10 +3016,6 @@ class VTXBaseAPI {
|
|
|
3036
3016
|
useType: true,
|
|
3037
3017
|
url: true,
|
|
3038
3018
|
key: true
|
|
3039
|
-
},
|
|
3040
|
-
preferences: {
|
|
3041
|
-
_id: true,
|
|
3042
|
-
showProfileHelper: true
|
|
3043
3019
|
}
|
|
3044
3020
|
};
|
|
3045
3021
|
let retValue;
|
|
@@ -3216,7 +3192,7 @@ class VTXBaseAPI {
|
|
|
3216
3192
|
finishTimeMS: true,
|
|
3217
3193
|
resultWebLink: true
|
|
3218
3194
|
},
|
|
3219
|
-
|
|
3195
|
+
fundRaisingCampaignId: true
|
|
3220
3196
|
};
|
|
3221
3197
|
try {
|
|
3222
3198
|
const response = await client.mutation({
|
|
@@ -3369,18 +3345,7 @@ class VTXBaseAPI {
|
|
|
3369
3345
|
finishTimeMS: true,
|
|
3370
3346
|
resultWebLink: true
|
|
3371
3347
|
},
|
|
3372
|
-
|
|
3373
|
-
budget: {
|
|
3374
|
-
_id: true,
|
|
3375
|
-
totalRequired: true,
|
|
3376
|
-
initialFunds: true,
|
|
3377
|
-
items: {
|
|
3378
|
-
_id: true,
|
|
3379
|
-
quantity: true,
|
|
3380
|
-
concept: true,
|
|
3381
|
-
itemCost: true
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3348
|
+
fundRaisingCampaignId: true
|
|
3384
3349
|
};
|
|
3385
3350
|
let retValue;
|
|
3386
3351
|
try {
|
|
@@ -3576,169 +3541,17 @@ class VTXBaseAPI {
|
|
|
3576
3541
|
}
|
|
3577
3542
|
return retValue;
|
|
3578
3543
|
}
|
|
3579
|
-
async deleteAthleteCompetition(dto) {
|
|
3580
|
-
console.log('HEADERS:');
|
|
3581
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
3582
|
-
const client = (0, client_1.createClient)({
|
|
3583
|
-
url: this.backendUrl + '/graphql',
|
|
3584
|
-
headers: this.headers,
|
|
3585
|
-
});
|
|
3586
|
-
let retValue = {};
|
|
3587
|
-
const fields = {
|
|
3588
|
-
idToDelete: true,
|
|
3589
|
-
deleted: true,
|
|
3590
|
-
failureReason: {
|
|
3591
|
-
code: true,
|
|
3592
|
-
message: true
|
|
3593
|
-
}
|
|
3594
|
-
};
|
|
3595
|
-
try {
|
|
3596
|
-
const response = await client.mutation({
|
|
3597
|
-
deleteAthleteCompetition: {
|
|
3598
|
-
__args: {
|
|
3599
|
-
input: dto
|
|
3600
|
-
},
|
|
3601
|
-
...fields
|
|
3602
|
-
},
|
|
3603
|
-
});
|
|
3604
|
-
VTXBaseAPI.Logger.debug('deleteAthleteCompetition Response:');
|
|
3605
|
-
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3606
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteCompetition', (r) => {
|
|
3607
|
-
const isResponseOk = true && response?.deleteAthleteCompetition?.idToDelete;
|
|
3608
|
-
return isResponseOk;
|
|
3609
|
-
});
|
|
3610
|
-
}
|
|
3611
|
-
catch (err1) {
|
|
3612
|
-
VTXBaseAPI.Logger.error('deleteAthleteCompetition err1:');
|
|
3613
|
-
VTXBaseAPI.Logger.error(err1);
|
|
3614
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3615
|
-
}
|
|
3616
|
-
return retValue;
|
|
3617
|
-
}
|
|
3618
|
-
async createFundingCampaign(dto) {
|
|
3619
|
-
console.log('HEADERS:');
|
|
3620
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
3621
|
-
const client = (0, client_1.createClient)({
|
|
3622
|
-
url: this.backendUrl + '/graphql',
|
|
3623
|
-
headers: this.headers,
|
|
3624
|
-
});
|
|
3625
|
-
let retValue = {};
|
|
3626
|
-
const fields = {
|
|
3627
|
-
_id: true,
|
|
3628
|
-
budgetMode: true,
|
|
3629
|
-
status: true,
|
|
3630
|
-
title: true,
|
|
3631
|
-
motivation: true,
|
|
3632
|
-
website: true,
|
|
3633
|
-
fundsRequired: true,
|
|
3634
|
-
initialFundsObtained: true,
|
|
3635
|
-
fundsObtained: true,
|
|
3636
|
-
location: {
|
|
3637
|
-
userProvidedLatitude: true,
|
|
3638
|
-
userProvidedLongitude: true,
|
|
3639
|
-
cityNameGeocode: true,
|
|
3640
|
-
stateNameGeocode: true,
|
|
3641
|
-
countryIso2CodeGeocode: true,
|
|
3642
|
-
timeZoneGeocode: true,
|
|
3643
|
-
latitudeGeocode: true,
|
|
3644
|
-
longitudeGeocode: true,
|
|
3645
|
-
city: {
|
|
3646
|
-
_id: true,
|
|
3647
|
-
name: true,
|
|
3648
|
-
localizedName: true,
|
|
3649
|
-
state: {
|
|
3650
|
-
_id: true,
|
|
3651
|
-
name: true,
|
|
3652
|
-
country: {
|
|
3653
|
-
_id: true,
|
|
3654
|
-
name: true
|
|
3655
|
-
}
|
|
3656
|
-
},
|
|
3657
|
-
latitude: true,
|
|
3658
|
-
longitude: true,
|
|
3659
|
-
timezone: true,
|
|
3660
|
-
}
|
|
3661
|
-
},
|
|
3662
|
-
endingDate: true,
|
|
3663
|
-
budget: {
|
|
3664
|
-
initialFunds: true,
|
|
3665
|
-
totalRequired: true,
|
|
3666
|
-
items: {
|
|
3667
|
-
_id: true,
|
|
3668
|
-
quantity: true,
|
|
3669
|
-
concept: true,
|
|
3670
|
-
itemCost: true
|
|
3671
|
-
}
|
|
3672
|
-
},
|
|
3673
|
-
competitions: {
|
|
3674
|
-
_id: true,
|
|
3675
|
-
event: {
|
|
3676
|
-
_id: true,
|
|
3677
|
-
name: true,
|
|
3678
|
-
eventWebSite: true,
|
|
3679
|
-
startDate: true,
|
|
3680
|
-
endDate: true,
|
|
3681
|
-
verified: true,
|
|
3682
|
-
banner: {
|
|
3683
|
-
_id: true,
|
|
3684
|
-
name: true,
|
|
3685
|
-
contentType: true,
|
|
3686
|
-
size: true,
|
|
3687
|
-
useType: true,
|
|
3688
|
-
url: true,
|
|
3689
|
-
key: true
|
|
3690
|
-
},
|
|
3691
|
-
},
|
|
3692
|
-
participationDate: true,
|
|
3693
|
-
competitionNumber: true,
|
|
3694
|
-
result: {
|
|
3695
|
-
resultType: true,
|
|
3696
|
-
position: true,
|
|
3697
|
-
score: true,
|
|
3698
|
-
finishTimeMS: true,
|
|
3699
|
-
resultWebLink: true
|
|
3700
|
-
},
|
|
3701
|
-
fundRaisingCampaignIds: true
|
|
3702
|
-
}
|
|
3703
|
-
};
|
|
3704
|
-
try {
|
|
3705
|
-
const response = await client.mutation({
|
|
3706
|
-
createFundingCampaaign: {
|
|
3707
|
-
__args: {
|
|
3708
|
-
input: dto
|
|
3709
|
-
},
|
|
3710
|
-
...fields
|
|
3711
|
-
},
|
|
3712
|
-
});
|
|
3713
|
-
VTXBaseAPI.Logger.log("==================HERE=====================================");
|
|
3714
|
-
VTXBaseAPI.Logger.log('createFundingCampaign Response:');
|
|
3715
|
-
VTXBaseAPI.Logger.log(JSON.stringify(response, null, 2));
|
|
3716
|
-
VTXBaseAPI.Logger.log("==================DONE=====================================");
|
|
3717
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'createFundingCampaign', (r) => {
|
|
3718
|
-
const isResponseOk = true && response?.createFundingCampaign?._id;
|
|
3719
|
-
return isResponseOk;
|
|
3720
|
-
});
|
|
3721
|
-
}
|
|
3722
|
-
catch (err1) {
|
|
3723
|
-
VTXBaseAPI.Logger.log("************** ERROR *******************************");
|
|
3724
|
-
VTXBaseAPI.Logger.log('createFundingCampaign err1:');
|
|
3725
|
-
VTXBaseAPI.Logger.log(err1);
|
|
3726
|
-
VTXBaseAPI.Logger.log("************** DONE ERROR **************************");
|
|
3727
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3728
|
-
}
|
|
3729
|
-
return retValue;
|
|
3730
|
-
}
|
|
3731
3544
|
}
|
|
3732
3545
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
3733
3546
|
VTXBaseAPI.Logger = {
|
|
3734
3547
|
debug: (str) => {
|
|
3735
3548
|
},
|
|
3736
3549
|
log: (str) => {
|
|
3737
|
-
console.log(str);
|
|
3738
3550
|
},
|
|
3739
3551
|
warn: (str) => {
|
|
3740
3552
|
},
|
|
3741
3553
|
error: (str) => {
|
|
3554
|
+
console.error(str);
|
|
3742
3555
|
},
|
|
3743
3556
|
};
|
|
3744
3557
|
//# sourceMappingURL=vtx-base-api.js.map
|