@vertikalx/vtx-backend-client 1.0.0-dev-david.2 → 1.0.0-dev-carlos.27

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-david.2",
3
+ "version": "1.0.0-dev-carlos.27",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -1,7 +1,6 @@
1
- import { User, AddValuesResponse, 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, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, CodeVerificationResponse, resetPasswordDto } from '../client';
1
+ import { User, AddValuesResponse, 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, DeleteSingleValueDto, DeleteSingleValueResponse, FundRaisingCampaign, CreateFundingCampaignDto, FundRaisingCampaignGenqlSelection, AthleteQueryDto, AthleteQueryResponse, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeSession, StripeAccountReferenceGenqlSelection, StripeAccountReference, StripeCheckoutSessionGenqlSelection, StripeCheckoutSession, DonationCheckoutDto, GetDatabaseFileDto, TextDatabaseFileGenqlSelection, TextDatabaseFile, StripeQueryDto, StripeObject, SetFundingStatusDto, EditPictureResponse, UploadAlbumsPicturesDto, AWSS3DeleteUseTypeFileDto, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
- import { VerificationCodeType } from '@stackbus/common-types';
5
4
  export declare class VTXBaseAPI {
6
5
  protected headers: APICallHeaders;
7
6
  protected backendUrl: string;
@@ -77,18 +76,17 @@ export declare class VTXBaseAPI {
77
76
  setFundingStatus(dto: SetFundingStatusDto, desiredFields?: FundRaisingCampaignGenqlSelection): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
78
77
  findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
79
78
  editPicture(newPicDto: EditPictureDto): Promise<ITypedBackendResponse<EditPictureResponse>>;
79
+ DeletePictureFromBuket(deleteDto: AWSS3DeleteUseTypeFileDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
80
80
  addAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<AddValuesResponse>>;
81
81
  createAthleteAlbum(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
82
82
  deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
83
83
  getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
84
- getAthleteAlbumsById(albumId: string): Promise<ITypedBackendResponse<Album>>;
85
- getAndSetAlbumById(albumId: string): Promise<ITypedBackendResponse<Album>>;
84
+ getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
86
85
  queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
87
- getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
88
- deleteAthleteIntegration(): Promise<ITypedBackendResponse<boolean>>;
86
+ getAthleteStravaIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
87
+ getAthleteInstagramIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
88
+ getAthleteIntegrations(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
89
+ updateAthleteIntegration(type: string): Promise<ITypedBackendResponse<boolean>>;
89
90
  deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
90
- createResetPasswordCode(email: string): Promise<ITypedBackendResponse<EditValueResponse>>;
91
- getResetVerificationCode(id: string): Promise<ITypedBackendResponse<VerificationCodeType>>;
92
- verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
93
- resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
91
+ saveAthleteCompetitionResult(dto: SetCompetitionResultDto): Promise<ITypedBackendResponse<AthleteCompetitionResult>>;
94
92
  }
@@ -1829,11 +1829,11 @@ class VTXBaseAPI {
1829
1829
  url: this.backendUrl + "/graphql",
1830
1830
  headers: this.headers,
1831
1831
  });
1832
- let retValue;
1833
1832
  const fields = {
1834
1833
  _id: true,
1835
1834
  name: true,
1836
1835
  };
1836
+ let retValue;
1837
1837
  try {
1838
1838
  const response = await client.query({
1839
1839
  getCountries: {
@@ -2229,12 +2229,7 @@ class VTXBaseAPI {
2229
2229
  },
2230
2230
  preferences: {
2231
2231
  _id: true,
2232
- showProfileHelper: true,
2233
- defaultAlbum: {
2234
- _id: true,
2235
- label: true,
2236
- description: true,
2237
- }
2232
+ showProfileHelper: true
2238
2233
  },
2239
2234
  currentCampaign: {
2240
2235
  _id: true,
@@ -5712,6 +5707,45 @@ class VTXBaseAPI {
5712
5707
  }
5713
5708
  return retValue;
5714
5709
  }
5710
+ async DeletePictureFromBuket(deleteDto) {
5711
+ console.log('HEADERS:');
5712
+ console.log(JSON.stringify(this.headers, null, 2));
5713
+ const client = (0, client_1.createClient)({
5714
+ url: this.backendUrl + '/graphql',
5715
+ headers: this.headers,
5716
+ });
5717
+ let retValue = {};
5718
+ const fields = {
5719
+ idToDelete: true,
5720
+ deleted: true,
5721
+ failureReason: {
5722
+ code: true,
5723
+ message: true
5724
+ }
5725
+ };
5726
+ try {
5727
+ const response = await client.mutation({
5728
+ DeletePictureBuket: {
5729
+ __args: {
5730
+ input: deleteDto
5731
+ },
5732
+ ...fields
5733
+ },
5734
+ });
5735
+ VTXBaseAPI.Logger.debug('deletePicture Response:');
5736
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
5737
+ retValue = (0, response_builder_1.buildResponse)(response, 'DeletePictureBuket', (r) => {
5738
+ const isResponseOk = true && response?.DeletePictureBuket?.idToDelete;
5739
+ return isResponseOk;
5740
+ });
5741
+ }
5742
+ catch (err1) {
5743
+ VTXBaseAPI.Logger.error('editProfileValue err1:');
5744
+ VTXBaseAPI.Logger.error(err1);
5745
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5746
+ }
5747
+ return retValue;
5748
+ }
5715
5749
  async addAlbumsPictures(dto) {
5716
5750
  console.log('HEADERS:');
5717
5751
  console.log(JSON.stringify(this.headers, null, 2));
@@ -5789,7 +5823,7 @@ class VTXBaseAPI {
5789
5823
  console.log('createAthleteAlbum Response:');
5790
5824
  console.log(JSON.stringify(response, null, 2));
5791
5825
  retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
5792
- const isResponseOk = response?.createAthleteAlbum?.label;
5826
+ const isResponseOk = response?.createAthleteAlbum?._id;
5793
5827
  return isResponseOk;
5794
5828
  });
5795
5829
  }
@@ -5850,9 +5884,8 @@ class VTXBaseAPI {
5850
5884
  url: this.backendUrl + '/graphql',
5851
5885
  headers: this.headers,
5852
5886
  });
5853
- let retValue;
5887
+ let retValue = {};
5854
5888
  const fields = {
5855
- _id: true,
5856
5889
  label: true,
5857
5890
  description: true,
5858
5891
  photos: {
@@ -5877,7 +5910,7 @@ class VTXBaseAPI {
5877
5910
  console.log('getAthleteAlbums Response:');
5878
5911
  console.log(JSON.stringify(response, null, 2));
5879
5912
  retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
5880
- const isResponseOk = response?.getAthleteAlbums.length > 0;
5913
+ const isResponseOk = response?.getAthleteAlbums?.length > 0;
5881
5914
  return isResponseOk;
5882
5915
  });
5883
5916
  }
@@ -5890,55 +5923,7 @@ class VTXBaseAPI {
5890
5923
  console.log(JSON.stringify(retValue, null, 2));
5891
5924
  return retValue;
5892
5925
  }
5893
- async getAthleteAlbumsById(albumId) {
5894
- console.log('HEADERS:');
5895
- console.log(JSON.stringify(this.headers, null, 2));
5896
- const client = (0, client_1.createClient)({
5897
- url: this.backendUrl + '/graphql',
5898
- headers: this.headers,
5899
- });
5900
- let retValue = {};
5901
- const fields = {
5902
- label: true,
5903
- description: true,
5904
- photos: {
5905
- _id: true,
5906
- photo: {
5907
- _id: true,
5908
- name: true,
5909
- contentType: true,
5910
- size: true,
5911
- useType: true,
5912
- url: true,
5913
- }
5914
- }
5915
- };
5916
- try {
5917
- const response = await client.query({
5918
- getAthleteAlbumId: {
5919
- __args: {
5920
- input: albumId
5921
- },
5922
- ...fields
5923
- },
5924
- });
5925
- console.log('getAthleteAlbumId Response:');
5926
- console.log(JSON.stringify(response, null, 2));
5927
- retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbumId', (r) => {
5928
- const isResponseOk = response?.getAthleteAlbumId?._id;
5929
- return isResponseOk;
5930
- });
5931
- }
5932
- catch (err1) {
5933
- console.error('getAthleteAlbumId err1:');
5934
- console.error(err1);
5935
- retValue = (0, response_builder_1.buildErrorResponse)(err1);
5936
- }
5937
- console.log('retValue:');
5938
- console.log(JSON.stringify(retValue, null, 2));
5939
- return retValue;
5940
- }
5941
- async getAndSetAlbumById(albumId) {
5926
+ async getAthleteAlbumsById() {
5942
5927
  console.log('HEADERS:');
5943
5928
  console.log(JSON.stringify(this.headers, null, 2));
5944
5929
  const client = (0, client_1.createClient)({
@@ -5947,7 +5932,6 @@ class VTXBaseAPI {
5947
5932
  });
5948
5933
  let retValue = {};
5949
5934
  const fields = {
5950
- _id: true,
5951
5935
  label: true,
5952
5936
  description: true,
5953
5937
  photos: {
@@ -5964,22 +5948,20 @@ class VTXBaseAPI {
5964
5948
  };
5965
5949
  try {
5966
5950
  const response = await client.query({
5967
- getAndSetAlbumById: {
5968
- __args: {
5969
- input: albumId
5970
- },
5951
+ getAthleteAlbums: {
5952
+ __args: {},
5971
5953
  ...fields
5972
5954
  },
5973
5955
  });
5974
- console.log('getAndSetAlbumById Response:');
5956
+ console.log('getAthleteAlbums Response:');
5975
5957
  console.log(JSON.stringify(response, null, 2));
5976
- retValue = (0, response_builder_1.buildResponse)(response, 'getAndSetAlbumById', (r) => {
5977
- const isResponseOk = response?.getAndSetAlbumById?._id;
5958
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
5959
+ const isResponseOk = response?.getAthleteAlbums?.length > 0;
5978
5960
  return isResponseOk;
5979
5961
  });
5980
5962
  }
5981
5963
  catch (err1) {
5982
- console.error('getAndSetAlbumById err1:');
5964
+ console.error('getAthleteAlbums err1:');
5983
5965
  console.error(err1);
5984
5966
  retValue = (0, response_builder_1.buildErrorResponse)(err1);
5985
5967
  }
@@ -6278,7 +6260,7 @@ class VTXBaseAPI {
6278
6260
  }
6279
6261
  return retValue;
6280
6262
  }
6281
- async getAthleteIntegrationsByAthlete() {
6263
+ async getAthleteStravaIntegration() {
6282
6264
  const client = (0, client_1.createClient)({
6283
6265
  url: this.backendUrl + '/graphql',
6284
6266
  headers: this.headers,
@@ -6310,32 +6292,12 @@ class VTXBaseAPI {
6310
6292
  };
6311
6293
  try {
6312
6294
  const response = await client.query({
6313
- getAthleteIntegrationsByAthlete: {
6295
+ getAthleteStravaIntegration: {
6314
6296
  ...fields
6315
6297
  },
6316
6298
  });
6317
- retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrationsByAthlete', (r) => {
6318
- const isResponseOk = !!response?.getAthleteIntegrationsByAthlete?._id;
6319
- return isResponseOk;
6320
- });
6321
- }
6322
- catch (err) {
6323
- retValue = (0, response_builder_1.buildErrorResponse)(err);
6324
- }
6325
- return retValue;
6326
- }
6327
- async deleteAthleteIntegration() {
6328
- const client = (0, client_1.createClient)({
6329
- url: this.backendUrl + '/graphql',
6330
- headers: this.headers,
6331
- });
6332
- let retValue = {};
6333
- try {
6334
- const response = await client.mutation({
6335
- deleteAthleteIntegration: true
6336
- });
6337
- retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteIntegration', (r) => {
6338
- const isResponseOk = response?.deleteAthleteIntegration === true;
6299
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
6300
+ const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
6339
6301
  return isResponseOk;
6340
6302
  });
6341
6303
  }
@@ -6344,124 +6306,181 @@ class VTXBaseAPI {
6344
6306
  }
6345
6307
  return retValue;
6346
6308
  }
6347
- async deleteUploadedTypeKeyFile(dto) {
6348
- console.log('HEADERS:');
6349
- console.log(JSON.stringify(this.headers, null, 2));
6309
+ async getAthleteInstagramIntegration() {
6350
6310
  const client = (0, client_1.createClient)({
6351
6311
  url: this.backendUrl + '/graphql',
6352
6312
  headers: this.headers,
6353
6313
  });
6354
6314
  let retValue = {};
6355
6315
  const fields = {
6356
- httpStatus: true,
6357
- result: true,
6358
- message: true,
6359
- errors: true
6316
+ _id: true,
6317
+ athlete: {
6318
+ _id: true,
6319
+ },
6320
+ hasInstagramIntegration: true,
6321
+ instagramTokenExpires: true,
6322
+ instagramUserData: {
6323
+ user_id: true,
6324
+ username: true,
6325
+ name: true,
6326
+ account_type: true,
6327
+ followers_count: true,
6328
+ media_count: true
6329
+ },
6330
+ instagramMediaData: {
6331
+ data: {
6332
+ id: true,
6333
+ caption: true,
6334
+ media_type: true,
6335
+ media_url: true,
6336
+ permalink: true,
6337
+ thumbnail_url: true,
6338
+ timestamp: true,
6339
+ username: true,
6340
+ like_count: true,
6341
+ comments_count: true,
6342
+ insights: {
6343
+ data: {
6344
+ name: true,
6345
+ period: true,
6346
+ values: true
6347
+ }
6348
+ }
6349
+ },
6350
+ paging: {
6351
+ cursors: {
6352
+ before: true,
6353
+ after: true
6354
+ },
6355
+ next: true
6356
+ }
6357
+ }
6360
6358
  };
6361
6359
  try {
6362
- const response = await client.mutation({
6363
- deleteUploadedTypeKeyFile: {
6364
- __args: {
6365
- input: dto
6366
- },
6360
+ const response = await client.query({
6361
+ getAthleteInstagramIntegration: {
6367
6362
  ...fields
6368
6363
  },
6369
6364
  });
6370
- console.log('deleteUploadedTypeKeyFile Response:');
6371
- console.log(JSON.stringify(response, null, 2));
6372
- retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
6373
- const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
6365
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
6366
+ const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
6374
6367
  return isResponseOk;
6375
6368
  });
6376
6369
  }
6377
- catch (err1) {
6378
- console.error('deleteUploadedTypeKeyFile err1:');
6379
- console.error(err1);
6380
- retValue = (0, response_builder_1.buildErrorResponse)(err1);
6370
+ catch (err) {
6371
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
6381
6372
  }
6382
- console.log('retValue:');
6383
- console.log(JSON.stringify(retValue, null, 2));
6384
6373
  return retValue;
6385
6374
  }
6386
- async createResetPasswordCode(email) {
6387
- console.log('HEADERS:');
6388
- console.log(JSON.stringify(this.headers, null, 2));
6375
+ async getAthleteIntegrations() {
6389
6376
  const client = (0, client_1.createClient)({
6390
6377
  url: this.backendUrl + '/graphql',
6391
6378
  headers: this.headers,
6392
6379
  });
6393
6380
  let retValue = {};
6394
6381
  const fields = {
6395
- field: true,
6396
- changed: true,
6382
+ _id: true,
6383
+ athlete: {
6384
+ _id: true,
6385
+ },
6386
+ hasStravaIntegration: true,
6387
+ stravaTokenExpires: true,
6388
+ stravaAthleteData: {
6389
+ id: true,
6390
+ username: true,
6391
+ firstname: true,
6392
+ lastname: true,
6393
+ bio: true,
6394
+ city: true,
6395
+ state: true,
6396
+ country: true,
6397
+ sex: true,
6398
+ premium: true,
6399
+ profile: true,
6400
+ created_at: true,
6401
+ updated_at: true,
6402
+ weight: true
6403
+ },
6404
+ hasInstagramIntegration: true,
6405
+ instagramTokenExpires: true,
6406
+ instagramUserData: {
6407
+ user_id: true,
6408
+ username: true,
6409
+ name: true,
6410
+ account_type: true,
6411
+ followers_count: true,
6412
+ media_count: true
6413
+ },
6414
+ instagramMediaData: {
6415
+ data: {
6416
+ id: true,
6417
+ caption: true,
6418
+ media_type: true,
6419
+ media_url: true,
6420
+ permalink: true,
6421
+ thumbnail_url: true,
6422
+ timestamp: true,
6423
+ username: true,
6424
+ like_count: true,
6425
+ comments_count: true,
6426
+ insights: {
6427
+ data: {
6428
+ name: true,
6429
+ period: true,
6430
+ values: true
6431
+ }
6432
+ }
6433
+ },
6434
+ paging: {
6435
+ cursors: {
6436
+ before: true,
6437
+ after: true
6438
+ },
6439
+ next: true
6440
+ }
6441
+ }
6397
6442
  };
6398
6443
  try {
6399
- const response = await client.mutation({
6400
- createResetPasswordCode: {
6401
- __args: {
6402
- input: email
6403
- },
6444
+ const response = await client.query({
6445
+ getAthleteIntegrations: {
6404
6446
  ...fields
6405
6447
  },
6406
6448
  });
6407
- console.log('createResetPasswordCode Response:');
6408
- console.log(JSON.stringify(response, null, 2));
6409
- retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
6410
- const isResponseOk = response?.createResetPasswordCode?.field !== null;
6449
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
6450
+ const isResponseOk = !!response?.getAthleteIntegrations?._id;
6411
6451
  return isResponseOk;
6412
6452
  });
6413
6453
  }
6414
- catch (err1) {
6415
- console.error('createResetPasswordCode err1:');
6416
- console.error(err1);
6417
- retValue = (0, response_builder_1.buildErrorResponse)(err1);
6454
+ catch (err) {
6455
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
6418
6456
  }
6419
- console.log('retValue:');
6420
- console.log(JSON.stringify(retValue, null, 2));
6421
6457
  return retValue;
6422
6458
  }
6423
- async getResetVerificationCode(id) {
6424
- console.log('HEADERS:');
6425
- console.log(JSON.stringify(this.headers, null, 2));
6459
+ async updateAthleteIntegration(type) {
6426
6460
  const client = (0, client_1.createClient)({
6427
6461
  url: this.backendUrl + '/graphql',
6428
6462
  headers: this.headers,
6429
6463
  });
6430
6464
  let retValue = {};
6431
- const fields = {
6432
- _id: true,
6433
- type: true,
6434
- recipient: true,
6435
- expires: true,
6436
- isExpired: true,
6437
- createdDate: true,
6438
- };
6439
6465
  try {
6440
- const response = await client.query({
6441
- getResetVerificationCode: {
6466
+ const response = await client.mutation({
6467
+ updateAthleteIntegration: {
6442
6468
  __args: {
6443
- input: id
6469
+ type: type
6444
6470
  },
6445
- ...fields
6446
- },
6471
+ }
6447
6472
  });
6448
- console.log('getResetVerificationCode Response:');
6449
- console.log(JSON.stringify(response, null, 2));
6450
- retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
6451
- const isResponseOk = response?.getResetVerificationCode?.changed;
6473
+ retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteIntegration', (r) => {
6474
+ const isResponseOk = response?.updateAthleteIntegration === true;
6452
6475
  return isResponseOk;
6453
6476
  });
6454
6477
  }
6455
- catch (err1) {
6456
- console.error('getResetVerificationCode err1:');
6457
- console.error(err1);
6458
- retValue = (0, response_builder_1.buildErrorResponse)(err1);
6478
+ catch (err) {
6479
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
6459
6480
  }
6460
- console.log('retValue:');
6461
- console.log(JSON.stringify(retValue, null, 2));
6462
6481
  return retValue;
6463
6482
  }
6464
- async verifyCode(input) {
6483
+ async deleteUploadedTypeKeyFile(dto) {
6465
6484
  console.log('HEADERS:');
6466
6485
  console.log(JSON.stringify(this.headers, null, 2));
6467
6486
  const client = (0, client_1.createClient)({
@@ -6470,38 +6489,29 @@ class VTXBaseAPI {
6470
6489
  });
6471
6490
  let retValue = {};
6472
6491
  const fields = {
6492
+ httpStatus: true,
6473
6493
  result: true,
6474
- code: {
6475
- _id: true,
6476
- type: true,
6477
- recipient: true,
6478
- expires: true,
6479
- isExpired: true,
6480
- createdDate: true,
6481
- },
6482
- error: {
6483
- errorCode: true,
6484
- errorMessage: true,
6485
- }
6494
+ message: true,
6495
+ errors: true
6486
6496
  };
6487
6497
  try {
6488
- const response = await client.query({
6489
- verifyCode: {
6498
+ const response = await client.mutation({
6499
+ deleteUploadedTypeKeyFile: {
6490
6500
  __args: {
6491
- input: input
6501
+ input: dto
6492
6502
  },
6493
6503
  ...fields
6494
6504
  },
6495
6505
  });
6496
- console.log('verifyCode Response:');
6506
+ console.log('deleteUploadedTypeKeyFile Response:');
6497
6507
  console.log(JSON.stringify(response, null, 2));
6498
- retValue = (0, response_builder_1.buildResponse)(response, 'verifyCode', (r) => {
6499
- const isResponseOk = response?.verifyCode?.result === 'success' || response?.verifyCode?.result === 'error';
6508
+ retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
6509
+ const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
6500
6510
  return isResponseOk;
6501
6511
  });
6502
6512
  }
6503
6513
  catch (err1) {
6504
- console.error('verifyCode err1:');
6514
+ console.error('deleteUploadedTypeKeyFile err1:');
6505
6515
  console.error(err1);
6506
6516
  retValue = (0, response_builder_1.buildErrorResponse)(err1);
6507
6517
  }
@@ -6509,42 +6519,41 @@ class VTXBaseAPI {
6509
6519
  console.log(JSON.stringify(retValue, null, 2));
6510
6520
  return retValue;
6511
6521
  }
6512
- async resetUserPassword(input) {
6513
- console.log('HEADERS:');
6514
- console.log(JSON.stringify(this.headers, null, 2));
6522
+ async saveAthleteCompetitionResult(dto) {
6515
6523
  const client = (0, client_1.createClient)({
6516
6524
  url: this.backendUrl + '/graphql',
6517
6525
  headers: this.headers,
6518
6526
  });
6519
6527
  let retValue = {};
6520
6528
  const fields = {
6521
- field: true,
6522
- changed: true,
6529
+ _id: true,
6530
+ resultType: true,
6531
+ position: true,
6532
+ score: true,
6533
+ finishTimeMS: true,
6534
+ resultWebLink: true,
6523
6535
  };
6524
6536
  try {
6525
6537
  const response = await client.mutation({
6526
- resetUserPassword: {
6538
+ saveAthleteCompetitionResult: {
6527
6539
  __args: {
6528
- input: input
6540
+ input: dto
6529
6541
  },
6530
6542
  ...fields
6531
6543
  },
6532
6544
  });
6533
- console.log('resetUserPassword Response:');
6534
- console.log(JSON.stringify(response, null, 2));
6535
- retValue = (0, response_builder_1.buildResponse)(response, 'resetUserPassword', (r) => {
6536
- const isResponseOk = response?.resetUserPassword?.changed;
6537
- ;
6545
+ VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
6546
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
6547
+ retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
6548
+ const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
6538
6549
  return isResponseOk;
6539
6550
  });
6540
6551
  }
6541
6552
  catch (err1) {
6542
- console.error('resetUserPassword err1:');
6543
- console.error(err1);
6553
+ VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
6554
+ VTXBaseAPI.Logger.error(err1);
6544
6555
  retValue = (0, response_builder_1.buildErrorResponse)(err1);
6545
6556
  }
6546
- console.log('retValue:');
6547
- console.log(JSON.stringify(retValue, null, 2));
6548
6557
  return retValue;
6549
6558
  }
6550
6559
  }