@vertikalx/vtx-backend-client 3.0.0-dev-max.39 → 3.0.0-dev-max.41

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.
Files changed (71) hide show
  1. package/package.json +1 -1
  2. package/src/api/api-call-headers.d.ts +0 -0
  3. package/src/api/api-call-headers.js +0 -0
  4. package/src/api/api-call-headers.js.map +0 -0
  5. package/src/api/backend-response.d.ts +0 -0
  6. package/src/api/backend-response.js +0 -0
  7. package/src/api/backend-response.js.map +0 -0
  8. package/src/api/domains.d.ts +0 -0
  9. package/src/api/domains.js +0 -0
  10. package/src/api/domains.js.map +0 -0
  11. package/src/api/response-builder.d.ts +0 -0
  12. package/src/api/response-builder.js +0 -0
  13. package/src/api/response-builder.js.map +0 -0
  14. package/src/api/types.d.ts +0 -0
  15. package/src/api/types.js +0 -0
  16. package/src/api/types.js.map +0 -0
  17. package/src/api/vtx-apikey-api.d.ts +0 -0
  18. package/src/api/vtx-apikey-api.js +0 -0
  19. package/src/api/vtx-apikey-api.js.map +0 -0
  20. package/src/api/vtx-base-api.d.ts +16 -2
  21. package/src/api/vtx-base-api.js +126 -5
  22. package/src/api/vtx-base-api.js.map +1 -1
  23. package/src/api/vtx-mobile-api.d.ts +0 -0
  24. package/src/api/vtx-mobile-api.js +0 -0
  25. package/src/api/vtx-mobile-api.js.map +0 -0
  26. package/src/api/vtx-web-browser-api.d.ts +0 -0
  27. package/src/api/vtx-web-browser-api.js +0 -0
  28. package/src/api/vtx-web-browser-api.js.map +0 -0
  29. package/src/api/vtx-web-server-api.d.ts +0 -0
  30. package/src/api/vtx-web-server-api.js +0 -0
  31. package/src/api/vtx-web-server-api.js.map +0 -0
  32. package/src/client/index.d.ts +0 -0
  33. package/src/client/index.js +0 -0
  34. package/src/client/index.js.map +0 -0
  35. package/src/client/runtime/batcher.d.ts +0 -0
  36. package/src/client/runtime/batcher.js +0 -0
  37. package/src/client/runtime/batcher.js.map +0 -0
  38. package/src/client/runtime/createClient.d.ts +0 -0
  39. package/src/client/runtime/createClient.js +0 -0
  40. package/src/client/runtime/createClient.js.map +0 -0
  41. package/src/client/runtime/error.d.ts +0 -0
  42. package/src/client/runtime/error.js +0 -0
  43. package/src/client/runtime/error.js.map +0 -0
  44. package/src/client/runtime/fetcher.d.ts +0 -0
  45. package/src/client/runtime/fetcher.js +0 -0
  46. package/src/client/runtime/fetcher.js.map +0 -0
  47. package/src/client/runtime/generateGraphqlOperation.d.ts +0 -0
  48. package/src/client/runtime/generateGraphqlOperation.js +0 -0
  49. package/src/client/runtime/generateGraphqlOperation.js.map +0 -0
  50. package/src/client/runtime/index.d.ts +0 -0
  51. package/src/client/runtime/index.js +0 -0
  52. package/src/client/runtime/index.js.map +0 -0
  53. package/src/client/runtime/linkTypeMap.d.ts +0 -0
  54. package/src/client/runtime/linkTypeMap.js +0 -0
  55. package/src/client/runtime/linkTypeMap.js.map +0 -0
  56. package/src/client/runtime/typeSelection.d.ts +0 -0
  57. package/src/client/runtime/typeSelection.js +0 -0
  58. package/src/client/runtime/typeSelection.js.map +0 -0
  59. package/src/client/runtime/types.d.ts +0 -0
  60. package/src/client/runtime/types.js +0 -0
  61. package/src/client/runtime/types.js.map +0 -0
  62. package/src/client/schema.d.ts +59 -0
  63. package/src/client/schema.js +21 -2
  64. package/src/client/schema.js.map +1 -1
  65. package/src/client/types.d.ts +26 -0
  66. package/src/client/types.js +257 -192
  67. package/src/client/types.js.map +1 -1
  68. package/src/index.d.ts +0 -0
  69. package/src/index.js +0 -0
  70. package/src/index.js.map +0 -0
  71. package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "3.0.0-dev-max.39",
