@vertikalx/vtx-backend-client 2.0.0-dev.4 → 2.0.0-dev.6
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 +1 -1
- package/src/api/vtx-base-api.d.ts +1 -0
- package/src/api/vtx-base-api.js +51 -2
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/client/schema.d.ts +8 -0
- package/src/client/schema.js.map +1 -1
- package/src/client/types.d.ts +4 -0
- package/src/client/types.js +12 -0
- package/src/client/types.js.map +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -111,4 +111,5 @@ export declare class VTXBaseAPI {
|
|
|
111
111
|
addCompetitionBudget(input: AddCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
112
112
|
editCompetitionBudget(input: EditCompetitionBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
113
113
|
editCampaignBudget(input: EditCampaignBudgetDto): Promise<ITypedBackendResponse<Boolean>>;
|
|
114
|
+
getDonationsByAthlete(): Promise<ITypedBackendResponse<Receipt[]>>;
|
|
114
115
|
}
|
package/src/api/vtx-base-api.js
CHANGED
|
@@ -1989,6 +1989,7 @@ class VTXBaseAPI {
|
|
|
1989
1989
|
trainer: true,
|
|
1990
1990
|
trainerUrl: true,
|
|
1991
1991
|
aboutMe: true,
|
|
1992
|
+
biography: true,
|
|
1992
1993
|
followStats: {
|
|
1993
1994
|
followers: true,
|
|
1994
1995
|
followed: true,
|
|
@@ -4599,7 +4600,7 @@ class VTXBaseAPI {
|
|
|
4599
4600
|
scores: {
|
|
4600
4601
|
vtxScore: true,
|
|
4601
4602
|
},
|
|
4602
|
-
|
|
4603
|
+
profilePicture: {
|
|
4603
4604
|
url: true,
|
|
4604
4605
|
},
|
|
4605
4606
|
currentCampaign: {
|
|
@@ -5152,6 +5153,7 @@ class VTXBaseAPI {
|
|
|
5152
5153
|
trainer: true,
|
|
5153
5154
|
trainerUrl: true,
|
|
5154
5155
|
aboutMe: true,
|
|
5156
|
+
biography: true,
|
|
5155
5157
|
followStats: {
|
|
5156
5158
|
followers: true,
|
|
5157
5159
|
followed: true,
|
|
@@ -6378,9 +6380,18 @@ class VTXBaseAPI {
|
|
|
6378
6380
|
},
|
|
6379
6381
|
participationDate: true,
|
|
6380
6382
|
},
|
|
6381
|
-
|
|
6383
|
+
profilePicture: {
|
|
6382
6384
|
url: true,
|
|
6383
6385
|
},
|
|
6386
|
+
currentCampaign: {
|
|
6387
|
+
_id: true,
|
|
6388
|
+
budgetMode: true,
|
|
6389
|
+
status: true,
|
|
6390
|
+
title: true,
|
|
6391
|
+
motivation: true,
|
|
6392
|
+
website: true,
|
|
6393
|
+
endingDate: true,
|
|
6394
|
+
}
|
|
6384
6395
|
};
|
|
6385
6396
|
const fields = {
|
|
6386
6397
|
athletes: fieldsAthlete,
|
|
@@ -7427,6 +7438,44 @@ class VTXBaseAPI {
|
|
|
7427
7438
|
}
|
|
7428
7439
|
return retValue;
|
|
7429
7440
|
}
|
|
7441
|
+
async getDonationsByAthlete() {
|
|
7442
|
+
const client = (0, client_1.createClient)({
|
|
7443
|
+
url: this.backendUrl + '/graphql',
|
|
7444
|
+
headers: this.headers,
|
|
7445
|
+
});
|
|
7446
|
+
let retValue = { data: [] };
|
|
7447
|
+
const fields = {
|
|
7448
|
+
receiptId: true,
|
|
7449
|
+
campaignName: true,
|
|
7450
|
+
athleteName: true,
|
|
7451
|
+
donorName: true,
|
|
7452
|
+
amount: true,
|
|
7453
|
+
currency: true,
|
|
7454
|
+
dateIssued: true,
|
|
7455
|
+
confirmed: true,
|
|
7456
|
+
message: true
|
|
7457
|
+
};
|
|
7458
|
+
try {
|
|
7459
|
+
const response = await client.query({
|
|
7460
|
+
getDonationsByAthlete: {
|
|
7461
|
+
...fields
|
|
7462
|
+
},
|
|
7463
|
+
});
|
|
7464
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getDonationsByAthlete', (r) => {
|
|
7465
|
+
const isResponseOk = !!response?.getDonationsByAthlete &&
|
|
7466
|
+
Array.isArray(response.getDonationsByAthlete);
|
|
7467
|
+
return isResponseOk;
|
|
7468
|
+
});
|
|
7469
|
+
if (!retValue.data) {
|
|
7470
|
+
retValue.data = [];
|
|
7471
|
+
}
|
|
7472
|
+
}
|
|
7473
|
+
catch (err) {
|
|
7474
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err);
|
|
7475
|
+
retValue.data = [];
|
|
7476
|
+
}
|
|
7477
|
+
return retValue;
|
|
7478
|
+
}
|
|
7430
7479
|
}
|
|
7431
7480
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
7432
7481
|
VTXBaseAPI.Logger = {
|