@vertikalx/vtx-backend-client 1.0.0-dev-daniel.146 → 1.0.0-dev-daniel.148

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertikalx/vtx-backend-client",
3
- "version": "1.0.0-dev-daniel.146",
3
+ "version": "1.0.0-dev-daniel.148",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -39,4 +39,6 @@ export declare class VTXBaseAPI {
39
39
  validateUserCredentialsVtx(username: string, password: string): Promise<ITypedBackendResponse<User>>;
40
40
  findAthleteForUser(loginEmail: string): Promise<ITypedBackendResponse<Athlete>>;
41
41
  getBrands(): Promise<ITypedBackendResponse<Brand[]>>;
42
+ getAthletes(): Promise<ITypedBackendResponse<Athlete[]>>;
43
+ getRecommendedAthletes(loginEmail: string): Promise<ITypedBackendResponse<Athlete[]>>;
42
44
  }
@@ -1848,6 +1848,454 @@ class VTXBaseAPI {
1848
1848
  }
1849
1849
  return retValue;
1850
1850
  }
1851
+ async getAthletes() {
1852
+ const client = (0, client_1.createClient)({
1853
+ url: this.backendUrl + "/graphql",
1854
+ headers: this.headers,
1855
+ });
1856
+ const fields = {
1857
+ _id: true,
1858
+ firstName: true,
1859
+ lastName: true,
1860
+ screenName: true,
1861
+ dob: true,
1862
+ lgbt: true,
1863
+ competitionGender: true,
1864
+ country: {
1865
+ _id: true,
1866
+ name: true
1867
+ },
1868
+ location: {
1869
+ userProvidedLatitude: true,
1870
+ userProvidedLongitude: true,
1871
+ cityNameGeocode: true,
1872
+ stateNameGeocode: true,
1873
+ countryIso2CodeGeocode: true,
1874
+ timeZoneGeocode: true,
1875
+ latitudeGeocode: true,
1876
+ longitudeGeocode: true,
1877
+ city: {
1878
+ _id: true,
1879
+ name: true,
1880
+ localizedName: true,
1881
+ state: {
1882
+ _id: true,
1883
+ name: true,
1884
+ country: {
1885
+ _id: true,
1886
+ name: true
1887
+ }
1888
+ },
1889
+ latitude: true,
1890
+ longitude: true,
1891
+ timezone: true,
1892
+ }
1893
+ },
1894
+ trainer: true,
1895
+ trainerUrl: true,
1896
+ followStats: {
1897
+ followers: true,
1898
+ followed: true,
1899
+ raves: true,
1900
+ favorites: true
1901
+ },
1902
+ mainSport: {
1903
+ _id: true,
1904
+ name: true
1905
+ },
1906
+ mainSportLevel: {
1907
+ _id: true,
1908
+ label: true,
1909
+ index: true
1910
+ },
1911
+ scores: {
1912
+ vtxScore: true,
1913
+ socialScore: true,
1914
+ trainingScore: true,
1915
+ competitionScore: true
1916
+ },
1917
+ rankings: {
1918
+ worldRanking: {
1919
+ scope: true,
1920
+ scopeId: true,
1921
+ scopeName: true,
1922
+ position: true,
1923
+ total: true
1924
+ },
1925
+ countryRanking: {
1926
+ scope: true,
1927
+ scopeId: true,
1928
+ scopeName: true,
1929
+ position: true,
1930
+ total: true
1931
+ },
1932
+ stateRanking: {
1933
+ scope: true,
1934
+ scopeId: true,
1935
+ scopeName: true,
1936
+ position: true,
1937
+ total: true
1938
+ },
1939
+ cityRanking: {
1940
+ scope: true,
1941
+ scopeId: true,
1942
+ scopeName: true,
1943
+ position: true,
1944
+ total: true
1945
+ },
1946
+ },
1947
+ allSports: {
1948
+ _id: true,
1949
+ name: true
1950
+ },
1951
+ teams: {
1952
+ _id: true,
1953
+ name: true,
1954
+ description: true,
1955
+ approved: true,
1956
+ logo: {
1957
+ _id: true,
1958
+ name: true,
1959
+ contentType: true,
1960
+ size: true,
1961
+ useType: true,
1962
+ url: true,
1963
+ key: true
1964
+ },
1965
+ banner: {
1966
+ _id: true,
1967
+ name: true,
1968
+ contentType: true,
1969
+ size: true,
1970
+ useType: true,
1971
+ url: true,
1972
+ key: true
1973
+ }
1974
+ },
1975
+ sponsorBrands: {
1976
+ _id: true,
1977
+ name: true,
1978
+ slogan: true,
1979
+ website: true,
1980
+ description: true,
1981
+ approved: true,
1982
+ published: true,
1983
+ logo: {
1984
+ _id: true,
1985
+ name: true,
1986
+ contentType: true,
1987
+ size: true,
1988
+ useType: true,
1989
+ url: true,
1990
+ key: true
1991
+ },
1992
+ stats: {
1993
+ campaigns: true,
1994
+ sponsorships: true,
1995
+ sports: true,
1996
+ athletes: true
1997
+ },
1998
+ operatorIds: true,
1999
+ },
2000
+ competitions: {
2001
+ _id: true,
2002
+ event: {
2003
+ _id: true,
2004
+ name: true,
2005
+ eventWebSite: true,
2006
+ startDate: true,
2007
+ endDate: true,
2008
+ verified: true,
2009
+ banner: {
2010
+ _id: true,
2011
+ name: true,
2012
+ contentType: true,
2013
+ size: true,
2014
+ useType: true,
2015
+ url: true,
2016
+ key: true
2017
+ }
2018
+ },
2019
+ eventName: true,
2020
+ date: true,
2021
+ result: {
2022
+ _id: true,
2023
+ type: true,
2024
+ position: true,
2025
+ score: true,
2026
+ timems: true,
2027
+ resultWebLink: true
2028
+ }
2029
+ },
2030
+ totalUpcomingCompetitions: true,
2031
+ totalPastCompetitions: true,
2032
+ profilePicture: {
2033
+ _id: true,
2034
+ name: true,
2035
+ contentType: true,
2036
+ size: true,
2037
+ useType: true,
2038
+ url: true,
2039
+ key: true
2040
+ },
2041
+ cardPicture: {
2042
+ _id: true,
2043
+ name: true,
2044
+ contentType: true,
2045
+ size: true,
2046
+ useType: true,
2047
+ url: true,
2048
+ key: true
2049
+ }
2050
+ };
2051
+ let retValue;
2052
+ try {
2053
+ const response = await client.query({
2054
+ getAthletes: {
2055
+ __args: {},
2056
+ ...fields
2057
+ }
2058
+ });
2059
+ console.log('getAthletes Response:');
2060
+ console.log(JSON.stringify(response, null, 2));
2061
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthletes', (r) => {
2062
+ console.log(JSON.stringify(response, null, 2));
2063
+ const isResponseOk = true && Array.isArray(response?.getAthletes);
2064
+ return isResponseOk;
2065
+ });
2066
+ }
2067
+ catch (err1) {
2068
+ console.log('getAthletes err1:');
2069
+ console.log(err1);
2070
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
2071
+ }
2072
+ return retValue;
2073
+ }
2074
+ async getRecommendedAthletes(loginEmail) {
2075
+ const client = (0, client_1.createClient)({
2076
+ url: this.backendUrl + "/graphql",
2077
+ headers: this.headers,
2078
+ });
2079
+ const fields = {
2080
+ _id: true,
2081
+ firstName: true,
2082
+ lastName: true,
2083
+ screenName: true,
2084
+ dob: true,
2085
+ lgbt: true,
2086
+ competitionGender: true,
2087
+ country: {
2088
+ _id: true,
2089
+ name: true
2090
+ },
2091
+ location: {
2092
+ userProvidedLatitude: true,
2093
+ userProvidedLongitude: true,
2094
+ cityNameGeocode: true,
2095
+ stateNameGeocode: true,
2096
+ countryIso2CodeGeocode: true,
2097
+ timeZoneGeocode: true,
2098
+ latitudeGeocode: true,
2099
+ longitudeGeocode: true,
2100
+ city: {
2101
+ _id: true,
2102
+ name: true,
2103
+ localizedName: true,
2104
+ state: {
2105
+ _id: true,
2106
+ name: true,
2107
+ country: {
2108
+ _id: true,
2109
+ name: true
2110
+ }
2111
+ },
2112
+ latitude: true,
2113
+ longitude: true,
2114
+ timezone: true,
2115
+ }
2116
+ },
2117
+ trainer: true,
2118
+ trainerUrl: true,
2119
+ followStats: {
2120
+ followers: true,
2121
+ followed: true,
2122
+ raves: true,
2123
+ favorites: true
2124
+ },
2125
+ mainSport: {
2126
+ _id: true,
2127
+ name: true
2128
+ },
2129
+ mainSportLevel: {
2130
+ _id: true,
2131
+ label: true,
2132
+ index: true
2133
+ },
2134
+ scores: {
2135
+ vtxScore: true,
2136
+ socialScore: true,
2137
+ trainingScore: true,
2138
+ competitionScore: true
2139
+ },
2140
+ rankings: {
2141
+ worldRanking: {
2142
+ scope: true,
2143
+ scopeId: true,
2144
+ scopeName: true,
2145
+ position: true,
2146
+ total: true
2147
+ },
2148
+ countryRanking: {
2149
+ scope: true,
2150
+ scopeId: true,
2151
+ scopeName: true,
2152
+ position: true,
2153
+ total: true
2154
+ },
2155
+ stateRanking: {
2156
+ scope: true,
2157
+ scopeId: true,
2158
+ scopeName: true,
2159
+ position: true,
2160
+ total: true
2161
+ },
2162
+ cityRanking: {
2163
+ scope: true,
2164
+ scopeId: true,
2165
+ scopeName: true,
2166
+ position: true,
2167
+ total: true
2168
+ },
2169
+ },
2170
+ allSports: {
2171
+ _id: true,
2172
+ name: true
2173
+ },
2174
+ teams: {
2175
+ _id: true,
2176
+ name: true,
2177
+ description: true,
2178
+ approved: true,
2179
+ logo: {
2180
+ _id: true,
2181
+ name: true,
2182
+ contentType: true,
2183
+ size: true,
2184
+ useType: true,
2185
+ url: true,
2186
+ key: true
2187
+ },
2188
+ banner: {
2189
+ _id: true,
2190
+ name: true,
2191
+ contentType: true,
2192
+ size: true,
2193
+ useType: true,
2194
+ url: true,
2195
+ key: true
2196
+ }
2197
+ },
2198
+ sponsorBrands: {
2199
+ _id: true,
2200
+ name: true,
2201
+ slogan: true,
2202
+ website: true,
2203
+ description: true,
2204
+ approved: true,
2205
+ published: true,
2206
+ logo: {
2207
+ _id: true,
2208
+ name: true,
2209
+ contentType: true,
2210
+ size: true,
2211
+ useType: true,
2212
+ url: true,
2213
+ key: true
2214
+ },
2215
+ stats: {
2216
+ campaigns: true,
2217
+ sponsorships: true,
2218
+ sports: true,
2219
+ athletes: true
2220
+ },
2221
+ operatorIds: true,
2222
+ },
2223
+ competitions: {
2224
+ _id: true,
2225
+ event: {
2226
+ _id: true,
2227
+ name: true,
2228
+ eventWebSite: true,
2229
+ startDate: true,
2230
+ endDate: true,
2231
+ verified: true,
2232
+ banner: {
2233
+ _id: true,
2234
+ name: true,
2235
+ contentType: true,
2236
+ size: true,
2237
+ useType: true,
2238
+ url: true,
2239
+ key: true
2240
+ }
2241
+ },
2242
+ eventName: true,
2243
+ date: true,
2244
+ result: {
2245
+ _id: true,
2246
+ type: true,
2247
+ position: true,
2248
+ score: true,
2249
+ timems: true,
2250
+ resultWebLink: true
2251
+ }
2252
+ },
2253
+ totalUpcomingCompetitions: true,
2254
+ totalPastCompetitions: true,
2255
+ profilePicture: {
2256
+ _id: true,
2257
+ name: true,
2258
+ contentType: true,
2259
+ size: true,
2260
+ useType: true,
2261
+ url: true,
2262
+ key: true
2263
+ },
2264
+ cardPicture: {
2265
+ _id: true,
2266
+ name: true,
2267
+ contentType: true,
2268
+ size: true,
2269
+ useType: true,
2270
+ url: true,
2271
+ key: true
2272
+ }
2273
+ };
2274
+ let retValue;
2275
+ try {
2276
+ const response = await client.query({
2277
+ getRecommendedAthletes: {
2278
+ __args: {
2279
+ loginEmail: loginEmail
2280
+ },
2281
+ ...fields
2282
+ }
2283
+ });
2284
+ console.log('getRecommendedAthletes Response:');
2285
+ console.log(JSON.stringify(response, null, 2));
2286
+ retValue = (0, response_builder_1.buildResponse)(response, 'getRecommendedAthletes', (r) => {
2287
+ console.log(JSON.stringify(response, null, 2));
2288
+ const isResponseOk = true && Array.isArray(response?.getRecommendedAthletes);
2289
+ return isResponseOk;
2290
+ });
2291
+ }
2292
+ catch (err1) {
2293
+ console.log('getRecommendedAthletes err1:');
2294
+ console.log(err1);
2295
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
2296
+ }
2297
+ return retValue;
2298
+ }
1851
2299
  }
1852
2300
  exports.VTXBaseAPI = VTXBaseAPI;
1853
2301
  //# sourceMappingURL=vtx-base-api.js.map