@vertikalx/vtx-backend-client 1.0.0-dev-david.0 → 1.0.0-dev-geo.67
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 -2
- package/src/api/vtx-base-api.js +171 -41
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +62 -38
- package/src/client/schema.js +15 -15
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +30 -15
- package/src/client/types.js +146 -105
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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,
|
|
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';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
|
+
import { VerificationCodeType } from '@stackbus/common-types';
|
|
4
5
|
export declare class VTXBaseAPI {
|
|
5
6
|
protected headers: APICallHeaders;
|
|
6
7
|
protected backendUrl: string;
|
|
@@ -76,7 +77,6 @@ export declare class VTXBaseAPI {
|
|
|
76
77
|
setFundingStatus(dto: SetFundingStatusDto, desiredFields?: FundRaisingCampaignGenqlSelection): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
77
78
|
findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
78
79
|
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>>;
|
|
@@ -86,4 +86,8 @@ export declare class VTXBaseAPI {
|
|
|
86
86
|
getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
87
87
|
deleteAthleteIntegration(): Promise<ITypedBackendResponse<boolean>>;
|
|
88
88
|
deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
|
|
89
|
+
createResetPasswordCode(email: string): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
90
|
+
getResetVerificationCode(id: string): Promise<ITypedBackendResponse<VerificationCodeType>>;
|
|
91
|
+
verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
|
|
92
|
+
resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
89
93
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -2229,7 +2229,12 @@ class VTXBaseAPI {
|
|
|
2229
2229
|
},
|
|
2230
2230
|
preferences: {
|
|
2231
2231
|
_id: true,
|
|
2232
|
-
showProfileHelper: true
|
|
2232
|
+
showProfileHelper: true,
|
|
2233
|
+
defaultAlbum: {
|
|
2234
|
+
_id: true,
|
|
2235
|
+
label: true,
|
|
2236
|
+
description: true,
|
|
2237
|
+
}
|
|
2233
2238
|
},
|
|
2234
2239
|
currentCampaign: {
|
|
2235
2240
|
_id: true,
|
|
@@ -5707,45 +5712,6 @@ class VTXBaseAPI {
|
|
|
5707
5712
|
}
|
|
5708
5713
|
return retValue;
|
|
5709
5714
|
}
|
|
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
|
-
}
|
|
5749
5715
|
async addAlbumsPictures(dto) {
|
|
5750
5716
|
console.log('HEADERS:');
|
|
5751
5717
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
@@ -5823,7 +5789,7 @@ class VTXBaseAPI {
|
|
|
5823
5789
|
console.log('createAthleteAlbum Response:');
|
|
5824
5790
|
console.log(JSON.stringify(response, null, 2));
|
|
5825
5791
|
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => {
|
|
5826
|
-
const isResponseOk = response?.createAthleteAlbum?.
|
|
5792
|
+
const isResponseOk = response?.createAthleteAlbum?._id;
|
|
5827
5793
|
return isResponseOk;
|
|
5828
5794
|
});
|
|
5829
5795
|
}
|
|
@@ -6365,6 +6331,170 @@ class VTXBaseAPI {
|
|
|
6365
6331
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6366
6332
|
return retValue;
|
|
6367
6333
|
}
|
|
6334
|
+
async createResetPasswordCode(email) {
|
|
6335
|
+
console.log('HEADERS:');
|
|
6336
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6337
|
+
const client = (0, client_1.createClient)({
|
|
6338
|
+
url: this.backendUrl + '/graphql',
|
|
6339
|
+
headers: this.headers,
|
|
6340
|
+
});
|
|
6341
|
+
let retValue = {};
|
|
6342
|
+
const fields = {
|
|
6343
|
+
field: true,
|
|
6344
|
+
changed: true,
|
|
6345
|
+
};
|
|
6346
|
+
try {
|
|
6347
|
+
const response = await client.mutation({
|
|
6348
|
+
createResetPasswordCode: {
|
|
6349
|
+
__args: {
|
|
6350
|
+
input: email
|
|
6351
|
+
},
|
|
6352
|
+
...fields
|
|
6353
|
+
},
|
|
6354
|
+
});
|
|
6355
|
+
console.log('createResetPasswordCode Response:');
|
|
6356
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6357
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6358
|
+
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6359
|
+
return isResponseOk;
|
|
6360
|
+
});
|
|
6361
|
+
}
|
|
6362
|
+
catch (err1) {
|
|
6363
|
+
console.error('createResetPasswordCode err1:');
|
|
6364
|
+
console.error(err1);
|
|
6365
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6366
|
+
}
|
|
6367
|
+
console.log('retValue:');
|
|
6368
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6369
|
+
return retValue;
|
|
6370
|
+
}
|
|
6371
|
+
async getResetVerificationCode(id) {
|
|
6372
|
+
console.log('HEADERS:');
|
|
6373
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6374
|
+
const client = (0, client_1.createClient)({
|
|
6375
|
+
url: this.backendUrl + '/graphql',
|
|
6376
|
+
headers: this.headers,
|
|
6377
|
+
});
|
|
6378
|
+
let retValue = {};
|
|
6379
|
+
const fields = {
|
|
6380
|
+
_id: true,
|
|
6381
|
+
type: true,
|
|
6382
|
+
recipient: true,
|
|
6383
|
+
expires: true,
|
|
6384
|
+
isExpired: true,
|
|
6385
|
+
createdDate: true,
|
|
6386
|
+
};
|
|
6387
|
+
try {
|
|
6388
|
+
const response = await client.query({
|
|
6389
|
+
getResetVerificationCode: {
|
|
6390
|
+
__args: {
|
|
6391
|
+
input: id
|
|
6392
|
+
},
|
|
6393
|
+
...fields
|
|
6394
|
+
},
|
|
6395
|
+
});
|
|
6396
|
+
console.log('getResetVerificationCode Response:');
|
|
6397
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6398
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
|
|
6399
|
+
const isResponseOk = response?.getResetVerificationCode?.changed;
|
|
6400
|
+
return isResponseOk;
|
|
6401
|
+
});
|
|
6402
|
+
}
|
|
6403
|
+
catch (err1) {
|
|
6404
|
+
console.error('getResetVerificationCode err1:');
|
|
6405
|
+
console.error(err1);
|
|
6406
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6407
|
+
}
|
|
6408
|
+
console.log('retValue:');
|
|
6409
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6410
|
+
return retValue;
|
|
6411
|
+
}
|
|
6412
|
+
async verifyCode(input) {
|
|
6413
|
+
console.log('HEADERS:');
|
|
6414
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6415
|
+
const client = (0, client_1.createClient)({
|
|
6416
|
+
url: this.backendUrl + '/graphql',
|
|
6417
|
+
headers: this.headers,
|
|
6418
|
+
});
|
|
6419
|
+
let retValue = {};
|
|
6420
|
+
const fields = {
|
|
6421
|
+
result: true,
|
|
6422
|
+
code: {
|
|
6423
|
+
_id: true,
|
|
6424
|
+
type: true,
|
|
6425
|
+
recipient: true,
|
|
6426
|
+
expires: true,
|
|
6427
|
+
isExpired: true,
|
|
6428
|
+
createdDate: true,
|
|
6429
|
+
},
|
|
6430
|
+
error: {
|
|
6431
|
+
errorCode: true,
|
|
6432
|
+
errorMessage: true,
|
|
6433
|
+
}
|
|
6434
|
+
};
|
|
6435
|
+
try {
|
|
6436
|
+
const response = await client.query({
|
|
6437
|
+
verifyCode: {
|
|
6438
|
+
__args: {
|
|
6439
|
+
input: input
|
|
6440
|
+
},
|
|
6441
|
+
...fields
|
|
6442
|
+
},
|
|
6443
|
+
});
|
|
6444
|
+
console.log('verifyCode Response:');
|
|
6445
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6446
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'verifyCode', (r) => {
|
|
6447
|
+
const isResponseOk = response?.verifyCode?.result === 'success' || response?.verifyCode?.result === 'error';
|
|
6448
|
+
return isResponseOk;
|
|
6449
|
+
});
|
|
6450
|
+
}
|
|
6451
|
+
catch (err1) {
|
|
6452
|
+
console.error('verifyCode err1:');
|
|
6453
|
+
console.error(err1);
|
|
6454
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6455
|
+
}
|
|
6456
|
+
console.log('retValue:');
|
|
6457
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6458
|
+
return retValue;
|
|
6459
|
+
}
|
|
6460
|
+
async resetUserPassword(input) {
|
|
6461
|
+
console.log('HEADERS:');
|
|
6462
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6463
|
+
const client = (0, client_1.createClient)({
|
|
6464
|
+
url: this.backendUrl + '/graphql',
|
|
6465
|
+
headers: this.headers,
|
|
6466
|
+
});
|
|
6467
|
+
let retValue = {};
|
|
6468
|
+
const fields = {
|
|
6469
|
+
field: true,
|
|
6470
|
+
changed: true,
|
|
6471
|
+
};
|
|
6472
|
+
try {
|
|
6473
|
+
const response = await client.mutation({
|
|
6474
|
+
resetUserPassword: {
|
|
6475
|
+
__args: {
|
|
6476
|
+
input: input
|
|
6477
|
+
},
|
|
6478
|
+
...fields
|
|
6479
|
+
},
|
|
6480
|
+
});
|
|
6481
|
+
console.log('resetUserPassword Response:');
|
|
6482
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6483
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'resetUserPassword', (r) => {
|
|
6484
|
+
const isResponseOk = response?.resetUserPassword?.changed;
|
|
6485
|
+
;
|
|
6486
|
+
return isResponseOk;
|
|
6487
|
+
});
|
|
6488
|
+
}
|
|
6489
|
+
catch (err1) {
|
|
6490
|
+
console.error('resetUserPassword err1:');
|
|
6491
|
+
console.error(err1);
|
|
6492
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6493
|
+
}
|
|
6494
|
+
console.log('retValue:');
|
|
6495
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6496
|
+
return retValue;
|
|
6497
|
+
}
|
|
6368
6498
|
}
|
|
6369
6499
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
6370
6500
|
VTXBaseAPI.Logger = {
|