@vertikalx/vtx-backend-client 1.0.0-dev-david.1 → 1.0.0-dev-daniel.235
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 +3 -7
- package/src/api/vtx-base-api.js +51 -183
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +40 -63
- package/src/client/schema.js +15 -15
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +16 -30
- package/src/client/types.js +108 -146
- 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 } 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,14 @@ 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
|
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>>;
|
|
93
89
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -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?.
|
|
5826
|
+
const isResponseOk = response?.createAthleteAlbum?._id;
|
|
5793
5827
|
return isResponseOk;
|
|
5794
5828
|
});
|
|
5795
5829
|
}
|
|
@@ -5850,7 +5884,7 @@ 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
5889
|
label: true,
|
|
5856
5890
|
description: true,
|
|
@@ -5876,7 +5910,7 @@ class VTXBaseAPI {
|
|
|
5876
5910
|
console.log('getAthleteAlbums Response:');
|
|
5877
5911
|
console.log(JSON.stringify(response, null, 2));
|
|
5878
5912
|
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5879
|
-
const isResponseOk = response?.getAthleteAlbums
|
|
5913
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
5880
5914
|
return isResponseOk;
|
|
5881
5915
|
});
|
|
5882
5916
|
}
|
|
@@ -5889,7 +5923,7 @@ class VTXBaseAPI {
|
|
|
5889
5923
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5890
5924
|
return retValue;
|
|
5891
5925
|
}
|
|
5892
|
-
async
|
|
5926
|
+
async getAthleteAlbumsById() {
|
|
5893
5927
|
console.log('HEADERS:');
|
|
5894
5928
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
5895
5929
|
const client = (0, client_1.createClient)({
|
|
@@ -5914,22 +5948,20 @@ class VTXBaseAPI {
|
|
|
5914
5948
|
};
|
|
5915
5949
|
try {
|
|
5916
5950
|
const response = await client.query({
|
|
5917
|
-
|
|
5918
|
-
__args: {
|
|
5919
|
-
input: albumId
|
|
5920
|
-
},
|
|
5951
|
+
getAthleteAlbums: {
|
|
5952
|
+
__args: {},
|
|
5921
5953
|
...fields
|
|
5922
5954
|
},
|
|
5923
5955
|
});
|
|
5924
|
-
console.log('
|
|
5956
|
+
console.log('getAthleteAlbums Response:');
|
|
5925
5957
|
console.log(JSON.stringify(response, null, 2));
|
|
5926
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5927
|
-
const isResponseOk = response?.
|
|
5958
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteAlbums', (r) => {
|
|
5959
|
+
const isResponseOk = response?.getAthleteAlbums?.length > 0;
|
|
5928
5960
|
return isResponseOk;
|
|
5929
5961
|
});
|
|
5930
5962
|
}
|
|
5931
5963
|
catch (err1) {
|
|
5932
|
-
console.error('
|
|
5964
|
+
console.error('getAthleteAlbums err1:');
|
|
5933
5965
|
console.error(err1);
|
|
5934
5966
|
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5935
5967
|
}
|
|
@@ -6333,170 +6365,6 @@ class VTXBaseAPI {
|
|
|
6333
6365
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6334
6366
|
return retValue;
|
|
6335
6367
|
}
|
|
6336
|
-
async createResetPasswordCode(email) {
|
|
6337
|
-
console.log('HEADERS:');
|
|
6338
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6339
|
-
const client = (0, client_1.createClient)({
|
|
6340
|
-
url: this.backendUrl + '/graphql',
|
|
6341
|
-
headers: this.headers,
|
|
6342
|
-
});
|
|
6343
|
-
let retValue = {};
|
|
6344
|
-
const fields = {
|
|
6345
|
-
field: true,
|
|
6346
|
-
changed: true,
|
|
6347
|
-
};
|
|
6348
|
-
try {
|
|
6349
|
-
const response = await client.mutation({
|
|
6350
|
-
createResetPasswordCode: {
|
|
6351
|
-
__args: {
|
|
6352
|
-
input: email
|
|
6353
|
-
},
|
|
6354
|
-
...fields
|
|
6355
|
-
},
|
|
6356
|
-
});
|
|
6357
|
-
console.log('createResetPasswordCode Response:');
|
|
6358
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6359
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'createResetPasswordCode', (r) => {
|
|
6360
|
-
const isResponseOk = response?.createResetPasswordCode?.field !== null;
|
|
6361
|
-
return isResponseOk;
|
|
6362
|
-
});
|
|
6363
|
-
}
|
|
6364
|
-
catch (err1) {
|
|
6365
|
-
console.error('createResetPasswordCode err1:');
|
|
6366
|
-
console.error(err1);
|
|
6367
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6368
|
-
}
|
|
6369
|
-
console.log('retValue:');
|
|
6370
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6371
|
-
return retValue;
|
|
6372
|
-
}
|
|
6373
|
-
async getResetVerificationCode(id) {
|
|
6374
|
-
console.log('HEADERS:');
|
|
6375
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
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
|
-
type: true,
|
|
6384
|
-
recipient: true,
|
|
6385
|
-
expires: true,
|
|
6386
|
-
isExpired: true,
|
|
6387
|
-
createdDate: true,
|
|
6388
|
-
};
|
|
6389
|
-
try {
|
|
6390
|
-
const response = await client.query({
|
|
6391
|
-
getResetVerificationCode: {
|
|
6392
|
-
__args: {
|
|
6393
|
-
input: id
|
|
6394
|
-
},
|
|
6395
|
-
...fields
|
|
6396
|
-
},
|
|
6397
|
-
});
|
|
6398
|
-
console.log('getResetVerificationCode Response:');
|
|
6399
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6400
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getResetVerificationCode', (r) => {
|
|
6401
|
-
const isResponseOk = response?.getResetVerificationCode?.changed;
|
|
6402
|
-
return isResponseOk;
|
|
6403
|
-
});
|
|
6404
|
-
}
|
|
6405
|
-
catch (err1) {
|
|
6406
|
-
console.error('getResetVerificationCode err1:');
|
|
6407
|
-
console.error(err1);
|
|
6408
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6409
|
-
}
|
|
6410
|
-
console.log('retValue:');
|
|
6411
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6412
|
-
return retValue;
|
|
6413
|
-
}
|
|
6414
|
-
async verifyCode(input) {
|
|
6415
|
-
console.log('HEADERS:');
|
|
6416
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6417
|
-
const client = (0, client_1.createClient)({
|
|
6418
|
-
url: this.backendUrl + '/graphql',
|
|
6419
|
-
headers: this.headers,
|
|
6420
|
-
});
|
|
6421
|
-
let retValue = {};
|
|
6422
|
-
const fields = {
|
|
6423
|
-
result: true,
|
|
6424
|
-
code: {
|
|
6425
|
-
_id: true,
|
|
6426
|
-
type: true,
|
|
6427
|
-
recipient: true,
|
|
6428
|
-
expires: true,
|
|
6429
|
-
isExpired: true,
|
|
6430
|
-
createdDate: true,
|
|
6431
|
-
},
|
|
6432
|
-
error: {
|
|
6433
|
-
errorCode: true,
|
|
6434
|
-
errorMessage: true,
|
|
6435
|
-
}
|
|
6436
|
-
};
|
|
6437
|
-
try {
|
|
6438
|
-
const response = await client.query({
|
|
6439
|
-
verifyCode: {
|
|
6440
|
-
__args: {
|
|
6441
|
-
input: input
|
|
6442
|
-
},
|
|
6443
|
-
...fields
|
|
6444
|
-
},
|
|
6445
|
-
});
|
|
6446
|
-
console.log('verifyCode Response:');
|
|
6447
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6448
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'verifyCode', (r) => {
|
|
6449
|
-
const isResponseOk = response?.verifyCode?.result === 'success' || response?.verifyCode?.result === 'error';
|
|
6450
|
-
return isResponseOk;
|
|
6451
|
-
});
|
|
6452
|
-
}
|
|
6453
|
-
catch (err1) {
|
|
6454
|
-
console.error('verifyCode err1:');
|
|
6455
|
-
console.error(err1);
|
|
6456
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6457
|
-
}
|
|
6458
|
-
console.log('retValue:');
|
|
6459
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6460
|
-
return retValue;
|
|
6461
|
-
}
|
|
6462
|
-
async resetUserPassword(input) {
|
|
6463
|
-
console.log('HEADERS:');
|
|
6464
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
6465
|
-
const client = (0, client_1.createClient)({
|
|
6466
|
-
url: this.backendUrl + '/graphql',
|
|
6467
|
-
headers: this.headers,
|
|
6468
|
-
});
|
|
6469
|
-
let retValue = {};
|
|
6470
|
-
const fields = {
|
|
6471
|
-
field: true,
|
|
6472
|
-
changed: true,
|
|
6473
|
-
};
|
|
6474
|
-
try {
|
|
6475
|
-
const response = await client.mutation({
|
|
6476
|
-
resetUserPassword: {
|
|
6477
|
-
__args: {
|
|
6478
|
-
input: input
|
|
6479
|
-
},
|
|
6480
|
-
...fields
|
|
6481
|
-
},
|
|
6482
|
-
});
|
|
6483
|
-
console.log('resetUserPassword Response:');
|
|
6484
|
-
console.log(JSON.stringify(response, null, 2));
|
|
6485
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'resetUserPassword', (r) => {
|
|
6486
|
-
const isResponseOk = response?.resetUserPassword?.changed;
|
|
6487
|
-
;
|
|
6488
|
-
return isResponseOk;
|
|
6489
|
-
});
|
|
6490
|
-
}
|
|
6491
|
-
catch (err1) {
|
|
6492
|
-
console.error('resetUserPassword err1:');
|
|
6493
|
-
console.error(err1);
|
|
6494
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6495
|
-
}
|
|
6496
|
-
console.log('retValue:');
|
|
6497
|
-
console.log(JSON.stringify(retValue, null, 2));
|
|
6498
|
-
return retValue;
|
|
6499
|
-
}
|
|
6500
6368
|
}
|
|
6501
6369
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
6502
6370
|
VTXBaseAPI.Logger = {
|