@vertikalx/vtx-backend-client 1.0.0-dev-geo.18 → 1.0.0-dev-daniel.201
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/response-builder.js +2 -3
- package/src/api/response-builder.js.map +1 -1
- package/src/api/vtx-base-api.d.ts +3 -4
- package/src/api/vtx-base-api.js +52 -412
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/runtime/generateGraphqlOperation.d.ts +1 -1
- package/src/client/schema.d.ts +60 -34
- package/src/client/schema.graphql +28 -14
- package/src/client/schema.js +15 -8
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +30 -18
- package/src/client/types.js +166 -134
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
- package/libs/vtx-backend-client/package.json +0 -16
- package/libs/vtx-backend-client/src/api/api-call-headers.d.ts +0 -16
- package/libs/vtx-backend-client/src/api/api-call-headers.js +0 -20
- package/libs/vtx-backend-client/src/api/api-call-headers.js.map +0 -1
- package/libs/vtx-backend-client/src/api/backend-response.d.ts +0 -10
- package/libs/vtx-backend-client/src/api/backend-response.js +0 -3
- package/libs/vtx-backend-client/src/api/backend-response.js.map +0 -1
- package/libs/vtx-backend-client/src/api/domains.d.ts +0 -3
- package/libs/vtx-backend-client/src/api/domains.js +0 -7
- package/libs/vtx-backend-client/src/api/domains.js.map +0 -1
- package/libs/vtx-backend-client/src/api/response-builder.d.ts +0 -4
- package/libs/vtx-backend-client/src/api/response-builder.js +0 -123
- package/libs/vtx-backend-client/src/api/response-builder.js.map +0 -1
- package/libs/vtx-backend-client/src/api/types.d.ts +0 -2
- package/libs/vtx-backend-client/src/api/types.js +0 -3
- package/libs/vtx-backend-client/src/api/types.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.d.ts +0 -6
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js +0 -19
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-base-api.d.ts +0 -71
- package/libs/vtx-backend-client/src/api/vtx-base-api.js +0 -5114
- package/libs/vtx-backend-client/src/api/vtx-base-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.d.ts +0 -6
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js +0 -27
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.d.ts +0 -7
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js +0 -36
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js.map +0 -1
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.d.ts +0 -7
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js +0 -33
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js.map +0 -1
- package/libs/vtx-backend-client/src/client/index.d.ts +0 -25
- package/libs/vtx-backend-client/src/client/index.js +0 -44
- package/libs/vtx-backend-client/src/client/index.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/batcher.d.ts +0 -36
- package/libs/vtx-backend-client/src/client/runtime/batcher.js +0 -123
- package/libs/vtx-backend-client/src/client/runtime/batcher.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/createClient.d.ts +0 -17
- package/libs/vtx-backend-client/src/client/runtime/createClient.js +0 -28
- package/libs/vtx-backend-client/src/client/runtime/createClient.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/error.d.ts +0 -15
- package/libs/vtx-backend-client/src/client/runtime/error.js +0 -19
- package/libs/vtx-backend-client/src/client/runtime/error.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/fetcher.d.ts +0 -10
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js +0 -68
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.d.ts +0 -30
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js +0 -134
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/index.d.ts +0 -11
- package/libs/vtx-backend-client/src/client/runtime/index.js +0 -17
- package/libs/vtx-backend-client/src/client/runtime/index.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.d.ts +0 -9
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js +0 -95
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.d.ts +0 -28
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js +0 -3
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js.map +0 -1
- package/libs/vtx-backend-client/src/client/runtime/types.d.ts +0 -55
- package/libs/vtx-backend-client/src/client/runtime/types.js +0 -3
- package/libs/vtx-backend-client/src/client/runtime/types.js.map +0 -1
- package/libs/vtx-backend-client/src/client/schema.d.ts +0 -2954
- package/libs/vtx-backend-client/src/client/schema.js +0 -649
- package/libs/vtx-backend-client/src/client/schema.js.map +0 -1
- package/libs/vtx-backend-client/src/client/types.d.ts +0 -1614
- package/libs/vtx-backend-client/src/client/types.js +0 -4189
- package/libs/vtx-backend-client/src/client/types.js.map +0 -1
- package/libs/vtx-backend-client/src/index.d.ts +0 -11
- package/libs/vtx-backend-client/src/index.js +0 -28
- package/libs/vtx-backend-client/src/index.js.map +0 -1
- package/src/api/dto/edit-picture.dto.d.ts +0 -5
- package/src/api/dto/edit-picture.dto.js +0 -31
- package/src/api/dto/edit-picture.dto.js.map +0 -1
- package/src/api/types/edit-picture-response.type.d.ts +0 -7
- package/src/api/types/edit-picture-response.type.js +0 -39
- package/src/api/types/edit-picture-response.type.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildResponse = buildResponse;
|
|
4
|
+
exports.buildErrorResponse = buildErrorResponse;
|
|
4
5
|
const vtx_core_common_1 = require("@vertikalx/vtx-core-common");
|
|
5
6
|
const Logger = {
|
|
6
7
|
log: (msg) => {
|
|
@@ -74,7 +75,6 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
74
75
|
Logger.log(JSON.stringify(retValue, null, 2));
|
|
75
76
|
return retValue;
|
|
76
77
|
}
|
|
77
|
-
exports.buildResponse = buildResponse;
|
|
78
78
|
function buildErrorResponse(error) {
|
|
79
79
|
const retValue = {};
|
|
80
80
|
if (error.errors) {
|
|
@@ -96,7 +96,6 @@ function buildErrorResponse(error) {
|
|
|
96
96
|
retValue.error = extractError(retValue.rawErrors);
|
|
97
97
|
return retValue;
|
|
98
98
|
}
|
|
99
|
-
exports.buildErrorResponse = buildErrorResponse;
|
|
100
99
|
function extractError(rawErrors) {
|
|
101
100
|
let retValue = {
|
|
102
101
|
httpStatus: 500,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-builder.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/response-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response-builder.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/response-builder.ts"],"names":[],"mappings":";;AAaA,sCAkFC;AACD,gDAmCC;AAjID,gEAAwD;AAKxD,MAAM,MAAM,GAAG;IACb,GAAG,EAAC,CAAC,GAAU,EAAC,EAAE;IAElB,CAAC;CACF,CAAC;AAEF,SAAgB,aAAa,CAAI,QAAY,EAAE,YAAmB,EAAE,OAAkB;IAClF,MAAM,QAAQ,GAA4B,EAAE,CAAA;IAO1C,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAC,CAAC;QAGrB,IAAI,CAAC;YACH,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAM,CAAC;QAC9C,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IACH,CAAC;IAED,QAAQ,CAAC,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAE,CAAC;IAQnD,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD,SAAS,YAAY,CAAC,SAA0B;IAE9C,IAAI,QAAQ,GAAgB;QAC1B,UAAU,EAAC,GAAG;QACd,IAAI,EAAC,4BAAU,CAAC,gBAAgB,CAAC,IAAI;QACrC,OAAO,EAAC,4BAAU,CAAC,gBAAgB,CAAC,WAAW;KAChD,CAAC;IAEF,IAAI,CAAE,SAAS,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAC,CAAC;QACxC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,QAAQ,GAAO,SAAS,CAAC,IAAI,CAAE,CAAC,CAAC,EAAE;QAEnC,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,UAAU,EAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAC,CAAC;QACZ,QAAQ,GAAG;YACT,UAAU,EAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,IAAI,GAAG;YAClD,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAI,4BAAU,CAAC,gBAAgB,CAAC,IAAI;YAC9E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,IAAK,4BAAU,CAAC,gBAAgB,CAAC,WAAW;SACjG,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAGlB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { User, 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, AthleteQueryDto, AthleteQueryResponse,
|
|
1
|
+
import { User, 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, AthleteQueryDto, AthleteQueryResponse, StripeAccountGenqlSelection, StripeSessionGenqlSelection, CreateStripeAccountDto, StripeAccount, StripeSession } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
|
-
import { EditPictureDto } from 'src/api/dto/edit-picture.dto';
|
|
5
4
|
export declare class VTXBaseAPI {
|
|
6
5
|
protected headers: APICallHeaders;
|
|
7
6
|
protected backendUrl: string;
|
|
@@ -66,6 +65,6 @@ export declare class VTXBaseAPI {
|
|
|
66
65
|
createAthleteMembershipAffilation(dto: CreateAthleteMembershipDto, desiredFields?: AthleteMembershipGenqlSelection): Promise<ITypedBackendResponse<AthleteMembership>>;
|
|
67
66
|
deleteMembershipAffiliation(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
68
67
|
queryAthleteFundingCampaigns(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
createStripeAccount(dto: CreateStripeAccountDto, desiredFields?: StripeAccountGenqlSelection): Promise<ITypedBackendResponse<StripeAccount>>;
|
|
69
|
+
createAthleteStripeSession(desiredFields?: StripeSessionGenqlSelection): Promise<ITypedBackendResponse<StripeSession>>;
|
|
71
70
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -2260,6 +2260,16 @@ class VTXBaseAPI {
|
|
|
2260
2260
|
resultWebLink: true
|
|
2261
2261
|
}
|
|
2262
2262
|
}
|
|
2263
|
+
},
|
|
2264
|
+
stripeAccount: {
|
|
2265
|
+
_id: true,
|
|
2266
|
+
stripeAccountId: true,
|
|
2267
|
+
email: true,
|
|
2268
|
+
needsConfiguration: true,
|
|
2269
|
+
countryId: true,
|
|
2270
|
+
defaultCurrency: true,
|
|
2271
|
+
created: true,
|
|
2272
|
+
accountData: true
|
|
2263
2273
|
}
|
|
2264
2274
|
};
|
|
2265
2275
|
try {
|
|
@@ -4652,449 +4662,79 @@ class VTXBaseAPI {
|
|
|
4652
4662
|
}
|
|
4653
4663
|
return retValue;
|
|
4654
4664
|
}
|
|
4655
|
-
async
|
|
4665
|
+
async createStripeAccount(dto, desiredFields) {
|
|
4656
4666
|
const client = (0, client_1.createClient)({
|
|
4657
4667
|
url: this.backendUrl + "/graphql",
|
|
4658
4668
|
headers: this.headers,
|
|
4659
4669
|
});
|
|
4660
|
-
|
|
4661
|
-
const fields = {
|
|
4670
|
+
const fields = desiredFields ?? {
|
|
4662
4671
|
_id: true,
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
_id: true,
|
|
4671
|
-
name: true
|
|
4672
|
-
},
|
|
4673
|
-
location: {
|
|
4674
|
-
userProvidedLatitude: true,
|
|
4675
|
-
userProvidedLongitude: true,
|
|
4676
|
-
cityNameGeocode: true,
|
|
4677
|
-
stateNameGeocode: true,
|
|
4678
|
-
countryIso2CodeGeocode: true,
|
|
4679
|
-
timeZoneGeocode: true,
|
|
4680
|
-
latitudeGeocode: true,
|
|
4681
|
-
longitudeGeocode: true,
|
|
4682
|
-
city: {
|
|
4683
|
-
_id: true,
|
|
4684
|
-
name: true,
|
|
4685
|
-
localizedName: true,
|
|
4686
|
-
state: {
|
|
4687
|
-
_id: true,
|
|
4688
|
-
name: true,
|
|
4689
|
-
country: {
|
|
4690
|
-
_id: true,
|
|
4691
|
-
name: true
|
|
4692
|
-
}
|
|
4693
|
-
},
|
|
4694
|
-
latitude: true,
|
|
4695
|
-
longitude: true,
|
|
4696
|
-
timezone: true,
|
|
4697
|
-
}
|
|
4698
|
-
},
|
|
4699
|
-
trainer: true,
|
|
4700
|
-
trainerUrl: true,
|
|
4701
|
-
aboutMe: true,
|
|
4702
|
-
followStats: {
|
|
4703
|
-
followers: true,
|
|
4704
|
-
followed: true,
|
|
4705
|
-
raves: true,
|
|
4706
|
-
favorites: true
|
|
4707
|
-
},
|
|
4708
|
-
mainSport: {
|
|
4709
|
-
_id: true,
|
|
4710
|
-
name: true
|
|
4711
|
-
},
|
|
4712
|
-
mainSportLevel: {
|
|
4713
|
-
_id: true,
|
|
4714
|
-
label: true,
|
|
4715
|
-
index: true
|
|
4716
|
-
},
|
|
4717
|
-
scores: {
|
|
4718
|
-
vtxScore: true,
|
|
4719
|
-
socialScore: true,
|
|
4720
|
-
trainingScore: true,
|
|
4721
|
-
competitionScore: true
|
|
4722
|
-
},
|
|
4723
|
-
rankings: {
|
|
4724
|
-
worldRanking: {
|
|
4725
|
-
scope: true,
|
|
4726
|
-
scopeId: true,
|
|
4727
|
-
scopeName: true,
|
|
4728
|
-
position: true,
|
|
4729
|
-
total: true
|
|
4730
|
-
},
|
|
4731
|
-
countryRanking: {
|
|
4732
|
-
scope: true,
|
|
4733
|
-
scopeId: true,
|
|
4734
|
-
scopeName: true,
|
|
4735
|
-
position: true,
|
|
4736
|
-
total: true
|
|
4737
|
-
},
|
|
4738
|
-
stateRanking: {
|
|
4739
|
-
scope: true,
|
|
4740
|
-
scopeId: true,
|
|
4741
|
-
scopeName: true,
|
|
4742
|
-
position: true,
|
|
4743
|
-
total: true
|
|
4744
|
-
},
|
|
4745
|
-
cityRanking: {
|
|
4746
|
-
scope: true,
|
|
4747
|
-
scopeId: true,
|
|
4748
|
-
scopeName: true,
|
|
4749
|
-
position: true,
|
|
4750
|
-
total: true
|
|
4751
|
-
},
|
|
4752
|
-
},
|
|
4753
|
-
allSports: {
|
|
4754
|
-
_id: true,
|
|
4755
|
-
name: true
|
|
4756
|
-
},
|
|
4757
|
-
teams: {
|
|
4758
|
-
_id: true,
|
|
4759
|
-
name: true,
|
|
4760
|
-
description: true,
|
|
4761
|
-
approved: true,
|
|
4762
|
-
logo: {
|
|
4763
|
-
_id: true,
|
|
4764
|
-
name: true,
|
|
4765
|
-
contentType: true,
|
|
4766
|
-
size: true,
|
|
4767
|
-
useType: true,
|
|
4768
|
-
url: true,
|
|
4769
|
-
key: true
|
|
4770
|
-
},
|
|
4771
|
-
banner: {
|
|
4772
|
-
_id: true,
|
|
4773
|
-
name: true,
|
|
4774
|
-
contentType: true,
|
|
4775
|
-
size: true,
|
|
4776
|
-
useType: true,
|
|
4777
|
-
url: true,
|
|
4778
|
-
key: true
|
|
4779
|
-
}
|
|
4780
|
-
},
|
|
4781
|
-
sponsorBrands: {
|
|
4782
|
-
_id: true,
|
|
4783
|
-
name: true,
|
|
4784
|
-
slogan: true,
|
|
4785
|
-
website: true,
|
|
4786
|
-
description: true,
|
|
4787
|
-
approved: true,
|
|
4788
|
-
published: true,
|
|
4789
|
-
logo: {
|
|
4790
|
-
_id: true,
|
|
4791
|
-
name: true,
|
|
4792
|
-
contentType: true,
|
|
4793
|
-
size: true,
|
|
4794
|
-
useType: true,
|
|
4795
|
-
url: true,
|
|
4796
|
-
key: true
|
|
4797
|
-
},
|
|
4798
|
-
stats: {
|
|
4799
|
-
campaigns: true,
|
|
4800
|
-
sponsorships: true,
|
|
4801
|
-
sports: true,
|
|
4802
|
-
athletes: true
|
|
4803
|
-
},
|
|
4804
|
-
operatorIds: true,
|
|
4805
|
-
},
|
|
4806
|
-
competitions: {
|
|
4807
|
-
_id: true,
|
|
4808
|
-
event: {
|
|
4809
|
-
_id: true,
|
|
4810
|
-
name: true,
|
|
4811
|
-
mainSport: {
|
|
4812
|
-
_id: true,
|
|
4813
|
-
name: true
|
|
4814
|
-
},
|
|
4815
|
-
eventWebSite: true,
|
|
4816
|
-
startDate: true,
|
|
4817
|
-
endDate: true,
|
|
4818
|
-
verified: true,
|
|
4819
|
-
location: {
|
|
4820
|
-
_id: true,
|
|
4821
|
-
userProvidedLatitude: true,
|
|
4822
|
-
userProvidedLongitude: true,
|
|
4823
|
-
cityNameGeocode: true,
|
|
4824
|
-
stateNameGeocode: true,
|
|
4825
|
-
countryIso2CodeGeocode: true,
|
|
4826
|
-
timeZoneGeocode: true,
|
|
4827
|
-
latitudeGeocode: true,
|
|
4828
|
-
longitudeGeocode: true,
|
|
4829
|
-
city: {
|
|
4830
|
-
_id: true,
|
|
4831
|
-
name: true,
|
|
4832
|
-
localizedName: true,
|
|
4833
|
-
state: {
|
|
4834
|
-
_id: true,
|
|
4835
|
-
name: true,
|
|
4836
|
-
country: {
|
|
4837
|
-
_id: true,
|
|
4838
|
-
name: true
|
|
4839
|
-
}
|
|
4840
|
-
},
|
|
4841
|
-
latitude: true,
|
|
4842
|
-
longitude: true,
|
|
4843
|
-
timezone: true,
|
|
4844
|
-
}
|
|
4845
|
-
},
|
|
4846
|
-
banner: {
|
|
4847
|
-
_id: true,
|
|
4848
|
-
name: true,
|
|
4849
|
-
contentType: true,
|
|
4850
|
-
size: true,
|
|
4851
|
-
useType: true,
|
|
4852
|
-
url: true,
|
|
4853
|
-
key: true
|
|
4854
|
-
}
|
|
4855
|
-
},
|
|
4856
|
-
participationDate: true,
|
|
4857
|
-
result: {
|
|
4858
|
-
_id: true,
|
|
4859
|
-
resultType: true,
|
|
4860
|
-
position: true,
|
|
4861
|
-
score: true,
|
|
4862
|
-
finishTimeMS: true,
|
|
4863
|
-
resultWebLink: true
|
|
4864
|
-
}
|
|
4865
|
-
},
|
|
4866
|
-
affiliations: {
|
|
4867
|
-
_id: true,
|
|
4868
|
-
organization: {
|
|
4869
|
-
_id: true,
|
|
4870
|
-
shortName: true,
|
|
4871
|
-
acronym: true,
|
|
4872
|
-
fullName: true,
|
|
4873
|
-
website: true,
|
|
4874
|
-
logo: {
|
|
4875
|
-
_id: true,
|
|
4876
|
-
name: true,
|
|
4877
|
-
contentType: true,
|
|
4878
|
-
size: true,
|
|
4879
|
-
useType: true,
|
|
4880
|
-
url: true,
|
|
4881
|
-
key: true
|
|
4882
|
-
}
|
|
4883
|
-
},
|
|
4884
|
-
membershipNumber: true,
|
|
4885
|
-
membershipType: true,
|
|
4886
|
-
issueDate: true,
|
|
4887
|
-
expirationDate: true,
|
|
4888
|
-
},
|
|
4889
|
-
totalUpcomingCompetitions: true,
|
|
4890
|
-
totalPastCompetitions: true,
|
|
4891
|
-
profilePicture: {
|
|
4892
|
-
_id: true,
|
|
4893
|
-
name: true,
|
|
4894
|
-
contentType: true,
|
|
4895
|
-
size: true,
|
|
4896
|
-
useType: true,
|
|
4897
|
-
url: true,
|
|
4898
|
-
key: true
|
|
4899
|
-
},
|
|
4900
|
-
cardPicture: {
|
|
4901
|
-
_id: true,
|
|
4902
|
-
name: true,
|
|
4903
|
-
contentType: true,
|
|
4904
|
-
size: true,
|
|
4905
|
-
useType: true,
|
|
4906
|
-
url: true,
|
|
4907
|
-
key: true
|
|
4908
|
-
},
|
|
4909
|
-
preferences: {
|
|
4910
|
-
_id: true,
|
|
4911
|
-
showProfileHelper: true
|
|
4912
|
-
},
|
|
4913
|
-
currentCampaign: {
|
|
4914
|
-
_id: true,
|
|
4915
|
-
budgetMode: true,
|
|
4916
|
-
status: true,
|
|
4917
|
-
title: true,
|
|
4918
|
-
motivation: true,
|
|
4919
|
-
website: true,
|
|
4920
|
-
fundsRequired: true,
|
|
4921
|
-
initialFundsObtained: true,
|
|
4922
|
-
fundsObtained: true,
|
|
4923
|
-
location: {
|
|
4924
|
-
_id: true,
|
|
4925
|
-
userProvidedLatitude: true,
|
|
4926
|
-
userProvidedLongitude: true,
|
|
4927
|
-
cityNameGeocode: true,
|
|
4928
|
-
stateNameGeocode: true,
|
|
4929
|
-
countryIso2CodeGeocode: true,
|
|
4930
|
-
timeZoneGeocode: true,
|
|
4931
|
-
latitudeGeocode: true,
|
|
4932
|
-
longitudeGeocode: true,
|
|
4933
|
-
city: {
|
|
4934
|
-
_id: true,
|
|
4935
|
-
name: true,
|
|
4936
|
-
localizedName: true,
|
|
4937
|
-
state: {
|
|
4938
|
-
_id: true,
|
|
4939
|
-
name: true,
|
|
4940
|
-
country: {
|
|
4941
|
-
_id: true,
|
|
4942
|
-
name: true
|
|
4943
|
-
}
|
|
4944
|
-
},
|
|
4945
|
-
latitude: true,
|
|
4946
|
-
longitude: true,
|
|
4947
|
-
timezone: true,
|
|
4948
|
-
}
|
|
4949
|
-
},
|
|
4950
|
-
endingDate: true,
|
|
4951
|
-
budget: {
|
|
4952
|
-
_id: true,
|
|
4953
|
-
initialFunds: true,
|
|
4954
|
-
totalRequired: true,
|
|
4955
|
-
items: {
|
|
4956
|
-
_id: true,
|
|
4957
|
-
quantity: true,
|
|
4958
|
-
concept: true,
|
|
4959
|
-
itemCost: true
|
|
4960
|
-
}
|
|
4961
|
-
},
|
|
4962
|
-
competitions: {
|
|
4963
|
-
_id: true,
|
|
4964
|
-
event: {
|
|
4965
|
-
_id: true,
|
|
4966
|
-
name: true,
|
|
4967
|
-
mainSport: {
|
|
4968
|
-
_id: true,
|
|
4969
|
-
name: true
|
|
4970
|
-
},
|
|
4971
|
-
eventWebSite: true,
|
|
4972
|
-
startDate: true,
|
|
4973
|
-
endDate: true,
|
|
4974
|
-
verified: true,
|
|
4975
|
-
banner: {
|
|
4976
|
-
_id: true,
|
|
4977
|
-
name: true,
|
|
4978
|
-
contentType: true,
|
|
4979
|
-
size: true,
|
|
4980
|
-
useType: true,
|
|
4981
|
-
url: true,
|
|
4982
|
-
key: true
|
|
4983
|
-
},
|
|
4984
|
-
location: {
|
|
4985
|
-
_id: true,
|
|
4986
|
-
userProvidedLatitude: true,
|
|
4987
|
-
userProvidedLongitude: true,
|
|
4988
|
-
cityNameGeocode: true,
|
|
4989
|
-
stateNameGeocode: true,
|
|
4990
|
-
countryIso2CodeGeocode: true,
|
|
4991
|
-
timeZoneGeocode: true,
|
|
4992
|
-
latitudeGeocode: true,
|
|
4993
|
-
longitudeGeocode: true,
|
|
4994
|
-
city: {
|
|
4995
|
-
_id: true,
|
|
4996
|
-
name: true,
|
|
4997
|
-
localizedName: true,
|
|
4998
|
-
state: {
|
|
4999
|
-
_id: true,
|
|
5000
|
-
name: true,
|
|
5001
|
-
country: {
|
|
5002
|
-
_id: true,
|
|
5003
|
-
name: true
|
|
5004
|
-
}
|
|
5005
|
-
},
|
|
5006
|
-
latitude: true,
|
|
5007
|
-
longitude: true,
|
|
5008
|
-
timezone: true,
|
|
5009
|
-
}
|
|
5010
|
-
},
|
|
5011
|
-
},
|
|
5012
|
-
participationDate: true,
|
|
5013
|
-
result: {
|
|
5014
|
-
_id: true,
|
|
5015
|
-
resultType: true,
|
|
5016
|
-
position: true,
|
|
5017
|
-
score: true,
|
|
5018
|
-
finishTimeMS: true,
|
|
5019
|
-
resultWebLink: true
|
|
5020
|
-
}
|
|
5021
|
-
}
|
|
5022
|
-
}
|
|
4672
|
+
stripeAccountId: true,
|
|
4673
|
+
email: true,
|
|
4674
|
+
needsConfiguration: true,
|
|
4675
|
+
countryId: true,
|
|
4676
|
+
defaultCurrency: true,
|
|
4677
|
+
created: true,
|
|
4678
|
+
accountData: true
|
|
5023
4679
|
};
|
|
4680
|
+
fields._id = true;
|
|
4681
|
+
let retValue = {};
|
|
5024
4682
|
try {
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
findAthletebyIdpublic: {
|
|
4683
|
+
const response = await client.mutation({
|
|
4684
|
+
createStripeAccount: {
|
|
5028
4685
|
__args: {
|
|
5029
|
-
|
|
4686
|
+
input: dto
|
|
5030
4687
|
},
|
|
5031
4688
|
...fields
|
|
5032
4689
|
}
|
|
5033
4690
|
});
|
|
5034
|
-
VTXBaseAPI.Logger.debug('
|
|
4691
|
+
VTXBaseAPI.Logger.debug('createStripeAccount Response:');
|
|
5035
4692
|
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5036
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5037
|
-
|
|
4693
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createStripeAccount', (r) => {
|
|
4694
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4695
|
+
const isResponseOk = true && response?.createStripeAccount?._id;
|
|
5038
4696
|
return isResponseOk;
|
|
5039
4697
|
});
|
|
5040
4698
|
}
|
|
5041
|
-
catch (
|
|
5042
|
-
VTXBaseAPI.Logger.error('
|
|
5043
|
-
VTXBaseAPI.Logger.error(
|
|
5044
|
-
retValue = (0, response_builder_1.buildErrorResponse)(
|
|
4699
|
+
catch (error1) {
|
|
4700
|
+
VTXBaseAPI.Logger.error('createStripeAccount err1:');
|
|
4701
|
+
VTXBaseAPI.Logger.error(error1);
|
|
4702
|
+
retValue = (0, response_builder_1.buildErrorResponse)(error1);
|
|
5045
4703
|
}
|
|
5046
4704
|
return retValue;
|
|
5047
4705
|
}
|
|
5048
|
-
async
|
|
5049
|
-
console.log('HEADERS:');
|
|
5050
|
-
console.log(JSON.stringify(this.headers, null, 2));
|
|
4706
|
+
async createAthleteStripeSession(desiredFields) {
|
|
5051
4707
|
const client = (0, client_1.createClient)({
|
|
5052
|
-
url: this.backendUrl +
|
|
4708
|
+
url: this.backendUrl + "/graphql",
|
|
5053
4709
|
headers: this.headers,
|
|
5054
4710
|
});
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
name: true,
|
|
5061
|
-
contentType: true,
|
|
5062
|
-
size: true,
|
|
5063
|
-
useType: true,
|
|
5064
|
-
url: true,
|
|
5065
|
-
key: true
|
|
5066
|
-
},
|
|
5067
|
-
newValue: {
|
|
5068
|
-
_id: true,
|
|
5069
|
-
name: true,
|
|
5070
|
-
contentType: true,
|
|
5071
|
-
size: true,
|
|
5072
|
-
useType: true,
|
|
5073
|
-
url: true,
|
|
5074
|
-
key: true
|
|
5075
|
-
},
|
|
5076
|
-
changed: true
|
|
4711
|
+
const fields = desiredFields ?? {
|
|
4712
|
+
account: true,
|
|
4713
|
+
client_secret: true,
|
|
4714
|
+
expires_at: true,
|
|
4715
|
+
livemode: true
|
|
5077
4716
|
};
|
|
4717
|
+
fields.client_secret = true;
|
|
4718
|
+
let retValue = {};
|
|
5078
4719
|
try {
|
|
5079
4720
|
const response = await client.mutation({
|
|
5080
|
-
|
|
5081
|
-
__args: {
|
|
5082
|
-
input: newPicDto
|
|
5083
|
-
},
|
|
4721
|
+
createAthleteStripeSession: {
|
|
4722
|
+
__args: {},
|
|
5084
4723
|
...fields
|
|
5085
|
-
}
|
|
4724
|
+
}
|
|
5086
4725
|
});
|
|
5087
|
-
VTXBaseAPI.Logger.debug('
|
|
4726
|
+
VTXBaseAPI.Logger.debug('createAthleteStripeSession Response:');
|
|
5088
4727
|
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5089
|
-
retValue = (0, response_builder_1.buildResponse)(response, '
|
|
5090
|
-
|
|
4728
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteStripeSession', (r) => {
|
|
4729
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4730
|
+
const isResponseOk = true && response?.createAthleteStripeSession?.client_secret;
|
|
5091
4731
|
return isResponseOk;
|
|
5092
4732
|
});
|
|
5093
4733
|
}
|
|
5094
|
-
catch (
|
|
5095
|
-
VTXBaseAPI.Logger.error('
|
|
5096
|
-
VTXBaseAPI.Logger.error(
|
|
5097
|
-
retValue = (0, response_builder_1.buildErrorResponse)(
|
|
4734
|
+
catch (error1) {
|
|
4735
|
+
VTXBaseAPI.Logger.error('createAthleteStripeSession err1:');
|
|
4736
|
+
VTXBaseAPI.Logger.error(error1);
|
|
4737
|
+
retValue = (0, response_builder_1.buildErrorResponse)(error1);
|
|
5098
4738
|
}
|
|
5099
4739
|
return retValue;
|
|
5100
4740
|
}
|