@vertikalx/vtx-backend-client 1.0.1-dev-max.2 → 1.0.1-dev-max.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.1-dev-max.2",
3
+ "version": "1.0.1-dev-max.3",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.1-dev-max.2",
3
+ "version": "1.0.1-dev-max.3",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -3,6 +3,7 @@ import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  import { VerificationCodeType } from '@stackbus/common-types';
5
5
  import { GetAthleteCampaignsDto } from 'src/api/dto/get-athlete-campaigns.dto';
6
+ import { UpdateFundingCampaignDto } from 'src/api/dto/create-funding-campaign.dto';
6
7
  export declare class VTXBaseAPI {
7
8
  protected headers: APICallHeaders;
8
9
  protected backendUrl: string;
@@ -83,6 +84,7 @@ export declare class VTXBaseAPI {
83
84
  editAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
84
85
  createAthleteAlbum(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
85
86
  deleteFundingCampaign(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
87
+ updateFundingCampaign(dto: UpdateFundingCampaignDto): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
86
88
  deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
87
89
  getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
88
90
  getPublicAthleteAlbums(athleteId: string): Promise<ITypedBackendResponse<Album[]>>;
@@ -5743,6 +5743,149 @@ class VTXBaseAPI {
5743
5743
  console.log(JSON.stringify(retValue, null, 2));
5744
5744
  return retValue;
5745
5745
  }
5746
+ async updateFundingCampaign(dto) {
5747
+ console.log('HEADERS:');
5748
+ console.log(JSON.stringify(this.headers, null, 2));
5749
+ const client = (0, client_1.createClient)({
5750
+ url: this.backendUrl + '/graphql',
5751
+ headers: this.headers,
5752
+ });
5753
+ let retValue = {};
5754
+ const fields = {
5755
+ _id: true,
5756
+ budgetMode: true,
5757
+ status: true,
5758
+ title: true,
5759
+ motivation: true,
5760
+ website: true,
5761
+ fundsRequired: true,
5762
+ initialFundsObtained: true,
5763
+ fundsObtained: true,
5764
+ vtxComissionPct: true,
5765
+ location: {
5766
+ userProvidedLatitude: true,
5767
+ userProvidedLongitude: true,
5768
+ cityNameGeocode: true,
5769
+ stateNameGeocode: true,
5770
+ countryIso2CodeGeocode: true,
5771
+ timeZoneGeocode: true,
5772
+ latitudeGeocode: true,
5773
+ longitudeGeocode: true,
5774
+ city: {
5775
+ _id: true,
5776
+ name: true,
5777
+ localizedName: true,
5778
+ state: {
5779
+ _id: true,
5780
+ name: true,
5781
+ country: {
5782
+ _id: true,
5783
+ name: true
5784
+ }
5785
+ },
5786
+ latitude: true,
5787
+ longitude: true,
5788
+ timezone: true,
5789
+ }
5790
+ },
5791
+ endingDate: true,
5792
+ budget: {
5793
+ initialFunds: true,
5794
+ totalRequired: true,
5795
+ items: {
5796
+ _id: true,
5797
+ quantity: true,
5798
+ concept: true,
5799
+ itemCost: true
5800
+ }
5801
+ },
5802
+ competitions: {
5803
+ _id: true,
5804
+ event: {
5805
+ _id: true,
5806
+ name: true,
5807
+ mainSport: {
5808
+ _id: true,
5809
+ name: true
5810
+ },
5811
+ eventWebSite: true,
5812
+ startDate: true,
5813
+ endDate: true,
5814
+ verified: true,
5815
+ banner: {
5816
+ _id: true,
5817
+ name: true,
5818
+ contentType: true,
5819
+ size: true,
5820
+ useType: true,
5821
+ url: true,
5822
+ key: true
5823
+ },
5824
+ location: {
5825
+ _id: true,
5826
+ userProvidedLatitude: true,
5827
+ userProvidedLongitude: true,
5828
+ cityNameGeocode: true,
5829
+ stateNameGeocode: true,
5830
+ countryIso2CodeGeocode: true,
5831
+ timeZoneGeocode: true,
5832
+ latitudeGeocode: true,
5833
+ longitudeGeocode: true,
5834
+ city: {
5835
+ _id: true,
5836
+ name: true,
5837
+ localizedName: true,
5838
+ state: {
5839
+ _id: true,
5840
+ name: true,
5841
+ country: {
5842
+ _id: true,
5843
+ name: true
5844
+ }
5845
+ },
5846
+ latitude: true,
5847
+ longitude: true,
5848
+ timezone: true,
5849
+ }
5850
+ },
5851
+ },
5852
+ participationDate: true,
5853
+ competitionNumber: true,
5854
+ result: {
5855
+ resultType: true,
5856
+ position: true,
5857
+ score: true,
5858
+ finishTimeMS: true,
5859
+ resultWebLink: true
5860
+ },
5861
+ fundRaisingCampaignIds: true
5862
+ }
5863
+ };
5864
+ try {
5865
+ const response = await client.mutation({
5866
+ updateFundingCampaign: {
5867
+ __args: {
5868
+ input: dto
5869
+ },
5870
+ ...fields
5871
+ },
5872
+ });
5873
+ console.log('updateFundingCampaign Response:');
5874
+ console.log(JSON.stringify(response, null, 2));
5875
+ retValue = (0, response_builder_1.buildResponse)(response, 'updateFundingCampaign', (r) => {
5876
+ const isResponseOk = response?.updateFundingCampaign?._id;
5877
+ return isResponseOk;
5878
+ });
5879
+ }
5880
+ catch (err1) {
5881
+ console.error('updateFundingCampaign err1:');
5882
+ console.error(err1);
5883
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5884
+ }
5885
+ console.log('retValue:');
5886
+ console.log(JSON.stringify(retValue, null, 2));
5887
+ return retValue;
5888
+ }
5746
5889
  async deleteAthleteAlbum(dto) {
5747
5890
  console.log('HEADERS:');
5748
5891
  console.log(JSON.stringify(this.headers, null, 2));