@vertikalx/vtx-backend-client 1.0.0-dev-max.32 → 1.0.0-dev-max.33

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev-max.32",
3
+ "version": "1.0.0-dev-max.33",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev-max.32",
3
+ "version": "1.0.0-dev-max.33",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -1,7 +1,8 @@
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, FundingCheckoutSessionData, GetFundingCheckoutSessionDataDto, Album, State, Country, AWSS3DeleteUseTypeKeyDto, AthleteIntegrationReference, AWSS3CallResult, SetCompetitionResultDto, AthleteCompetitionResult, CodeVerificationResponse, resetPasswordDto, DeleteValuesDto, existValueDto, ExistValueResponse } 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 } 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';
5
+ import { GetReceiptDto } from 'src/api/dto/get-receipt.dto';
5
6
  export declare class VTXBaseAPI {
6
7
  protected headers: APICallHeaders;
7
8
  protected backendUrl: string;
@@ -89,7 +90,7 @@ export declare class VTXBaseAPI {
89
90
  getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
90
91
  getAthleteStravaIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
91
92
  getAthleteInstagramIntegration(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
92
- getFundingCheckoutSessionData(dto: GetFundingCheckoutSessionDataDto): Promise<ITypedBackendResponse<FundingCheckoutSessionData>>;
93
+ getReceipt(dto: GetReceiptDto): Promise<ITypedBackendResponse<Receipt>>;
93
94
  getAthleteIntegrations(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
94
95
  updateAthleteIntegration(type: string): Promise<ITypedBackendResponse<boolean>>;
95
96
  deleteUploadedTypeKeyFile(dto: AWSS3DeleteUseTypeKeyDto): Promise<ITypedBackendResponse<AWSS3CallResult>>;
@@ -6179,72 +6179,39 @@ class VTXBaseAPI {
6179
6179
  }
6180
6180
  return retValue;
6181
6181
  }
6182
- async getFundingCheckoutSessionData(dto) {
6182
+ async getReceipt(dto) {
6183
6183
  const client = (0, client_1.createClient)({
6184
6184
  url: this.backendUrl + '/graphql',
6185
6185
  headers: this.headers,
6186
6186
  });
6187
6187
  let retValue = {};
6188
6188
  const fields = {
6189
- _id: true,
6190
- session: {
6191
- _id: true,
6192
- type: true,
6193
- estimatedStripeComission: true,
6194
- stripeSessionId: true,
6195
- stripeAccountId: true,
6196
- donationAmount: true,
6197
- fromEmail: true,
6198
- confirmed: true,
6199
- completed: true,
6200
- completedDate: true,
6201
- createdDate: true,
6202
- },
6203
- fromName: true,
6204
- paidToAthlete: true,
6205
- paidToVtx: true,
6206
- fundingCampaign: {
6207
- _id: true,
6208
- athlete: {
6209
- _id: true,
6210
- firstName: true,
6211
- lastName: true,
6212
- screenName: true
6213
- },
6214
- budgetMode: true,
6215
- status: true,
6216
- title: true,
6217
- motivation: true,
6218
- website: true,
6219
- fundsRequired: true,
6220
- initialFundsObtained: true,
6221
- fundsObtained: true,
6222
- endingDate: true,
6223
- vtxComissionPct: true
6224
- },
6225
- mode: true,
6226
- athleteId: true,
6227
- athleteName: true,
6228
- fromPhone: true,
6189
+ receiptId: true,
6190
+ campaignName: true,
6191
+ donorName: true,
6192
+ amount: true,
6193
+ currency: true,
6194
+ dateIssued: true,
6229
6195
  message: true,
6230
6196
  };
6231
6197
  try {
6232
6198
  const response = await client.query({
6233
- getFundingCheckoutSessionData: {
6199
+ getReceipt: {
6234
6200
  __args: {
6235
6201
  input: dto
6236
6202
  },
6237
6203
  ...fields
6238
6204
  },
6239
6205
  });
6240
- retValue = (0, response_builder_1.buildResponse)(response, 'getFundingCheckoutSessionData', (r) => {
6241
- const isResponseOk = !!response?.getFundingCheckoutSessionData?._id;
6206
+ retValue = (0, response_builder_1.buildResponse)(response, 'getReceipt', (r) => {
6207
+ const isResponseOk = !!response?.getReceipt?.receiptId;
6242
6208
  return isResponseOk;
6243
6209
  });
6244
6210
  }
6245
6211
  catch (err) {
6246
6212
  retValue = (0, response_builder_1.buildErrorResponse)(err);
6247
6213
  }
6214
+ console.log('GetReceipt retValue:', JSON.stringify(retValue, null, 2));
6248
6215
  return retValue;
6249
6216
  }
6250
6217
  async getAthleteIntegrations() {