@vertikalx/vtx-backend-client 1.0.0-dev-carlos.1 → 1.0.0-dev-carlos.3

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-carlos.1",
3
+ "version": "1.0.0-dev-carlos.3",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -81,4 +81,5 @@ export declare class VTXBaseAPI {
81
81
  getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
82
82
  getAthleteAlbumsById(): Promise<ITypedBackendResponse<Album>>;
83
83
  queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
84
+ getAthleteIntegrationsByAthlete(): Promise<ITypedBackendResponse<any>>;
84
85
  }
@@ -6190,6 +6190,60 @@ class VTXBaseAPI {
6190
6190
  }
6191
6191
  return retValue;
6192
6192
  }
6193
+ async getAthleteIntegrationsByAthlete() {
6194
+ console.log('HEADERS:');
6195
+ console.log(JSON.stringify(this.headers, null, 2));
6196
+ const client = (0, client_1.createClient)({
6197
+ url: this.backendUrl + '/graphql',
6198
+ headers: this.headers,
6199
+ });
6200
+ let retValue = {};
6201
+ const fields = {
6202
+ _id: true,
6203
+ athlete: {
6204
+ _id: true,
6205
+ },
6206
+ hasStravaIntegration: true,
6207
+ stravaTokenExpires: true,
6208
+ stravaAthleteData: {
6209
+ id: true,
6210
+ username: true,
6211
+ firstname: true,
6212
+ lastname: true,
6213
+ bio: true,
6214
+ city: true,
6215
+ state: true,
6216
+ country: true,
6217
+ sex: true,
6218
+ premium: true,
6219
+ profile: true,
6220
+ created_at: true,
6221
+ updated_at: true,
6222
+ weight: true
6223
+ }
6224
+ };
6225
+ try {
6226
+ const response = await client.query({
6227
+ getAthleteIntegrationsByAthlete: {
6228
+ ...fields
6229
+ },
6230
+ });
6231
+ console.log('getAthleteIntegrationsByAthlete Response:');
6232
+ console.log(JSON.stringify(response, null, 2));
6233
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrationsByAthlete', (r) => {
6234
+ const isResponseOk = !!response?.getAthleteIntegrationsByAthlete?._id;
6235
+ return isResponseOk;
6236
+ });
6237
+ }
6238
+ catch (err1) {
6239
+ console.error('getAthleteIntegrationsByAthlete err1:');
6240
+ console.error(err1);
6241
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
6242
+ }
6243
+ console.log('retValue:');
6244
+ console.log(JSON.stringify(retValue, null, 2));
6245
+ return retValue;
6246
+ }
6193
6247
  }
6194
6248
  exports.VTXBaseAPI = VTXBaseAPI;
6195
6249
  VTXBaseAPI.Logger = {