@vertikalx/vtx-backend-client 1.0.0-dev-daniel.182 → 1.0.0-dev-geo.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev-daniel.182",
3
+ "version": "1.0.0-dev-geo.3",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -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, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto } 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 } 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
  }
@@ -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,89 +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
- },
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
- }
2147
2060
  }
2148
2061
  };
2149
2062
  try {
@@ -2430,10 +2343,6 @@ class VTXBaseAPI {
2430
2343
  useType: true,
2431
2344
  url: true,
2432
2345
  key: true
2433
- },
2434
- preferences: {
2435
- _id: true,
2436
- showProfileHelper: true
2437
2346
  }
2438
2347
  };
2439
2348
  let retValue;
@@ -2657,10 +2566,6 @@ class VTXBaseAPI {
2657
2566
  useType: true,
2658
2567
  url: true,
2659
2568
  key: true
2660
- },
2661
- preferences: {
2662
- _id: true,
2663
- showProfileHelper: true
2664
2569
  }
2665
2570
  };
2666
2571
  let retValue;
@@ -2886,10 +2791,6 @@ class VTXBaseAPI {
2886
2791
  useType: true,
2887
2792
  url: true,
2888
2793
  key: true
2889
- },
2890
- preferences: {
2891
- _id: true,
2892
- showProfileHelper: true
2893
2794
  }
2894
2795
  };
2895
2796
  let retValue;
@@ -3115,10 +3016,6 @@ class VTXBaseAPI {
3115
3016
  useType: true,
3116
3017
  url: true,
3117
3018
  key: true
3118
- },
3119
- preferences: {
3120
- _id: true,
3121
- showProfileHelper: true
3122
3019
  }
3123
3020
  };
3124
3021
  let retValue;
@@ -3295,7 +3192,7 @@ class VTXBaseAPI {
3295
3192
  finishTimeMS: true,
3296
3193
  resultWebLink: true
3297
3194
  },
3298
- fundRaisingCampaignIds: true
3195
+ fundRaisingCampaignId: true
3299
3196
  };
3300
3197
  try {
3301
3198
  const response = await client.mutation({
@@ -3448,18 +3345,7 @@ class VTXBaseAPI {
3448
3345
  finishTimeMS: true,
3449
3346
  resultWebLink: true
3450
3347
  },
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
- }
3348
+ fundRaisingCampaignId: true
3463
3349
  };
3464
3350
  let retValue;
3465
3351
  try {
@@ -3655,169 +3541,17 @@ class VTXBaseAPI {
3655
3541
  }
3656
3542
  return retValue;
3657
3543
  }
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
- }
3810
3544
  }
3811
3545
  exports.VTXBaseAPI = VTXBaseAPI;
3812
3546
  VTXBaseAPI.Logger = {
3813
3547
  debug: (str) => {
3814
3548
  },
3815
3549
  log: (str) => {
3816
- console.log(str);
3817
3550
  },
3818
3551
  warn: (str) => {
3819
3552
  },
3820
3553
  error: (str) => {
3554
+ console.error(str);
3821
3555
  },
3822
3556
  };
3823
3557
  //# sourceMappingURL=vtx-base-api.js.map