@vertikalx/vtx-backend-client 1.0.0-dev-daniel.158 → 1.0.0-dev-daniel.160
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 +1 -0
- package/src/api/vtx-base-api.js +423 -7
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +6 -0
- package/src/client/schema.graphql +1 -0
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +3 -0
- package/src/client/types.js +9 -0
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -47,6 +47,7 @@ export declare class VTXBaseAPI {
|
|
|
47
47
|
findAthleteForUser(loginEmail: string): Promise<ITypedBackendResponse<Athlete>>;
|
|
48
48
|
getBrands(): Promise<ITypedBackendResponse<Brand[]>>;
|
|
49
49
|
getAthletes(): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
50
|
+
searchAthletes(searchString: string): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
50
51
|
getRecommendedAthletes(loginEmail: string): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
51
52
|
getSponsorAthletesForTenant(): Promise<ITypedBackendResponse<Athlete[]>>;
|
|
52
53
|
getUserImagesFromEmail(loginEmail: string): Promise<ITypedBackendResponse<UserImages>>;
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -815,7 +815,81 @@ class VTXBaseAPI {
|
|
|
815
815
|
},
|
|
816
816
|
criteria: {
|
|
817
817
|
_id: true,
|
|
818
|
-
label: true
|
|
818
|
+
label: true,
|
|
819
|
+
qualifications: {
|
|
820
|
+
on_AgeQualification: {
|
|
821
|
+
type: true,
|
|
822
|
+
value: true,
|
|
823
|
+
operator: true
|
|
824
|
+
},
|
|
825
|
+
on_DistanceQualification: {
|
|
826
|
+
type: true,
|
|
827
|
+
maxDistance: true,
|
|
828
|
+
latitude: true,
|
|
829
|
+
longitude: true
|
|
830
|
+
},
|
|
831
|
+
on_GenderQualification: {
|
|
832
|
+
type: true,
|
|
833
|
+
operator: true,
|
|
834
|
+
values: true
|
|
835
|
+
},
|
|
836
|
+
on_LocationQualification: {
|
|
837
|
+
type: true,
|
|
838
|
+
operator: true,
|
|
839
|
+
countries: {
|
|
840
|
+
_id: true,
|
|
841
|
+
name: true
|
|
842
|
+
},
|
|
843
|
+
states: {
|
|
844
|
+
_id: true,
|
|
845
|
+
name: true,
|
|
846
|
+
country: {
|
|
847
|
+
_id: true,
|
|
848
|
+
name: true
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
cities: {
|
|
852
|
+
_id: true,
|
|
853
|
+
name: true,
|
|
854
|
+
localizedName: true,
|
|
855
|
+
state: {
|
|
856
|
+
_id: true,
|
|
857
|
+
name: true,
|
|
858
|
+
country: {
|
|
859
|
+
_id: true,
|
|
860
|
+
name: true
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
latitude: true,
|
|
864
|
+
longitude: true,
|
|
865
|
+
timezone: true
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
on_NationalityQualification: {
|
|
869
|
+
type: true,
|
|
870
|
+
operator: true,
|
|
871
|
+
countries: {
|
|
872
|
+
_id: true,
|
|
873
|
+
name: true
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
on_ScoreQualification: {
|
|
877
|
+
type: true,
|
|
878
|
+
scoreType: true,
|
|
879
|
+
operator: true,
|
|
880
|
+
value: true
|
|
881
|
+
},
|
|
882
|
+
on_SportsLevelQualification: {
|
|
883
|
+
type: true,
|
|
884
|
+
operator: true,
|
|
885
|
+
level: true
|
|
886
|
+
},
|
|
887
|
+
on_SportsQualification: {
|
|
888
|
+
type: true,
|
|
889
|
+
sports: true,
|
|
890
|
+
operator: true
|
|
891
|
+
}
|
|
892
|
+
}
|
|
819
893
|
},
|
|
820
894
|
deadline: true,
|
|
821
895
|
startDate: true,
|
|
@@ -908,7 +982,42 @@ class VTXBaseAPI {
|
|
|
908
982
|
_id: true,
|
|
909
983
|
title: true,
|
|
910
984
|
description: true,
|
|
911
|
-
|
|
985
|
+
cashValue: true,
|
|
986
|
+
otherValue: true,
|
|
987
|
+
brand: {
|
|
988
|
+
_id: true,
|
|
989
|
+
name: true,
|
|
990
|
+
slogan: true,
|
|
991
|
+
website: true,
|
|
992
|
+
description: true,
|
|
993
|
+
approved: true,
|
|
994
|
+
published: true,
|
|
995
|
+
logo: {
|
|
996
|
+
_id: true,
|
|
997
|
+
name: true,
|
|
998
|
+
contentType: true,
|
|
999
|
+
size: true,
|
|
1000
|
+
useType: true,
|
|
1001
|
+
url: true,
|
|
1002
|
+
key: true
|
|
1003
|
+
},
|
|
1004
|
+
banner: {
|
|
1005
|
+
_id: true,
|
|
1006
|
+
name: true,
|
|
1007
|
+
contentType: true,
|
|
1008
|
+
size: true,
|
|
1009
|
+
useType: true,
|
|
1010
|
+
url: true,
|
|
1011
|
+
key: true
|
|
1012
|
+
},
|
|
1013
|
+
stats: {
|
|
1014
|
+
campaigns: true,
|
|
1015
|
+
sponsorships: true,
|
|
1016
|
+
sports: true,
|
|
1017
|
+
athletes: true
|
|
1018
|
+
},
|
|
1019
|
+
operatorIds: true
|
|
1020
|
+
},
|
|
912
1021
|
banner: {
|
|
913
1022
|
_id: true,
|
|
914
1023
|
name: true,
|
|
@@ -918,6 +1027,92 @@ class VTXBaseAPI {
|
|
|
918
1027
|
url: true,
|
|
919
1028
|
key: true
|
|
920
1029
|
},
|
|
1030
|
+
criteria: {
|
|
1031
|
+
_id: true,
|
|
1032
|
+
label: true,
|
|
1033
|
+
qualifications: {
|
|
1034
|
+
on_AgeQualification: {
|
|
1035
|
+
type: true,
|
|
1036
|
+
value: true,
|
|
1037
|
+
operator: true
|
|
1038
|
+
},
|
|
1039
|
+
on_DistanceQualification: {
|
|
1040
|
+
type: true,
|
|
1041
|
+
maxDistance: true,
|
|
1042
|
+
latitude: true,
|
|
1043
|
+
longitude: true
|
|
1044
|
+
},
|
|
1045
|
+
on_GenderQualification: {
|
|
1046
|
+
type: true,
|
|
1047
|
+
operator: true,
|
|
1048
|
+
values: true
|
|
1049
|
+
},
|
|
1050
|
+
on_LocationQualification: {
|
|
1051
|
+
type: true,
|
|
1052
|
+
operator: true,
|
|
1053
|
+
countries: {
|
|
1054
|
+
_id: true,
|
|
1055
|
+
name: true
|
|
1056
|
+
},
|
|
1057
|
+
states: {
|
|
1058
|
+
_id: true,
|
|
1059
|
+
name: true,
|
|
1060
|
+
country: {
|
|
1061
|
+
_id: true,
|
|
1062
|
+
name: true
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
cities: {
|
|
1066
|
+
_id: true,
|
|
1067
|
+
name: true,
|
|
1068
|
+
localizedName: true,
|
|
1069
|
+
state: {
|
|
1070
|
+
_id: true,
|
|
1071
|
+
name: true,
|
|
1072
|
+
country: {
|
|
1073
|
+
_id: true,
|
|
1074
|
+
name: true
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
latitude: true,
|
|
1078
|
+
longitude: true,
|
|
1079
|
+
timezone: true
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
on_NationalityQualification: {
|
|
1083
|
+
type: true,
|
|
1084
|
+
operator: true,
|
|
1085
|
+
countries: {
|
|
1086
|
+
_id: true,
|
|
1087
|
+
name: true
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
on_ScoreQualification: {
|
|
1091
|
+
type: true,
|
|
1092
|
+
scoreType: true,
|
|
1093
|
+
operator: true,
|
|
1094
|
+
value: true
|
|
1095
|
+
},
|
|
1096
|
+
on_SportsLevelQualification: {
|
|
1097
|
+
type: true,
|
|
1098
|
+
operator: true,
|
|
1099
|
+
level: true
|
|
1100
|
+
},
|
|
1101
|
+
on_SportsQualification: {
|
|
1102
|
+
type: true,
|
|
1103
|
+
sports: true,
|
|
1104
|
+
operator: true
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
deadline: true,
|
|
1109
|
+
startDate: true,
|
|
1110
|
+
duration: {
|
|
1111
|
+
length: true,
|
|
1112
|
+
unit: true
|
|
1113
|
+
},
|
|
1114
|
+
terms: true,
|
|
1115
|
+
isPrivate: true,
|
|
921
1116
|
stats: {
|
|
922
1117
|
totalApplications: true,
|
|
923
1118
|
newApplications: true,
|
|
@@ -928,11 +1123,7 @@ class VTXBaseAPI {
|
|
|
928
1123
|
remainingSponsorships: true
|
|
929
1124
|
},
|
|
930
1125
|
approved: true,
|
|
931
|
-
published: true
|
|
932
|
-
criteria: {
|
|
933
|
-
_id: true,
|
|
934
|
-
label: true
|
|
935
|
-
}
|
|
1126
|
+
published: true
|
|
936
1127
|
};
|
|
937
1128
|
let retValue;
|
|
938
1129
|
try {
|
|
@@ -2163,6 +2354,231 @@ class VTXBaseAPI {
|
|
|
2163
2354
|
}
|
|
2164
2355
|
return retValue;
|
|
2165
2356
|
}
|
|
2357
|
+
async searchAthletes(searchString) {
|
|
2358
|
+
const client = (0, client_1.createClient)({
|
|
2359
|
+
url: this.backendUrl + "/graphql",
|
|
2360
|
+
headers: this.headers,
|
|
2361
|
+
});
|
|
2362
|
+
const fields = {
|
|
2363
|
+
_id: true,
|
|
2364
|
+
firstName: true,
|
|
2365
|
+
lastName: true,
|
|
2366
|
+
screenName: true,
|
|
2367
|
+
dob: true,
|
|
2368
|
+
lgbt: true,
|
|
2369
|
+
competitionGender: true,
|
|
2370
|
+
country: {
|
|
2371
|
+
_id: true,
|
|
2372
|
+
name: true
|
|
2373
|
+
},
|
|
2374
|
+
location: {
|
|
2375
|
+
userProvidedLatitude: true,
|
|
2376
|
+
userProvidedLongitude: true,
|
|
2377
|
+
cityNameGeocode: true,
|
|
2378
|
+
stateNameGeocode: true,
|
|
2379
|
+
countryIso2CodeGeocode: true,
|
|
2380
|
+
timeZoneGeocode: true,
|
|
2381
|
+
latitudeGeocode: true,
|
|
2382
|
+
longitudeGeocode: true,
|
|
2383
|
+
city: {
|
|
2384
|
+
_id: true,
|
|
2385
|
+
name: true,
|
|
2386
|
+
localizedName: true,
|
|
2387
|
+
state: {
|
|
2388
|
+
_id: true,
|
|
2389
|
+
name: true,
|
|
2390
|
+
country: {
|
|
2391
|
+
_id: true,
|
|
2392
|
+
name: true
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2395
|
+
latitude: true,
|
|
2396
|
+
longitude: true,
|
|
2397
|
+
timezone: true,
|
|
2398
|
+
}
|
|
2399
|
+
},
|
|
2400
|
+
trainer: true,
|
|
2401
|
+
trainerUrl: true,
|
|
2402
|
+
followStats: {
|
|
2403
|
+
followers: true,
|
|
2404
|
+
followed: true,
|
|
2405
|
+
raves: true,
|
|
2406
|
+
favorites: true
|
|
2407
|
+
},
|
|
2408
|
+
mainSport: {
|
|
2409
|
+
_id: true,
|
|
2410
|
+
name: true
|
|
2411
|
+
},
|
|
2412
|
+
mainSportLevel: {
|
|
2413
|
+
_id: true,
|
|
2414
|
+
label: true,
|
|
2415
|
+
index: true
|
|
2416
|
+
},
|
|
2417
|
+
scores: {
|
|
2418
|
+
vtxScore: true,
|
|
2419
|
+
socialScore: true,
|
|
2420
|
+
trainingScore: true,
|
|
2421
|
+
competitionScore: true
|
|
2422
|
+
},
|
|
2423
|
+
rankings: {
|
|
2424
|
+
worldRanking: {
|
|
2425
|
+
scope: true,
|
|
2426
|
+
scopeId: true,
|
|
2427
|
+
scopeName: true,
|
|
2428
|
+
position: true,
|
|
2429
|
+
total: true
|
|
2430
|
+
},
|
|
2431
|
+
countryRanking: {
|
|
2432
|
+
scope: true,
|
|
2433
|
+
scopeId: true,
|
|
2434
|
+
scopeName: true,
|
|
2435
|
+
position: true,
|
|
2436
|
+
total: true
|
|
2437
|
+
},
|
|
2438
|
+
stateRanking: {
|
|
2439
|
+
scope: true,
|
|
2440
|
+
scopeId: true,
|
|
2441
|
+
scopeName: true,
|
|
2442
|
+
position: true,
|
|
2443
|
+
total: true
|
|
2444
|
+
},
|
|
2445
|
+
cityRanking: {
|
|
2446
|
+
scope: true,
|
|
2447
|
+
scopeId: true,
|
|
2448
|
+
scopeName: true,
|
|
2449
|
+
position: true,
|
|
2450
|
+
total: true
|
|
2451
|
+
},
|
|
2452
|
+
},
|
|
2453
|
+
allSports: {
|
|
2454
|
+
_id: true,
|
|
2455
|
+
name: true
|
|
2456
|
+
},
|
|
2457
|
+
teams: {
|
|
2458
|
+
_id: true,
|
|
2459
|
+
name: true,
|
|
2460
|
+
description: true,
|
|
2461
|
+
approved: true,
|
|
2462
|
+
logo: {
|
|
2463
|
+
_id: true,
|
|
2464
|
+
name: true,
|
|
2465
|
+
contentType: true,
|
|
2466
|
+
size: true,
|
|
2467
|
+
useType: true,
|
|
2468
|
+
url: true,
|
|
2469
|
+
key: true
|
|
2470
|
+
},
|
|
2471
|
+
banner: {
|
|
2472
|
+
_id: true,
|
|
2473
|
+
name: true,
|
|
2474
|
+
contentType: true,
|
|
2475
|
+
size: true,
|
|
2476
|
+
useType: true,
|
|
2477
|
+
url: true,
|
|
2478
|
+
key: true
|
|
2479
|
+
}
|
|
2480
|
+
},
|
|
2481
|
+
sponsorBrands: {
|
|
2482
|
+
_id: true,
|
|
2483
|
+
name: true,
|
|
2484
|
+
slogan: true,
|
|
2485
|
+
website: true,
|
|
2486
|
+
description: true,
|
|
2487
|
+
approved: true,
|
|
2488
|
+
published: true,
|
|
2489
|
+
logo: {
|
|
2490
|
+
_id: true,
|
|
2491
|
+
name: true,
|
|
2492
|
+
contentType: true,
|
|
2493
|
+
size: true,
|
|
2494
|
+
useType: true,
|
|
2495
|
+
url: true,
|
|
2496
|
+
key: true
|
|
2497
|
+
},
|
|
2498
|
+
stats: {
|
|
2499
|
+
campaigns: true,
|
|
2500
|
+
sponsorships: true,
|
|
2501
|
+
sports: true,
|
|
2502
|
+
athletes: true
|
|
2503
|
+
},
|
|
2504
|
+
operatorIds: true,
|
|
2505
|
+
},
|
|
2506
|
+
competitions: {
|
|
2507
|
+
_id: true,
|
|
2508
|
+
event: {
|
|
2509
|
+
_id: true,
|
|
2510
|
+
name: true,
|
|
2511
|
+
eventWebSite: true,
|
|
2512
|
+
startDate: true,
|
|
2513
|
+
endDate: true,
|
|
2514
|
+
verified: true,
|
|
2515
|
+
banner: {
|
|
2516
|
+
_id: true,
|
|
2517
|
+
name: true,
|
|
2518
|
+
contentType: true,
|
|
2519
|
+
size: true,
|
|
2520
|
+
useType: true,
|
|
2521
|
+
url: true,
|
|
2522
|
+
key: true
|
|
2523
|
+
}
|
|
2524
|
+
},
|
|
2525
|
+
eventName: true,
|
|
2526
|
+
date: true,
|
|
2527
|
+
result: {
|
|
2528
|
+
_id: true,
|
|
2529
|
+
type: true,
|
|
2530
|
+
position: true,
|
|
2531
|
+
score: true,
|
|
2532
|
+
timems: true,
|
|
2533
|
+
resultWebLink: true
|
|
2534
|
+
}
|
|
2535
|
+
},
|
|
2536
|
+
totalUpcomingCompetitions: true,
|
|
2537
|
+
totalPastCompetitions: true,
|
|
2538
|
+
profilePicture: {
|
|
2539
|
+
_id: true,
|
|
2540
|
+
name: true,
|
|
2541
|
+
contentType: true,
|
|
2542
|
+
size: true,
|
|
2543
|
+
useType: true,
|
|
2544
|
+
url: true,
|
|
2545
|
+
key: true
|
|
2546
|
+
},
|
|
2547
|
+
cardPicture: {
|
|
2548
|
+
_id: true,
|
|
2549
|
+
name: true,
|
|
2550
|
+
contentType: true,
|
|
2551
|
+
size: true,
|
|
2552
|
+
useType: true,
|
|
2553
|
+
url: true,
|
|
2554
|
+
key: true
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
let retValue;
|
|
2558
|
+
try {
|
|
2559
|
+
const response = await client.query({
|
|
2560
|
+
searchAthletes: {
|
|
2561
|
+
__args: {
|
|
2562
|
+
searchString: searchString
|
|
2563
|
+
},
|
|
2564
|
+
...fields
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2567
|
+
VTXBaseAPI.Logger.debug('searchAthletes Response:');
|
|
2568
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
2569
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'searchAthletes', (r) => {
|
|
2570
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
2571
|
+
const isResponseOk = true && Array.isArray(response?.searchAthletes);
|
|
2572
|
+
return isResponseOk;
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
catch (err1) {
|
|
2576
|
+
VTXBaseAPI.Logger.error('searchAthletes err1:');
|
|
2577
|
+
VTXBaseAPI.Logger.error(err1);
|
|
2578
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
2579
|
+
}
|
|
2580
|
+
return retValue;
|
|
2581
|
+
}
|
|
2166
2582
|
async getRecommendedAthletes(loginEmail) {
|
|
2167
2583
|
const client = (0, client_1.createClient)({
|
|
2168
2584
|
url: this.backendUrl + "/graphql",
|