@vertikalx/vtx-backend-client 3.0.0-dev.15 → 3.0.0-dev.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "3.0.0-dev.15",
3
+ "version": "3.0.0-dev.16",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -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 } 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';
@@ -133,4 +133,13 @@ export declare class VTXBaseAPI {
133
133
  getAthleteHistoricalScoresPeriod(dto: GetHistoricalScoresDto): Promise<ITypedBackendResponse<HistoricalScoresPeriod>>;
134
134
  getMyHistoricalScoresPeriod(dto: GetMyHistoricalScoresDto): Promise<ITypedBackendResponse<HistoricalScoresPeriod>>;
135
135
  getTransactionDetails(dto: GetTransactionDetailsDto, desiredFields?: TransactionDetailsGenqlSelection): Promise<ITypedBackendResponse<TransactionDetails>>;
136
+ getAllUsers(): Promise<ITypedBackendResponse<AdminUserView[]>>;
137
+ getAllTransactions(): Promise<ITypedBackendResponse<AdminTransactionView[]>>;
138
+ getTransactionsPaginated(args?: {
139
+ query?: TransactionQueryDto;
140
+ }): Promise<ITypedBackendResponse<PaginatedTransactionsType>>;
141
+ getUsersPaginated(args: {
142
+ query: UserQueryDto;
143
+ }): Promise<ITypedBackendResponse<PaginatedUsersType>>;
144
+ updateUserSuspendedStatus(input: UpdateUserSuspendedStatusDto): Promise<ITypedBackendResponse<EditValueResponse>>;
136
145
  }
@@ -8666,6 +8666,333 @@ class VTXBaseAPI {
8666
8666
  }
8667
8667
  return retValue;
8668
8668
  }