3
+ "version": "3.0.0-dev-max.41",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/api/types.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,19 @@
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, GetHistoricalScoresDto, HistoricalScore, GetMyHistoricalScoresDto, HistoricalScoresPeriod, GetTransactionDetailsDto, TransactionDetails, TransactionDetailsGenqlSelection, AdminUserView, AdminTransactionView, PaginatedTransactionsType, TransactionQueryDto, PaginatedUsersType, UserQueryDto, PaginatedEventsType, EventQueryDto, PaginatedSportsType, SportQueryDto, StripeBalanceType, StripeBalanceTypeGenqlSelection, DeleteVtxUserDto, DeleteVtxUserResponse } 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, 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, PaginatedEventsType, EventQueryDto, PaginatedSportsType, SportQueryDto, StripeBalanceType, StripeBalanceTypeGenqlSelection, DeleteVtxUserDto, DeleteVtxUserResponse } 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';
5
+ export interface ForceScoreRefreshResult {
6
+ athleteId: string;
7
+ athleteName?: string | null;
8
+ status: string;
9
+ message?: string | null;
10
+ }
11
+ export interface ForceScoreRefreshResponse {
12
+ results: ForceScoreRefreshResult[];
13
+ successCount: number;
14
+ failureCount: number;
15
+ skippedCount: number;
16
+ }
5
17
  export declare class VTXBaseAPI {
6
18
  protected headers: APICallHeaders;
7
19
  protected backendUrl: string;
@@ -119,6 +131,8 @@ export declare class VTXBaseAPI {
119
131
  deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
120
132
  saveAthleteCompetitionResult(dto: SetCompetitionResultDto): Promise<ITypedBackendResponse<AthleteCompetitionResult>>;
121
133
  updateAthleteScores(): Promise<ITypedBackendResponse<Athlete>>;
134
+ updateAthleteCompetitionScores(): Promise<ITypedBackendResponse<Athlete>>;
135
+ forceRefreshAthleteScores(athleteIds: string[]): Promise<ITypedBackendResponse<ForceScoreRefreshResponse>>;
122
136
  createResetPasswordCode(email: string): Promise<ITypedBackendResponse<EditValueResponse>>;
123
137
  getResetVerificationCode(id: string): Promise<ITypedBackendResponse<VerificationCodeType>>;
124
138
  verifyCode(input: VerifyCodeDto): Promise<ITypedBackendResponse<CodeVerificationResponse>>;
@@ -132,7 +146,7 @@ export declare class VTXBaseAPI {
132
146
  editCampaignBudget(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
133
147
  editCompetitionBudgetForCampaign(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
134
148
  getDonationsByAthlete(): Promise<ITypedBackendResponse<Receipt[]>>;
135
- getDonationsByMember(): Promise<ITypedBackendResponse<Donation[]>>;
149
+ getDonationsByMember(desiredFields?: DonationGenqlSelection): Promise<ITypedBackendResponse<Donation[]>>;
136
150
  findMemberForUser(loginEmail: string): Promise<ITypedBackendResponse<Member>>;
137
151
  getBudgetConcepts(): Promise<ITypedBackendResponse<BudgetConcept[]>>;
138
152
  getBudgetItemsUnits(): Promise<ITypedBackendResponse<BudgetItemUnit[]>>;
@@ -7785,6 +7785,68 @@ class VTXBaseAPI {
7785
7785
  }
7786
7786
  return retValue;
7787
7787
  }
7788
+ async updateAthleteCompetitionScores() {
7789
+ const client = (0, client_1.createClient)({
7790
+ url: this.backendUrl + '/graphql',
7791
+ headers: this.headers,
7792
+ });
7793
+ let retValue = {};
7794
+ try {
7795
+ const response = await client.mutation({
7796
+ updateAthleteCompetitionScores: {
7797
+ _id: true,
7798
+ firstName: true,
7799
+ lastName: true,
7800
+ scores: {
7801
+ vtxScore: true,
7802
+ socialScore: true,
7803
+ trainingScore: true,
7804
+ competitionScore: true,
7805
+ }
7806
+ },
7807
+ });
7808
+ retValue = (0, response_builder_1.buildResponse)(response, 'updateAthleteCompetitionScores', (r) => {
7809
+ const isResponseOk = !!response?.updateAthleteCompetitionScores?._id;
7810
+ return isResponseOk;
7811
+ });
7812
+ }
7813
+ catch (err) {
7814
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
7815
+ }
7816
+ return retValue;
7817
+ }
7818
+ async forceRefreshAthleteScores(athleteIds) {
7819
+ const client = (0, client_1.createClient)({
7820
+ url: this.backendUrl + '/graphql',
7821
+ headers: this.headers,
7822
+ });
7823
+ let retValue = {};
7824
+ try {
7825
+ const response = await client.mutation({
7826
+ forceRefreshAthleteScores: {
7827
+ __args: {
7828
+ input: {
7829
+ athleteIds,
7830
+ },
7831
+ },
7832
+ results: {
7833
+ athleteId: true,
7834
+ athleteName: true,
7835
+ status: true,
7836
+ message: true,
7837
+ },
7838
+ successCount: true,
7839
+ failureCount: true,
7840
+ skippedCount: true,
7841
+ },
7842
+ });
7843
+ retValue = (0, response_builder_1.buildResponse)(response, 'forceRefreshAthleteScores', () => !!response?.forceRefreshAthleteScores);
7844
+ }
7845
+ catch (err) {
7846
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
7847
+ }
7848
+ return retValue;
7849
+ }
7788
7850
  async createResetPasswordCode(email) {
7789
7851
  console.log('HEADERS:');
7790
7852
  console.log(JSON.stringify(this.headers, null, 2));
@@ -8275,16 +8337,61 @@ class VTXBaseAPI {
8275
8337
  }
8276
8338
  return retValue;
8277
8339
  }
8278
- async getDonationsByMember() {
8340
+ async getDonationsByMember(desiredFields) {
8279
8341
  const client = (0, client_1.createClient)({
8280
8342
  url: this.backendUrl + '/graphql',
8281
8343
  headers: this.headers,
8282
8344
  });
8283
8345
  let retValue = { data: [] };
8284
- const fields = {
8346
+ const athleteSelection = {
8347
+ _id: true,
8348
+ firstName: true,
8349
+ lastName: true,
8350
+ screenName: true,
8351
+ competitionGender: true,
8352
+ country: {
8353
+ _id: true,
8354
+ name: true
8355
+ },
8356
+ location: {
8357
+ _id: true,
8358
+ city: {
8359
+ _id: true,
8360
+ name: true,
8361
+ state: {
8362
+ _id: true,
8363
+ name: true,
8364
+ country: {
8365
+ _id: true,
8366
+ name: true,
8367
+ }
8368
+ }
8369
+ }
8370
+ },
8371
+ mainSport: {
8372
+ _id: true,
8373
+ name: true,
8374
+ },
8375
+ mainSportLevel: {
8376
+ _id: true,
8377
+ label: true
8378
+ },
8379
+ profilePicture: {
8380
+ _id: true,
8381
+ name: true,
8382
+ contentType: true,
8383
+ size: true,
8384
+ useType: true,
8385
+ url: true,
8386
+ key: true
8387
+ }
8388
+ };
8389
+ const fields = desiredFields ?? {
8285
8390
  checkoutSessionId: true,
8286
8391
  fundingCheckoutSessionDataId: true,
8287
8392
  donationMode: true,
8393
+ donorName: true,
8394
+ donorEmail: true,
8288
8395
  completed: true,
8289
8396
  confirmed: true,
8290
8397
  donationAmount: true,
@@ -8293,9 +8400,24 @@ class VTXBaseAPI {
8293
8400
  athleteId: true,
8294
8401
  athleteName: true,
8295
8402
  message: true,
8403
+ athleteReference: athleteSelection,
8296
8404
  campaignReference: {
8297
8405
  _id: true,
8298
- title: true
8406
+ athlete: athleteSelection,
8407
+ status: true,
8408
+ title: true,
8409
+ motivation: true,
8410
+ website: true,
8411
+ fundsRequired: true,
8412
+ initialFundsObtained: true,
8413
+ fundsObtained: true,
8414
+ endingDate: true,
8415
+ video: {
8416
+ _id: true,
8417
+ source: true,
8418
+ url: true,
8419
+ sourceData: true
8420
+ }
8299
8421
  }
8300
8422
  };
8301
8423
  try {
@@ -8305,8 +8427,7 @@ class VTXBaseAPI {
8305
8427
  },
8306
8428
  });
8307
8429
  retValue = (0, response_builder_1.buildResponse)(response, 'getDonationsByMember', (r) => {
8308
- const isResponseOk = !!response?.getDonationsByMember &&
8309
- Array.isArray(response.getDonationsByMember);
8430
+ const isResponseOk = true && Array.isArray(response?.getDonationsByMember);
8310
8431
  return isResponseOk;
8311
8432
  });
8312
8433
  if (!retValue.data) {