@vertikalx/vtx-backend-client 2.0.0-dev-carlos.11 → 2.0.0-dev-alejo.5

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": "2.0.0-dev-carlos.11",
3
+ "version": "2.0.0-dev-alejo.5",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -111,4 +111,5 @@ export declare class VTXBaseAPI {
111
111
  addCompetitionBudget(input: AddCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
112
112
  editCompetitionBudget(input: EditCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
113
113
  editCampaignBudget(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
114
+ getDonationsByAthlete(): Promise<ITypedBackendResponse<Receipt[]>>;
114
115
  }
@@ -1989,6 +1989,7 @@ class VTXBaseAPI {
1989
1989
  trainer: true,
1990
1990
  trainerUrl: true,
1991
1991
  aboutMe: true,
1992
+ biography: true,
1992
1993
  followStats: {
1993
1994
  followers: true,
1994
1995
  followed: true,
@@ -3782,8 +3783,7 @@ class VTXBaseAPI {
3782
3783
  eventWebSite: true,
3783
3784
  mainSport: {
3784
3785
  _id: true,
3785
- name: true,
3786
- resultType: true
3786
+ name: true
3787
3787
  },
3788
3788
  startDate: true,
3789
3789
  endDate: true,
@@ -4600,7 +4600,7 @@ class VTXBaseAPI {
4600
4600
  scores: {
4601
4601
  vtxScore: true,
4602
4602
  },
4603
- cardPicture: {
4603
+ profilePicture: {
4604
4604
  url: true,
4605
4605
  },
4606
4606
  currentCampaign: {
@@ -5153,6 +5153,7 @@ class VTXBaseAPI {
5153
5153
  trainer: true,
5154
5154
  trainerUrl: true,
5155
5155
  aboutMe: true,
5156
+ biography: true,
5156
5157
  followStats: {
5157
5158
  followers: true,
5158
5159
  followed: true,
@@ -5648,8 +5649,12 @@ class VTXBaseAPI {
5648
5649
  });
5649
5650
  let retValue = {};
5650
5651
  const fields = {
5652
+ _id: true,
5651
5653
  label: true,
5652
5654
  description: true,
5655
+ displayIndex: true,
5656
+ competitionId: true,
5657
+ visibility: true,
5653
5658
  photos: {
5654
5659
  _id: true,
5655
5660
  photo: {
@@ -5696,8 +5701,12 @@ class VTXBaseAPI {
5696
5701
  });
5697
5702
  let retValue = {};
5698
5703
  const fields = {
5704
+ _id: true,
5699
5705
  label: true,
5700
5706
  description: true,
5707
+ displayIndex: true,
5708
+ competitionId: true,
5709
+ visibility: true,
5701
5710
  photos: {
5702
5711
  _id: true,
5703
5712
  photo: {
@@ -6157,6 +6166,9 @@ class VTXBaseAPI {
6157
6166
  _id: true,
6158
6167
  label: true,
6159
6168
  description: true,
6169
+ displayIndex: true,
6170
+ competitionId: true,
6171
+ visibility: true,
6160
6172
  photos: {
6161
6173
  _id: true,
6162
6174
  photo: {
@@ -6204,6 +6216,9 @@ class VTXBaseAPI {
6204
6216
  _id: true,
6205
6217
  label: true,
6206
6218
  description: true,
6219
+ displayIndex: true,
6220
+ competitionId: true,
6221
+ visibility: true,
6207
6222
  photos: {
6208
6223
  _id: true,
6209
6224
  photo: {
@@ -6250,8 +6265,12 @@ class VTXBaseAPI {
6250
6265
  });
6251
6266
  let retValue = {};
6252
6267
  const fields = {
6268
+ _id: true,
6253
6269
  label: true,
6254
6270
  description: true,
6271
+ displayIndex: true,
6272
+ competitionId: true,
6273
+ visibility: true,
6255
6274
  photos: {
6256
6275
  _id: true,
6257
6276
  photo: {
@@ -6301,6 +6320,9 @@ class VTXBaseAPI {
6301
6320
  _id: true,
6302
6321
  label: true,
6303
6322
  description: true,
6323
+ displayIndex: true,
6324
+ competitionId: true,
6325
+ visibility: true,
6304
6326
  photos: {
6305
6327
  _id: true,
6306
6328
  photo: {
@@ -6344,6 +6366,7 @@ class VTXBaseAPI {
6344
6366
  headers: this.headers,
6345
6367
  });
6346
6368
  const fieldsAthlete = {
6369
+ _id: true,
6347
6370
  firstName: true,
6348
6371
  lastName: true,
6349
6372
  screenName: true,
@@ -6353,7 +6376,9 @@ class VTXBaseAPI {
6353
6376
  _id: true,
6354
6377
  },
6355
6378
  location: {
6379
+ _id: true,
6356
6380
  city: {
6381
+ _id: true,
6357
6382
  name: true,
6358
6383
  state: {
6359
6384
  name: true,
@@ -6365,23 +6390,39 @@ class VTXBaseAPI {
6365
6390
  },
6366
6391
  aboutMe: true,
6367
6392
  mainSport: {
6393
+ _id: true,
6368
6394
  name: true
6369
6395
  },
6370
6396
  mainSportLevel: {
6397
+ _id: true,
6371
6398
  label: true,
6372
6399
  },
6373
6400
  scores: {
6374
6401
  vtxScore: true,
6402
+ socialScore: true,
6403
+ trainingScore: true,
6404
+ competitionScore: true
6375
6405
  },
6376
6406
  competitions: {
6407
+ _id: true,
6377
6408
  event: {
6409
+ _id: true,
6378
6410
  name: true,
6379
6411
  },
6380
6412
  participationDate: true,
6381
6413
  },
6382
- cardPicture: {
6414
+ profilePicture: {
6383
6415
  url: true,
6384
6416
  },
6417
+ currentCampaign: {
6418
+ _id: true,
6419
+ budgetMode: true,
6420
+ status: true,
6421
+ title: true,
6422
+ motivation: true,
6423
+ website: true,
6424
+ endingDate: true,
6425
+ }
6385
6426
  };
6386
6427
  const fields = {
6387
6428
  athletes: fieldsAthlete,
@@ -6961,6 +7002,11 @@ class VTXBaseAPI {
6961
7002
  ...fields
6962
7003
  },
6963
7004
  });
7005
+ console.log("+++++++++");
7006
+ console.log("+++++++++");
7007
+ console.log(response);
7008
+ console.log("+++++++++");
7009
+ console.log("+++++++++");
6964
7010
  VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
6965
7011
  VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
6966
7012
  retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
@@ -7278,6 +7324,7 @@ class VTXBaseAPI {
7278
7324
  fundsRequired: true,
7279
7325
  initialFundsObtained: true,
7280
7326
  status: true,
7327
+ budgetMode: true,
7281
7328
  endingDate: true,
7282
7329
  budget: true,
7283
7330
  competitions: true,
@@ -7427,6 +7474,44 @@ class VTXBaseAPI {
7427
7474
  }
7428
7475
  return retValue;
7429
7476
  }
7477
+ async getDonationsByAthlete() {
7478
+ const client = (0, client_1.createClient)({
7479
+ url: this.backendUrl + '/graphql',
7480
+ headers: this.headers,
7481
+ });
7482
+ let retValue = { data: [] };
7483
+ const fields = {
7484
+ receiptId: true,
7485
+ campaignName: true,
7486
+ athleteName: true,
7487
+ donorName: true,
7488
+ amount: true,
7489
+ currency: true,
7490
+ dateIssued: true,
7491
+ confirmed: true,
7492
+ message: true
7493
+ };
7494
+ try {
7495
+ const response = await client.query({
7496
+ getDonationsByAthlete: {
7497
+ ...fields
7498
+ },
7499
+ });
7500
+ retValue = (0, response_builder_1.buildResponse)(response, 'getDonationsByAthlete', (r) => {
7501
+ const isResponseOk = !!response?.getDonationsByAthlete &&
7502
+ Array.isArray(response.getDonationsByAthlete);
7503
+ return isResponseOk;
7504
+ });
7505
+ if (!retValue.data) {
7506
+ retValue.data = [];
7507
+ }
7508
+ }
7509
+ catch (err) {
7510
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
7511
+ retValue.data = [];
7512
+ }
7513
+ return retValue;
7514
+ }
7430
7515
  }
7431
7516
  exports.VTXBaseAPI = VTXBaseAPI;
7432
7517
  VTXBaseAPI.Logger = {