@vertikalx/vtx-backend-client 1.0.1-dev-max.15 → 1.0.1-dev-max.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.1-dev-max.15",
3
+ "version": "1.0.1-dev-max.16",
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.1-dev-max.15",
3
+ "version": "1.0.1-dev-max.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 } 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, ReceiptUrl, GetReceiptDto, DeleteValuesResponse, BudgetData, AddCompetitionBudgetDto, EditCompetitionBudgetDto, EditCampaignBudgetDto } 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';
@@ -110,4 +110,9 @@ export declare class VTXBaseAPI {
110
110
  resetUserPassword(input: resetPasswordDto): Promise<ITypedBackendResponse<EditValueResponse>>;
111
111
  deleteAlbumFotos(dto: DeleteValuesDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
112
112
  screenNameAviability(dto: existValueDto): Promise<ITypedBackendResponse<ExistValueResponse>>;
113
+ getBudgetsByAthlete(): Promise<ITypedBackendResponse<BudgetData>>;
114
+ deleteCompetitionBudget(competitionId: string): Promise<ITypedBackendResponse<Boolean>>;
115
+ addCompetitionBudget(input: AddCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
116
+ editCompetitionBudget(input: EditCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
117
+ editCampaignBudget(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
113
118
  }
@@ -7242,6 +7242,186 @@ class VTXBaseAPI {
7242
7242
  console.log(JSON.stringify(retValue, null, 2));
7243
7243
  return retValue;
7244
7244
  }
7245
+ async getBudgetsByAthlete() {
7246
+ const client = (0, client_1.createClient)({
7247
+ url: this.backendUrl + '/graphql',
7248
+ headers: this.headers,
7249
+ });
7250
+ let retValue = {};
7251
+ const fields = {
7252
+ competitions: {
7253
+ id: true,
7254
+ dateCreated: true,
7255
+ type: true,
7256
+ name: true,
7257
+ eventDate: true,
7258
+ budget: true,
7259
+ campaign: true,
7260
+ items: {
7261
+ _id: true,
7262
+ concept: true,
7263
+ quantity: true,
7264
+ itemCost: true,
7265
+ totalCost: true
7266
+ }
7267
+ },
7268
+ campaigns: {
7269
+ id: true,
7270
+ dateCreated: true,
7271
+ type: true,
7272
+ name: true,
7273
+ fundsRequired: true,
7274
+ initialFundsObtained: true,
7275
+ status: true,
7276
+ endingDate: true,
7277
+ budget: true,
7278
+ competitions: true,
7279
+ items: {
7280
+ _id: true,
7281
+ concept: true,
7282
+ quantity: true,
7283
+ itemCost: true,
7284
+ totalCost: true
7285
+ },
7286
+ competitionBudgets: {
7287
+ competitionId: true,
7288
+ eventName: true,
7289
+ budget: {
7290
+ _id: true,
7291
+ items: {
7292
+ _id: true,
7293
+ concept: true,
7294
+ quantity: true,
7295
+ itemCost: true,
7296
+ totalCost: true
7297
+ },
7298
+ totalAmount: true
7299
+ }
7300
+ }
7301
+ },
7302
+ };
7303
+ try {
7304
+ const response = await client.query({
7305
+ getBudgetsByAthlete: {
7306
+ ...fields
7307
+ },
7308
+ });
7309
+ retValue = (0, response_builder_1.buildResponse)(response, 'getBudgetsByAthlete', (r) => {
7310
+ const isResponseOk = !!response?.getBudgetsByAthlete &&
7311
+ Array.isArray(response.getBudgetsByAthlete.campaigns) &&
7312
+ Array.isArray(response.getBudgetsByAthlete.competitions);
7313
+ return isResponseOk;
7314
+ });
7315
+ }
7316
+ catch (err) {
7317
+ retValue = (0, response_builder_1.buildErrorResponse)(err);
7318
+ }
7319
+ return retValue;
7320
+ }
7321
+ async deleteCompetitionBudget(competitionId) {
7322
+ const client = (0, client_1.createClient)({
7323
+ url: this.backendUrl + '/graphql',
7324
+ headers: this.headers,
7325
+ });
7326
+ let retValue = {};
7327
+ try {
7328
+ const response = await client.mutation({
7329
+ deleteCompetitionBudget: {
7330
+ __args: {
7331
+ competitionId: competitionId
7332
+ },
7333
+ },
7334
+ });
7335
+ retValue = (0, response_builder_1.buildResponse)(response, 'deleteCompetitionBudget', (r) => {
7336
+ const isResponseOk = response?.deleteCompetitionBudget;
7337
+ return isResponseOk;
7338
+ });
7339
+ }
7340
+ catch (err1) {
7341
+ console.error('deleteCompetitionBudget err1:');
7342
+ console.error(err1);
7343
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
7344
+ }
7345
+ return retValue;
7346
+ }
7347
+ async addCompetitionBudget(input) {
7348
+ const client = (0, client_1.createClient)({
7349
+ url: this.backendUrl + '/graphql',
7350
+ headers: this.headers,
7351
+ });
7352
+ let retValue = {};
7353
+ try {
7354
+ const response = await client.mutation({
7355
+ addCompetitionBudget: {
7356
+ __args: {
7357
+ input: input
7358
+ },
7359
+ },
7360
+ });
7361
+ retValue = (0, response_builder_1.buildResponse)(response, 'addCompetitionBudget', (r) => {
7362
+ const isResponseOk = response?.addCompetitionBudget;
7363
+ return isResponseOk;
7364
+ });
7365
+ }
7366
+ catch (err1) {
7367
+ console.error('addCompetitionBudget err1:');
7368
+ console.error(err1);
7369
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
7370
+ }
7371
+ return retValue;
7372
+ }
7373
+ async editCompetitionBudget(input) {
7374
+ const client = (0, client_1.createClient)({
7375
+ url: this.backendUrl + '/graphql',
7376
+ headers: this.headers,
7377
+ });
7378
+ let retValue = {};
7379
+ try {
7380
+ const response = await client.mutation({
7381
+ editCompetitionBudget: {
7382
+ __args: {
7383
+ input: input
7384
+ },
7385
+ },
7386
+ });
7387
+ retValue = (0, response_builder_1.buildResponse)(response, 'editCompetitionBudget', (r) => {
7388
+ const isResponseOk = response?.editCompetitionBudget;
7389
+ return isResponseOk;
7390
+ });
7391
+ }
7392
+ catch (err1) {
7393
+ console.error('editCompetitionBudget err1:');
7394
+ console.error(err1);
7395
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
7396
+ }
7397
+ return retValue;
7398
+ }
7399
+ async editCampaignBudget(input) {
7400
+ const client = (0, client_1.createClient)({
7401
+ url: this.backendUrl + '/graphql',
7402
+ headers: this.headers,
7403
+ });
7404
+ let retValue = {};
7405
+ try {
7406
+ const response = await client.mutation({
7407
+ editCampaignBudget: {
7408
+ __args: {
7409
+ input: input
7410
+ },
7411
+ },
7412
+ });
7413
+ retValue = (0, response_builder_1.buildResponse)(response, 'editCampaignBudget', (r) => {
7414
+ const isResponseOk = response?.editCampaignBudget;
7415
+ return isResponseOk;
7416
+ });
7417
+ }
7418
+ catch (err1) {
7419
+ console.error('editCampaignBudget err1:');
7420
+ console.error(err1);
7421
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
7422
+ }
7423
+ return retValue;
7424
+ }
7245
7425
  }
7246
7426
  exports.VTXBaseAPI = VTXBaseAPI;
7247
7427
  VTXBaseAPI.Logger = {