@vertikalx/vtx-backend-client 1.0.0-dev-daniel.183 → 1.0.0-dev-geo.4

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.183",
3
+ "version": "1.0.0-dev-geo.4",
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, AthleteMembershipGenqlSelection, MembershipOrganizationReferenceGenqlSelection, MembershipOrganizationReference, CreateMembershipOrganizationDto, CreateAthleteMembershipDto } 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,7 @@ 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
+ createMembershipOrganization(dto: CreateMembershipOrganizationDto, desiredFields?: MembershipOrganizationReferenceGenqlSelection): Promise<ITypedBackendResponse<MembershipOrganizationReference>>;
62
+ getMembershipOrganizations(): Promise<ITypedBackendResponse<MembershipOrganizationReference[]>>;
63
+ createAthleteMembershipAffilation(dto: CreateAthleteMembershipDto, desiredFields?: AthleteMembershipGenqlSelection): Promise<ITypedBackendResponse<AthleteMembership>>;
63
64
  }
@@ -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,155 +3541,118 @@ 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));
3544
+ async createMembershipOrganization(dto, desiredFields) {
3661
3545
  const client = (0, client_1.createClient)({
3662
- url: this.backendUrl + '/graphql',
3546
+ url: this.backendUrl + "/graphql",
3663
3547
  headers: this.headers,
3664
3548
  });
3665
- let retValue = {};
3666
- const fields = {
3667
- idToDelete: true,
3668
- deleted: true,
3669
- failureReason: {
3670
- code: true,
3671
- message: true
3672
- }
3673
- };
3549
+ const fields = desiredFields ?? { _id: true };
3550
+ let retValue;
3674
3551
  try {
3675
3552
  const response = await client.mutation({
3676
- deleteAthleteCompetition: {
3553
+ createMembershipOrganization: {
3677
3554
  __args: {
3678
3555
  input: dto
3679
3556
  },
3680
3557
  ...fields
3681
- },
3558
+ }
3682
3559
  });
3683
- VTXBaseAPI.Logger.debug('deleteAthleteCompetition Response:');
3560
+ VTXBaseAPI.Logger.debug('createMembershipOrganization Response:');
3684
3561
  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;
3562
+ retValue = (0, response_builder_1.buildResponse)(response, 'createMembershipOrganization', (r) => {
3563
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
3564
+ const isResponseOk = true && response?.createMembershipOrganization?._id;
3687
3565
  return isResponseOk;
3688
3566
  });
3689
3567
  }
3690
3568
  catch (err1) {
3691
- VTXBaseAPI.Logger.error('deleteAthleteCompetition err1:');
3569
+ VTXBaseAPI.Logger.error('createMembershipOrganization err1:');
3692
3570
  VTXBaseAPI.Logger.error(err1);
3693
3571
  retValue = (0, response_builder_1.buildErrorResponse)(err1);
3694
3572
  }
3695
3573
  return retValue;
3696
3574
  }
3697
- async createFundingCampaign(dto) {
3698
- console.log('HEADERS:');
3699
- console.log(JSON.stringify(this.headers, null, 2));
3575
+ async getMembershipOrganizations() {
3700
3576
  const client = (0, client_1.createClient)({
3701
- url: this.backendUrl + '/graphql',
3577
+ url: this.backendUrl + "/graphql",
3702
3578
  headers: this.headers,
3703
3579
  });
3704
- let retValue = {};
3705
3580
  const fields = {
3706
3581
  _id: true,
3707
- budgetMode: true,
3708
- status: true,
3709
- title: true,
3710
- motivation: true,
3582
+ shortName: true,
3583
+ acronym: true,
3584
+ fullName: true,
3711
3585
  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
- }
3586
+ verified: true,
3587
+ logo: {
3588
+ _id: true,
3589
+ name: true,
3590
+ contentType: true,
3591
+ size: true,
3592
+ useType: true,
3593
+ url: true,
3594
+ key: true
3740
3595
  },
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
- }
3596
+ country: {
3597
+ _id: true,
3598
+ name: true
3751
3599
  },
3752
- competitions: {
3600
+ sport: {
3753
3601
  _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
3602
+ name: true
3781
3603
  }
3782
3604
  };
3605
+ let retValue;
3606
+ try {
3607
+ const response = await client.query({
3608
+ getMembershipOrganizations: {
3609
+ __args: {},
3610
+ ...fields
3611
+ }
3612
+ });
3613
+ VTXBaseAPI.Logger.debug('getMembershipOrganizations Response:');
3614
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
3615
+ retValue = (0, response_builder_1.buildResponse)(response, 'getMembershipOrganizations', (r) => {
3616
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
3617
+ const isResponseOk = true && Array.isArray(response?.getMembershipOrganizations);
3618
+ return isResponseOk;
3619
+ });
3620
+ }
3621
+ catch (err1) {
3622
+ VTXBaseAPI.Logger.error('getMembershipOrganizations err1:');
3623
+ VTXBaseAPI.Logger.error(err1);
3624
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
3625
+ }
3626
+ return retValue;
3627
+ }
3628
+ async createAthleteMembershipAffilation(dto, desiredFields) {
3629
+ const client = (0, client_1.createClient)({
3630
+ url: this.backendUrl + "/graphql",
3631
+ headers: this.headers,
3632
+ });
3633
+ const fields = desiredFields ?? { _id: true };
3634
+ let retValue;
3783
3635
  try {
3784
3636
  const response = await client.mutation({
3785
- createFundingCampaign: {
3637
+ createAthleteMembershipAffilation: {
3786
3638
  __args: {
3787
3639
  input: dto
3788
3640
  },
3789
3641
  ...fields
3790
- },
3642
+ }
3791
3643
  });
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;
3644
+ VTXBaseAPI.Logger.debug('createAthleteMembershipAffilation Response:');
3645
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
3646
+ retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteMembershipAffilation', (r) => {
3647
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
3648
+ const isResponseOk = true && response?.createAthleteMembershipAffilation?._id;
3798
3649
  return isResponseOk;
3799
3650
  });
3800
3651
  }
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);
3652
+ catch (error1) {
3653
+ VTXBaseAPI.Logger.error('createAthleteMembershipAffilation err1:');
3654
+ VTXBaseAPI.Logger.error(error1);
3655
+ retValue = (0, response_builder_1.buildErrorResponse)(error1);
3807
3656
  }
3808
3657
  return retValue;
3809
3658
  }
@@ -3813,11 +3662,11 @@ VTXBaseAPI.Logger = {
3813
3662
  debug: (str) => {
3814
3663
  },
3815
3664
  log: (str) => {
3816
- console.log(str);
3817
3665
  },
3818
3666
  warn: (str) => {
3819
3667
  },
3820
3668
  error: (str) => {
3669
+ console.error(str);
3821
3670
  },
3822
3671
  };
3823
3672
  //# sourceMappingURL=vtx-base-api.js.map