@vertikalx/vtx-backend-client 3.0.0-dev-max.53 → 3.0.0-dev-max.55
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 +11 -2
- package/src/api/vtx-base-api.js +197 -0
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +121 -34
- package/src/client/schema.js +35 -14
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +67 -13
- package/src/client/types.js +380 -245
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
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, UpdateSportEventDto, 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, UpdateUserSuspendedStatusDto, 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, MergeEventsResponse, MergeSportsEventsDto, BudgetConcept, BudgetItemUnit, CompetitionDeleteVerificationResponse, RegisterMemberDto, Member, Donation, DonationGenqlSelection, GetHistoricalScoresDto, HistoricalScore, GetMyHistoricalScoresDto, HistoricalScoresPeriod, GetTransactionDetailsDto, TransactionDetails, TransactionDetailsGenqlSelection, AdminUserView, AdminTransactionView, PaginatedTransactionsType, TransactionQueryDto, PaginatedUsersType, UserQueryDto,
|
|
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, UpdateSportEventDto, 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, UpdateUserSuspendedStatusDto, 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, MergeEventsResponse, MergeSportsEventsDto, BudgetConcept, BudgetItemUnit, CompetitionDeleteVerificationResponse, RegisterMemberDto, Member, Donation, DonationGenqlSelection, GetHistoricalScoresDto, HistoricalScore, GetMyHistoricalScoresDto, HistoricalScoresPeriod, GetTransactionDetailsDto, TransactionDetails, TransactionDetailsGenqlSelection, AdminUserView, AdminTransactionView, PaginatedTransactionsType, TransactionQueryDto, PaginatedUsersType, UserQueryDto, EventQueryDto, PaginatedSportsType, SportQueryDto, StripeBalanceType, StripeBalanceTypeGenqlSelection, DeleteVtxUserDto, DeleteVtxUserResponse, ForceScoreRefreshResponse, Offer, OfferGenqlSelection, CreateOfferDto, Sponsor, SponsorGenqlSelection, CreateSponsorDto, PaginatedBrands, BrandQueryDto, PaginatedEvents, SponsorQueryDto, PaginatedSponsors, OfferQueryDto, PaginatedOffers } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
import { VerificationCodeType } from '@vertikalx/common-types';
|
|
@@ -55,6 +55,9 @@ export declare class VTXBaseAPI {
|
|
|
55
55
|
validateUserCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<User>>;
|
|
56
56
|
findAthleteForUser(loginEmail: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
57
57
|
getBrands(): Promise<ITypedBackendResponse<Brand[]>>;
|
|
58
|
+
getBrandsPaginated(args: {
|
|
59
|
+
query: BrandQueryDto;
|
|
60
|
+
}): Promise<ITypedBackendResponse<PaginatedBrands>>;
|
|
58
61
|
getAthletes(): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
59
62
|
searchAthletes(searchString: string): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
60
63
|
getRecommendedAthletes(loginEmail: string): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
@@ -66,7 +69,7 @@ export declare class VTXBaseAPI {
|
|
|
66
69
|
getSportsEvents(dto: GetSportEventsDto): Promise<ITypedBackendResponse<SportsEvent[]>>;
|
|
67
70
|
getSportsEventsPaginated(dto: {
|
|
68
71
|
query: EventQueryDto;
|
|
69
|
-
}): Promise<ITypedBackendResponse<
|
|
72
|
+
}): Promise<ITypedBackendResponse<PaginatedEvents>>;
|
|
70
73
|
createSportsEvent(dto: CreateSportEventDto): Promise<ITypedBackendResponse<SportsEvent>>;
|
|
71
74
|
updateSportsEvent(dto: {
|
|
72
75
|
input: UpdateSportEventDto;
|
|
@@ -165,6 +168,9 @@ export declare class VTXBaseAPI {
|
|
|
165
168
|
deleteMyAccount(): Promise<ITypedBackendResponse<DeleteVtxUserResponse>>;
|
|
166
169
|
createOffer(dto: CreateOfferDto, desiredFields?: OfferGenqlSelection): Promise<ITypedBackendResponse<Offer>>;
|
|
167
170
|
getOffers(): Promise<ITypedBackendResponse<Offer[]>>;
|
|
171
|
+
getOffersPaginated(args: {
|
|
172
|
+
query: OfferQueryDto;
|
|
173
|
+
}): Promise<ITypedBackendResponse<PaginatedOffers>>;
|
|
168
174
|
getOfferById(id: string, desiredFields?: OfferGenqlSelection): Promise<ITypedBackendResponse<Offer>>;
|
|
169
175
|
getOffersForAthlete(athleteId: string | null, desiredFields?: OfferGenqlSelection): Promise<ITypedBackendResponse<Offer[]>>;
|
|
170
176
|
updateOffer(id: string, dto: CreateOfferDto, desiredFields?: OfferGenqlSelection): Promise<ITypedBackendResponse<Offer>>;
|
|
@@ -176,6 +182,9 @@ export declare class VTXBaseAPI {
|
|
|
176
182
|
linkBrandToSponsor(brandId: string, sponsorId: string, desiredFields?: BrandGenqlSelection): Promise<ITypedBackendResponse<Brand>>;
|
|
177
183
|
unlinkBrandFromSponsor(brandId: string, sponsorId: string, desiredFields?: BrandGenqlSelection): Promise<ITypedBackendResponse<Brand>>;
|
|
178
184
|
getSponsors(): Promise<ITypedBackendResponse<Sponsor[]>>;
|
|
185
|
+
getSponsorsPaginated(args: {
|
|
186
|
+
query: SponsorQueryDto;
|
|
187
|
+
}): Promise<ITypedBackendResponse<PaginatedSponsors>>;
|
|
179
188
|
createSponsor(dto: CreateSponsorDto, desiredFields?: SponsorGenqlSelection): Promise<ITypedBackendResponse<Sponsor>>;
|
|
180
189
|
updateSponsor(id: string, dto: CreateSponsorDto, desiredFields?: SponsorGenqlSelection): Promise<ITypedBackendResponse<Sponsor>>;
|
|
181
190
|
deleteSponsor(id: string): Promise<ITypedBackendResponse<boolean>>;
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -2703,6 +2703,79 @@ class VTXBaseAPI {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
return retValue;
|
|
2705
2705
|
}
|
|
2706
|
+
async getBrandsPaginated(args) {
|
|
2707
|
+
const client = (0, client_1.createClient)({
|
|
2708
|
+
url: this.backendUrl + "/graphql",
|
|
2709
|
+
headers: this.headers,
|
|
2710
|
+
});
|
|
2711
|
+
const fields = {
|
|
2712
|
+
items: {
|
|
2713
|
+
_id: true,
|
|
2714
|
+
name: true,
|
|
2715
|
+
slogan: true,
|
|
2716
|
+
website: true,
|
|
2717
|
+
description: true,
|
|
2718
|
+
approved: true,
|
|
2719
|
+
published: true,
|
|
2720
|
+
logo: {
|
|
2721
|
+
_id: true,
|
|
2722
|
+
name: true,
|
|
2723
|
+
contentType: true,
|
|
2724
|
+
size: true,
|
|
2725
|
+
useType: true,
|
|
2726
|
+
url: true,
|
|
2727
|
+
key: true
|
|
2728
|
+
},
|
|
2729
|
+
banner: {
|
|
2730
|
+
_id: true,
|
|
2731
|
+
name: true,
|
|
2732
|
+
contentType: true,
|
|
2733
|
+
size: true,
|
|
2734
|
+
useType: true,
|
|
2735
|
+
url: true,
|
|
2736
|
+
key: true
|
|
2737
|
+
},
|
|
2738
|
+
sponsors: {
|
|
2739
|
+
_id: true,
|
|
2740
|
+
sponsor: {
|
|
2741
|
+
_id: true,
|
|
2742
|
+
name: true,
|
|
2743
|
+
description: true
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
},
|
|
2747
|
+
pagination: {
|
|
2748
|
+
currentPage: true,
|
|
2749
|
+
totalPages: true,
|
|
2750
|
+
totalItems: true,
|
|
2751
|
+
itemsPerPage: true,
|
|
2752
|
+
hasNextPage: true,
|
|
2753
|
+
hasPreviousPage: true
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
let retValue;
|
|
2757
|
+
try {
|
|
2758
|
+
const response = await client.query({
|
|
2759
|
+
getBrandsPaginated: {
|
|
2760
|
+
__args: args,
|
|
2761
|
+
...fields
|
|
2762
|
+
}
|
|
2763
|
+
});
|
|
2764
|
+
VTXBaseAPI.Logger.debug('getBrandsPaginated Response:');
|
|
2765
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
2766
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getBrandsPaginated', (r) => {
|
|
2767
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
2768
|
+
const isResponseOk = true;
|
|
2769
|
+
return isResponseOk;
|
|
2770
|
+
});
|
|
2771
|
+
}
|
|
2772
|
+
catch (err1) {
|
|
2773
|
+
VTXBaseAPI.Logger.error('getBrandsPaginated err1:');
|
|
2774
|
+
VTXBaseAPI.Logger.error(err1);
|
|
2775
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
2776
|
+
}
|
|
2777
|
+
return retValue;
|
|
2778
|
+
}
|
|
2706
2779
|
async getAthletes() {
|
|
2707
2780
|
const client = (0, client_1.createClient)({
|
|
2708
2781
|
url: this.backendUrl + "/graphql",
|
|
@@ -9639,6 +9712,82 @@ class VTXBaseAPI {
|
|
|
9639
9712
|
}
|
|
9640
9713
|
return retValue;
|
|
9641
9714
|
}
|
|
9715
|
+
async getOffersPaginated(args) {
|
|
9716
|
+
const client = (0, client_1.createClient)({
|
|
9717
|
+
url: this.backendUrl + "/graphql",
|
|
9718
|
+
headers: this.headers,
|
|
9719
|
+
});
|
|
9720
|
+
const fields = {
|
|
9721
|
+
items: {
|
|
9722
|
+
_id: true,
|
|
9723
|
+
name: true,
|
|
9724
|
+
label: true,
|
|
9725
|
+
decription: true,
|
|
9726
|
+
type: true,
|
|
9727
|
+
status: true,
|
|
9728
|
+
discountType: true,
|
|
9729
|
+
discountTypeData: true,
|
|
9730
|
+
conditions: true,
|
|
9731
|
+
dateStart: true,
|
|
9732
|
+
dateEnd: true,
|
|
9733
|
+
dateCreated: true,
|
|
9734
|
+
offerImage: {
|
|
9735
|
+
_id: true,
|
|
9736
|
+
name: true,
|
|
9737
|
+
contentType: true,
|
|
9738
|
+
size: true,
|
|
9739
|
+
useType: true,
|
|
9740
|
+
url: true,
|
|
9741
|
+
key: true
|
|
9742
|
+
},
|
|
9743
|
+
brand: {
|
|
9744
|
+
_id: true,
|
|
9745
|
+
name: true,
|
|
9746
|
+
description: true,
|
|
9747
|
+
logo: {
|
|
9748
|
+
_id: true,
|
|
9749
|
+
url: true,
|
|
9750
|
+
key: true
|
|
9751
|
+
}
|
|
9752
|
+
},
|
|
9753
|
+
sponsor: {
|
|
9754
|
+
_id: true,
|
|
9755
|
+
name: true,
|
|
9756
|
+
description: true
|
|
9757
|
+
}
|
|
9758
|
+
},
|
|
9759
|
+
pagination: {
|
|
9760
|
+
currentPage: true,
|
|
9761
|
+
totalPages: true,
|
|
9762
|
+
totalItems: true,
|
|
9763
|
+
itemsPerPage: true,
|
|
9764
|
+
hasNextPage: true,
|
|
9765
|
+
hasPreviousPage: true
|
|
9766
|
+
}
|
|
9767
|
+
};
|
|
9768
|
+
let retValue;
|
|
9769
|
+
try {
|
|
9770
|
+
const response = await client.query({
|
|
9771
|
+
getOffersPaginated: {
|
|
9772
|
+
__args: args,
|
|
9773
|
+
...fields
|
|
9774
|
+
}
|
|
9775
|
+
});
|
|
9776
|
+
VTXBaseAPI.Logger.debug('getOffersPaginated Response:');
|
|
9777
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
9778
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getOffersPaginated', (r) => {
|
|
9779
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
9780
|
+
const isResponseOk = true;
|
|
9781
|
+
return isResponseOk;
|
|
9782
|
+
});
|
|
9783
|
+
}
|
|
9784
|
+
catch (err1) {
|
|
9785
|
+
VTXBaseAPI.Logger.error('getOffersPaginated err1:');
|
|
9786
|
+
VTXBaseAPI.Logger.error(err1);
|
|
9787
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
9788
|
+
}
|
|
9789
|
+
return retValue;
|
|
9790
|
+
}
|
|
9642
9791
|
async getOfferById(id, desiredFields) {
|
|
9643
9792
|
const client = (0, client_1.createClient)({
|
|
9644
9793
|
url: this.backendUrl + "/graphql",
|
|
@@ -10041,6 +10190,54 @@ class VTXBaseAPI {
|
|
|
10041
10190
|
}
|
|
10042
10191
|
return retValue;
|
|
10043
10192
|
}
|
|
10193
|
+
async getSponsorsPaginated(args) {
|
|
10194
|
+
const client = (0, client_1.createClient)({
|
|
10195
|
+
url: this.backendUrl + "/graphql",
|
|
10196
|
+
headers: this.headers,
|
|
10197
|
+
});
|
|
10198
|
+
const fields = {
|
|
10199
|
+
items: {
|
|
10200
|
+
_id: true,
|
|
10201
|
+
name: true,
|
|
10202
|
+
description: true,
|
|
10203
|
+
approved: true,
|
|
10204
|
+
tenant: {
|
|
10205
|
+
_id: true,
|
|
10206
|
+
name: true
|
|
10207
|
+
}
|
|
10208
|
+
},
|
|
10209
|
+
pagination: {
|
|
10210
|
+
currentPage: true,
|
|
10211
|
+
totalPages: true,
|
|
10212
|
+
totalItems: true,
|
|
10213
|
+
itemsPerPage: true,
|
|
10214
|
+
hasNextPage: true,
|
|
10215
|
+
hasPreviousPage: true
|
|
10216
|
+
}
|
|
10217
|
+
};
|
|
10218
|
+
let retValue;
|
|
10219
|
+
try {
|
|
10220
|
+
const response = await client.query({
|
|
10221
|
+
getSponsorsPaginated: {
|
|
10222
|
+
__args: args,
|
|
10223
|
+
...fields
|
|
10224
|
+
}
|
|
10225
|
+
});
|
|
10226
|
+
VTXBaseAPI.Logger.debug('getSponsorsPaginated Response:');
|
|
10227
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
10228
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getSponsorsPaginated', (r) => {
|
|
10229
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
10230
|
+
const isResponseOk = true;
|
|
10231
|
+
return isResponseOk;
|
|
10232
|
+
});
|
|
10233
|
+
}
|
|
10234
|
+
catch (err1) {
|
|
10235
|
+
VTXBaseAPI.Logger.error('getSponsorsPaginated err1:');
|
|
10236
|
+
VTXBaseAPI.Logger.error(err1);
|
|
10237
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
10238
|
+
}
|
|
10239
|
+
return retValue;
|
|
10240
|
+
}
|
|
10044
10241
|
async createSponsor(dto, desiredFields) {
|
|
10045
10242
|
const client = (0, client_1.createClient)({
|
|
10046
10243
|
url: this.backendUrl + "/graphql",
|