@vertikalx/vtx-backend-client 1.0.1-dev-max.11 → 1.0.1-dev-max.13
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/libs/vtx-backend-client/package.json +1 -1
- package/libs/vtx-backend-client/src/api/vtx-base-api.d.ts +2 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.js +143 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.js.map +1 -1
- package/libs/vtx-backend-client/src/client/schema.d.ts +9 -0
- package/libs/vtx-backend-client/src/client/schema.js.map +1 -1
- package/libs/vtx-backend-client/src/client/types.d.ts +7 -0
- package/libs/vtx-backend-client/src/client/types.js +35 -18
- package/libs/vtx-backend-client/src/client/types.js.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/set-current-campaign.dto.d.ts +3 -0
- package/src/api/dto/set-current-campaign.dto.js +26 -0
- package/src/api/dto/set-current-campaign.dto.js.map +1 -0
- package/src/api/vtx-base-api.d.ts +2 -0
- package/src/api/vtx-base-api.js +143 -0
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +9 -0
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +7 -0
- package/src/client/types.js +35 -18
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
|
@@ -4,6 +4,7 @@ import { APICallHeaders } from './api-call-headers';
|
|
|
4
4
|
import { VerificationCodeType } from '@stackbus/common-types';
|
|
5
5
|
import { GetAthleteCampaignsDto } from 'src/api/dto/get-athlete-campaigns.dto';
|
|
6
6
|
import { UpdateFundingCampaignDto } from 'src/api/dto/create-funding-campaign.dto';
|
|
7
|
+
import { SetCurrentCampaignDto } from 'src/api/dto/set-current-campaign.dto';
|
|
7
8
|
export declare class VTXBaseAPI {
|
|
8
9
|
protected headers: APICallHeaders;
|
|
9
10
|
protected backendUrl: string;
|
|
@@ -86,6 +87,7 @@ export declare class VTXBaseAPI {
|
|
|
86
87
|
deleteFundingCampaign(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
87
88
|
deleteFundingCampaigns(dto: DeleteValuesDto): Promise<ITypedBackendResponse<DeleteValuesResponse>>;
|
|
88
89
|
updateFundingCampaign(dto: UpdateFundingCampaignDto): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
90
|
+
setCurrentCampaign(dto: SetCurrentCampaignDto): Promise<ITypedBackendResponse<FundRaisingCampaign>>;
|
|
89
91
|
deleteAthleteAlbum(dto: DeleteSingleValueDto): Promise<ITypedBackendResponse<DeleteSingleValueResponse>>;
|
|
90
92
|
getAthleteAlbums(): Promise<ITypedBackendResponse<Album[]>>;
|
|
91
93
|
getPublicAthleteAlbums(athleteId: string): Promise<ITypedBackendResponse<Album[]>>;
|
|
@@ -5961,6 +5961,149 @@ class VTXBaseAPI {
|
|
|
5961
5961
|
console.log(JSON.stringify(retValue, null, 2));
|
|
5962
5962
|
return retValue;
|
|
5963
5963
|
}
|
|
5964
|
+
async setCurrentCampaign(dto) {
|
|
5965
|
+
console.log('HEADERS:');
|
|
5966
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5967
|
+
const client = (0, client_1.createClient)({
|
|
5968
|
+
url: this.backendUrl + '/graphql',
|
|
5969
|
+
headers: this.headers,
|
|
5970
|
+
});
|
|
5971
|
+
let retValue = {};
|
|
5972
|
+
const fields = {
|
|
5973
|
+
_id: true,
|
|
5974
|
+
budgetMode: true,
|
|
5975
|
+
status: true,
|
|
5976
|
+
title: true,
|
|
5977
|
+
motivation: true,
|
|
5978
|
+
website: true,
|
|
5979
|
+
fundsRequired: true,
|
|
5980
|
+
initialFundsObtained: true,
|
|
5981
|
+
fundsObtained: true,
|
|
5982
|
+
vtxComissionPct: true,
|
|
5983
|
+
location: {
|
|
5984
|
+
userProvidedLatitude: true,
|
|
5985
|
+
userProvidedLongitude: true,
|
|
5986
|
+
cityNameGeocode: true,
|
|
5987
|
+
stateNameGeocode: true,
|
|
5988
|
+
countryIso2CodeGeocode: true,
|
|
5989
|
+
timeZoneGeocode: true,
|
|
5990
|
+
latitudeGeocode: true,
|
|
5991
|
+
longitudeGeocode: true,
|
|
5992
|
+
city: {
|
|
5993
|
+
_id: true,
|
|
5994
|
+
name: true,
|
|
5995
|
+
localizedName: true,
|
|
5996
|
+
state: {
|
|
5997
|
+
_id: true,
|
|
5998
|
+
name: true,
|
|
5999
|
+
country: {
|
|
6000
|
+
_id: true,
|
|
6001
|
+
name: true
|
|
6002
|
+
}
|
|
6003
|
+
},
|
|
6004
|
+
latitude: true,
|
|
6005
|
+
longitude: true,
|
|
6006
|
+
timezone: true,
|
|
6007
|
+
}
|
|
6008
|
+
},
|
|
6009
|
+
endingDate: true,
|
|
6010
|
+
budget: {
|
|
6011
|
+
initialFunds: true,
|
|
6012
|
+
totalRequired: true,
|
|
6013
|
+
items: {
|
|
6014
|
+
_id: true,
|
|
6015
|
+
quantity: true,
|
|
6016
|
+
concept: true,
|
|
6017
|
+
itemCost: true
|
|
6018
|
+
}
|
|
6019
|
+
},
|
|
6020
|
+
competitions: {
|
|
6021
|
+
_id: true,
|
|
6022
|
+
event: {
|
|
6023
|
+
_id: true,
|
|
6024
|
+
name: true,
|
|
6025
|
+
mainSport: {
|
|
6026
|
+
_id: true,
|
|
6027
|
+
name: true
|
|
6028
|
+
},
|
|
6029
|
+
eventWebSite: true,
|
|
6030
|
+
startDate: true,
|
|
6031
|
+
endDate: true,
|
|
6032
|
+
verified: true,
|
|
6033
|
+
banner: {
|
|
6034
|
+
_id: true,
|
|
6035
|
+
name: true,
|
|
6036
|
+
contentType: true,
|
|
6037
|
+
size: true,
|
|
6038
|
+
useType: true,
|
|
6039
|
+
url: true,
|
|
6040
|
+
key: true
|
|
6041
|
+
},
|
|
6042
|
+
location: {
|
|
6043
|
+
_id: true,
|
|
6044
|
+
userProvidedLatitude: true,
|
|
6045
|
+
userProvidedLongitude: true,
|
|
6046
|
+
cityNameGeocode: true,
|
|
6047
|
+
stateNameGeocode: true,
|
|
6048
|
+
countryIso2CodeGeocode: true,
|
|
6049
|
+
timeZoneGeocode: true,
|
|
6050
|
+
latitudeGeocode: true,
|
|
6051
|
+
longitudeGeocode: true,
|
|
6052
|
+
city: {
|
|
6053
|
+
_id: true,
|
|
6054
|
+
name: true,
|
|
6055
|
+
localizedName: true,
|
|
6056
|
+
state: {
|
|
6057
|
+
_id: true,
|
|
6058
|
+
name: true,
|
|
6059
|
+
country: {
|
|
6060
|
+
_id: true,
|
|
6061
|
+
name: true
|
|
6062
|
+
}
|
|
6063
|
+
},
|
|
6064
|
+
latitude: true,
|
|
6065
|
+
longitude: true,
|
|
6066
|
+
timezone: true,
|
|
6067
|
+
}
|
|
6068
|
+
},
|
|
6069
|
+
},
|
|
6070
|
+
participationDate: true,
|
|
6071
|
+
competitionNumber: true,
|
|
6072
|
+
result: {
|
|
6073
|
+
resultType: true,
|
|
6074
|
+
position: true,
|
|
6075
|
+
score: true,
|
|
6076
|
+
finishTimeMS: true,
|
|
6077
|
+
resultWebLink: true
|
|
6078
|
+
},
|
|
6079
|
+
fundRaisingCampaignIds: true
|
|
6080
|
+
}
|
|
6081
|
+
};
|
|
6082
|
+
try {
|
|
6083
|
+
const response = await client.mutation({
|
|
6084
|
+
setCurrentCampaign: {
|
|
6085
|
+
__args: {
|
|
6086
|
+
input: dto
|
|
6087
|
+
},
|
|
6088
|
+
...fields
|
|
6089
|
+
},
|
|
6090
|
+
});
|
|
6091
|
+
console.log('setCurrentCampaign Response:');
|
|
6092
|
+
console.log(JSON.stringify(response, null, 2));
|
|
6093
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'setCurrentCampaign', (r) => {
|
|
6094
|
+
const isResponseOk = response?.setCurrentCampaign?._id;
|
|
6095
|
+
return isResponseOk;
|
|
6096
|
+
});
|
|
6097
|
+
}
|
|
6098
|
+
catch (err1) {
|
|
6099
|
+
console.error('setCurrentCampaign err1:');
|
|
6100
|
+
console.error(err1);
|
|
6101
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
6102
|
+
}
|
|
6103
|
+
console.log('retValue:');
|
|
6104
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
6105
|
+
return retValue;
|
|
6106
|
+
}
|
|
5964
6107
|
async deleteAthleteAlbum(dto) {
|
|
5965
6108
|
console.log('HEADERS:');
|
|
5966
6109
|
console.log(JSON.stringify(this.headers, null, 2));
|