8669
+ async getAllUsers() {
8670
+ const client = (0, client_1.createClient)({
8671
+ url: this.backendUrl + "/graphql",
8672
+ headers: this.headers,
8673
+ });
8674
+ const fields = {
8675
+ _id: true,
8676
+ loginEmail: true,
8677
+ firstName: true,
8678
+ lastName: true,
8679
+ screenName: true,
8680
+ suspended: true,
8681
+ domains: {
8682
+ _id: true,
8683
+ name: true,
8684
+ description: true
8685
+ },
8686
+ athlete: {
8687
+ _id: true,
8688
+ firstName: true,
8689
+ lastName: true,
8690
+ screenName: true,
8691
+ dob: true,
8692
+ competitionGender: true,
8693
+ country: {
8694
+ _id: true,
8695
+ name: true
8696
+ },
8697
+ location: {
8698
+ _id: true,
8699
+ cityNameGeocode: true,
8700
+ stateNameGeocode: true,
8701
+ countryIso2CodeGeocode: true,
8702
+ city: {
8703
+ _id: true,
8704
+ name: true,
8705
+ localizedName: true,
8706
+ state: {
8707
+ _id: true,
8708
+ name: true,
8709
+ country: {
8710
+ _id: true,
8711
+ name: true
8712
+ }
8713
+ }
8714
+ }
8715
+ },
8716
+ mainSport: {
8717
+ _id: true,
8718
+ name: true
8719
+ },
8720
+ mainSportLevel: {
8721
+ _id: true,
8722
+ label: true
8723
+ },
8724
+ allSports: {
8725
+ _id: true,
8726
+ name: true
8727
+ }
8728
+ },
8729
+ member: {
8730
+ _id: true,
8731
+ fullName: true,
8732
+ screenName: true
8733
+ }
8734
+ };
8735
+ let retValue;
8736
+ try {
8737
+ const response = await client.query({
8738
+ getAllUsers: {
8739
+ __args: {},
8740
+ ...fields
8741
+ }
8742
+ });
8743
+ VTXBaseAPI.Logger.debug('getAllUsers Response:');
8744
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8745
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAllUsers', (r) => {
8746
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8747
+ const isResponseOk = true;
8748
+ return isResponseOk;
8749
+ });
8750
+ }
8751
+ catch (err1) {
8752
+ VTXBaseAPI.Logger.error('getAllUsers err1:');
8753
+ VTXBaseAPI.Logger.error(err1);
8754
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
8755
+ }
8756
+ return retValue;
8757
+ }
8758
+ async getAllTransactions() {
8759
+ const client = (0, client_1.createClient)({
8760
+ url: this.backendUrl + "/graphql",
8761
+ headers: this.headers,
8762
+ });
8763
+ const fields = {
8764
+ _id: true,
8765
+ createdDate: true,
8766
+ stripeSessionId: true,
8767
+ concept: true,
8768
+ donationAmount: true,
8769
+ fromEmail: true,
8770
+ type: true,
8771
+ confirmed: true,
8772
+ completed: true,
8773
+ completedDate: true,
8774
+ stripeAccountId: true,
8775
+ fundingDetails: {
8776
+ paidToVtx: true,
8777
+ paidToAthlete: true,
8778
+ athleteId: true,
8779
+ athleteName: true,
8780
+ fromName: true,
8781
+ fromPhone: true,
8782
+ message: true,
8783
+ mode: true
8784
+ }
8785
+ };
8786
+ let retValue;
8787
+ try {
8788
+ const response = await client.query({
8789
+ getAllTransactions: {
8790
+ __args: {},
8791
+ ...fields
8792
+ }
8793
+ });
8794
+ VTXBaseAPI.Logger.debug('getAllTransactions Response:');
8795
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8796
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAllTransactions', (r) => {
8797
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8798
+ const isResponseOk = true;
8799
+ return isResponseOk;
8800
+ });
8801
+ }
8802
+ catch (err1) {
8803
+ VTXBaseAPI.Logger.error('getAllTransactions err1:');
8804
+ VTXBaseAPI.Logger.error(err1);
8805
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
8806
+ }
8807
+ return retValue;
8808
+ }
8809
+ async getTransactionsPaginated(args = {}) {
8810
+ const client = (0, client_1.createClient)({
8811
+ url: this.backendUrl + "/graphql",
8812
+ headers: this.headers,
8813
+ });
8814
+ const fields = {
8815
+ items: {
8816
+ _id: true,
8817
+ createdDate: true,
8818
+ stripeSessionId: true,
8819
+ donationAmount: true,
8820
+ fromEmail: true,
8821
+ type: true,
8822
+ confirmed: true,
8823
+ completed: true,
8824
+ completedDate: true,
8825
+ stripeAccountId: true,
8826
+ fundingDetails: {
8827
+ paidToVtx: true,
8828
+ paidToAthlete: true,
8829
+ athleteId: true,
8830
+ athleteName: true,
8831
+ fromName: true,
8832
+ fromPhone: true,
8833
+ message: true,
8834
+ mode: true
8835
+ }
8836
+ },
8837
+ pagination: {
8838
+ currentPage: true,
8839
+ totalPages: true,
8840
+ totalItems: true,
8841
+ itemsPerPage: true,
8842
+ hasNextPage: true,
8843
+ hasPreviousPage: true
8844
+ }
8845
+ };
8846
+ let retValue;
8847
+ try {
8848
+ const response = await client.query({
8849
+ getTransactionsPaginated: {
8850
+ __args: args,
8851
+ ...fields
8852
+ }
8853
+ });
8854
+ VTXBaseAPI.Logger.debug('getTransactionsPaginated Response:');
8855
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8856
+ retValue = (0, response_builder_1.buildResponse)(response, 'getTransactionsPaginated', (r) => {
8857
+ VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
8858
+ const isResponseOk = true;
8859
+ return isResponseOk;
8860
+ });
8861
+ }
8862
+ catch (err1) {
8863
+ VTXBaseAPI.Logger.error('getTransactionsPaginated err1:');
8864
+ VTXBaseAPI.Logger.error(err1);
8865
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
8866
+ }
8867
+ return retValue;
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
+ }
8669
8996
  }
8670
8997
  exports.VTXBaseAPI = VTXBaseAPI;
8671
8998
  VTXBaseAPI.Logger = {