@vertikalx/vtx-backend-client 3.0.0-dev-max.24 → 3.0.0-dev-max.25
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 +5 -1
- package/src/api/vtx-base-api.js +127 -0
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +68 -4
- package/src/client/schema.js +16 -2
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +43 -6
- package/src/client/types.js +261 -162
- 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, 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, MergeEventsResponse, MergeSportsEventsDto, BudgetConcept, BudgetItemUnit, CompetitionDeleteVerificationResponse, RegisterMemberDto, Member, Donation, GetHistoricalScoresDto, HistoricalScore, GetMyHistoricalScoresDto, HistoricalScoresPeriod, GetTransactionDetailsDto, TransactionDetails, TransactionDetailsGenqlSelection, AdminUserView, AdminTransactionView, PaginatedTransactionsType, TransactionQueryDto } 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, 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, GetHistoricalScoresDto, HistoricalScore, GetMyHistoricalScoresDto, HistoricalScoresPeriod, GetTransactionDetailsDto, TransactionDetails, TransactionDetailsGenqlSelection, AdminUserView, AdminTransactionView, PaginatedTransactionsType, TransactionQueryDto, PaginatedUsersType, UserQueryDto } 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';
|
|
@@ -138,4 +138,8 @@ export declare class VTXBaseAPI {
|
|
|
138
138
|
getTransactionsPaginated(args?: {
|
|
139
139
|
query?: TransactionQueryDto;
|
|
140
140
|
}): Promise<ITypedBackendResponse<PaginatedTransactionsType>>;
|
|
141
|
+
getUsersPaginated(args: {
|
|
142
|
+
query: UserQueryDto;
|
|
143
|
+
}): Promise<ITypedBackendResponse<PaginatedUsersType>>;
|
|
144
|
+
updateUserSuspendedStatus(input: UpdateUserSuspendedStatusDto): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
141
145
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -8866,6 +8866,133 @@ class VTXBaseAPI {
|
|
|
8866
8866
|
}
|
|
8867
8867
|
return retValue;
|
|
8868
8868
|
}
|
|
8869
|
+
async getUsersPaginated(args) {
|
|
8870
|
+
const client = (0, client_1.createClient)({
|
|
8871
|
+
url: this.backendUrl + "/graphql",
|
|
8872
|
+
headers: this.headers,
|
|
8873
|
+
});
|
|
8874
|
+
const fields = {
|
|
8875
|
+
items: {
|
|
8876
|
+
_id: true,
|
|
8877
|
+
loginEmail: true,
|
|
8878
|
+
firstName: true,
|
|
8879
|
+
lastName: true,
|
|
8880
|
+
screenName: true,
|
|
8881
|
+
suspended: true,
|
|
8882
|
+
domains: {
|
|
8883
|
+
_id: true,
|
|
8884
|
+
name: true,
|
|
8885
|
+
description: true
|
|
8886
|
+
},
|
|
8887
|
+
athlete: {
|
|
8888
|
+
_id: true,
|
|
8889
|
+
mainSport: {
|
|
8890
|
+
_id: true,
|
|
8891
|
+
name: true
|
|
8892
|
+
},
|
|
8893
|
+
mainSportLevel: {
|
|
8894
|
+
_id: true,
|
|
8895
|
+
label: true
|
|
8896
|
+
},
|
|
8897
|
+
competitionGender: true,
|
|
8898
|
+
dob: true,
|
|
8899
|
+
country: {
|
|
8900
|
+
_id: true,
|
|
8901
|
+
name: true
|
|
8902
|
+
},
|
|
8903
|
+
location: {
|
|
8904
|
+
city: {
|
|
8905
|
+
_id: true,
|
|
8906
|
+
name: true,
|
|
8907
|
+
state: {
|
|
8908
|
+
_id: true,
|
|
8909
|
+
name: true,
|
|
8910
|
+
country: {
|
|
8911
|
+
_id: true,
|
|
8912
|
+
name: true
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
},
|
|
8916
|
+
cityNameGeocode: true,
|
|
8917
|
+
stateNameGeocode: true
|
|
8918
|
+
},
|
|
8919
|
+
aboutMe: true,
|
|
8920
|
+
allSports: {
|
|
8921
|
+
_id: true,
|
|
8922
|
+
name: true
|
|
8923
|
+
}
|
|
8924
|
+
},
|
|
8925
|
+
member: {
|
|
8926
|
+
_id: true
|
|
8927
|
+
}
|
|
8928
|
+
},
|
|
8929
|
+
pagination: {
|
|
8930
|
+
currentPage: true,
|
|
8931
|
+
totalPages: true,
|
|
8932
|
+
totalItems: true,
|
|
8933
|
+
itemsPerPage: true,
|
|
8934
|
+
hasNextPage: true,
|
|
8935
|
+
hasPreviousPage: true
|
|
8936
|
+
}
|
|
8937
|
+
};
|
|
8938
|
+
let retValue;
|
|
8939
|
+
try {
|
|
8940
|
+
const response = await client.query({
|
|
8941
|
+
getUsersPaginated: {
|
|
8942
|
+
__args: args,
|
|
8943
|
+
...fields
|
|
8944
|
+
}
|
|
8945
|
+
});
|
|
8946
|
+
VTXBaseAPI.Logger.debug('getUsersPaginated Response:');
|
|
8947
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
8948
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getUsersPaginated', (r) => {
|
|
8949
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
8950
|
+
const isResponseOk = true;
|
|
8951
|
+
return isResponseOk;
|
|
8952
|
+
});
|
|
8953
|
+
}
|
|
8954
|
+
catch (err1) {
|
|
8955
|
+
VTXBaseAPI.Logger.error('getUsersPaginated err1:');
|
|
8956
|
+
VTXBaseAPI.Logger.error(err1);
|
|
8957
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
8958
|
+
}
|
|
8959
|
+
return retValue;
|
|
8960
|
+
}
|
|
8961
|
+
async updateUserSuspendedStatus(input) {
|
|
8962
|
+
const client = (0, client_1.createClient)({
|
|
8963
|
+
url: this.backendUrl + '/graphql',
|
|
8964
|
+
headers: this.headers,
|
|
8965
|
+
});
|
|
8966
|
+
let retValue = {};
|
|
8967
|
+
const fields = {
|
|
8968
|
+
field: true,
|
|
8969
|
+
changed: true,
|
|
8970
|
+
oldValue: true,
|
|
8971
|
+
newValue: true,
|
|
8972
|
+
};
|
|
8973
|
+
try {
|
|
8974
|
+
const response = await client.mutation({
|
|
8975
|
+
updateUserSuspendedStatus: {
|
|
8976
|
+
__args: {
|
|
8977
|
+
input: input
|
|
8978
|
+
},
|
|
8979
|
+
...fields
|
|
8980
|
+
},
|
|
8981
|
+
});
|
|
8982
|
+
VTXBaseAPI.Logger.debug('updateUserSuspendedStatus Response:');
|
|
8983
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
8984
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'updateUserSuspendedStatus', (r) => {
|
|
8985
|
+
const isResponseOk = response?.updateUserSuspendedStatus?.field !== null;
|
|
8986
|
+
return isResponseOk;
|
|
8987
|
+
});
|
|
8988
|
+
}
|
|
8989
|
+
catch (err1) {
|
|
8990
|
+
VTXBaseAPI.Logger.error('updateUserSuspendedStatus err1:');
|
|
8991
|
+
VTXBaseAPI.Logger.error(err1);
|
|
8992
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
8993
|
+
}
|
|
8994
|
+
return retValue;
|
|
8995
|
+
}
|
|
8869
8996
|
}
|
|
8870
8997
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
8871
8998
|
VTXBaseAPI.Logger = {
|