@vertikalx/vtx-backend-client 1.0.0-dev-geo.64 → 1.0.0-dev-carlos.21
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 +1 -1
- package/src/api/vtx-base-api.d.ts +6 -7
- package/src/api/vtx-base-api.js +190 -130
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +150 -30
- package/src/client/schema.js +51 -2
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +61 -18
- package/src/client/types.js +265 -160
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -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,
|
|
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,17 +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
84
|
getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
|
|
85
85
|
queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
|
|
86
|
-
|
|
86
|
+
getAthleteStravaIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
87
|
+
getAthleteInstagramIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
88
|
+
getAthleteIntegrations(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
87
89
|
deleteAthleteIntegration(): Promise<ITypedBackendResponse<boolean>>;
|
|
88
90
|
deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
|
|
89
|
-
|
|
90
|
-
getResetVerificationCode(id: string): Promise<ITypedBackendResponse<VerificationCodeType>>;
|
|
91
|
-
verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
|
|
92
|
-
resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
91
|
+
saveAthleteCompetitionResult(dto: SetCompetitionResultDto): Promise<ITypedBackendResponse<AthleteCompetitionResult>>;
|
|
93
92
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -5707,6 +5707,45 @@ class VTXBaseAPI {
|
|
|
5707
5707
|
}
|
|
5708
5708
|
return retValue;
|
|
5709
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
|
+
}
|
|
5710
5749
|
async addAlbumsPictures(dto) {
|
|
5711
5750
|
console.log('HEADERS:');
|
|
5712
5751
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
@@ -6221,7 +6260,7 @@ class VTXBaseAPI {
|
|
|
6221
6260
|
}
|
|
6222
6261
|
return retValue;
|
|
6223
6262
|
}
|
|
6224
|
-
async
|
|
6263
|
+
async getAthleteStravaIntegration() {
|
|
6225
6264
|
const client = (0, client_1.createClient)({
|
|
6226
6265
|
url: this.backendUrl + '/graphql',
|
|
6227
6266
|
headers: this.headers,
|
|
@@ -6253,12 +6292,12 @@ class VTXBaseAPI {
|
|
|
6253
6292
|
};
|
|
6254
6293
|
try {
|
|
6255
6294
|
const response = await client.query({
|
|
6256
|
-
|
|
6295
|
+
getAthleteStravaIntegration: {
|
|
6257
6296
|
...fields
|
|
6258
6297
|
},
|
|
6259
6298
|
});
|
|
6260
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6261
|
-
const isResponseOk = !!response?.
|
|
6299
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteStravaIntegration', (r) => {
|
|
6300
|
+
const isResponseOk = !!response?.getAthleteStravaIntegration?._id;
|
|
6262
6301
|
return isResponseOk;
|
|
6263
6302
|
});
|
|
6264
6303
|
}
|
|
@@ -6267,144 +6306,175 @@ class VTXBaseAPI {
|
|
|
6267
6306
|
}
|
|
6268
6307
|
return retValue;
|
|
6269
6308
|
}
|
|
6270
|
-
async
|
|
6271
|
-
const client = (0, client_1.createClient)({
|
|
6272
|
-
url: this.backendUrl + '/graphql',
|
|
6273
|
-
headers: this.headers,
|
|
6274
|
-
});
|
|
6275
|
-
let retValue = {};
|
|
6276
|
-
try {
|
|
6277
|
-
const response = await client.mutation({
|
|
6278
|
-
deleteAthleteIntegration: true
|
|
6279
|
-
});
|
|
6280
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteIntegration', (r) => {
|
|
6281
|
-
const isResponseOk = response?.deleteAthleteIntegration === true;
|
|
6282
|
-
return isResponseOk;
|
|
6283
|
-
});
|
|
6284
|
-
}
|
|
6285
|
-
catch (err) {
|
|
6286
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6287
|
-
}
|
|
6288
|
-
return retValue;
|
|
6289
|
-
}
|
|
6290
|
-
async deleteUploadedTypeKeyFile(dto) {
|
|
6291
|
-
console.log('HEADERS:');
|
|
6292
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6309
|
+
async getAthleteInstagramIntegration() {
|
|
6293
6310
|
const client = (0, client_1.createClient)({
|
|
6294
6311
|
url: this.backendUrl + '/graphql',
|
|
6295
6312
|
headers: this.headers,
|
|
6296
6313
|
});
|
|
6297
6314
|
let retValue = {};
|
|
6298
6315
|
const fields = {
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
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
|
+
}
|
|
6303
6358
|
};
|
|
6304
6359
|
try {
|
|
6305
|
-
const response = await client.
|
|
6306
|
-
|
|
6307
|
-
__args: {
|
|
6308
|
-
input: dto
|
|
6309
|
-
},
|
|
6360
|
+
const response = await client.query({
|
|
6361
|
+
getAthleteInstagramIntegration: {
|
|
6310
6362
|
...fields
|
|
6311
6363
|
},
|
|
6312
6364
|
});
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6316
|
-
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6365
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteInstagramIntegration', (r) => {
|
|
6366
|
+
const isResponseOk = !!response?.getAthleteInstagramIntegration?._id;
|
|
6317
6367
|
return isResponseOk;
|
|
6318
6368
|
});
|
|
6319
6369
|
}
|
|
6320
|
-
catch (
|
|
6321
|
-
|
|
6322
|
-
console.error(err1);
|
|
6323
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6370
|
+
catch (err) {
|
|
6371
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6324
6372
|
}
|
|
6325
|
-
console.log('retValue:');
|
|
6326
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6327
6373
|
return retValue;
|
|
6328
6374
|
}
|
|
6329
|
-
async
|
|
6330
|
-
console.log('HEADERS:');
|
|
6331
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6375
|
+
async getAthleteIntegrations() {
|
|
6332
6376
|
const client = (0, client_1.createClient)({
|
|
6333
6377
|
url: this.backendUrl + '/graphql',
|
|
6334
6378
|
headers: this.headers,
|
|
6335
6379
|
});
|
|
6336
6380
|
let retValue = {};
|
|
6337
6381
|
const fields = {
|
|
6338
|
-
|
|
6339
|
-
|
|
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
|
+
id: true,
|
|
6408
|
+
username: true,
|
|
6409
|
+
account_type: true,
|
|
6410
|
+
media_count: true
|
|
6411
|
+
},
|
|
6412
|
+
instagramMediaData: {
|
|
6413
|
+
data: {
|
|
6414
|
+
id: true,
|
|
6415
|
+
caption: true,
|
|
6416
|
+
media_type: true,
|
|
6417
|
+
media_url: true,
|
|
6418
|
+
permalink: true,
|
|
6419
|
+
thumbnail_url: true,
|
|
6420
|
+
timestamp: true,
|
|
6421
|
+
username: true,
|
|
6422
|
+
like_count: true,
|
|
6423
|
+
comments_count: true,
|
|
6424
|
+
insights: {
|
|
6425
|
+
data: {
|
|
6426
|
+
name: true,
|
|
6427
|
+
period: true,
|
|
6428
|
+
values: true
|
|
6429
|
+
}
|
|
6430
|
+
}
|
|
6431
|
+
},
|
|
6432
|
+
paging: {
|
|
6433
|
+
cursors: {
|
|
6434
|
+
before: true,
|
|
6435
|
+
after: true
|
|
6436
|
+
},
|
|
6437
|
+
next: true
|
|
6438
|
+
}
|
|
6439
|
+
}
|
|
6340
6440
|
};
|
|
6341
6441
|
try {
|
|
6342
|
-
const response = await client.
|
|
6343
|
-
|
|
6344
|
-
__args: {
|
|
6345
|
-
input: email
|
|
6346
|
-
},
|
|
6442
|
+
const response = await client.query({
|
|
6443
|
+
getAthleteIntegrations: {
|
|
6347
6444
|
...fields
|
|
6348
6445
|
},
|
|
6349
6446
|
});
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6353
|
-
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6447
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrations', (r) => {
|
|
6448
|
+
const isResponseOk = !!response?.getAthleteIntegrations?._id;
|
|
6354
6449
|
return isResponseOk;
|
|
6355
6450
|
});
|
|
6356
6451
|
}
|
|
6357
|
-
catch (
|
|
6358
|
-
|
|
6359
|
-
console.error(err1);
|
|
6360
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6452
|
+
catch (err) {
|
|
6453
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6361
6454
|
}
|
|
6362
|
-
console.log('retValue:');
|
|
6363
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6364
6455
|
return retValue;
|
|
6365
6456
|
}
|
|
6366
|
-
async
|
|
6367
|
-
console.log('HEADERS:');
|
|
6368
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6457
|
+
async deleteAthleteIntegration() {
|
|
6369
6458
|
const client = (0, client_1.createClient)({
|
|
6370
6459
|
url: this.backendUrl + '/graphql',
|
|
6371
6460
|
headers: this.headers,
|
|
6372
6461
|
});
|
|
6373
6462
|
let retValue = {};
|
|
6374
|
-
const fields = {
|
|
6375
|
-
_id: true,
|
|
6376
|
-
type: true,
|
|
6377
|
-
recipient: true,
|
|
6378
|
-
expires: true,
|
|
6379
|
-
isExpired: true,
|
|
6380
|
-
createdDate: true,
|
|
6381
|
-
};
|
|
6382
6463
|
try {
|
|
6383
|
-
const response = await client.
|
|
6384
|
-
|
|
6385
|
-
__args: {
|
|
6386
|
-
input: id
|
|
6387
|
-
},
|
|
6388
|
-
...fields
|
|
6389
|
-
},
|
|
6464
|
+
const response = await client.mutation({
|
|
6465
|
+
deleteAthleteIntegration: true
|
|
6390
6466
|
});
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
|
|
6394
|
-
const isResponseOk = response?.getResetVerificationCode?.changed;
|
|
6467
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteAthleteIntegration', (r) => {
|
|
6468
|
+
const isResponseOk = response?.deleteAthleteIntegration === true;
|
|
6395
6469
|
return isResponseOk;
|
|
6396
6470
|
});
|
|
6397
6471
|
}
|
|
6398
|
-
catch (
|
|
6399
|
-
|
|
6400
|
-
console.error(err1);
|
|
6401
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6472
|
+
catch (err) {
|
|
6473
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6402
6474
|
}
|
|
6403
|
-
console.log('retValue:');
|
|
6404
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6405
6475
|
return retValue;
|
|
6406
6476
|
}
|
|
6407
|
-
async
|
|
6477
|
+
async deleteUploadedTypeKeyFile(dto) {
|
|
6408
6478
|
console.log('HEADERS:');
|
|
6409
6479
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
6410
6480
|
const client = (0, client_1.createClient)({
|
|
@@ -6413,38 +6483,29 @@ class VTXBaseAPI {
|
|
|
6413
6483
|
});
|
|
6414
6484
|
let retValue = {};
|
|
6415
6485
|
const fields = {
|
|
6486
|
+
httpStatus: true,
|
|
6416
6487
|
result: true,
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
type: true,
|
|
6420
|
-
recipient: true,
|
|
6421
|
-
expires: true,
|
|
6422
|
-
isExpired: true,
|
|
6423
|
-
createdDate: true,
|
|
6424
|
-
},
|
|
6425
|
-
error: {
|
|
6426
|
-
errorCode: true,
|
|
6427
|
-
errorMessage: true,
|
|
6428
|
-
}
|
|
6488
|
+
message: true,
|
|
6489
|
+
errors: true
|
|
6429
6490
|
};
|
|
6430
6491
|
try {
|
|
6431
|
-
const response = await client.
|
|
6432
|
-
|
|
6492
|
+
const response = await client.mutation({
|
|
6493
|
+
deleteUploadedTypeKeyFile: {
|
|
6433
6494
|
__args: {
|
|
6434
|
-
input:
|
|
6495
|
+
input: dto
|
|
6435
6496
|
},
|
|
6436
6497
|
...fields
|
|
6437
6498
|
},
|
|
6438
6499
|
});
|
|
6439
|
-
console.log('
|
|
6500
|
+
console.log('deleteUploadedTypeKeyFile Response:');
|
|
6440
6501
|
console.log(JSON.stringify(response, null, 2));
|
|
6441
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6442
|
-
const isResponseOk = response?.
|
|
6502
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'deleteUploadedTypeKeyFile', (r) => {
|
|
6503
|
+
const isResponseOk = response?.deleteUploadedTypeKeyFile?.httpStatus;
|
|
6443
6504
|
return isResponseOk;
|
|
6444
6505
|
});
|
|
6445
6506
|
}
|
|
6446
6507
|
catch (err1) {
|
|
6447
|
-
console.error('
|
|
6508
|
+
console.error('deleteUploadedTypeKeyFile err1:');
|
|
6448
6509
|
console.error(err1);
|
|
6449
6510
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6450
6511
|
}
|
|
@@ -6452,42 +6513,41 @@ class VTXBaseAPI {
|
|
|
6452
6513
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6453
6514
|
return retValue;
|
|
6454
6515
|
}
|
|
6455
|
-
async
|
|
6456
|
-
console.log('HEADERS:');
|
|
6457
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6516
|
+
async saveAthleteCompetitionResult(dto) {
|
|
6458
6517
|
const client = (0, client_1.createClient)({
|
|
6459
6518
|
url: this.backendUrl + '/graphql',
|
|
6460
6519
|
headers: this.headers,
|
|
6461
6520
|
});
|
|
6462
6521
|
let retValue = {};
|
|
6463
6522
|
const fields = {
|
|
6464
|
-
|
|
6465
|
-
|
|
6523
|
+
_id: true,
|
|
6524
|
+
resultType: true,
|
|
6525
|
+
position: true,
|
|
6526
|
+
score: true,
|
|
6527
|
+
finishTimeMS: true,
|
|
6528
|
+
resultWebLink: true,
|
|
6466
6529
|
};
|
|
6467
6530
|
try {
|
|
6468
6531
|
const response = await client.mutation({
|
|
6469
|
-
|
|
6532
|
+
saveAthleteCompetitionResult: {
|
|
6470
6533
|
__args: {
|
|
6471
|
-
input:
|
|
6534
|
+
input: dto
|
|
6472
6535
|
},
|
|
6473
6536
|
...fields
|
|
6474
6537
|
},
|
|
6475
6538
|
});
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
6479
|
-
const isResponseOk = response?.
|
|
6480
|
-
;
|
|
6539
|
+
VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
|
|
6540
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
6541
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
|
|
6542
|
+
const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
|
|
6481
6543
|
return isResponseOk;
|
|
6482
6544
|
});
|
|
6483
6545
|
}
|
|
6484
6546
|
catch (err1) {
|
|
6485
|
-
|
|
6486
|
-
|
|
6547
|
+
VTXBaseAPI.Logger.error('saveAthleteCompetitionResult err1:');
|
|
6548
|
+
VTXBaseAPI.Logger.error(err1);
|
|
6487
6549
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6488
6550
|
}
|
|
6489
|
-
console.log('retValue:');
|
|
6490
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6491
6551
|
return retValue;
|
|
6492
6552
|
}
|
|
6493
6553
|
}
|