@vertikalx/vtx-backend-client 1.0.0-dev.91 → 1.0.0-dev.92

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.91",
3
+ "version": "1.0.0-dev.92",
4
4
  "description": "GraphQL API generated client for VTX",
5
5
  "types": "src/index.d.ts",
6
6
  "main": "src/index.js",
@@ -78,9 +78,11 @@ export declare class VTXBaseAPI {
78
78
  findAthleteForIdPublic(id: string): Promise<ITypedBackendResponse<Athlete>>;
79
79
  editPicture(newPicDto: EditPictureDto): Promise<ITypedBackendResponse<EditPictureResponse>>;
80
80
  addAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<AddValuesResponse>>;
81
+ editAlbumsPictures(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
81
82
  createAthleteAlbum(dto: UploadAlbumsPicturesDto): Promise<ITypedBackendResponse<Album>>;
82
83
  deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
83
84
  getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
85
+ getPublicAthleteAlbums(athleteId: string): Promise<ITypedBackendResponse<Album[]>>;
84
86
  getAthleteAlbumsById(albumId: string): Promise<ITypedBackendResponse<Album>>;
85
87
  getAndSetAlbumById(albumId: string): Promise<ITypedBackendResponse<Album>>;
86
88
  queryAthletesWithFilters(dto: AthleteQueryDto): Promise<ITypedBackendResponse<AthleteQueryResponse>>;
@@ -5770,6 +5770,54 @@ class VTXBaseAPI {
5770
5770
  console.log(JSON.stringify(retValue, null, 2));
5771
5771
  return retValue;
5772
5772
  }
5773
+ async editAlbumsPictures(dto) {
5774
+ console.log('HEADERS:');
5775
+ console.log(JSON.stringify(this.headers, null, 2));
5776
+ const client = (0, client_1.createClient)({
5777
+ url: this.backendUrl + '/graphql',
5778
+ headers: this.headers,
5779
+ });
5780
+ let retValue = {};
5781
+ const fields = {
5782
+ label: true,
5783
+ description: true,
5784
+ photos: {
5785
+ _id: true,
5786
+ photo: {
5787
+ _id: true,
5788
+ name: true,
5789
+ contentType: true,
5790
+ size: true,
5791
+ useType: true,
5792
+ url: true,
5793
+ }
5794
+ }
5795
+ };
5796
+ try {
5797
+ const response = await client.mutation({
5798
+ editAlbum: {
5799
+ __args: {
5800
+ input: dto
5801
+ },
5802
+ ...fields
5803
+ },
5804
+ });
5805
+ console.log('editAlbum Response:');
5806
+ console.log(JSON.stringify(response, null, 2));
5807
+ retValue = (0, response_builder_1.buildResponse)(response, 'editAlbum', (r) => {
5808
+ const isResponseOk = response?.editAlbum?.label;
5809
+ return isResponseOk;
5810
+ });
5811
+ }
5812
+ catch (err1) {
5813
+ console.error('editAlbum err1:');
5814
+ console.error(err1);
5815
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
5816
+ }
5817
+ console.log('retValue:');
5818
+ console.log(JSON.stringify(retValue, null, 2));
5819
+ return retValue;
5820
+ }
5773
5821
  async createAthleteAlbum(dto) {
5774
5822
  console.log('HEADERS:');
5775
5823
  console.log(JSON.stringify(this.headers, null, 2));
@@ -5906,6 +5954,55 @@ class VTXBaseAPI {
5906
5954
  console.log(JSON.stringify(retValue, null, 2));
5907
5955
  return retValue;
5908
5956
  }
5957
+ async getPublicAthleteAlbums(athleteId) {
5958
+ console.log('HEADERS:');
5959
+ console.log(JSON.stringify(this.headers, null, 2));
5960
+ const client = (0, client_1.createClient)({
5961
+ url: this.backendUrl + '/graphql',
5962
+ headers: this.headers,
5963
+ });
5964
+ let retValue;
5965
+ const fields = {
5966
+ _id: true,
5967
+ label: true,
5968
+ description: true,
5969
+ photos: {
5970
+ _id: true,
5971
+ photo: {
5972
+ _id: true,
5973
+ name: true,
5974
+ contentType: true,
5975
+ size: true,
5976
+ useType: true,
5977
+ url: true,
5978
+ }
5979
+ }
5980
+ };
5981
+ try {
5982
+ const response = await client.query({
5983
+ getPublicAthleteAlbums: {
5984
+ __args: {
5985
+ athleteId: athleteId
5986
+ },
5987
+ ...fields
5988
+ },
5989
+ });
5990
+ console.log('getPublicAthleteAlbums Response:');
5991
+ console.log(JSON.stringify(response, null, 2));
5992
+ retValue = (0, response_builder_1.buildResponse)(response, 'getPublicAthleteAlbums', (r) => {
5993
+ const isResponseOk = response?.getPublicAthleteAlbums.length > 0;
5994
+ return isResponseOk;
5995
+ });
5996
+ }
5997
+ catch (err1) {
5998
+ console.error('getPublicAthleteAlbums err1:');
5999
+ console.error(err1);
6000
+ retValue = (0, response_builder_1.buildErrorResponse)(err1);
6001
+ }
6002
+ console.log('retValue:');
6003
+ console.log(JSON.stringify(retValue, null, 2));
6004
+ return retValue;
6005
+ }
5909
6006
  async getAthleteAlbumsById(albumId) {
5910
6007
  console.log('HEADERS:');
5911
6008
  console.log(JSON.stringify(this.headers, null, 2));