@vertikalx/vtx-backend-client 1.0.0-dev-carlos.0 → 1.0.0-dev-carlos.2

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.0",
3
+ "version": "1.0.0-dev-carlos.2",
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
+ getAthleteIntegrationsByAthleteId(athleteId: string): Promise<ITypedBackendResponse<any>>;
84
85
  }
@@ -6190,6 +6190,63 @@ class VTXBaseAPI {
6190
6190
  }
6191
6191
  return retValue;
6192
6192
  }
6193
+ async getAthleteIntegrationsByAthleteId(athleteId) {
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
+ getAthleteIntegrationsByAthleteId: {
6228
+ __args: {
6229
+ athleteId: athleteId
6230
+ },
6231
+ ...fields
6232
+ },
6233
+ });
6234
+ console.log('getAthleteIntegrationsByAthleteId Response:');
6235
+ console.log(JSON.stringify(response, null, 2));
6236
+ retValue = (0, response_builder_1.buildResponse)(response, 'getAthleteIntegrationsByAthleteId', (r) => {
6237
+ const isResponseOk = !!response?.getAthleteIntegrationsByAthleteId?._id;
6238
+ return isResponseOk;
6239
+ });
6240
+ }
6241
+ catch (err1) {
6242
+ console.error('getAthleteIntegrationsByAthleteId err1:');
6243
+ console.error(err1);
6244
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
6245
+ }
6246
+ console.log('retValue:');
6247
+ console.log(JSON.stringify(retValue, null, 2));
6248
+ return retValue;
6249
+ }
6193
6250
  }
6194
6251
  exports.VTXBaseAPI = VTXBaseAPI;
6195
6252
  VTXBaseAPI.Logger = {