@vertikalx/vtx-backend-client 2.0.0-dev-alejo.37 → 2.0.0-dev-max.2
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/LICENSE.md +0 -0
- package/package.json +1 -1
- package/src/api/vtx-base-api.d.ts +4 -1
- package/src/api/vtx-base-api.js +113 -56
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +45 -28
- package/src/client/schema.js +9 -9
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +27 -17
- package/src/client/types.js +215 -189
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/LICENSE.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -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, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult, CodeVerificationResponse, resetPasswordDto, DeleteValuesDto, existValueDto, ExistValueResponse, Receipt, ReceiptUrl, GetReceiptDto, DeleteValuesResponse, BudgetData, AddCompetitionBudgetDto, EditCompetitionBudgetDto, EditCampaignBudgetDto, SetCurrentCampaignDto, GetAthleteCampaignsDto, UpdateFundingCampaignDto } 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, EditPictureDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult, CodeVerificationResponse, resetPasswordDto, DeleteValuesDto, existValueDto, ExistValueResponse, Receipt, ReceiptUrl, GetReceiptDto, DeleteValuesResponse, BudgetData, AddCompetitionBudgetDto, EditCompetitionBudgetDto, EditCampaignBudgetDto, SetCurrentCampaignDto, GetAthleteCampaignsDto, UpdateFundingCampaignDto, EditDisplayIndexDto, ValidatedToken } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
import { VerificationCodeType } from '@stackbus/common-types';
|
|
@@ -18,6 +18,7 @@ export declare class VTXBaseAPI {
|
|
|
18
18
|
static isBrowser(): boolean;
|
|
19
19
|
findUserByEmail(email: string): Promise<ITypedBackendResponse<User>>;
|
|
20
20
|
loginUserFromEmail(loginEmail: string, loginMethod?: string): Promise<ITypedBackendResponse<UserToken>>;
|
|
21
|
+
validateToken(token: string): Promise<ITypedBackendResponse<ValidatedToken>>;
|
|
21
22
|
createUserAndLogin(loginEmail: string): Promise<ITypedBackendResponse<UserWithToken>>;
|
|
22
23
|
registerAthlete(payload: RegisterAthleteDto): Promise<ITypedBackendResponse<Athlete>>;
|
|
23
24
|
findBrandByName(name: string, translations?: boolean): Promise<ITypedBackendResponse<Brand>>;
|
|
@@ -86,6 +87,7 @@ export declare class VTXBaseAPI {
|
|
|
86
87
|
setCurrentCampaign(dto: SetCurrentCampaignDto): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
87
88
|
deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
88
89
|
getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
|
|
90
|
+
reorderAlbums(dto: EditDisplayIndexDto): Promise<ITypedBackendResponse<Album[]>>;
|
|
89
91
|
getPublicAthleteAlbums(athleteId: string): Promise<ITypedBackendResponse<Album[]>>;
|
|
90
92
|
getAthleteAlbumsById(albumId: string): Promise<ITypedBackendResponse<Album>>;
|
|
91
93
|
getAndSetAlbumById(albumId: string): Promise<ITypedBackendResponse<Album>>;
|
|
@@ -111,5 +113,6 @@ export declare class VTXBaseAPI {
|
|
|
111
113
|
addCompetitionBudget(input: AddCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
112
114
|
editCompetitionBudget(input: EditCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
113
115
|
editCampaignBudget(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
116
|
+
editCompetitionBudgetForCampaign(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
114
117
|
getDonationsByAthlete(): Promise<ITypedBackendResponse<Receipt[]>>;
|
|
115
118
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -102,6 +102,41 @@ class VTXBaseAPI {
|
|
|
102
102
|
}
|
|
103
103
|
return retValue;
|
|
104
104
|
}
|
|
105
|
+
async validateToken(token) {
|
|
106
|
+
const client = (0, client_1.createClient)({
|
|
107
|
+
url: this.backendUrl + '/graphql',
|
|
108
|
+
headers: this.headers,
|
|
109
|
+
});
|
|
110
|
+
let retValue = {};
|
|
111
|
+
const fields = {
|
|
112
|
+
accessToken: true,
|
|
113
|
+
refreshToken: true,
|
|
114
|
+
expiresAt: true,
|
|
115
|
+
refreshExpiresAt: true
|
|
116
|
+
};
|
|
117
|
+
try {
|
|
118
|
+
const response = await client.mutation({
|
|
119
|
+
validateToken: {
|
|
120
|
+
__args: {
|
|
121
|
+
input: token
|
|
122
|
+
},
|
|
123
|
+
...fields
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
VTXBaseAPI.Logger.debug('validateToken Response:');
|
|
127
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
128
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'validateToken', (r) => {
|
|
129
|
+
const isResponseOk = true && response?.validateToken?.accessToken;
|
|
130
|
+
return isResponseOk;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
catch (err1) {
|
|
134
|
+
VTXBaseAPI.Logger.error('validateToken err1:');
|
|
135
|
+
VTXBaseAPI.Logger.error(err1);
|
|
136
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
137
|
+
}
|
|
138
|
+
return retValue;
|
|
139
|
+
}
|
|
105
140
|
async createUserAndLogin(loginEmail) {
|
|
106
141
|
const client = (0, client_1.createClient)({
|
|
107
142
|
url: this.backendUrl + "/graphql",
|
|
@@ -2225,12 +2260,6 @@ class VTXBaseAPI {
|
|
|
2225
2260
|
fundsRequired: true,
|
|
2226
2261
|
initialFundsObtained: true,
|
|
2227
2262
|
fundsObtained: true,
|
|
2228
|
-
video: {
|
|
2229
|
-
_id: true,
|
|
2230
|
-
source: true,
|
|
2231
|
-
url: true,
|
|
2232
|
-
sourceData: true
|
|
2233
|
-
},
|
|
2234
2263
|
location: {
|
|
2235
2264
|
_id: true,
|
|
2236
2265
|
userProvidedLatitude: true,
|
|
@@ -3789,7 +3818,8 @@ class VTXBaseAPI {
|
|
|
3789
3818
|
eventWebSite: true,
|
|
3790
3819
|
mainSport: {
|
|
3791
3820
|
_id: true,
|
|
3792
|
-
name: true
|
|
3821
|
+
name: true,
|
|
3822
|
+
resultType: true
|
|
3793
3823
|
},
|
|
3794
3824
|
startDate: true,
|
|
3795
3825
|
endDate: true,
|
|
@@ -4279,12 +4309,6 @@ class VTXBaseAPI {
|
|
|
4279
4309
|
initialFundsObtained: true,
|
|
4280
4310
|
fundsObtained: true,
|
|
4281
4311
|
vtxComissionPct: true,
|
|
4282
|
-
video: {
|
|
4283
|
-
_id: true,
|
|
4284
|
-
source: true,
|
|
4285
|
-
url: true,
|
|
4286
|
-
sourceData: true
|
|
4287
|
-
},
|
|
4288
4312
|
location: {
|
|
4289
4313
|
userProvidedLatitude: true,
|
|
4290
4314
|
userProvidedLongitude: true,
|
|
@@ -4623,12 +4647,6 @@ class VTXBaseAPI {
|
|
|
4623
4647
|
fundsRequired: true,
|
|
4624
4648
|
initialFundsObtained: true,
|
|
4625
4649
|
fundsObtained: true,
|
|
4626
|
-
video: {
|
|
4627
|
-
_id: true,
|
|
4628
|
-
source: true,
|
|
4629
|
-
url: true,
|
|
4630
|
-
sourceData: true
|
|
4631
|
-
},
|
|
4632
4650
|
endingDate: true,
|
|
4633
4651
|
}
|
|
4634
4652
|
};
|
|
@@ -4997,12 +5015,6 @@ class VTXBaseAPI {
|
|
|
4997
5015
|
initialFundsObtained: true,
|
|
4998
5016
|
fundsObtained: true,
|
|
4999
5017
|
vtxComissionPct: true,
|
|
5000
|
-
video: {
|
|
5001
|
-
_id: true,
|
|
5002
|
-
source: true,
|
|
5003
|
-
url: true,
|
|
5004
|
-
sourceData: true
|
|
5005
|
-
},
|
|
5006
5018
|
location: {
|
|
5007
5019
|
userProvidedLatitude: true,
|
|
5008
5020
|
userProvidedLongitude: true,
|
|
@@ -5432,12 +5444,6 @@ class VTXBaseAPI {
|
|
|
5432
5444
|
fundsRequired: true,
|
|
5433
5445
|
initialFundsObtained: true,
|
|
5434
5446
|
fundsObtained: true,
|
|
5435
|
-
video: {
|
|
5436
|
-
_id: true,
|
|
5437
|
-
source: true,
|
|
5438
|
-
url: true,
|
|
5439
|
-
sourceData: true
|
|
5440
|
-
},
|
|
5441
5447
|
location: {
|
|
5442
5448
|
_id: true,
|
|
5443
5449
|
userProvidedLatitude: true,
|
|
@@ -5876,12 +5882,6 @@ class VTXBaseAPI {
|
|
|
5876
5882
|
initialFundsObtained: true,
|
|
5877
5883
|
fundsObtained: true,
|
|
5878
5884
|
vtxComissionPct: true,
|
|
5879
|
-
video: {
|
|
5880
|
-
_id: true,
|
|
5881
|
-
source: true,
|
|
5882
|
-
url: true,
|
|
5883
|
-
sourceData: true
|
|
5884
|
-
},
|
|
5885
5885
|
location: {
|
|
5886
5886
|
userProvidedLatitude: true,
|
|
5887
5887
|
userProvidedLongitude: true,
|
|
@@ -6025,12 +6025,6 @@ class VTXBaseAPI {
|
|
|
6025
6025
|
initialFundsObtained: true,
|
|
6026
6026
|
fundsObtained: true,
|
|
6027
6027
|
vtxComissionPct: true,
|
|
6028
|
-
video: {
|
|
6029
|
-
_id: true,
|
|
6030
|
-
source: true,
|
|
6031
|
-
url: true,
|
|
6032
|
-
sourceData: true
|
|
6033
|
-
},
|
|
6034
6028
|
location: {
|
|
6035
6029
|
userProvidedLatitude: true,
|
|
6036
6030
|
userProvidedLongitude: true,
|
|
@@ -6246,6 +6240,56 @@ class VTXBaseAPI {
|
|
|
6246
6240
|
console.log(JSON.stringify(retValue, null, 2));
|
|
6247
6241
|
return retValue;
|
|
6248
6242
|
}
|
|
6243
|
+
async reorderAlbums(dto) {
|
|
6244
|
+
console.log('HEADERS:');
|
|
6245
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
6246
|
+
const client = (0, client_1.createClient)({
|
|
6247
|
+
url: this.backendUrl + '/graphql',
|
|
6248
|
+
headers: this.headers,
|
|
6249
|
+
});
|
|
6250
|
+
let retValue;
|
|
6251
|
+
const fields = {
|
|
6252
|
+
_id: true,
|
|
6253
|
+
label: true,
|
|
6254
|
+
description: true,
|
|
6255
|
+
displayIndex: true,
|
|
6256
|
+
photos: {
|
|
6257
|
+
_id: true,
|
|
6258
|
+
photo: {
|
|
6259
|
+
_id: true,
|
|
6260
|
+
name: true,
|
|
6261
|
+
contentType: true,
|
|
6262
|
+
size: true,
|
|
6263
|
+
useType: true,
|
|
6264
|
+
url: true,
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
};
|
|
6268
|
+
try {
|
|
6269
|
+
const response = await client.mutation({
|
|
6270
|
+
reorderAlbumIndex: {
|
|
6271
|
+
__args: {
|
|
6272
|
+
input: dto
|
|
6273
|
+
},
|
|
6274
|
+
...fields
|
|
6275
|
+
},
|
|
6276
|
+
});
|
|
6277
|
+
console.log('reorderAlbumIndex Response:');
|
|
6278
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6279
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'reorderAlbumIndex', (r) => {
|
|
6280
|
+
const isResponseOk = response?.reorderAlbumIndex.length > 0;
|
|
6281
|
+
return isResponseOk;
|
|
6282
|
+
});
|
|
6283
|
+
}
|
|
6284
|
+
catch (err1) {
|
|
6285
|
+
console.error('reorderAlbumIndex err1:');
|
|
6286
|
+
console.error(err1);
|
|
6287
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6288
|
+
}
|
|
6289
|
+
console.log('retValue:');
|
|
6290
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6291
|
+
return retValue;
|
|
6292
|
+
}
|
|
6249
6293
|
async getPublicAthleteAlbums(athleteId) {
|
|
6250
6294
|
console.log('HEADERS:');
|
|
6251
6295
|
console.log(JSON.stringify(this.headers, null, 2));
|
|
@@ -6463,12 +6507,6 @@ class VTXBaseAPI {
|
|
|
6463
6507
|
title: true,
|
|
6464
6508
|
motivation: true,
|
|
6465
6509
|
website: true,
|
|
6466
|
-
video: {
|
|
6467
|
-
_id: true,
|
|
6468
|
-
source: true,
|
|
6469
|
-
url: true,
|
|
6470
|
-
sourceData: true
|
|
6471
|
-
},
|
|
6472
6510
|
endingDate: true,
|
|
6473
6511
|
}
|
|
6474
6512
|
};
|
|
@@ -6827,12 +6865,6 @@ class VTXBaseAPI {
|
|
|
6827
6865
|
initialFundsObtained: true,
|
|
6828
6866
|
fundsObtained: true,
|
|
6829
6867
|
vtxComissionPct: true,
|
|
6830
|
-
video: {
|
|
6831
|
-
_id: true,
|
|
6832
|
-
source: true,
|
|
6833
|
-
url: true,
|
|
6834
|
-
sourceData: true
|
|
6835
|
-
},
|
|
6836
6868
|
location: {
|
|
6837
6869
|
userProvidedLatitude: true,
|
|
6838
6870
|
userProvidedLongitude: true,
|
|
@@ -7057,7 +7089,6 @@ class VTXBaseAPI {
|
|
|
7057
7089
|
},
|
|
7058
7090
|
});
|
|
7059
7091
|
VTXBaseAPI.Logger.debug('saveAthleteCompetitionResult Response:');
|
|
7060
|
-
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
7061
7092
|
retValue = (0, response_builder_1.buildResponse)(response, 'saveAthleteCompetitionResult', (r) => {
|
|
7062
7093
|
const isResponseOk = true && response?.saveAthleteCompetitionResult?._id;
|
|
7063
7094
|
return isResponseOk;
|
|
@@ -7523,6 +7554,32 @@ class VTXBaseAPI {
|
|
|
7523
7554
|
}
|
|
7524
7555
|
return retValue;
|
|
7525
7556
|
}
|
|
7557
|
+
async editCompetitionBudgetForCampaign(input) {
|
|
7558
|
+
const client = (0, client_1.createClient)({
|
|
7559
|
+
url: this.backendUrl + '/graphql',
|
|
7560
|
+
headers: this.headers,
|
|
7561
|
+
});
|
|
7562
|
+
let retValue = {};
|
|
7563
|
+
try {
|
|
7564
|
+
const response = await client.mutation({
|
|
7565
|
+
editCompetitionBudgetForCampaign: {
|
|
7566
|
+
__args: {
|
|
7567
|
+
input: input
|
|
7568
|
+
},
|
|
7569
|
+
},
|
|
7570
|
+
});
|
|
7571
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editCompetitionBudgerForCampaign', (r) => {
|
|
7572
|
+
const isResponseOk = response?.editCampaignBudget;
|
|
7573
|
+
return isResponseOk;
|
|
7574
|
+
});
|
|
7575
|
+
}
|
|
7576
|
+
catch (err1) {
|
|
7577
|
+
console.error('editCompetitionBudgerForCampaign err1:');
|
|
7578
|
+
console.error(err1);
|
|
7579
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
7580
|
+
}
|
|
7581
|
+
return retValue;
|
|
7582
|
+
}
|
|
7526
7583
|
async getDonationsByAthlete() {
|
|
7527
7584
|
const client = (0, client_1.createClient)({
|
|
7528
7585
|
url: this.backendUrl + '/graphql',
|