@vertikalx/vtx-backend-client 1.0.0-dev-carlos.7 → 1.0.0-dev-geo.48
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/vtx-base-api.d.ts +3 -2
- package/src/api/vtx-base-api.js +64 -46
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +2 -67
- package/src/client/schema.graphql +1728 -0
- package/src/client/schema.js +2 -16
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +1 -34
- package/src/client/types.js +115 -202
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -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, AWSS3DeleteUseTypeFileDto, EditPictureDto, Album,
|
|
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, AWSS3DeleteUseTypeFileDto, EditPictureDto, Album, State, Country } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
export declare class VTXBaseAPI {
|
|
@@ -43,6 +43,8 @@ export declare class VTXBaseAPI {
|
|
|
43
43
|
findCityById(cityId: string): Promise<ITypedBackendResponse<City>>;
|
|
44
44
|
getSportLevels(): Promise<ITypedBackendResponse<SportLevel[]>>;
|
|
45
45
|
getSports(): Promise<ITypedBackendResponse<Sport[]>>;
|
|
46
|
+
getStates(): Promise<ITypedBackendResponse<State[]>>;
|
|
47
|
+
getCountries(): Promise<ITypedBackendResponse<Country[]>>;
|
|
46
48
|
loginUserFromCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<UserWithToken>>;
|
|
47
49
|
validateUserCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<User>>;
|
|
48
50
|
findAthleteForUser(loginEmail: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
@@ -81,5 +83,4 @@ export declare class VTXBaseAPI {
|
|
|
81
83
|
getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
|
|
82
84
|
getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
|
|
83
85
|
queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
|
|
84
|
-
getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<AthleteIntegrationReference>>;
|
|
85
86
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -1788,6 +1788,70 @@ class VTXBaseAPI {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
return retValue;
|
|
1790
1790
|
}
|
|
1791
|
+
async getStates() {
|
|
1792
|
+
const client = (0, client_1.createClient)({
|
|
1793
|
+
url: this.backendUrl + "/graphql",
|
|
1794
|
+
headers: this.headers,
|
|
1795
|
+
});
|
|
1796
|
+
const fields = {
|
|
1797
|
+
_id: true,
|
|
1798
|
+
name: true,
|
|
1799
|
+
};
|
|
1800
|
+
let retValue;
|
|
1801
|
+
try {
|
|
1802
|
+
const response = await client.query({
|
|
1803
|
+
getStates: {
|
|
1804
|
+
__args: {},
|
|
1805
|
+
...fields
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
VTXBaseAPI.Logger.debug('getStates Response:');
|
|
1809
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1810
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getStates', (r) => {
|
|
1811
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1812
|
+
const isResponseOk = true && Array.isArray(response?.getStates);
|
|
1813
|
+
return isResponseOk;
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
catch (err1) {
|
|
1817
|
+
VTXBaseAPI.Logger.error('getStates err1:');
|
|
1818
|
+
VTXBaseAPI.Logger.error(err1);
|
|
1819
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
1820
|
+
}
|
|
1821
|
+
return retValue;
|
|
1822
|
+
}
|
|
1823
|
+
async getCountries() {
|
|
1824
|
+
const client = (0, client_1.createClient)({
|
|
1825
|
+
url: this.backendUrl + "/graphql",
|
|
1826
|
+
headers: this.headers,
|
|
1827
|
+
});
|
|
1828
|
+
const fields = {
|
|
1829
|
+
_id: true,
|
|
1830
|
+
name: true,
|
|
1831
|
+
};
|
|
1832
|
+
let retValue;
|
|
1833
|
+
try {
|
|
1834
|
+
const response = await client.query({
|
|
1835
|
+
getCountries: {
|
|
1836
|
+
__args: {},
|
|
1837
|
+
...fields
|
|
1838
|
+
}
|
|
1839
|
+
});
|
|
1840
|
+
VTXBaseAPI.Logger.debug('getCountries Response:');
|
|
1841
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1842
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getCountries', (r) => {
|
|
1843
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
1844
|
+
const isResponseOk = true && Array.isArray(response?.getCountries);
|
|
1845
|
+
return isResponseOk;
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
catch (err1) {
|
|
1849
|
+
VTXBaseAPI.Logger.error('getCountries err1:');
|
|
1850
|
+
VTXBaseAPI.Logger.error(err1);
|
|
1851
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
1852
|
+
}
|
|
1853
|
+
return retValue;
|
|
1854
|
+
}
|
|
1791
1855
|
async loginUserFromCredentialsVtx(username, password) {
|
|
1792
1856
|
const client = (0, client_1.createClient)({
|
|
1793
1857
|
url: this.backendUrl + '/graphql',
|
|
@@ -6190,52 +6254,6 @@ class VTXBaseAPI {
|
|
|
6190
6254
|
}
|
|
6191
6255
|
return retValue;
|
|
6192
6256
|
}
|
|
6193
|
-
async getAthleteIntegrationsByAthlete() {
|
|
6194
|
-
const client = (0, client_1.createClient)({
|
|
6195
|
-
url: this.backendUrl + '/graphql',
|
|
6196
|
-
headers: this.headers,
|
|
6197
|
-
});
|
|
6198
|
-
let retValue = {};
|
|
6199
|
-
const fields = {
|
|
6200
|
-
_id: true,
|
|
6201
|
-
athlete: {
|
|
6202
|
-
_id: true,
|
|
6203
|
-
},
|
|
6204
|
-
hasStravaIntegration: true,
|
|
6205
|
-
stravaTokenExpires: true,
|
|
6206
|
-
stravaAthleteData: {
|
|
6207
|
-
id: true,
|
|
6208
|
-
username: true,
|
|
6209
|
-
firstname: true,
|
|
6210
|
-
lastname: true,
|
|
6211
|
-
bio: true,
|
|
6212
|
-
city: true,
|
|
6213
|
-
state: true,
|
|
6214
|
-
country: true,
|
|
6215
|
-
sex: true,
|
|
6216
|
-
premium: true,
|
|
6217
|
-
profile: true,
|
|
6218
|
-
created_at: true,
|
|
6219
|
-
updated_at: true,
|
|
6220
|
-
weight: true
|
|
6221
|
-
}
|
|
6222
|
-
};
|
|
6223
|
-
try {
|
|
6224
|
-
const response = await client.query({
|
|
6225
|
-
getAthleteIntegrationsByAthlete: {
|
|
6226
|
-
...fields
|
|
6227
|
-
},
|
|
6228
|
-
});
|
|
6229
|
-
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrationsByAthlete', (r) => {
|
|
6230
|
-
const isResponseOk = !!response?.getAthleteIntegrationsByAthlete?._id;
|
|
6231
|
-
return isResponseOk;
|
|
6232
|
-
});
|
|
6233
|
-
}
|
|
6234
|
-
catch (err) {
|
|
6235
|
-
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
6236
|
-
}
|
|
6237
|
-
return retValue;
|
|
6238
|
-
}
|
|
6239
6257
|
}
|
|
6240
6258
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
6241
6259
|
VTXBaseAPI.Logger = {
|