@vertikalx/vtx-backend-client 1.0.0-dev-daniel.160 → 1.0.0-dev-daniel.162
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/api-call-headers.d.ts +3 -3
- package/src/api/api-call-headers.js +3 -3
- package/src/api/api-call-headers.js.map +1 -1
- package/src/api/response-builder.js +8 -9
- package/src/api/response-builder.js.map +1 -1
- package/src/api/vtx-base-api.d.ts +7 -1
- package/src/api/vtx-base-api.js +334 -24
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/api/vtx-web-browser-api.js +2 -2
- package/src/api/vtx-web-browser-api.js.map +1 -1
- package/src/client/schema.d.ts +370 -16
- package/src/client/schema.graphql +191 -8
- package/src/client/schema.js +64 -1
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +205 -8
- package/src/client/types.js +598 -79
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@ export declare const DEFAULT_APP_KEY_HEADER = "io-stackbus-app-key";
|
|
|
9
9
|
export declare const DEFAULT_SYSTEM_USER_TOKEN_HEADER = "io-stackbus-cms-system-user-token";
|
|
10
10
|
export declare const DEFAULT_API_KEY_ID_HEADER = "io-stackbus-cms-api-key-id";
|
|
11
11
|
export declare const DEFAULT_API_KEY_VALUE_HEADER = "io-stackbus-cms-api-key-value";
|
|
12
|
-
export declare const DEFAULT_PROD_URL = "https://backend.
|
|
13
|
-
export declare const DEFAULT_PREPROD_URL = "https://backend.
|
|
14
|
-
export declare const DEFAULT_DEV_REMOTE_URL = "https://backend.
|
|
12
|
+
export declare const DEFAULT_PROD_URL = "https://backend.vtxapp.net:3010";
|
|
13
|
+
export declare const DEFAULT_PREPROD_URL = "https://backend.vtxapp.net:3010";
|
|
14
|
+
export declare const DEFAULT_DEV_REMOTE_URL = "https://backend.vtxapp.net:3010";
|
|
15
15
|
export declare const DEFAULT_DEV_LOCAL_URL = "http://localhost:3010";
|
|
16
16
|
export declare const DEFAULT_HEADERS: APICallHeaders;
|
|
@@ -9,9 +9,9 @@ exports.DEFAULT_APP_KEY_HEADER = 'io-stackbus-app-key';
|
|
|
9
9
|
exports.DEFAULT_SYSTEM_USER_TOKEN_HEADER = 'io-stackbus-cms-system-user-token';
|
|
10
10
|
exports.DEFAULT_API_KEY_ID_HEADER = 'io-stackbus-cms-api-key-id';
|
|
11
11
|
exports.DEFAULT_API_KEY_VALUE_HEADER = 'io-stackbus-cms-api-key-value';
|
|
12
|
-
exports.DEFAULT_PROD_URL = 'https://backend.
|
|
13
|
-
exports.DEFAULT_PREPROD_URL = 'https://backend.
|
|
14
|
-
exports.DEFAULT_DEV_REMOTE_URL = 'https://backend.
|
|
12
|
+
exports.DEFAULT_PROD_URL = 'https://backend.vtxapp.net:3010';
|
|
13
|
+
exports.DEFAULT_PREPROD_URL = 'https://backend.vtxapp.net:3010';
|
|
14
|
+
exports.DEFAULT_DEV_REMOTE_URL = 'https://backend.vtxapp.net:3010';
|
|
15
15
|
exports.DEFAULT_DEV_LOCAL_URL = 'http://localhost:3010';
|
|
16
16
|
exports.DEFAULT_HEADERS = {
|
|
17
17
|
["Content-Type"]: "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-call-headers.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/api-call-headers.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAG1B,QAAA,wBAAwB,GAAG,2BAA2B,CAAC;AAGvD,QAAA,8BAA8B,GAAG,iCAAiC,CAAC;AAGnE,QAAA,+BAA+B,GAAG,kCAAkC,CAAC;AAGrE,QAAA,sBAAsB,GAAG,qBAAqB,CAAC;AAG/C,QAAA,gCAAgC,GAAG,mCAAmC,CAAC;AAGvE,QAAA,yBAAyB,GAAG,4BAA4B,CAAC;AAGzD,QAAA,4BAA4B,GAAG,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"api-call-headers.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/api/api-call-headers.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAG1B,QAAA,wBAAwB,GAAG,2BAA2B,CAAC;AAGvD,QAAA,8BAA8B,GAAG,iCAAiC,CAAC;AAGnE,QAAA,+BAA+B,GAAG,kCAAkC,CAAC;AAGrE,QAAA,sBAAsB,GAAG,qBAAqB,CAAC;AAG/C,QAAA,gCAAgC,GAAG,mCAAmC,CAAC;AAGvE,QAAA,yBAAyB,GAAG,4BAA4B,CAAC;AAGzD,QAAA,4BAA4B,GAAG,+BAA+B,CAAC;AAS/D,QAAA,gBAAgB,GAAG,iCAAiC,CAAC;AACrD,QAAA,mBAAmB,GAAG,iCAAiC,CAAC;AACxD,QAAA,sBAAsB,GAAG,iCAAiC,CAAC;AAC3D,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAGhD,QAAA,eAAe,GAAkB;IAC1C,CAAC,cAAc,CAAC,EAAC,kBAAkB;IACnC,CAAC,gCAAwB,CAAC,EAAC,yBAAiB;CAC/C,CAAC"}
|
|
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.buildResponse = buildResponse;
|
|
4
4
|
exports.buildErrorResponse = buildErrorResponse;
|
|
5
5
|
const vtx_core_common_1 = require("@vertikalx/vtx-core-common");
|
|
6
|
+
const Logger = {
|
|
7
|
+
log: (msg) => {
|
|
8
|
+
}
|
|
9
|
+
};
|
|
6
10
|
function buildResponse(response, rootProperty, checker) {
|
|
7
11
|
const retValue = {};
|
|
8
12
|
if (checker(response)) {
|
|
9
|
-
console.log('checker 1');
|
|
10
13
|
try {
|
|
11
14
|
retValue.data = response[rootProperty];
|
|
12
15
|
}
|
|
13
16
|
catch (casterr) {
|
|
14
|
-
|
|
17
|
+
Logger.log('Error trying to cast to return type');
|
|
15
18
|
retValue.error = {
|
|
16
19
|
httpStatus: 500,
|
|
17
20
|
code: vtx_core_common_1.VTX_ERRORS.VTX_SERVER_ERROR.code,
|
|
@@ -26,7 +29,6 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
else if (response?.errors) {
|
|
29
|
-
console.log('checker 2');
|
|
30
32
|
if (Array.isArray(response.errors)) {
|
|
31
33
|
retValue.rawErrors = response.errors;
|
|
32
34
|
}
|
|
@@ -35,7 +37,6 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
else if (response?.error) {
|
|
38
|
-
console.log('checker 3');
|
|
39
40
|
if (Array.isArray(response.error)) {
|
|
40
41
|
retValue.rawErrors = response.error;
|
|
41
42
|
}
|
|
@@ -44,12 +45,11 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
else if (checker(response?.data)) {
|
|
47
|
-
console.log('checker 4');
|
|
48
48
|
try {
|
|
49
49
|
retValue.data = response.data[rootProperty];
|
|
50
50
|
}
|
|
51
51
|
catch (casterr) {
|
|
52
|
-
|
|
52
|
+
Logger.log('Error trying to cast to return type');
|
|
53
53
|
retValue.error = {
|
|
54
54
|
httpStatus: 500,
|
|
55
55
|
code: vtx_core_common_1.VTX_ERRORS.VTX_SERVER_ERROR.code,
|
|
@@ -64,7 +64,6 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
|
-
console.log('checker 5');
|
|
68
67
|
retValue.error = {
|
|
69
68
|
httpStatus: 500,
|
|
70
69
|
code: vtx_core_common_1.VTX_ERRORS.VTX_SERVER_ERROR.code,
|
|
@@ -72,8 +71,8 @@ function buildResponse(response, rootProperty, checker) {
|
|
|
72
71
|
};
|
|
73
72
|
retValue.rawErrors = ['Error: Obtained incorrect data from Backend'];
|
|
74
73
|
}
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
Logger.log('buildResponse retValue:');
|
|
75
|
+
Logger.log(JSON.stringify(retValue, null, 2));
|
|
77
76
|
return retValue;
|
|
78
77
|
}
|
|
79
78
|
function buildErrorResponse(error) {
|
|
@@ -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,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YAClD,QAAQ,CAAC,KAAK,GAAG;gBACf,UAAU,EAAC,GAAG;gBACd,IAAI,EAAC,4BAAU,CAAC,gBAAgB,CAAC,IAAI;gBACrC,OAAO,EAAC,6CAA6C;aACtD,CAAC;YACF,QAAQ,CAAC,SAAS,GAAG;gBACnB;oBACE,IAAI,EAAC,QAAQ;oBACb,KAAK,EAAC,OAAO;iBACd;aACF,CAAC;QACJ,CAAC;IAEH,CAAC;SAAM,IAAI,QAAQ,EAAE,MAAM,EAAE,CAAC;QAG5B,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,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EnC,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,4 +1,4 @@
|
|
|
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 } from '../client';
|
|
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 } from '../client';
|
|
2
2
|
import { ITypedBackendResponse } from './backend-response';
|
|
3
3
|
import { APICallHeaders } from './api-call-headers';
|
|
4
4
|
export declare class VTXBaseAPI {
|
|
@@ -51,4 +51,10 @@ export declare class VTXBaseAPI {
|
|
|
51
51
|
getRecommendedAthletes(loginEmail: string): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
52
52
|
getSponsorAthletesForTenant(): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
53
53
|
getUserImagesFromEmail(loginEmail: string): Promise<ITypedBackendResponse<UserImages>>;
|
|
54
|
+
editAboutMe(newValue: string): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
55
|
+
editProfileValue(newValue: string, field: string): Promise<ITypedBackendResponse<EditValueResponse>>;
|
|
56
|
+
addAthleteCompetition(dto: CreateAthleteCompetitionDto): Promise<ITypedBackendResponse<AthleteCompetition>>;
|
|
57
|
+
getSportsEvents(dto: GetSportEventsDto): Promise<ITypedBackendResponse<SportsEvent[]>>;
|
|
58
|
+
createSportsEvent(dto: CreateSportEventDto): Promise<ITypedBackendResponse<SportsEvent>>;
|
|
59
|
+
getAthleteCompetitions(dto: GetAthleteCompetitionsDto): Promise<ITypedBackendResponse<AthleteCompetition[]>>;
|
|
54
60
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -206,6 +206,7 @@ class VTXBaseAPI {
|
|
|
206
206
|
},
|
|
207
207
|
trainer: true,
|
|
208
208
|
trainerUrl: true,
|
|
209
|
+
aboutMe: true,
|
|
209
210
|
followStats: {
|
|
210
211
|
followers: true,
|
|
211
212
|
followed: true,
|
|
@@ -329,14 +330,13 @@ class VTXBaseAPI {
|
|
|
329
330
|
key: true
|
|
330
331
|
}
|
|
331
332
|
},
|
|
332
|
-
|
|
333
|
-
date: true,
|
|
333
|
+
participationDate: true,
|
|
334
334
|
result: {
|
|
335
335
|
_id: true,
|
|
336
|
-
|
|
336
|
+
resultType: true,
|
|
337
337
|
position: true,
|
|
338
338
|
score: true,
|
|
339
|
-
|
|
339
|
+
finishTimeMS: true,
|
|
340
340
|
resultWebLink: true
|
|
341
341
|
}
|
|
342
342
|
},
|
|
@@ -891,6 +891,13 @@ class VTXBaseAPI {
|
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
},
|
|
894
|
+
sponsorshipItems: {
|
|
895
|
+
_id: true,
|
|
896
|
+
quantity: true,
|
|
897
|
+
title: true,
|
|
898
|
+
value: true,
|
|
899
|
+
type: true
|
|
900
|
+
},
|
|
894
901
|
deadline: true,
|
|
895
902
|
startDate: true,
|
|
896
903
|
duration: {
|
|
@@ -1105,6 +1112,13 @@ class VTXBaseAPI {
|
|
|
1105
1112
|
}
|
|
1106
1113
|
}
|
|
1107
1114
|
},
|
|
1115
|
+
sponsorshipItems: {
|
|
1116
|
+
_id: true,
|
|
1117
|
+
quantity: true,
|
|
1118
|
+
title: true,
|
|
1119
|
+
value: true,
|
|
1120
|
+
type: true
|
|
1121
|
+
},
|
|
1108
1122
|
deadline: true,
|
|
1109
1123
|
startDate: true,
|
|
1110
1124
|
duration: {
|
|
@@ -1890,6 +1904,7 @@ class VTXBaseAPI {
|
|
|
1890
1904
|
},
|
|
1891
1905
|
trainer: true,
|
|
1892
1906
|
trainerUrl: true,
|
|
1907
|
+
aboutMe: true,
|
|
1893
1908
|
followStats: {
|
|
1894
1909
|
followers: true,
|
|
1895
1910
|
followed: true,
|
|
@@ -2013,14 +2028,13 @@ class VTXBaseAPI {
|
|
|
2013
2028
|
key: true
|
|
2014
2029
|
}
|
|
2015
2030
|
},
|
|
2016
|
-
|
|
2017
|
-
date: true,
|
|
2031
|
+
participationDate: true,
|
|
2018
2032
|
result: {
|
|
2019
2033
|
_id: true,
|
|
2020
|
-
|
|
2034
|
+
resultType: true,
|
|
2021
2035
|
position: true,
|
|
2022
2036
|
score: true,
|
|
2023
|
-
|
|
2037
|
+
finishTimeMS: true,
|
|
2024
2038
|
resultWebLink: true
|
|
2025
2039
|
}
|
|
2026
2040
|
},
|
|
@@ -2176,6 +2190,7 @@ class VTXBaseAPI {
|
|
|
2176
2190
|
},
|
|
2177
2191
|
trainer: true,
|
|
2178
2192
|
trainerUrl: true,
|
|
2193
|
+
aboutMe: true,
|
|
2179
2194
|
followStats: {
|
|
2180
2195
|
followers: true,
|
|
2181
2196
|
followed: true,
|
|
@@ -2299,14 +2314,13 @@ class VTXBaseAPI {
|
|
|
2299
2314
|
key: true
|
|
2300
2315
|
}
|
|
2301
2316
|
},
|
|
2302
|
-
|
|
2303
|
-
date: true,
|
|
2317
|
+
participationDate: true,
|
|
2304
2318
|
result: {
|
|
2305
2319
|
_id: true,
|
|
2306
|
-
|
|
2320
|
+
resultType: true,
|
|
2307
2321
|
position: true,
|
|
2308
2322
|
score: true,
|
|
2309
|
-
|
|
2323
|
+
finishTimeMS: true,
|
|
2310
2324
|
resultWebLink: true
|
|
2311
2325
|
}
|
|
2312
2326
|
},
|
|
@@ -2399,6 +2413,7 @@ class VTXBaseAPI {
|
|
|
2399
2413
|
},
|
|
2400
2414
|
trainer: true,
|
|
2401
2415
|
trainerUrl: true,
|
|
2416
|
+
aboutMe: true,
|
|
2402
2417
|
followStats: {
|
|
2403
2418
|
followers: true,
|
|
2404
2419
|
followed: true,
|
|
@@ -2522,14 +2537,13 @@ class VTXBaseAPI {
|
|
|
2522
2537
|
key: true
|
|
2523
2538
|
}
|
|
2524
2539
|
},
|
|
2525
|
-
|
|
2526
|
-
date: true,
|
|
2540
|
+
participationDate: true,
|
|
2527
2541
|
result: {
|
|
2528
2542
|
_id: true,
|
|
2529
|
-
|
|
2543
|
+
resultType: true,
|
|
2530
2544
|
position: true,
|
|
2531
2545
|
score: true,
|
|
2532
|
-
|
|
2546
|
+
finishTimeMS: true,
|
|
2533
2547
|
resultWebLink: true
|
|
2534
2548
|
}
|
|
2535
2549
|
},
|
|
@@ -2624,6 +2638,7 @@ class VTXBaseAPI {
|
|
|
2624
2638
|
},
|
|
2625
2639
|
trainer: true,
|
|
2626
2640
|
trainerUrl: true,
|
|
2641
|
+
aboutMe: true,
|
|
2627
2642
|
followStats: {
|
|
2628
2643
|
followers: true,
|
|
2629
2644
|
followed: true,
|
|
@@ -2747,14 +2762,13 @@ class VTXBaseAPI {
|
|
|
2747
2762
|
key: true
|
|
2748
2763
|
}
|
|
2749
2764
|
},
|
|
2750
|
-
|
|
2751
|
-
date: true,
|
|
2765
|
+
participationDate: true,
|
|
2752
2766
|
result: {
|
|
2753
2767
|
_id: true,
|
|
2754
|
-
|
|
2768
|
+
resultType: true,
|
|
2755
2769
|
position: true,
|
|
2756
2770
|
score: true,
|
|
2757
|
-
|
|
2771
|
+
finishTimeMS: true,
|
|
2758
2772
|
resultWebLink: true
|
|
2759
2773
|
}
|
|
2760
2774
|
},
|
|
@@ -2849,6 +2863,7 @@ class VTXBaseAPI {
|
|
|
2849
2863
|
},
|
|
2850
2864
|
trainer: true,
|
|
2851
2865
|
trainerUrl: true,
|
|
2866
|
+
aboutMe: true,
|
|
2852
2867
|
followStats: {
|
|
2853
2868
|
followers: true,
|
|
2854
2869
|
followed: true,
|
|
@@ -2972,14 +2987,13 @@ class VTXBaseAPI {
|
|
|
2972
2987
|
key: true
|
|
2973
2988
|
}
|
|
2974
2989
|
},
|
|
2975
|
-
|
|
2976
|
-
date: true,
|
|
2990
|
+
participationDate: true,
|
|
2977
2991
|
result: {
|
|
2978
2992
|
_id: true,
|
|
2979
|
-
|
|
2993
|
+
resultType: true,
|
|
2980
2994
|
position: true,
|
|
2981
2995
|
score: true,
|
|
2982
|
-
|
|
2996
|
+
finishTimeMS: true,
|
|
2983
2997
|
resultWebLink: true
|
|
2984
2998
|
}
|
|
2985
2999
|
},
|
|
@@ -3062,6 +3076,302 @@ class VTXBaseAPI {
|
|
|
3062
3076
|
}
|
|
3063
3077
|
return retValue;
|
|
3064
3078
|
}
|
|
3079
|
+
async editAboutMe(newValue) {
|
|
3080
|
+
console.log('HEADERS:');
|
|
3081
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
3082
|
+
const client = (0, client_1.createClient)({
|
|
3083
|
+
url: this.backendUrl + '/graphql',
|
|
3084
|
+
headers: this.headers,
|
|
3085
|
+
});
|
|
3086
|
+
let retValue = {};
|
|
3087
|
+
const fields = {
|
|
3088
|
+
field: true,
|
|
3089
|
+
oldValue: true,
|
|
3090
|
+
newValue: true,
|
|
3091
|
+
changed: true
|
|
3092
|
+
};
|
|
3093
|
+
const dto = {
|
|
3094
|
+
field: 'aboutMe',
|
|
3095
|
+
newValue: newValue
|
|
3096
|
+
};
|
|
3097
|
+
try {
|
|
3098
|
+
const response = await client.mutation({
|
|
3099
|
+
editProfileValue: {
|
|
3100
|
+
__args: {
|
|
3101
|
+
input: dto
|
|
3102
|
+
},
|
|
3103
|
+
...fields
|
|
3104
|
+
},
|
|
3105
|
+
});
|
|
3106
|
+
VTXBaseAPI.Logger.debug('editProfileValue Response:');
|
|
3107
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3108
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editProfileValue', (r) => {
|
|
3109
|
+
const isResponseOk = true && response?.editProfileValue?.field;
|
|
3110
|
+
return isResponseOk;
|
|
3111
|
+
});
|
|
3112
|
+
}
|
|
3113
|
+
catch (err1) {
|
|
3114
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
3115
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3116
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3117
|
+
}
|
|
3118
|
+
return retValue;
|
|
3119
|
+
}
|
|
3120
|
+
async editProfileValue(newValue, field) {
|
|
3121
|
+
const client = (0, client_1.createClient)({
|
|
3122
|
+
url: this.backendUrl + '/graphql',
|
|
3123
|
+
headers: this.headers,
|
|
3124
|
+
});
|
|
3125
|
+
let retValue = {};
|
|
3126
|
+
const fields = {
|
|
3127
|
+
field: true,
|
|
3128
|
+
oldValue: true,
|
|
3129
|
+
newValue: true,
|
|
3130
|
+
changed: true
|
|
3131
|
+
};
|
|
3132
|
+
const dto = {
|
|
3133
|
+
field: field,
|
|
3134
|
+
newValue: newValue
|
|
3135
|
+
};
|
|
3136
|
+
try {
|
|
3137
|
+
const response = await client.mutation({
|
|
3138
|
+
editProfileValue: {
|
|
3139
|
+
__args: {
|
|
3140
|
+
input: dto
|
|
3141
|
+
},
|
|
3142
|
+
...fields
|
|
3143
|
+
},
|
|
3144
|
+
});
|
|
3145
|
+
VTXBaseAPI.Logger.debug('editProfileValue Response:');
|
|
3146
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3147
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editProfileValue', (r) => {
|
|
3148
|
+
const isResponseOk = true && response?.editProfileValue?.field;
|
|
3149
|
+
return isResponseOk;
|
|
3150
|
+
});
|
|
3151
|
+
}
|
|
3152
|
+
catch (err1) {
|
|
3153
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
3154
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3155
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3156
|
+
}
|
|
3157
|
+
return retValue;
|
|
3158
|
+
}
|
|
3159
|
+
async addAthleteCompetition(dto) {
|
|
3160
|
+
console.log('HEADERS:');
|
|
3161
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
3162
|
+
const client = (0, client_1.createClient)({
|
|
3163
|
+
url: this.backendUrl + '/graphql',
|
|
3164
|
+
headers: this.headers,
|
|
3165
|
+
});
|
|
3166
|
+
let retValue = {};
|
|
3167
|
+
const fields = {
|
|
3168
|
+
_id: true,
|
|
3169
|
+
event: {
|
|
3170
|
+
_id: true,
|
|
3171
|
+
name: true,
|
|
3172
|
+
eventWebSite: true,
|
|
3173
|
+
startDate: true,
|
|
3174
|
+
endDate: true,
|
|
3175
|
+
verified: true,
|
|
3176
|
+
banner: {
|
|
3177
|
+
_id: true,
|
|
3178
|
+
name: true,
|
|
3179
|
+
contentType: true,
|
|
3180
|
+
size: true,
|
|
3181
|
+
useType: true,
|
|
3182
|
+
url: true,
|
|
3183
|
+
key: true
|
|
3184
|
+
},
|
|
3185
|
+
},
|
|
3186
|
+
participationDate: true,
|
|
3187
|
+
competitionNumber: true,
|
|
3188
|
+
result: {
|
|
3189
|
+
resultType: true,
|
|
3190
|
+
position: true,
|
|
3191
|
+
score: true,
|
|
3192
|
+
finishTimeMS: true,
|
|
3193
|
+
resultWebLink: true
|
|
3194
|
+
},
|
|
3195
|
+
fundRaisingCampaignId: true
|
|
3196
|
+
};
|
|
3197
|
+
try {
|
|
3198
|
+
const response = await client.mutation({
|
|
3199
|
+
addAthleteCompetition: {
|
|
3200
|
+
__args: {
|
|
3201
|
+
input: dto
|
|
3202
|
+
},
|
|
3203
|
+
...fields
|
|
3204
|
+
},
|
|
3205
|
+
});
|
|
3206
|
+
VTXBaseAPI.Logger.debug('addAthleteCompetition Response:');
|
|
3207
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3208
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'addAthleteCompetition', (r) => {
|
|
3209
|
+
const isResponseOk = true && response?.addAthleteCompetition?._id;
|
|
3210
|
+
return isResponseOk;
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
catch (err1) {
|
|
3214
|
+
VTXBaseAPI.Logger.error('addAthleteCompetition err1:');
|
|
3215
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3216
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3217
|
+
}
|
|
3218
|
+
return retValue;
|
|
3219
|
+
}
|
|
3220
|
+
async getSportsEvents(dto) {
|
|
3221
|
+
const client = (0, client_1.createClient)({
|
|
3222
|
+
url: this.backendUrl + "/graphql",
|
|
3223
|
+
headers: this.headers,
|
|
3224
|
+
});
|
|
3225
|
+
const fields = {
|
|
3226
|
+
_id: true,
|
|
3227
|
+
name: true,
|
|
3228
|
+
eventWebSite: true,
|
|
3229
|
+
startDate: true,
|
|
3230
|
+
endDate: true,
|
|
3231
|
+
verified: true,
|
|
3232
|
+
banner: {
|
|
3233
|
+
_id: true,
|
|
3234
|
+
name: true,
|
|
3235
|
+
contentType: true,
|
|
3236
|
+
size: true,
|
|
3237
|
+
useType: true,
|
|
3238
|
+
url: true,
|
|
3239
|
+
key: true
|
|
3240
|
+
}
|
|
3241
|
+
};
|
|
3242
|
+
let retValue;
|
|
3243
|
+
try {
|
|
3244
|
+
const response = await client.query({
|
|
3245
|
+
getSportsEvents: {
|
|
3246
|
+
__args: {
|
|
3247
|
+
input: dto
|
|
3248
|
+
},
|
|
3249
|
+
...fields
|
|
3250
|
+
}
|
|
3251
|
+
});
|
|
3252
|
+
VTXBaseAPI.Logger.debug('getSportsEvents Response:');
|
|
3253
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3254
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getSportsEvents', (r) => {
|
|
3255
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3256
|
+
const isResponseOk = true && Array.isArray(response?.getSportsEvents);
|
|
3257
|
+
return isResponseOk;
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3260
|
+
catch (err1) {
|
|
3261
|
+
VTXBaseAPI.Logger.error('getSportsEvents err1:');
|
|
3262
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3263
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3264
|
+
}
|
|
3265
|
+
return retValue;
|
|
3266
|
+
}
|
|
3267
|
+
async createSportsEvent(dto) {
|
|
3268
|
+
console.log('HEADERS:');
|
|
3269
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
3270
|
+
const client = (0, client_1.createClient)({
|
|
3271
|
+
url: this.backendUrl + '/graphql',
|
|
3272
|
+
headers: this.headers,
|
|
3273
|
+
});
|
|
3274
|
+
let retValue = {};
|
|
3275
|
+
const fields = {
|
|
3276
|
+
_id: true,
|
|
3277
|
+
name: true,
|
|
3278
|
+
eventWebSite: true,
|
|
3279
|
+
startDate: true,
|
|
3280
|
+
endDate: true,
|
|
3281
|
+
verified: true,
|
|
3282
|
+
banner: {
|
|
3283
|
+
_id: true,
|
|
3284
|
+
name: true,
|
|
3285
|
+
contentType: true,
|
|
3286
|
+
size: true,
|
|
3287
|
+
useType: true,
|
|
3288
|
+
url: true,
|
|
3289
|
+
key: true
|
|
3290
|
+
},
|
|
3291
|
+
};
|
|
3292
|
+
try {
|
|
3293
|
+
const response = await client.mutation({
|
|
3294
|
+
createSportsEvent: {
|
|
3295
|
+
__args: {
|
|
3296
|
+
input: dto
|
|
3297
|
+
},
|
|
3298
|
+
...fields
|
|
3299
|
+
},
|
|
3300
|
+
});
|
|
3301
|
+
VTXBaseAPI.Logger.debug('createSportsEvent Response:');
|
|
3302
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3303
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createSportsEvent', (r) => {
|
|
3304
|
+
const isResponseOk = true && response?.createSportsEvent?._id;
|
|
3305
|
+
return isResponseOk;
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
catch (err1) {
|
|
3309
|
+
VTXBaseAPI.Logger.error('createSportsEvent err1:');
|
|
3310
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3311
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3312
|
+
}
|
|
3313
|
+
return retValue;
|
|
3314
|
+
}
|
|
3315
|
+
async getAthleteCompetitions(dto) {
|
|
3316
|
+
const client = (0, client_1.createClient)({
|
|
3317
|
+
url: this.backendUrl + "/graphql",
|
|
3318
|
+
headers: this.headers,
|
|
3319
|
+
});
|
|
3320
|
+
const fields = {
|
|
3321
|
+
_id: true,
|
|
3322
|
+
event: {
|
|
3323
|
+
_id: true,
|
|
3324
|
+
name: true,
|
|
3325
|
+
eventWebSite: true,
|
|
3326
|
+
startDate: true,
|
|
3327
|
+
endDate: true,
|
|
3328
|
+
verified: true,
|
|
3329
|
+
banner: {
|
|
3330
|
+
_id: true,
|
|
3331
|
+
name: true,
|
|
3332
|
+
contentType: true,
|
|
3333
|
+
size: true,
|
|
3334
|
+
useType: true,
|
|
3335
|
+
url: true,
|
|
3336
|
+
key: true
|
|
3337
|
+
},
|
|
3338
|
+
},
|
|
3339
|
+
participationDate: true,
|
|
3340
|
+
competitionNumber: true,
|
|
3341
|
+
result: {
|
|
3342
|
+
resultType: true,
|
|
3343
|
+
position: true,
|
|
3344
|
+
score: true,
|
|
3345
|
+
finishTimeMS: true,
|
|
3346
|
+
resultWebLink: true
|
|
3347
|
+
},
|
|
3348
|
+
fundRaisingCampaignId: true
|
|
3349
|
+
};
|
|
3350
|
+
let retValue;
|
|
3351
|
+
try {
|
|
3352
|
+
const response = await client.query({
|
|
3353
|
+
getAthleteCompetitions: {
|
|
3354
|
+
__args: {
|
|
3355
|
+
input: dto
|
|
3356
|
+
},
|
|
3357
|
+
...fields
|
|
3358
|
+
}
|
|
3359
|
+
});
|
|
3360
|
+
VTXBaseAPI.Logger.debug('getSportsEvents Response:');
|
|
3361
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3362
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteCompetitions', (r) => {
|
|
3363
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
3364
|
+
const isResponseOk = true && Array.isArray(response?.getAthleteCompetitions);
|
|
3365
|
+
return isResponseOk;
|
|
3366
|
+
});
|
|
3367
|
+
}
|
|
3368
|
+
catch (err1) {
|
|
3369
|
+
VTXBaseAPI.Logger.error('getAthleteCompetitions err1:');
|
|
3370
|
+
VTXBaseAPI.Logger.error(err1);
|
|
3371
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
3372
|
+
}
|
|
3373
|
+
return retValue;
|
|
3374
|
+
}
|
|
3065
3375
|
}
|
|
3066
3376
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
3067
3377
|
VTXBaseAPI.Logger = {
|