@vertikalx/vtx-backend-client 1.0.0-dev-geo.2 → 1.0.0-dev-daniel.181

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-geo.2",
3
+ "version": "1.0.0-dev-daniel.181",
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 } 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
  }
@@ -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,10 @@ class VTXBaseAPI {
2057
2061
  useType: true,
2058
2062
  url: true,
2059
2063
  key: true
2064
+ },
2065
+ preferences: {
2066
+ _id: true,
2067
+ showProfileHelper: true
2060
2068
  }
2061
2069
  };
2062
2070
  try {
@@ -2343,6 +2351,10 @@ class VTXBaseAPI {
2343
2351
  useType: true,
2344
2352
  url: true,
2345
2353
  key: true
2354
+ },
2355
+ preferences: {
2356
+ _id: true,
2357
+ showProfileHelper: true
2346
2358
  }
2347
2359
  };
2348
2360
  let retValue;
@@ -2566,6 +2578,10 @@ class VTXBaseAPI {
2566
2578
  useType: true,
2567
2579
  url: true,
2568
2580
  key: true
2581
+ },
2582
+ preferences: {
2583
+ _id: true,
2584
+ showProfileHelper: true
2569
2585
  }
2570
2586
  };
2571
2587
  let retValue;
@@ -2791,6 +2807,10 @@ class VTXBaseAPI {
2791
2807
  useType: true,
2792
2808
  url: true,
2793
2809
  key: true
2810
+ },
2811
+ preferences: {
2812
+ _id: true,
2813
+ showProfileHelper: true
2794
2814
  }
2795
2815
  };
2796
2816
  let retValue;
@@ -3016,6 +3036,10 @@ class VTXBaseAPI {
3016
3036
  useType: true,
3017
3037
  url: true,
3018
3038
  key: true
3039
+ },
3040
+ preferences: {
3041
+ _id: true,
3042
+ showProfileHelper: true
3019
3043
  }
3020
3044
  };
3021
3045
  let retValue;
@@ -3192,7 +3216,7 @@ class VTXBaseAPI {
3192
3216
  finishTimeMS: true,
3193
3217
  resultWebLink: true
3194
3218
  },
3195
- fundRaisingCampaignId: true
3219
+ fundRaisingCampaignIds: true
3196
3220
  };
3197
3221
  try {
3198
3222
  const response = await client.mutation({
@@ -3345,7 +3369,18 @@ class VTXBaseAPI {
3345
3369
  finishTimeMS: true,
3346
3370
  resultWebLink: true
3347
3371
  },
3348
- fundRaisingCampaignId: true
3372
+ fundRaisingCampaignIds: true,
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
+ }
3349
3384
  };
3350
3385
  let retValue;
3351
3386
  try {
@@ -3541,17 +3576,169 @@ class VTXBaseAPI {
3541
3576
  }
3542
3577
  return retValue;
3543
3578
  }
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
+ createFundingCampaign: {
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
+ }
3544
3731
  }
3545
3732
  exports.VTXBaseAPI = VTXBaseAPI;
3546
3733
  VTXBaseAPI.Logger = {
3547
3734
  debug: (str) => {
3548
3735
  },
3549
3736
  log: (str) => {
3737
+ console.log(str);
3550
3738
  },
3551
3739
  warn: (str) => {
3552
3740
  },
3553
3741
  error: (str) => {
3554
- console.error(str);
3555
3742
  },
3556
3743
  };
3557
3744
  //# sourceMappingURL=vtx-base-api.js.map