@vertikalx/vtx-backend-client 1.0.0-dev-carlos.25 → 1.0.0-dev-david.0

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-carlos.25",
3
+ "version": "1.0.0-dev-david.0",
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, 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';
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 } from '../client';
2
2
  import { ITypedBackendResponse } from './backend-response';
3
3
  import { APICallHeaders } from './api-call-headers';
4
4
  export declare class VTXBaseAPI {
@@ -83,10 +83,7 @@ export declare class VTXBaseAPI {
83
83
  getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
84
84
  getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
85
85
  queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
86
- getAthleteStravaIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
87
- getAthleteInstagramIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
88
- getAthleteIntegrations(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
86
+ getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
89
87
  deleteAthleteIntegration(): Promise<ITypedBackendResponse<boolean>>;
90
88
  deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
91
- saveAthleteCompetitionResult(dto: SetCompetitionResultDto): Promise<ITypedBackendResponse<AthleteCompetitionResult>>;
92
89
  }
@@ -5823,7 +5823,7 @@ class VTXBaseAPI {
5823
5823
  console.log('createAthleteAlbum Response:');
5824
5824
  console.log(JSON.stringify(response, null, 2));
5825
5825
  retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
5826
- const isResponseOk = response?.createAthleteAlbum?._id;
5826
+ const isResponseOk = response?.createAthleteAlbum?.label;
5827
5827
  return isResponseOk;
5828
5828
  });
5829
5829
  }
@@ -6260,7 +6260,7 @@ class VTXBaseAPI {
6260
6260
  }
6261
6261
  return retValue;
6262
6262
  }
6263
- async getAthleteStravaIntegration() {
6263
+ async getAthleteIntegrationsByAthlete() {
6264
6264
  const client = (0, client_1.createClient)({
6265
6265
  url: this.backendUrl + '/graphql',
6266
6266
  headers: this.headers,
@@ -6292,162 +6292,12 @@ class VTXBaseAPI {
6292
6292
  };
6293
6293
  try {
6294
6294
  const response = await client.query({
6295
- getAthleteStravaIntegration: {
6295
+ getAthleteIntegrationsByAthlete: {
6296
6296
  ...fields
6297
6297
  },
6298
6298
  });
6299
- retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
6300
- const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
6301
- return isResponseOk;
6302
- });
6303
- }
6304
- catch (err) {
6305
- retValue = (0, response_builder_1.buildErrorResponse)(err);
6306
- }
6307
- return retValue;
6308
- }
6309
- async getAthleteInstagramIntegration() {
6310
- const client = (0, client_1.createClient)({
6311
- url: this.backendUrl + '/graphql',
6312
- headers: this.headers,
6313
- });
6314
- let retValue = {};
6315
- const fields = {
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
- }
6358
- };
6359
- try {
6360
- const response = await client.query({
6361
- getAthleteInstagramIntegration: {
6362
- ...fields
6363
- },
6364
- });
6365
- retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
6366
- const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
6367
- return isResponseOk;
6368
- });
6369
- }
6370
- catch (err) {
6371
- retValue = (0, response_builder_1.buildErrorResponse)(err);
6372
- }
6373
- return retValue;
6374
- }
6375
- async getAthleteIntegrations() {
6376
- const client = (0, client_1.createClient)({
6377
- url: this.backendUrl + '/graphql',
6378
- headers: this.headers,
6379
- });
6380
- let retValue = {};
6381
- const fields = {
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
- }
6442
- };
6443
- try {
6444
- const response = await client.query({
6445
- getAthleteIntegrations: {
6446
- ...fields
6447
- },
6448
- });
6449
- retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
6450
- const isResponseOk = !!response?.getAthleteIntegrations?._id;
6299
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrationsByAthlete', (r) => {
6300
+ const isResponseOk = !!response?.getAthleteIntegrationsByAthlete?._id;
6451
6301
  return isResponseOk;
6452
6302
  });
6453
6303
  }
@@ -6515,43 +6365,6 @@ class VTXBaseAPI {
6515
6365
  console.log(JSON.stringify(retValue, null, 2));
6516
6366
  return retValue;
6517
6367
  }
6518
- async saveAthleteCompetitionResult(dto) {
6519
- const client = (0, client_1.createClient)({
6520
- url: this.backendUrl + '/graphql',
6521
- headers: this.headers,
6522
- });
6523
- let retValue = {};
6524
- const fields = {
6525
- _id: true,
6526
- resultType: true,
6527
- position: true,
6528
- score: true,
6529
- finishTimeMS: true,
6530
- resultWebLink: true,
6531
- };
6532
- try {
6533
- const response = await client.mutation({
6534
- saveAthleteCompetitionResult: {
6535
- __args: {
6536
- input: dto
6537
- },
6538
- ...fields
6539
- },
6540
- });
6541
- VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
6542
- VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
6543
- retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
6544
- const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
6545
- return isResponseOk;
6546
- });
6547
- }
6548
- catch (err1) {
6549
- VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
6550
- VTXBaseAPI.Logger.error(err1);
6551
- retValue = (0, response_builder_1.buildErrorResponse)(err1);
6552
- }
6553
- return retValue;
6554
- }
6555
6368
  }
6556
6369
  exports.VTXBaseAPI = VTXBaseAPI;
6557
6370
  VTXBaseAPI.Logger = {