@vertikalx/vtx-backend-client 3.0.1-dev-max.0 → 3.0.1-dev-max.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 +1 -1
- package/src/api/api-call-headers.d.ts +12 -0
- package/src/api/api-call-headers.js +16 -0
- package/src/api/api-call-headers.js.map +1 -0
- package/src/api/backend-response.d.ts +10 -0
- package/src/api/backend-response.js +3 -0
- package/src/api/backend-response.js.map +1 -0
- package/src/api/domains.d.ts +4 -0
- package/src/api/domains.js +8 -0
- package/src/api/domains.js.map +1 -0
- package/src/api/response-builder.d.ts +4 -0
- package/src/api/response-builder.js +123 -0
- package/src/api/response-builder.js.map +1 -0
- package/src/api/types.d.ts +2 -0
- package/src/api/types.js +3 -0
- package/src/api/types.js.map +1 -0
- package/src/api/vtx-apikey-api.d.ts +6 -0
- package/src/api/vtx-apikey-api.js +19 -0
- package/src/api/vtx-apikey-api.js.map +1 -0
- package/src/api/vtx-base-api.d.ts +349 -0
- package/src/api/vtx-base-api.js +836 -0
- package/src/api/vtx-base-api.js.map +1 -0
- package/src/api/vtx-mobile-api.d.ts +11 -0
- package/src/api/vtx-mobile-api.js +28 -0
- package/src/api/vtx-mobile-api.js.map +1 -0
- package/src/api/vtx-web-browser-api.d.ts +7 -0
- package/src/api/vtx-web-browser-api.js +37 -0
- package/src/api/vtx-web-browser-api.js.map +1 -0
- package/src/api/vtx-web-server-api.d.ts +7 -0
- package/src/api/vtx-web-server-api.js +34 -0
- package/src/api/vtx-web-server-api.js.map +1 -0
- package/src/client/index.d.ts +25 -0
- package/src/client/index.js +44 -0
- package/src/client/index.js.map +1 -0
- package/src/client/runtime/batcher.d.ts +36 -0
- package/src/client/runtime/batcher.js +123 -0
- package/src/client/runtime/batcher.js.map +1 -0
- package/src/client/runtime/createClient.d.ts +17 -0
- package/src/client/runtime/createClient.js +28 -0
- package/src/client/runtime/createClient.js.map +1 -0
- package/src/client/runtime/error.d.ts +15 -0
- package/src/client/runtime/error.js +19 -0
- package/src/client/runtime/error.js.map +1 -0
- package/src/client/runtime/fetcher.d.ts +10 -0
- package/src/client/runtime/fetcher.js +68 -0
- package/src/client/runtime/fetcher.js.map +1 -0
- package/src/client/runtime/generateGraphqlOperation.d.ts +30 -0
- package/src/client/runtime/generateGraphqlOperation.js +134 -0
- package/src/client/runtime/generateGraphqlOperation.js.map +1 -0
- package/src/client/runtime/index.d.ts +11 -0
- package/src/client/runtime/index.js +17 -0
- package/src/client/runtime/index.js.map +1 -0
- package/src/client/runtime/linkTypeMap.d.ts +9 -0
- package/src/client/runtime/linkTypeMap.js +95 -0
- package/src/client/runtime/linkTypeMap.js.map +1 -0
- package/src/client/runtime/typeSelection.d.ts +28 -0
- package/src/client/runtime/typeSelection.js +3 -0
- package/src/client/runtime/typeSelection.js.map +1 -0
- package/src/client/runtime/types.d.ts +55 -0
- package/src/client/runtime/types.js +3 -0
- package/src/client/runtime/types.js.map +1 -0
- package/src/client/schema.d.ts +7646 -0
- package/src/client/schema.js +1654 -0
- package/src/client/schema.js.map +1 -0
- package/src/client/types.d.ts +4041 -0
- package/src/client/{types.ts → types.js} +5 -2
- package/src/client/types.js.map +1 -0
- package/src/generated/graphql.d.ts +13696 -0
- package/src/generated/graphql.js +5830 -0
- package/src/generated/graphql.js.map +1 -0
- package/src/{index.ts → index.d.ts} +2 -5
- package/src/index.js +31 -0
- package/src/index.js.map +1 -0
- package/src/api/api-call-headers.ts +0 -35
- package/src/api/backend-response.ts +0 -14
- package/src/api/domains.ts +0 -6
- package/src/api/response-builder.ts +0 -165
- package/src/api/types.ts +0 -9
- package/src/api/vtx-apikey-api.ts +0 -23
- package/src/api/vtx-base-api.ts +0 -2253
- package/src/api/vtx-mobile-api.ts +0 -43
- package/src/api/vtx-web-browser-api.ts +0 -46
- package/src/api/vtx-web-server-api.ts +0 -41
- package/src/client/index.ts +0 -65
- package/src/client/runtime/batcher.ts +0 -275
- package/src/client/runtime/createClient.ts +0 -68
- package/src/client/runtime/error.ts +0 -29
- package/src/client/runtime/fetcher.ts +0 -97
- package/src/client/runtime/generateGraphqlOperation.ts +0 -225
- package/src/client/runtime/index.ts +0 -13
- package/src/client/runtime/linkTypeMap.ts +0 -156
- package/src/client/runtime/typeSelection.ts +0 -95
- package/src/client/runtime/types.ts +0 -69
- package/src/client/schema.ts +0 -8329
- package/src/generated/graphql.ts +0 -12445
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VTXBaseAPI = void 0;
|
|
4
|
+
const package_json_1 = require("../../package.json");
|
|
5
|
+
const graphql_request_1 = require("graphql-request");
|
|
6
|
+
const graphql_1 = require("../generated/graphql");
|
|
7
|
+
const api_call_headers_1 = require("./api-call-headers");
|
|
8
|
+
const response_builder_1 = require("./response-builder");
|
|
9
|
+
const domains_1 = require("./domains");
|
|
10
|
+
const vtx_core_common_1 = require("@vertikalx/vtx-core-common");
|
|
11
|
+
class VTXBaseAPI {
|
|
12
|
+
constructor(backendUrl, headers, requestConfig) {
|
|
13
|
+
this.headers = headers ?? api_call_headers_1.DEFAULT_HEADERS;
|
|
14
|
+
this.backendUrl = backendUrl;
|
|
15
|
+
this.gqlClient = new graphql_request_1.GraphQLClient(backendUrl + '/graphql', {
|
|
16
|
+
headers: this.headers,
|
|
17
|
+
...(requestConfig?.fetch ? { fetch: requestConfig.fetch } : {}),
|
|
18
|
+
});
|
|
19
|
+
this.sdk = (0, graphql_1.getSdk)(this.gqlClient);
|
|
20
|
+
}
|
|
21
|
+
getHeaders() {
|
|
22
|
+
return this.headers;
|
|
23
|
+
}
|
|
24
|
+
setHeader(key, value) {
|
|
25
|
+
this.headers[key] = value;
|
|
26
|
+
this.gqlClient.setHeaders(this.headers);
|
|
27
|
+
}
|
|
28
|
+
static getVersion() {
|
|
29
|
+
return package_json_1.default?.version ?? '0.0.0';
|
|
30
|
+
}
|
|
31
|
+
static isBrowser() {
|
|
32
|
+
if (typeof process === 'object' && typeof require === 'function') {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (typeof importScripts === 'function') {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (typeof window === 'object') {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
async execute(sdkCall, rootProperty, checker, logPrefix) {
|
|
44
|
+
let retValue = {};
|
|
45
|
+
try {
|
|
46
|
+
const response = await sdkCall();
|
|
47
|
+
VTXBaseAPI.Logger.debug(`${logPrefix} Response:`);
|
|
48
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
49
|
+
retValue = (0, response_builder_1.buildResponse)(response, rootProperty, checker);
|
|
50
|
+
}
|
|
51
|
+
catch (err1) {
|
|
52
|
+
VTXBaseAPI.Logger.error(`${logPrefix} err1:`);
|
|
53
|
+
VTXBaseAPI.Logger.error(err1);
|
|
54
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
55
|
+
}
|
|
56
|
+
return retValue;
|
|
57
|
+
}
|
|
58
|
+
async findUserByEmail(email) {
|
|
59
|
+
const curatedEmail = email.trim().toLocaleLowerCase();
|
|
60
|
+
return this.execute(() => this.sdk.FindUserByEmail({ email: curatedEmail }), 'findUserByEmail', (r) => !!r?.findUserByEmail?._id, 'findUserByEmail');
|
|
61
|
+
}
|
|
62
|
+
async loginUserFromEmail(loginEmail, loginMethod = "") {
|
|
63
|
+
const curatedEmail = loginEmail.trim().toLocaleLowerCase();
|
|
64
|
+
return this.execute(() => this.sdk.LoginUserFromEmail({ email: curatedEmail, loginMethod }), 'loginUserFromEmail', (r) => !!r?.loginUserFromEmail?.actualToken, 'loginUserFromEmail');
|
|
65
|
+
}
|
|
66
|
+
async createUserAndLogin(loginEmail) {
|
|
67
|
+
const curatedEmail = loginEmail.trim().toLowerCase();
|
|
68
|
+
const payload = { loginEmail: curatedEmail };
|
|
69
|
+
return this.execute(() => this.sdk.CreateUserAndLogin({ user: payload }), 'createUserAndLogin', (r) => !!r?.createUserAndLogin?._id, 'createUserAndLogin');
|
|
70
|
+
}
|
|
71
|
+
async registerMember(dto) {
|
|
72
|
+
return this.execute(() => this.sdk.RegisterMember({ input: dto }), 'registerMember', (r) => !!r?.registerMember?._id, 'registerMember');
|
|
73
|
+
}
|
|
74
|
+
async registerAthlete(payload) {
|
|
75
|
+
return this.execute(() => this.sdk.RegisterAthlete({ input: payload }), 'registerAthlete', (r) => !!r?.registerAthlete?._id, 'registerAthlete');
|
|
76
|
+
}
|
|
77
|
+
async findBrandByName(name, translations = false) {
|
|
78
|
+
return this.execute(() => this.sdk.FindBrandByName({ name, translations }), 'getBrandByName', (r) => !!r?.getBrandByName?._id, 'getBrandByName');
|
|
79
|
+
}
|
|
80
|
+
async createBrand(dto) {
|
|
81
|
+
return this.execute(() => this.sdk.CreateBrand({ input: dto }), 'createBrand', (r) => !!r?.createBrand?._id, 'createBrand');
|
|
82
|
+
}
|
|
83
|
+
async createSponsorship(dto, _desiredFields) {
|
|
84
|
+
return this.execute(() => this.sdk.CreateSponsorship({ input: dto }), 'createSponsorship', (r) => !!r?.createSponsorship?._id, 'createSponsorship');
|
|
85
|
+
}
|
|
86
|
+
async getS3UploadUrl(dto) {
|
|
87
|
+
return this.execute(() => this.sdk.GetS3UploadUrl({ input: dto }), 'getUploadUrl', (r) => r?.getUploadUrl?.uploadUrl !== undefined && r?.getUploadUrl?.uploadUrl !== null, 'getUploadUrl');
|
|
88
|
+
}
|
|
89
|
+
async getVtxS3UploadUrl(dto) {
|
|
90
|
+
return this.execute(() => this.sdk.GetVtxS3UploadUrl({ input: dto }), 'getS3UploadUrl', (r) => r?.getS3UploadUrl?.uploadUrl !== undefined && r?.getS3UploadUrl?.uploadUrl !== null, 'getVtxS3UploadUrl');
|
|
91
|
+
}
|
|
92
|
+
async refreshToken(currentToken, refreshToken) {
|
|
93
|
+
const dto = { refreshToken };
|
|
94
|
+
return this.execute(() => this.sdk.RefreshToken({ dto }), 'refreshToken', (r) => !!r?.refreshToken?.refreshToken, 'refreshToken');
|
|
95
|
+
}
|
|
96
|
+
async registerNewDomainTenant(input) {
|
|
97
|
+
return this.execute(() => this.sdk.RegisterNewDomainTenant({ tenant: input }), 'registerNewDomainTenant', (r) => !!r?.registerNewDomainTenant?._id, 'registerNewDomainTenant');
|
|
98
|
+
}
|
|
99
|
+
async registerNewDomainTenantWithLogin(input) {
|
|
100
|
+
return this.execute(() => this.sdk.RegisterNewDomainTenantWithLogin({ tenant: input }), 'TenantWithUserLogin', (r) => !!r?.TenantWithUserLogin?._id, 'registerNewDomainTenantWithLogin');
|
|
101
|
+
}
|
|
102
|
+
async registerUserToDomainFromEmail(input) {
|
|
103
|
+
return this.execute(() => this.sdk.RegisterUserToDomainFromEmail({ input }), 'registerUserToDomainFromEmail', (r) => !!r?.registerUserToDomainFromEmail?.loginEmail, 'registerUserToDomainFromEmail');
|
|
104
|
+
}
|
|
105
|
+
async getPublicSponsorships() {
|
|
106
|
+
return this.execute(() => this.sdk.GetPublicSponsorships(), 'getPublicSponsorships', (r) => Array.isArray(r?.getPublicSponsorships), 'getPublicSponsorships');
|
|
107
|
+
}
|
|
108
|
+
async getTenantSponsorshipsFromUri(tenantUri, token) {
|
|
109
|
+
if ((!tenantUri) || (tenantUri.trim() === "")) {
|
|
110
|
+
return {
|
|
111
|
+
error: {
|
|
112
|
+
httpStatus: 400,
|
|
113
|
+
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI.code,
|
|
114
|
+
message: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI.description
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const credential = token.domains.find(c => {
|
|
119
|
+
if (c.tenant) {
|
|
120
|
+
if ((c.tenant.tenant_uri == tenantUri) && (c._id == domains_1.DOMAIN_SPONSOR)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
});
|
|
126
|
+
if (!credential) {
|
|
127
|
+
return {
|
|
128
|
+
error: {
|
|
129
|
+
httpStatus: 400,
|
|
130
|
+
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_URI_FOR_SPONSOR.code,
|
|
131
|
+
message: "Tenant in domain SPONSOR not found in domains with URI " + tenantUri
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const tenantId = credential.tenant?._id ?? null;
|
|
136
|
+
if ((!tenantId) || (tenantId == "ALL")) {
|
|
137
|
+
return {
|
|
138
|
+
error: {
|
|
139
|
+
httpStatus: 400,
|
|
140
|
+
code: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_ID.code,
|
|
141
|
+
message: vtx_core_common_1.VTX_ERRORS.INVALID_TENANT_ID.description
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return this.getTenantSponsorships(tenantId);
|
|
146
|
+
}
|
|
147
|
+
async isUserSuspended(loginEmail) {
|
|
148
|
+
return this.execute(() => this.sdk.IsUserSuspended({ loginEmail }), 'isUserSuspended', (r) => r?.isUserSuspended !== undefined, 'isUserSuspended');
|
|
149
|
+
}
|
|
150
|
+
async getTenantSponsorships(tenantId) {
|
|
151
|
+
return this.execute(() => this.sdk.GetTenantSponsorships(), 'getTenantSponsorships', (r) => Array.isArray(r?.getTenantSponsorships), 'getTenantSponsorships');
|
|
152
|
+
}
|
|
153
|
+
async sendAthleteInvitations(input) {
|
|
154
|
+
return this.execute(() => this.sdk.SendAthleteInvitations({ input }), 'sendAthleteInvitations', (r) => Array.isArray(r?.sendAthleteInvitations), 'sendAthleteInvitations');
|
|
155
|
+
}
|
|
156
|
+
async registerSponsorUser(input) {
|
|
157
|
+
return this.execute(() => this.sdk.RegisterSponsorUser({ input }), 'registerSponsorUser', (r) => !!r?.registerSponsorUser?._id, 'registerSponsorUser');
|
|
158
|
+
}
|
|
159
|
+
async registerAthleteUser(input) {
|
|
160
|
+
return this.execute(() => this.sdk.RegisterAthleteUser({ input }), 'registerAthleteUser', (r) => !!r?.registerAthleteUser?._id, 'registerAthleteUser');
|
|
161
|
+
}
|
|
162
|
+
async preRegisterAthleteUser(input) {
|
|
163
|
+
return this.execute(() => this.sdk.PreRegisterAthleteUser({ input }), 'preRegisterAthleteUser', (r) => !!r?.preRegisterAthleteUser?._id, 'preRegisterAthleteUser');
|
|
164
|
+
}
|
|
165
|
+
async confirmAthleteUserRegistrationAndLogin(input) {
|
|
166
|
+
return this.execute(() => this.sdk.ConfirmAthleteUserRegistrationAndLogin({ input }), 'confirmAthleteUserRegistrationAndLogin', (r) => !!r?.confirmAthleteUserRegistrationAndLogin?._id, 'confirmAthleteUserRegistrationAndLogin');
|
|
167
|
+
}
|
|
168
|
+
async confirmAthleteUserRegistration(input) {
|
|
169
|
+
return this.execute(() => this.sdk.ConfirmAthleteUserRegistration({ input }), 'confirmAthleteUserRegistration', (r) => !!r?.confirmAthleteUserRegistration?._id, 'confirmAthleteUserRegistration');
|
|
170
|
+
}
|
|
171
|
+
async findSponsorAthleteInvitation(dto) {
|
|
172
|
+
return this.execute(() => this.sdk.FindSponsorAthleteInvitation({ input: dto }), 'findSponsorAthleteInvitation', (r) => !!r?.findSponsorAthleteInvitation?._id, 'findSponsorAthleteInvitation');
|
|
173
|
+
}
|
|
174
|
+
async findVtxUser(dto) {
|
|
175
|
+
return this.execute(() => this.sdk.FindVtxUser({ input: dto }), 'findVtxUser', (r) => !!r?.findVtxUser?._id, 'findVtxUser');
|
|
176
|
+
}
|
|
177
|
+
async findCitiesStartingWith(pattern) {
|
|
178
|
+
return this.execute(() => this.sdk.FindCitiesStartingWith({ text: pattern }), 'findCitiesStartingWith', (r) => Array.isArray(r?.findCitiesStartingWith), 'findCitiesStartingWith');
|
|
179
|
+
}
|
|
180
|
+
async findCityById(cityId) {
|
|
181
|
+
return this.execute(() => this.sdk.FindCityById({ cityId }), 'findCityById', (r) => !!r?.findCityById?._id, 'findCityById');
|
|
182
|
+
}
|
|
183
|
+
async getSportLevels() {
|
|
184
|
+
return this.execute(() => this.sdk.GetSportLevels(), 'getSportLevels', (r) => Array.isArray(r?.getSportLevels), 'getSportLevels');
|
|
185
|
+
}
|
|
186
|
+
async getSports() {
|
|
187
|
+
return this.execute(() => this.sdk.GetSports(), 'getSports', (r) => Array.isArray(r?.getSports), 'getSports');
|
|
188
|
+
}
|
|
189
|
+
async getSportsPaginated(args) {
|
|
190
|
+
return this.execute(() => this.sdk.GetSportsPaginated({ query: args.query }), 'getSportsPaginated', (r) => true, 'getSportsPaginated');
|
|
191
|
+
}
|
|
192
|
+
async getStates() {
|
|
193
|
+
return this.execute(() => this.sdk.GetStates(), 'getStates', (r) => Array.isArray(r?.getStates), 'getStates');
|
|
194
|
+
}
|
|
195
|
+
async getCountries() {
|
|
196
|
+
return this.execute(() => this.sdk.GetCountries(), 'getCountries', (r) => Array.isArray(r?.getCountries), 'getCountries');
|
|
197
|
+
}
|
|
198
|
+
async loginUserFromCredentialsVtx(username, password) {
|
|
199
|
+
const curatedEmail = username.trim().toLocaleLowerCase();
|
|
200
|
+
return this.execute(() => this.sdk.LoginUserFromCredentialsVtx({ username: curatedEmail, password }), 'loginUserFromCredentialsVtx', (r) => !!r?.loginUserFromCredentialsVtx?.actualToken, 'loginUserFromCredentialsVtx');
|
|
201
|
+
}
|
|
202
|
+
async validateUserCredentialsVtx(username, password) {
|
|
203
|
+
const curatedEmail = username.trim().toLocaleLowerCase();
|
|
204
|
+
return this.execute(() => this.sdk.ValidateUserCredentialsVtx({ username: curatedEmail, password }), 'validateUserCredentials', (r) => !!r?.validateUserCredentials?._id, 'validateUserCredentials');
|
|
205
|
+
}
|
|
206
|
+
async findAthleteForUser(loginEmail) {
|
|
207
|
+
return this.execute(() => this.sdk.FindAthleteForUser({ loginEmail }), 'findAthleteForUser', (r) => !!r?.findAthleteForUser?._id, 'findAthleteForUser');
|
|
208
|
+
}
|
|
209
|
+
async getBrands() {
|
|
210
|
+
return this.execute(() => this.sdk.GetBrands(), 'brands', (r) => Array.isArray(r?.brands), 'brands');
|
|
211
|
+
}
|
|
212
|
+
async getBrandsPaginated(args) {
|
|
213
|
+
return this.execute(() => this.sdk.GetBrandsPaginated({ query: args.query }), 'getBrandsPaginated', (r) => true, 'getBrandsPaginated');
|
|
214
|
+
}
|
|
215
|
+
async getAthletes() {
|
|
216
|
+
return this.execute(() => this.sdk.GetAthletes(), 'athletes', (r) => Array.isArray(r?.athletes), 'athletes');
|
|
217
|
+
}
|
|
218
|
+
async searchAthletes(searchString) {
|
|
219
|
+
return this.execute(() => this.sdk.SearchAthletes({ searchString }), 'searchAthletes', (r) => Array.isArray(r?.searchAthletes), 'searchAthletes');
|
|
220
|
+
}
|
|
221
|
+
async getRecommendedAthletes(loginEmail) {
|
|
222
|
+
return this.execute(() => this.sdk.GetRecommendedAthletes({ loginEmail }), 'getRecommendedAthletes', (r) => Array.isArray(r?.getRecommendedAthletes), 'getRecommendedAthletes');
|
|
223
|
+
}
|
|
224
|
+
async getSponsorAthletesForTenant() {
|
|
225
|
+
return this.execute(() => this.sdk.GetSponsorAthletesForTenant(), 'getSponsorAthletesForTenant', (r) => Array.isArray(r?.getSponsorAthletesForTenant), 'getSponsorAthletesForTenant');
|
|
226
|
+
}
|
|
227
|
+
async getUserImagesFromEmail(loginEmail) {
|
|
228
|
+
return this.execute(() => this.sdk.GetUserImagesFromEmail({ loginEmail }), 'getUserImagesFromEmail', (r) => !!r?.getUserImagesFromEmail, 'getUserImagesFromEmail');
|
|
229
|
+
}
|
|
230
|
+
async editAboutMe(newValue) {
|
|
231
|
+
const dto = { field: 'aboutMe', newValue };
|
|
232
|
+
return this.execute(() => this.sdk.EditAboutMe({ input: dto }), 'editProfileValue', (r) => !!r?.editProfileValue?.field, 'editProfileValue');
|
|
233
|
+
}
|
|
234
|
+
async editProfileValue(newValue, field) {
|
|
235
|
+
const dto = { field, newValue };
|
|
236
|
+
return this.execute(() => this.sdk.EditProfileValue({ input: dto }), 'editProfileValue', (r) => !!r?.editProfileValue?.field, 'editProfileValue');
|
|
237
|
+
}
|
|
238
|
+
async addAthleteCompetition(dto) {
|
|
239
|
+
return this.execute(() => this.sdk.AddAthleteCompetition({ input: dto }), 'addAthleteCompetition', (r) => !!r?.addAthleteCompetition?._id, 'addAthleteCompetition');
|
|
240
|
+
}
|
|
241
|
+
async getSportsEvents(dto) {
|
|
242
|
+
return this.execute(() => this.sdk.GetSportsEvents({ input: dto }), 'getSportsEvents', (r) => Array.isArray(r?.getSportsEvents), 'getSportsEvents');
|
|
243
|
+
}
|
|
244
|
+
async getSportsEventsPaginated(dto) {
|
|
245
|
+
return this.execute(() => this.sdk.GetSportsEventsPaginated({ query: dto.query }), 'getSportsEventsPaginated', (r) => true, 'getSportsEventsPaginated');
|
|
246
|
+
}
|
|
247
|
+
async createSportsEvent(dto) {
|
|
248
|
+
return this.execute(() => this.sdk.CreateSportsEvent({ input: dto }), 'createSportsEvent', (r) => !!r?.createSportsEvent?._id, 'createSportsEvent');
|
|
249
|
+
}
|
|
250
|
+
async updateSportsEvent(dto) {
|
|
251
|
+
return this.execute(() => this.sdk.UpdateSportsEvent({ input: dto.input }), 'updateSportsEvent', (r) => !!r?.updateSportsEvent?._id, 'updateSportsEvent');
|
|
252
|
+
}
|
|
253
|
+
async deleteSportsEvent(dto) {
|
|
254
|
+
return this.execute(() => this.sdk.DeleteSportsEvent({ eventId: dto.eventId }), 'deleteSportsEvent', (r) => !!r?.deleteSportsEvent?.idToDelete, 'deleteSportsEvent');
|
|
255
|
+
}
|
|
256
|
+
async mergeSportsEvents(dto) {
|
|
257
|
+
return this.execute(() => this.sdk.MergeSportsEvents({ input: dto }), 'mergeSportsEvents', (r) => !!r?.mergeSportsEvents, 'mergeSportsEvents');
|
|
258
|
+
}
|
|
259
|
+
async getAthleteCompetitions(dto) {
|
|
260
|
+
return this.execute(() => this.sdk.GetAthleteCompetitions({ input: dto }), 'getAthleteCompetitions', (r) => Array.isArray(r?.getAthleteCompetitions), 'getAthleteCompetitions');
|
|
261
|
+
}
|
|
262
|
+
async getAthleteMemberships(athleteId) {
|
|
263
|
+
return this.execute(() => this.sdk.GetAthleteMemberships({ athleteId }), 'getAthleteMemberships', (r) => Array.isArray(r?.getAthleteMemberships), 'getAthleteMemberships');
|
|
264
|
+
}
|
|
265
|
+
async deleteAthleteCompetition(dto) {
|
|
266
|
+
return this.execute(() => this.sdk.DeleteAthleteCompetition({ input: dto }), 'deleteAthleteCompetition', (r) => !!r?.deleteAthleteCompetition?.idToDelete, 'deleteAthleteCompetition');
|
|
267
|
+
}
|
|
268
|
+
async createFundingCampaign(dto) {
|
|
269
|
+
return this.execute(() => this.sdk.CreateFundingCampaign({ input: dto }), 'createFundingCampaign', (r) => !!r?.createFundingCampaign?._id, 'createFundingCampaign');
|
|
270
|
+
}
|
|
271
|
+
async createMembershipOrganization(dto) {
|
|
272
|
+
return this.execute(() => this.sdk.CreateMembershipOrganization({ input: dto }), 'createMembershipOrganization', (r) => !!r?.createMembershipOrganization?._id, 'createMembershipOrganization');
|
|
273
|
+
}
|
|
274
|
+
async getMembershipOrganizations() {
|
|
275
|
+
return this.execute(() => this.sdk.GetMembershipOrganizations(), 'getMembershipOrganizations', (r) => Array.isArray(r?.getMembershipOrganizations), 'getMembershipOrganizations');
|
|
276
|
+
}
|
|
277
|
+
async createAthleteMembershipAffilation(dto) {
|
|
278
|
+
return this.execute(() => this.sdk.CreateAthleteMembershipAffilation({ input: dto }), 'createAthleteMembershipAffilation', (r) => !!r?.createAthleteMembershipAffilation?._id, 'createAthleteMembershipAffilation');
|
|
279
|
+
}
|
|
280
|
+
async deleteMembershipAffiliation(dto) {
|
|
281
|
+
return this.execute(() => this.sdk.DeleteMembershipAffiliation({ input: dto }), 'deleteMembershipAffiliation', (r) => !!r?.deleteMembershipAffiliation?.idToDelete, 'deleteMembershipAffiliation');
|
|
282
|
+
}
|
|
283
|
+
async queryAthleteFundingCampaigns(dto) {
|
|
284
|
+
return this.execute(() => this.sdk.QueryAthleteFundingCampaigns({ input: dto }), 'queryAthleteFundingCampaigns', (r) => !!r?.queryAthleteFundingCampaigns, 'queryAthleteFundingCampaigns');
|
|
285
|
+
}
|
|
286
|
+
async createStripeAccount(dto) {
|
|
287
|
+
return this.execute(() => this.sdk.CreateStripeAccount({ input: dto }), 'createStripeAccount', (r) => !!r?.createStripeAccount?._id, 'createStripeAccount');
|
|
288
|
+
}
|
|
289
|
+
async createAthleteStripeSession() {
|
|
290
|
+
return this.execute(() => this.sdk.CreateAthleteStripeSession(), 'createAthleteStripeSession', (r) => !!r?.createAthleteStripeSession?.client_secret, 'createAthleteStripeSession');
|
|
291
|
+
}
|
|
292
|
+
async createStripeCheckoutSession(dto, _desiredFields) {
|
|
293
|
+
return this.execute(() => this.sdk.CreateStripeCheckoutSession({ input: dto }), 'createStripeCheckoutSession', (r) => !!r?.createStripeCheckoutSession?.client_secret, 'createStripeCheckoutSession');
|
|
294
|
+
}
|
|
295
|
+
async createStripeLoginLink() {
|
|
296
|
+
return this.execute(() => this.sdk.CreateStripeLoginLink(), 'createStripeLoginLink', (r) => !!r?.createStripeLoginLink, 'createStripeLoginLink');
|
|
297
|
+
}
|
|
298
|
+
async createStripeAccountLink() {
|
|
299
|
+
return this.execute(() => this.sdk.CreateStripeAccountLink(), 'createStripeAccountLink', (r) => !!r?.createStripeAccountLink, 'createStripeAccountLink');
|
|
300
|
+
}
|
|
301
|
+
async getStripeBalance() {
|
|
302
|
+
return this.execute(() => this.sdk.GetStripeBalance(), 'getStripeBalance', (r) => r?.getStripeBalance?.availableUSD !== undefined, 'getStripeBalance');
|
|
303
|
+
}
|
|
304
|
+
async getDatabaseTextFile(dto) {
|
|
305
|
+
return this.execute(() => this.sdk.GetDatabaseTextFile({ input: dto }), 'getDatabaseTextFile', (r) => !!r?.getDatabaseTextFile?._id, 'getDatabaseTextFile');
|
|
306
|
+
}
|
|
307
|
+
async getReceiptUrl(dto) {
|
|
308
|
+
return this.execute(() => this.sdk.GetReceiptUrl({ input: dto }), 'getReceiptUrl', (r) => !!r?.getReceiptUrl?.receiptId, 'getReceiptUrl');
|
|
309
|
+
}
|
|
310
|
+
async stripeQuery(dto) {
|
|
311
|
+
return this.execute(() => this.sdk.StripeQuery({ input: dto }), 'stripeQuery', (r) => !!r?.stripeQuery, 'stripeQuery');
|
|
312
|
+
}
|
|
313
|
+
async setFundingStatus(dto, _desiredFields) {
|
|
314
|
+
return this.execute(() => this.sdk.SetFundingStatus({ input: dto }), 'setFundingStatus', (r) => !!r?.setFundingStatus?._id, 'setFundingStatus');
|
|
315
|
+
}
|
|
316
|
+
async findAthleteForIdPublic(id) {
|
|
317
|
+
return this.execute(() => this.sdk.FindAthleteForIdPublic({ athleteId: id }), 'findAthletebyIdpublic', (r) => !!r?.findAthletebyIdpublic?._id, 'findAthletebyIdpublic');
|
|
318
|
+
}
|
|
319
|
+
async editPicture(newPicDto) {
|
|
320
|
+
console.log('HEADERS:');
|
|
321
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
322
|
+
return this.execute(() => this.sdk.EditPicture({ input: newPicDto }), 'editPicture', (r) => !!r?.editPicture?.field, 'editPicture');
|
|
323
|
+
}
|
|
324
|
+
async addAlbumsPictures(dto) {
|
|
325
|
+
console.log('HEADERS:');
|
|
326
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
327
|
+
let retValue = {};
|
|
328
|
+
try {
|
|
329
|
+
const response = await this.sdk.AddAlbumPictures({ input: dto });
|
|
330
|
+
console.log('AddAlbumsPictures Response:');
|
|
331
|
+
console.log(JSON.stringify(response, null, 2));
|
|
332
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'AddAlbumPictures', (r) => {
|
|
333
|
+
return r?.AddAlbumPictures?.result === 'success' || r?.AddAlbumPictures?.result === 'partial';
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
catch (err1) {
|
|
337
|
+
console.error('addPictures err1:');
|
|
338
|
+
console.error(err1);
|
|
339
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
340
|
+
}
|
|
341
|
+
console.log('retValue:');
|
|
342
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
343
|
+
return retValue;
|
|
344
|
+
}
|
|
345
|
+
async editAlbumsPictures(dto) {
|
|
346
|
+
console.log('HEADERS:');
|
|
347
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
348
|
+
let retValue = {};
|
|
349
|
+
try {
|
|
350
|
+
const response = await this.sdk.EditAlbumsPictures({ input: dto });
|
|
351
|
+
console.log('editAlbum Response:');
|
|
352
|
+
console.log(JSON.stringify(response, null, 2));
|
|
353
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editAlbum', (r) => !!r?.editAlbum?.label);
|
|
354
|
+
}
|
|
355
|
+
catch (err1) {
|
|
356
|
+
console.error('editAlbum err1:');
|
|
357
|
+
console.error(err1);
|
|
358
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
359
|
+
}
|
|
360
|
+
console.log('retValue:');
|
|
361
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
362
|
+
return retValue;
|
|
363
|
+
}
|
|
364
|
+
async createAthleteAlbum(dto) {
|
|
365
|
+
console.log('HEADERS:');
|
|
366
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
367
|
+
let retValue = {};
|
|
368
|
+
try {
|
|
369
|
+
const response = await this.sdk.CreateAthleteAlbum({ input: dto });
|
|
370
|
+
console.log('createAthleteAlbum Response:');
|
|
371
|
+
console.log(JSON.stringify(response, null, 2));
|
|
372
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteAlbum', (r) => !!r?.createAthleteAlbum?.label);
|
|
373
|
+
}
|
|
374
|
+
catch (err1) {
|
|
375
|
+
console.error('createAthleteAlbum err1:');
|
|
376
|
+
console.error(err1);
|
|
377
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
378
|
+
}
|
|
379
|
+
console.log('retValue:');
|
|
380
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
381
|
+
return retValue;
|
|
382
|
+
}
|
|
383
|
+
async deleteFundingCampaign(dto) {
|
|
384
|
+
return this.execute(() => this.sdk.DeleteFundingCampaign({ input: dto }), 'deleteFundingCampaign', (r) => !!r?.deleteFundingCampaign?.deleted, 'deleteFundingCampaign');
|
|
385
|
+
}
|
|
386
|
+
async deleteFundingCampaigns(dto) {
|
|
387
|
+
return this.execute(() => this.sdk.DeleteFundingCampaigns({ input: dto }), 'deleteFundingCampaigns', (r) => !!r?.deleteFundingCampaigns, 'deleteFundingCampaigns');
|
|
388
|
+
}
|
|
389
|
+
async updateFundingCampaign(dto) {
|
|
390
|
+
return this.execute(() => this.sdk.UpdateFundingCampaign({ input: dto }), 'updateFundingCampaign', (r) => !!r?.updateFundingCampaign?._id, 'updateFundingCampaign');
|
|
391
|
+
}
|
|
392
|
+
async setCurrentCampaign(dto) {
|
|
393
|
+
return this.execute(() => this.sdk.SetCurrentCampaign({ input: dto }), 'setCurrentCampaign', (r) => !!r?.setCurrentCampaign?._id, 'setCurrentCampaign');
|
|
394
|
+
}
|
|
395
|
+
async deleteAthleteAlbum(dto) {
|
|
396
|
+
return this.execute(() => this.sdk.DeleteAthleteAlbum({ input: dto }), 'deleteAthleteAlbum', (r) => !!r?.deleteAthleteAlbum?.deleted, 'deleteAthleteAlbum');
|
|
397
|
+
}
|
|
398
|
+
async getAthleteAlbums() {
|
|
399
|
+
return this.execute(() => this.sdk.GetAthleteAlbums(), 'getAthleteAlbums', (r) => Array.isArray(r?.getAthleteAlbums), 'getAthleteAlbums');
|
|
400
|
+
}
|
|
401
|
+
async reorderAlbums(dto) {
|
|
402
|
+
return this.execute(() => this.sdk.ReorderAlbums({ input: dto }), 'reorderAlbumIndex', (r) => r?.reorderAlbumIndex?.length > 0, 'reorderAlbumIndex');
|
|
403
|
+
}
|
|
404
|
+
async getPublicAthleteAlbums(athleteId) {
|
|
405
|
+
return this.execute(() => this.sdk.GetPublicAthleteAlbums({ athleteId }), 'getPublicAthleteAlbums', (r) => r?.getPublicAthleteAlbums?.length > 0, 'getPublicAthleteAlbums');
|
|
406
|
+
}
|
|
407
|
+
async getAthleteAlbumsById(albumId) {
|
|
408
|
+
return this.execute(() => this.sdk.GetAthleteAlbumsById({ input: albumId }), 'getAthleteAlbumId', (r) => !!r?.getAthleteAlbumId?._id, 'getAthleteAlbumId');
|
|
409
|
+
}
|
|
410
|
+
async getAndSetAlbumById(albumId) {
|
|
411
|
+
return this.execute(() => this.sdk.GetAndSetAlbumById({ input: albumId }), 'getAndSetAlbumById', (r) => !!r?.getAndSetAlbumById?._id, 'getAndSetAlbumById');
|
|
412
|
+
}
|
|
413
|
+
async queryAthletesWithFilters(dto) {
|
|
414
|
+
return this.execute(() => this.sdk.QueryAthletesWithFilters({ input: dto }), 'queryAthletesWithFilters', (r) => !!r?.queryAthletesWithFilters, 'queryAthletesWithFilters');
|
|
415
|
+
}
|
|
416
|
+
async getAthleteIntegrationsByAthlete() {
|
|
417
|
+
return this.execute(() => this.sdk.GetAthleteIntegrationsByAthlete(), 'getAthleteIntegrationsByAthlete', (r) => !!r?.getAthleteIntegrationsByAthlete, 'getAthleteIntegrationsByAthlete');
|
|
418
|
+
}
|
|
419
|
+
async deleteAthleteIntegration() {
|
|
420
|
+
return { error: { httpStatus: 501, code: 0, message: 'deleteAthleteIntegration not implemented' } };
|
|
421
|
+
}
|
|
422
|
+
async getAthleteStravaIntegration() {
|
|
423
|
+
return this.execute(() => this.sdk.GetAthleteStravaIntegration(), 'getAthleteStravaIntegration', (r) => !!r?.getAthleteStravaIntegration, 'getAthleteStravaIntegration');
|
|
424
|
+
}
|
|
425
|
+
async getAthleteInstagramIntegration() {
|
|
426
|
+
return this.execute(() => this.sdk.GetAthleteInstagramIntegration(), 'getAthleteInstagramIntegration', (r) => !!r?.getAthleteInstagramIntegration, 'getAthleteInstagramIntegration');
|
|
427
|
+
}
|
|
428
|
+
async getReceipt(dto) {
|
|
429
|
+
return this.execute(() => this.sdk.GetReceipt({ input: dto }), 'getReceipt', (r) => !!r?.getReceipt?._id, 'getReceipt');
|
|
430
|
+
}
|
|
431
|
+
async getAthleteIntegrations() {
|
|
432
|
+
return this.execute(() => this.sdk.GetAthleteIntegrations(), 'getAthleteIntegrations', (r) => !!r?.getAthleteIntegrations, 'getAthleteIntegrations');
|
|
433
|
+
}
|
|
434
|
+
async getAthleteCampaigns(dto) {
|
|
435
|
+
return this.execute(() => this.sdk.GetAthleteCampaigns({ input: dto }), 'getAthleteCampaigns', (r) => Array.isArray(r?.getAthleteCampaigns), 'getAthleteCampaigns');
|
|
436
|
+
}
|
|
437
|
+
async browseCampaigns(dto) {
|
|
438
|
+
return this.execute(() => this.sdk.BrowseCampaigns({ input: dto }), 'browseCampaigns', (r) => !!r?.browseCampaigns, 'browseCampaigns');
|
|
439
|
+
}
|
|
440
|
+
async updateAthleteIntegration(type) {
|
|
441
|
+
return this.execute(() => this.sdk.UpdateAthleteIntegration({ type }), 'updateAthleteIntegration', (r) => r?.updateAthleteIntegration === true, 'updateAthleteIntegration');
|
|
442
|
+
}
|
|
443
|
+
async deleteUploadedTypeKeyFile(dto) {
|
|
444
|
+
return this.execute(() => this.sdk.DeleteUploadedTypeKeyFile({ input: dto }), 'deleteUploadedTypeKeyFile', (r) => !!r?.deleteUploadedTypeKeyFile?.httpStatus, 'deleteUploadedTypeKeyFile');
|
|
445
|
+
}
|
|
446
|
+
async saveAthleteCompetitionResult(dto) {
|
|
447
|
+
return this.execute(() => this.sdk.SaveAthleteCompetitionResult({ input: dto }), 'saveAthleteCompetitionResult', (r) => !!r?.saveAthleteCompetitionResult?._id, 'saveAthleteCompetitionResult');
|
|
448
|
+
}
|
|
449
|
+
async updateAthleteScores() {
|
|
450
|
+
return this.execute(() => this.sdk.UpdateAthleteScores(), 'updateAthleteScores', (r) => !!r?.updateAthleteScores?._id, 'updateAthleteScores');
|
|
451
|
+
}
|
|
452
|
+
async updateAthleteCompetitionScores() {
|
|
453
|
+
return this.execute(() => this.sdk.UpdateAthleteCompetitionScores(), 'updateAthleteCompetitionScores', (r) => !!r?.updateAthleteCompetitionScores?._id, 'updateAthleteCompetitionScores');
|
|
454
|
+
}
|
|
455
|
+
async forceRefreshAthleteScores(athleteIds, options) {
|
|
456
|
+
return this.execute(() => this.sdk.ForceRefreshAthleteScores({ input: { athleteIds } }), 'forceRefreshAthleteScores', (r) => !!r?.forceRefreshAthleteScores, 'forceRefreshAthleteScores');
|
|
457
|
+
}
|
|
458
|
+
async checkScoreRefreshCapabilities(input) {
|
|
459
|
+
return this.execute(() => this.sdk.CheckScoreRefreshCapabilities({ input }), 'checkScoreRefreshCapabilities', (r) => !!r?.checkScoreRefreshCapabilities, 'checkScoreRefreshCapabilities');
|
|
460
|
+
}
|
|
461
|
+
async createResetPasswordCode(email) {
|
|
462
|
+
return this.execute(() => this.sdk.CreateResetPasswordCode({ input: email }), 'createResetPasswordCode', (r) => r?.createResetPasswordCode?.field !== null, 'createResetPasswordCode');
|
|
463
|
+
}
|
|
464
|
+
async getResetVerificationCode(id) {
|
|
465
|
+
return this.execute(() => this.sdk.GetResetVerificationCode({ input: id }), 'getResetVerificationCode', (r) => !!r?.getResetVerificationCode?.changed, 'getResetVerificationCode');
|
|
466
|
+
}
|
|
467
|
+
async verifyCode(input) {
|
|
468
|
+
return this.execute(() => this.sdk.VerifyCode({ input }), 'verifyCode', (r) => r?.verifyCode?.result === 'success' || r?.verifyCode?.result === 'error', 'verifyCode');
|
|
469
|
+
}
|
|
470
|
+
async resetUserPassword(input) {
|
|
471
|
+
return this.execute(() => this.sdk.ResetUserPassword({ input }), 'resetUserPassword', (r) => r?.resetUserPassword?.field !== null, 'resetUserPassword');
|
|
472
|
+
}
|
|
473
|
+
async deleteAlbumFotos(dto) {
|
|
474
|
+
return this.execute(() => this.sdk.DeleteAlbumFotos({ input: dto }), 'deleteAlbumFotos', (r) => !!r?.deleteAlbumFotos?.deleted, 'deleteAlbumFotos');
|
|
475
|
+
}
|
|
476
|
+
async screenNameAviability(dto) {
|
|
477
|
+
return this.execute(() => this.sdk.ScreenNameAvailability({ input: dto }), 'screenNameAviability', (r) => r?.screenNameAviability !== undefined, 'screenNameAviability');
|
|
478
|
+
}
|
|
479
|
+
async getBudgetsByAthlete() {
|
|
480
|
+
return this.execute(() => this.sdk.GetBudgetsByAthlete(), 'getBudgetsByAthlete', (r) => !!r?.getBudgetsByAthlete, 'getBudgetsByAthlete');
|
|
481
|
+
}
|
|
482
|
+
async deleteCompetitionBudget(competitionId) {
|
|
483
|
+
return this.execute(() => this.sdk.DeleteCompetitionBudget({ competitionId }), 'deleteCompetitionBudget', (r) => r?.deleteCompetitionBudget !== undefined, 'deleteCompetitionBudget');
|
|
484
|
+
}
|
|
485
|
+
async addCompetitionBudget(input) {
|
|
486
|
+
return this.execute(() => this.sdk.AddCompetitionBudget({ input }), 'addCompetitionBudget', (r) => r?.addCompetitionBudget !== undefined, 'addCompetitionBudget');
|
|
487
|
+
}
|
|
488
|
+
async editCompetitionBudget(input) {
|
|
489
|
+
return this.execute(() => this.sdk.EditCompetitionBudget({ input }), 'editCompetitionBudget', (r) => r?.editCompetitionBudget !== undefined, 'editCompetitionBudget');
|
|
490
|
+
}
|
|
491
|
+
async editCampaignBudget(input) {
|
|
492
|
+
return this.execute(() => this.sdk.EditCampaignBudget({ input }), 'editCampaignBudget', (r) => r?.editCampaignBudget !== undefined, 'editCampaignBudget');
|
|
493
|
+
}
|
|
494
|
+
async editCompetitionBudgetForCampaign(input) {
|
|
495
|
+
return this.execute(() => this.sdk.EditCompetitionBudgetForCampaign({ input }), 'editCompetitionBudgetForCampaign', (r) => r?.editCompetitionBudgetForCampaign !== undefined, 'editCompetitionBudgetForCampaign');
|
|
496
|
+
}
|
|
497
|
+
async getDonationsByAthlete() {
|
|
498
|
+
return this.execute(() => this.sdk.GetDonationsByAthlete(), 'getDonationsByAthlete', (r) => Array.isArray(r?.getDonationsByAthlete), 'getDonationsByAthlete');
|
|
499
|
+
}
|
|
500
|
+
async getDonationsByMember() {
|
|
501
|
+
return this.execute(() => this.sdk.GetDonationsByMember(), 'getDonationsByMember', (r) => Array.isArray(r?.getDonationsByMember), 'getDonationsByMember');
|
|
502
|
+
}
|
|
503
|
+
async findMemberForUser(loginEmail) {
|
|
504
|
+
return this.execute(() => this.sdk.FindMemberForUser({ loginEmail }), 'findMemberForUser', (r) => !!r?.findMemberForUser?._id, 'findMemberForUser');
|
|
505
|
+
}
|
|
506
|
+
async getBudgetConcepts() {
|
|
507
|
+
return this.execute(() => this.sdk.GetBudgetConcepts(), 'getBudgetConcepts', (r) => Array.isArray(r?.getBudgetConcepts), 'getBudgetConcepts');
|
|
508
|
+
}
|
|
509
|
+
async getBudgetItemsUnits() {
|
|
510
|
+
return this.execute(() => this.sdk.GetBudgetItemsUnits(), 'getBudgetItemsUnits', (r) => Array.isArray(r?.getBudgetItemsUnits), 'getBudgetItemsUnits');
|
|
511
|
+
}
|
|
512
|
+
async verifyAthleteCompetitionLinkedForDelete(dto) {
|
|
513
|
+
return this.execute(() => this.sdk.VerifyAthleteCompetitionLinkedForDelete({ input: dto }), 'verifyAthleteCompetitionLinkedForDelete', (r) => r?.verifyAthleteCompetitionLinkedForDelete !== undefined, 'verifyAthleteCompetitionLinkedForDelete');
|
|
514
|
+
}
|
|
515
|
+
async forceDeleteAthleteCompetition(dto) {
|
|
516
|
+
return this.execute(() => this.sdk.ForceDeleteAthleteCompetition({ input: dto }), 'forceDeleteAthleteCompetition', (r) => !!r?.forceDeleteAthleteCompetition?.idToDelete, 'forceDeleteAthleteCompetition');
|
|
517
|
+
}
|
|
518
|
+
async registerUser(input) {
|
|
519
|
+
return this.execute(() => this.sdk.RegisterUser({ input }), 'registerUser', (r) => !!r?.registerUser?._id, 'registerUser');
|
|
520
|
+
}
|
|
521
|
+
async getDonationsToAthlete(athleteId) {
|
|
522
|
+
return this.execute(() => this.sdk.GetDonationsToAthlete({ athleteId }), 'getDonationsToAthlete', (r) => Array.isArray(r?.getDonationsToAthlete), 'getDonationsToAthlete');
|
|
523
|
+
}
|
|
524
|
+
async getDonationsToMe() {
|
|
525
|
+
return this.execute(() => this.sdk.GetDonationsToMe(), 'getDonationsToMe', (r) => Array.isArray(r?.getDonationsToMe), 'getDonationsToMe');
|
|
526
|
+
}
|
|
527
|
+
async getDonationDatesForCalendar(campaignId) {
|
|
528
|
+
return this.execute(() => this.sdk.GetDonationDatesForCalendar({ campaignId }), 'getDonationDatesForCalendar', (r) => !!r?.getDonationDatesForCalendar, 'getDonationDatesForCalendar');
|
|
529
|
+
}
|
|
530
|
+
async getDonationsPaginated(query) {
|
|
531
|
+
return this.execute(() => this.sdk.GetDonationsPaginated({ query }), 'getDonationsPaginated', (r) => !!r?.getDonationsPaginated, 'getDonationsPaginated');
|
|
532
|
+
}
|
|
533
|
+
async getAthleteHistoricalScores(dto) {
|
|
534
|
+
return this.execute(() => this.sdk.GetAthleteHistoricalScores({ input: dto }), 'getAthleteHistoricalScores', (r) => Array.isArray(r?.getAthleteHistoricalScores), 'getAthleteHistoricalScores');
|
|
535
|
+
}
|
|
536
|
+
async getMyHistoricalScores(dto) {
|
|
537
|
+
return this.execute(() => this.sdk.GetMyHistoricalScores({ input: dto }), 'getMyHistoricalScores', (r) => Array.isArray(r?.getMyHistoricalScores), 'getMyHistoricalScores');
|
|
538
|
+
}
|
|
539
|
+
async getAthleteHistoricalScoresPeriod(dto) {
|
|
540
|
+
return this.execute(() => this.sdk.GetAthleteHistoricalScoresPeriod({ input: dto }), 'getAthleteHistoricalScoresPeriod', (r) => !!r?.getAthleteHistoricalScoresPeriod, 'getAthleteHistoricalScoresPeriod');
|
|
541
|
+
}
|
|
542
|
+
async getMyHistoricalScoresPeriod(dto) {
|
|
543
|
+
return this.execute(() => this.sdk.GetMyHistoricalScoresPeriod({ input: dto }), 'getMyHistoricalScoresPeriod', (r) => !!r?.getMyHistoricalScoresPeriod, 'getMyHistoricalScoresPeriod');
|
|
544
|
+
}
|
|
545
|
+
async getTransactionDetails(dto) {
|
|
546
|
+
return this.execute(() => this.sdk.GetTransactionDetails({ input: dto }), 'getTransactionDetails', (r) => !!r?.getTransactionDetails, 'getTransactionDetails');
|
|
547
|
+
}
|
|
548
|
+
async getAllUsers() {
|
|
549
|
+
return this.execute(() => this.sdk.GetAllUsers(), 'getAllUsers', (r) => Array.isArray(r?.getAllUsers), 'getAllUsers');
|
|
550
|
+
}
|
|
551
|
+
async getAllTransactions() {
|
|
552
|
+
return this.execute(() => this.sdk.GetAllTransactions(), 'getAllTransactions', (r) => Array.isArray(r?.getAllTransactions), 'getAllTransactions');
|
|
553
|
+
}
|
|
554
|
+
async getTransactionsPaginated(args = {}) {
|
|
555
|
+
return this.execute(() => this.sdk.GetTransactionsPaginated({ query: args.query }), 'getTransactionsPaginated', (r) => true, 'getTransactionsPaginated');
|
|
556
|
+
}
|
|
557
|
+
async getUsersPaginated(args) {
|
|
558
|
+
return this.execute(() => this.sdk.GetUsersPaginated({ query: args.query }), 'getUsersPaginated', (r) => true, 'getUsersPaginated');
|
|
559
|
+
}
|
|
560
|
+
async updateUserSuspendedStatus(dto) {
|
|
561
|
+
return this.execute(() => this.sdk.UpdateUserSuspendedStatus({ input: dto }), 'updateUserSuspendedStatus', (r) => r?.updateUserSuspendedStatus?.field !== null, 'updateUserSuspendedStatus');
|
|
562
|
+
}
|
|
563
|
+
async deleteVtxUser(dto) {
|
|
564
|
+
return this.execute(() => this.sdk.DeleteVtxUser({ input: dto }), 'deleteVtxUser', (r) => r?.deleteVtxUser?.success !== undefined, 'deleteVtxUser');
|
|
565
|
+
}
|
|
566
|
+
async deleteMyAccount() {
|
|
567
|
+
return this.execute(() => this.sdk.DeleteMyAccount(), 'deleteMyAccount', (r) => r?.deleteMyAccount?.success !== undefined, 'deleteMyAccount');
|
|
568
|
+
}
|
|
569
|
+
async createOffer(dto) {
|
|
570
|
+
return this.execute(() => this.sdk.CreateOffer({ input: dto }), 'createOffer', (r) => !!r?.createOffer?._id, 'createOffer');
|
|
571
|
+
}
|
|
572
|
+
async getOffers() {
|
|
573
|
+
return this.execute(() => this.sdk.GetOffers(), 'getOffers', (r) => Array.isArray(r?.getOffers), 'getOffers');
|
|
574
|
+
}
|
|
575
|
+
async getOffersPaginated(args) {
|
|
576
|
+
return this.execute(() => this.sdk.GetOffersPaginated({ query: args.query }), 'getOffersPaginated', (r) => true, 'getOffersPaginated');
|
|
577
|
+
}
|
|
578
|
+
async getOffersWithEligibility(args) {
|
|
579
|
+
return this.execute(() => this.sdk.OffersWithEligibility({ query: args.query }), 'offersWithEligibility', (r) => true, 'offersWithEligibility');
|
|
580
|
+
}
|
|
581
|
+
async getOfferById(id) {
|
|
582
|
+
return this.execute(() => this.sdk.GetOfferById({ id }), 'getOfferById', (r) => !!r?.getOfferById?._id, 'getOfferById');
|
|
583
|
+
}
|
|
584
|
+
async getOffersForAthlete(athleteId) {
|
|
585
|
+
return this.execute(() => this.sdk.GetOffersForAthlete({ athleteId }), 'getOffersForAthlete', (r) => Array.isArray(r?.getOffersForAthlete), 'getOffersForAthlete');
|
|
586
|
+
}
|
|
587
|
+
async updateOffer(id, dto) {
|
|
588
|
+
return this.execute(() => this.sdk.UpdateOffer({ id, input: dto }), 'updateOffer', (r) => !!r?.updateOffer?._id, 'updateOffer');
|
|
589
|
+
}
|
|
590
|
+
async deleteOffer(id) {
|
|
591
|
+
return this.execute(() => this.sdk.DeleteOffer({ id }), 'deleteOffer', (r) => r?.deleteOffer === true, 'deleteOffer');
|
|
592
|
+
}
|
|
593
|
+
async setOfferStatus(id, status) {
|
|
594
|
+
return this.execute(() => this.sdk.SetOfferStatus({ id, status }), 'setOfferStatus', (r) => !!r?.setOfferStatus?._id, 'setOfferStatus');
|
|
595
|
+
}
|
|
596
|
+
async activateOffer(id) {
|
|
597
|
+
return this.execute(() => this.sdk.ActivateOffer({ id }), 'activateOffer', (r) => !!r?.activateOffer?._id, 'activateOffer');
|
|
598
|
+
}
|
|
599
|
+
async deactivateOffer(id) {
|
|
600
|
+
return this.execute(() => this.sdk.DeactivateOffer({ id }), 'deactivateOffer', (r) => !!r?.deactivateOffer?._id, 'deactivateOffer');
|
|
601
|
+
}
|
|
602
|
+
async uploadCouponCodes(offerId, csvContent) {
|
|
603
|
+
return this.execute(() => this.sdk.UploadCouponCodes({ offerId, csvContent }), 'uploadCouponCodes', (r) => !!r?.uploadCouponCodes, 'uploadCouponCodes');
|
|
604
|
+
}
|
|
605
|
+
async claimOffer(offerId, athleteId) {
|
|
606
|
+
return this.execute(() => this.sdk.ClaimOffer({ offerId, athleteId }), 'claimOffer', (r) => !!r?.claimOffer?._id, 'claimOffer');
|
|
607
|
+
}
|
|
608
|
+
async getMyOfferClaims(args) {
|
|
609
|
+
return this.execute(() => this.sdk.GetMyOfferClaims({ athleteId: args.athleteId, query: args.query }), 'getMyOfferClaims', (r) => Array.isArray(r?.getMyOfferClaims), 'getMyOfferClaims');
|
|
610
|
+
}
|
|
611
|
+
async removeOfferClaim(claimId, athleteId) {
|
|
612
|
+
return this.execute(() => this.sdk.RemoveOfferClaim({ claimId, athleteId }), 'removeOfferClaim', (r) => r?.removeOfferClaim === true, 'removeOfferClaim');
|
|
613
|
+
}
|
|
614
|
+
async updateBrand(id, dto) {
|
|
615
|
+
return this.execute(() => this.sdk.UpdateBrand({ id, input: dto }), 'updateBrand', (r) => !!r?.updateBrand?._id, 'updateBrand');
|
|
616
|
+
}
|
|
617
|
+
async deleteBrand(id) {
|
|
618
|
+
return this.execute(() => this.sdk.DeleteBrand({ id }), 'deleteBrand', (r) => r?.deleteBrand === true, 'deleteBrand');
|
|
619
|
+
}
|
|
620
|
+
async linkBrandToSponsor(brandId, sponsorId) {
|
|
621
|
+
return this.execute(() => this.sdk.LinkBrandToSponsor({ brandId, sponsorId }), 'linkBrandToSponsor', (r) => !!r?.linkBrandToSponsor?._id, 'linkBrandToSponsor');
|
|
622
|
+
}
|
|
623
|
+
async unlinkBrandFromSponsor(brandId, sponsorId) {
|
|
624
|
+
return this.execute(() => this.sdk.UnlinkBrandFromSponsor({ brandId, sponsorId }), 'unlinkBrandFromSponsor', (r) => !!r?.unlinkBrandFromSponsor?._id, 'unlinkBrandFromSponsor');
|
|
625
|
+
}
|
|
626
|
+
async getSponsors() {
|
|
627
|
+
return this.execute(() => this.sdk.GetSponsors(), 'getSponsors', (r) => Array.isArray(r?.getSponsors), 'getSponsors');
|
|
628
|
+
}
|
|
629
|
+
async getSponsorsPaginated(args) {
|
|
630
|
+
return this.execute(() => this.sdk.GetSponsorsPaginated({ query: args.query }), 'getSponsorsPaginated', (r) => true, 'getSponsorsPaginated');
|
|
631
|
+
}
|
|
632
|
+
async createSponsor(dto) {
|
|
633
|
+
return this.execute(() => this.sdk.CreateSponsor({ input: dto }), 'createSponsor', (r) => !!r?.createSponsor?._id, 'createSponsor');
|
|
634
|
+
}
|
|
635
|
+
async updateSponsor(id, dto) {
|
|
636
|
+
return this.execute(() => this.sdk.UpdateSponsor({ id, input: dto }), 'updateSponsor', (r) => !!r?.updateSponsor?._id, 'updateSponsor');
|
|
637
|
+
}
|
|
638
|
+
async deleteSponsor(id) {
|
|
639
|
+
return this.execute(() => this.sdk.DeleteSponsor({ id }), 'deleteSponsor', (r) => r?.deleteSponsor === true, 'deleteSponsor');
|
|
640
|
+
}
|
|
641
|
+
async getLeaderboard(args) {
|
|
642
|
+
return this.execute(() => this.sdk.GetLeaderboard({ input: args?.input }), 'getLeaderboard', (r) => !!r?.getLeaderboard, 'getLeaderboard');
|
|
643
|
+
}
|
|
644
|
+
async getUserRank(args) {
|
|
645
|
+
return this.execute(() => this.sdk.GetUserRank({ input: args.input }), 'getUserRank', (r) => !!r?.getUserRank, 'getUserRank');
|
|
646
|
+
}
|
|
647
|
+
async rebuildLeaderboardCache() {
|
|
648
|
+
return this.execute(() => this.sdk.RebuildLeaderboardCache(), 'rebuildLeaderboardCache', (r) => r?.rebuildLeaderboardCache !== undefined, 'rebuildLeaderboardCache');
|
|
649
|
+
}
|
|
650
|
+
async getAthleteDashboard(athleteId) {
|
|
651
|
+
return this.execute(() => this.sdk.GetAthleteDashboard({ athleteId }), 'athleteDashboard', (r) => !!r?.athleteDashboard, 'getAthleteDashboard');
|
|
652
|
+
}
|
|
653
|
+
async getAthleteScoreHistory(args) {
|
|
654
|
+
return this.execute(() => this.sdk.GetAthleteScoreHistory({ input: args.input }), 'athleteScoreHistory', (r) => Array.isArray(r?.athleteScoreHistory), 'getAthleteScoreHistory');
|
|
655
|
+
}
|
|
656
|
+
async getAthleteRankHistory(args) {
|
|
657
|
+
return this.execute(() => this.sdk.GetAthleteRankHistory({ input: args.input }), 'athleteRankHistory', (r) => Array.isArray(r?.athleteRankHistory), 'getAthleteRankHistory');
|
|
658
|
+
}
|
|
659
|
+
async getAthleteRankContext(args) {
|
|
660
|
+
return this.execute(() => this.sdk.GetAthleteRankContext({ input: args.input }), 'athleteRankContext', (r) => !!r?.athleteRankContext, 'getAthleteRankContext');
|
|
661
|
+
}
|
|
662
|
+
async getAthleteActivities(args) {
|
|
663
|
+
return this.execute(() => this.sdk.GetAthleteActivities({ input: args.input }), 'athleteActivities', (r) => !!r?.athleteActivities, 'getAthleteActivities');
|
|
664
|
+
}
|
|
665
|
+
async getAthleteActivityDetail(args) {
|
|
666
|
+
return this.execute(() => this.sdk.GetAthleteActivityDetail({ input: args.input }), 'athleteActivityDetail', (r) => !!r?.athleteActivityDetail, 'getAthleteActivityDetail');
|
|
667
|
+
}
|
|
668
|
+
async getAthleteComponentSummary(args) {
|
|
669
|
+
return this.execute(() => this.sdk.GetAthleteComponentSummary({ input: args.input }), 'athleteComponentSummary', (r) => !!r?.athleteComponentSummary, 'getAthleteComponentSummary');
|
|
670
|
+
}
|
|
671
|
+
async getSocialAggregates(args) {
|
|
672
|
+
return this.execute(() => this.sdk.GetSocialAggregates({
|
|
673
|
+
athleteId: args.input.athleteId,
|
|
674
|
+
platform: args.input.platform,
|
|
675
|
+
range: { start: args.input.startDate, end: args.input.endDate },
|
|
676
|
+
periodType: args.input.periodType,
|
|
677
|
+
}), 'socialAggregates', (r) => r?.socialAggregates !== undefined, 'getSocialAggregates');
|
|
678
|
+
}
|
|
679
|
+
async getPostsWithComparison(args) {
|
|
680
|
+
return this.execute(() => this.sdk.GetPostsWithComparison({
|
|
681
|
+
athleteId: args.input.athleteId,
|
|
682
|
+
platform: args.input.platform,
|
|
683
|
+
options: {
|
|
684
|
+
sortBy: args.input.sortBy,
|
|
685
|
+
contentType: args.input.contentType,
|
|
686
|
+
limit: args.input.limit,
|
|
687
|
+
offset: args.input.offset,
|
|
688
|
+
comparisonWindowDays: args.input.comparisonWindowDays,
|
|
689
|
+
},
|
|
690
|
+
}), 'postsWithComparison', (r) => r?.postsWithComparison !== undefined, 'getPostsWithComparison');
|
|
691
|
+
}
|
|
692
|
+
async getAthleteActivityDates(athleteId) {
|
|
693
|
+
return this.execute(() => this.sdk.GetAthleteActivityDates({ input: { athleteId } }), 'athleteActivityDates', (r) => r?.athleteActivityDates?.dates !== undefined, 'getAthleteActivityDates');
|
|
694
|
+
}
|
|
695
|
+
async getMyNotifications(options) {
|
|
696
|
+
return this.execute(() => this.sdk.MyNotifications({ input: (options || {}) }), 'myNotifications', (r) => r?.myNotifications?.notifications !== undefined, 'getMyNotifications');
|
|
697
|
+
}
|
|
698
|
+
async getNotificationUnreadCount() {
|
|
699
|
+
return this.execute(() => this.sdk.NotificationUnreadCount(), 'notificationUnreadCount', (r) => r?.notificationUnreadCount?.count !== undefined, 'getNotificationUnreadCount');
|
|
700
|
+
}
|
|
701
|
+
async getMyNotificationPreferences() {
|
|
702
|
+
return this.execute(() => this.sdk.MyNotificationPreferences(), 'myNotificationPreferences', (r) => r?.myNotificationPreferences?.id !== undefined, 'getMyNotificationPreferences');
|
|
703
|
+
}
|
|
704
|
+
async markNotificationAsRead(notificationId) {
|
|
705
|
+
return this.execute(() => this.sdk.MarkNotificationAsRead({ input: { notificationId } }), 'markNotificationAsRead', (r) => r?.markNotificationAsRead?.id !== undefined, 'markNotificationAsRead');
|
|
706
|
+
}
|
|
707
|
+
async markAllNotificationsAsRead() {
|
|
708
|
+
return this.execute(() => this.sdk.MarkAllNotificationsAsRead(), 'markAllNotificationsAsRead', (r) => r?.markAllNotificationsAsRead !== undefined, 'markAllNotificationsAsRead');
|
|
709
|
+
}
|
|
710
|
+
async dismissNotification(notificationId) {
|
|
711
|
+
return this.execute(() => this.sdk.DismissNotification({ input: { notificationId } }), 'dismissNotification', (r) => r?.dismissNotification !== undefined, 'dismissNotification');
|
|
712
|
+
}
|
|
713
|
+
async registerDeviceToken(token, platform, deviceName) {
|
|
714
|
+
const input = { token, platform, deviceName };
|
|
715
|
+
return this.execute(() => this.sdk.RegisterDeviceToken({ input }), 'registerDeviceToken', (r) => r?.registerDeviceToken?.id !== undefined, 'registerDeviceToken');
|
|
716
|
+
}
|
|
717
|
+
async unregisterDeviceToken(token) {
|
|
718
|
+
const input = { token };
|
|
719
|
+
return this.execute(() => this.sdk.UnregisterDeviceToken({ input }), 'unregisterDeviceToken', (r) => r?.unregisterDeviceToken !== undefined, 'unregisterDeviceToken');
|
|
720
|
+
}
|
|
721
|
+
async updateNotificationPreferences(input) {
|
|
722
|
+
return this.execute(() => this.sdk.UpdateNotificationPreferences({ input: input }), 'updateNotificationPreferences', (r) => r?.updateNotificationPreferences?.id !== undefined, 'updateNotificationPreferences');
|
|
723
|
+
}
|
|
724
|
+
async followAthlete(athleteId) {
|
|
725
|
+
return this.execute(() => this.sdk.FollowAthlete({ input: { athleteId } }), 'followAthlete', (r) => r?.followAthlete !== undefined, 'followAthlete');
|
|
726
|
+
}
|
|
727
|
+
async unfollowAthlete(athleteId) {
|
|
728
|
+
return this.execute(() => this.sdk.UnfollowAthlete({ input: { athleteId } }), 'unfollowAthlete', (r) => r?.unfollowAthlete !== undefined, 'unfollowAthlete');
|
|
729
|
+
}
|
|
730
|
+
async isFollowingAthlete(athleteId) {
|
|
731
|
+
return this.execute(() => this.sdk.IsFollowingAthlete({ input: { athleteId } }), 'isFollowingAthlete', (r) => r?.isFollowingAthlete?.isFollowing !== undefined, 'isFollowingAthlete');
|
|
732
|
+
}
|
|
733
|
+
async getMyFollowedAthletes(options) {
|
|
734
|
+
return this.execute(() => this.sdk.MyFollowedAthletes({ input: (options || null) }), 'myFollowedAthletes', (r) => r?.myFollowedAthletes?.athletes !== undefined, 'getMyFollowedAthletes');
|
|
735
|
+
}
|
|
736
|
+
async deleteOnboardingAthlete() {
|
|
737
|
+
return this.execute(() => this.sdk.DeleteOnboardingAthlete(), 'deleteOnboardingAthlete', (r) => r?.deleteOnboardingAthlete?.success === true, 'deleteOnboardingAthlete');
|
|
738
|
+
}
|
|
739
|
+
async updateOnboardingProgress(step, complete) {
|
|
740
|
+
return this.execute(() => this.sdk.UpdateOnboardingProgress({ input: { step, complete } }), 'updateOnboardingProgress', (r) => r?.updateOnboardingProgress?.success === true, 'updateOnboardingProgress');
|
|
741
|
+
}
|
|
742
|
+
async getOnboardingProgress() {
|
|
743
|
+
return this.execute(() => this.sdk.GetOnboardingProgress(), 'getOnboardingProgress', (r) => r?.getOnboardingProgress?.success === true, 'getOnboardingProgress');
|
|
744
|
+
}
|
|
745
|
+
async getPublicAthleteIntegrationStatus(athleteId) {
|
|
746
|
+
return this.execute(() => this.sdk.GetPublicAthleteIntegrationStatus({ athleteId }), 'getPublicAthleteIntegrationStatus', (r) => r?.getPublicAthleteIntegrationStatus != null, 'getPublicAthleteIntegrationStatus');
|
|
747
|
+
}
|
|
748
|
+
async getEmailCampaigns(args) {
|
|
749
|
+
return this.execute(() => this.sdk.GetEmailCampaigns({ ...args }), 'getEmailCampaigns', (r) => r?.getEmailCampaigns?.campaigns != null, 'getEmailCampaigns');
|
|
750
|
+
}
|
|
751
|
+
async createEmailCampaign(input) {
|
|
752
|
+
return this.execute(() => this.sdk.CreateEmailCampaign({ input }), 'createEmailCampaign', (r) => !!r?.createEmailCampaign?._id, 'createEmailCampaign');
|
|
753
|
+
}
|
|
754
|
+
async updateEmailCampaign(id, input) {
|
|
755
|
+
return this.execute(() => this.sdk.UpdateEmailCampaign({ id, input }), 'updateEmailCampaign', (r) => !!r?.updateEmailCampaign?._id, 'updateEmailCampaign');
|
|
756
|
+
}
|
|
757
|
+
async deleteEmailCampaign(id) {
|
|
758
|
+
return this.execute(() => this.sdk.DeleteEmailCampaign({ id }), 'deleteEmailCampaign', (r) => r?.deleteEmailCampaign === true, 'deleteEmailCampaign');
|
|
759
|
+
}
|
|
760
|
+
async cloneEmailCampaign(id) {
|
|
761
|
+
return this.execute(() => this.sdk.CloneEmailCampaign({ id }), 'cloneEmailCampaign', (r) => !!r?.cloneEmailCampaign?._id, 'cloneEmailCampaign');
|
|
762
|
+
}
|
|
763
|
+
async sendTestEmail(campaignId, email) {
|
|
764
|
+
return this.execute(() => this.sdk.SendTestEmail({ campaignId, adminEmail: email }), 'sendTestEmail', (r) => !!r?.sendTestEmail, 'sendTestEmail');
|
|
765
|
+
}
|
|
766
|
+
async sendBulkEmail(campaignId) {
|
|
767
|
+
return this.execute(() => this.sdk.SendBulkEmail({ campaignId }), 'sendBulkEmail', (r) => !!r?.sendBulkEmail, 'sendBulkEmail');
|
|
768
|
+
}
|
|
769
|
+
async scheduleEmailCampaign(campaignId, scheduledFor) {
|
|
770
|
+
return this.execute(() => this.sdk.ScheduleEmailCampaign({ campaignId, scheduledFor }), 'scheduleEmailCampaign', (r) => !!r?.scheduleEmailCampaign?._id, 'scheduleEmailCampaign');
|
|
771
|
+
}
|
|
772
|
+
async cancelScheduledEmail(campaignId) {
|
|
773
|
+
return this.execute(() => this.sdk.CancelScheduledEmail({ campaignId }), 'cancelScheduledEmail', (r) => !!r?.cancelScheduledEmail?._id, 'cancelScheduledEmail');
|
|
774
|
+
}
|
|
775
|
+
async getAudiencePreview(filters) {
|
|
776
|
+
return this.execute(() => this.sdk.GetAudiencePreview({ filters }), 'getAudiencePreview', (r) => r?.getAudiencePreview?.total != null, 'getAudiencePreview');
|
|
777
|
+
}
|
|
778
|
+
async getSendGridTemplates() {
|
|
779
|
+
return this.execute(() => this.sdk.GetSendGridTemplates(), 'getSendGridTemplates', (r) => r?.getSendGridTemplates != null, 'getSendGridTemplates');
|
|
780
|
+
}
|
|
781
|
+
async getSendGridTemplatePreview(templateId) {
|
|
782
|
+
return this.execute(() => this.sdk.GetSendGridTemplatePreview({ templateId }), 'getSendGridTemplatePreview', (r) => r?.getSendGridTemplatePreview != null, 'getSendGridTemplatePreview');
|
|
783
|
+
}
|
|
784
|
+
async getEmailSegments() {
|
|
785
|
+
return this.execute(() => this.sdk.GetEmailSegments(), 'getEmailSegments', (r) => r?.getEmailSegments != null, 'getEmailSegments');
|
|
786
|
+
}
|
|
787
|
+
async createEmailSegment(input) {
|
|
788
|
+
return this.execute(() => this.sdk.CreateEmailSegment({ input }), 'createEmailSegment', (r) => !!r?.createEmailSegment?._id, 'createEmailSegment');
|
|
789
|
+
}
|
|
790
|
+
async updateEmailSegment(id, input) {
|
|
791
|
+
return this.execute(() => this.sdk.UpdateEmailSegment({ id, input }), 'updateEmailSegment', (r) => !!r?.updateEmailSegment?._id, 'updateEmailSegment');
|
|
792
|
+
}
|
|
793
|
+
async deleteEmailSegment(id) {
|
|
794
|
+
return this.execute(() => this.sdk.DeleteEmailSegment({ id }), 'deleteEmailSegment', (r) => r?.deleteEmailSegment === true, 'deleteEmailSegment');
|
|
795
|
+
}
|
|
796
|
+
async getAiCoachThread() {
|
|
797
|
+
return this.execute(() => this.sdk.GetAiCoachThread(), 'getAiCoachThread', (r) => r?.getAiCoachThread !== undefined, 'getAiCoachThread');
|
|
798
|
+
}
|
|
799
|
+
async getAiCoachThreadHistory(limit) {
|
|
800
|
+
return this.execute(() => this.sdk.GetAiCoachThreadHistory({ limit: limit ?? 10 }), 'getAiCoachThreadHistory', (r) => Array.isArray(r?.getAiCoachThreadHistory), 'getAiCoachThreadHistory');
|
|
801
|
+
}
|
|
802
|
+
async getAiCoachThreadMessages(threadId) {
|
|
803
|
+
return this.execute(() => this.sdk.GetAiCoachThreadMessages({ threadId }), 'getAiCoachThreadMessages', (r) => Array.isArray(r?.getAiCoachThreadMessages), 'getAiCoachThreadMessages');
|
|
804
|
+
}
|
|
805
|
+
async getAiCoachConfig() {
|
|
806
|
+
return this.execute(() => this.sdk.GetAiCoachConfig(), 'getAiCoachConfig', (r) => r?.getAiCoachConfig?.athleteId !== undefined, 'getAiCoachConfig');
|
|
807
|
+
}
|
|
808
|
+
async sendAiCoachMessage(input) {
|
|
809
|
+
return this.execute(() => this.sdk.SendAiCoachMessage({ input: input }), 'sendAiCoachMessage', (r) => !!r?.sendAiCoachMessage?._id, 'sendAiCoachMessage');
|
|
810
|
+
}
|
|
811
|
+
async updateAiCoachConfig(input) {
|
|
812
|
+
return this.execute(() => this.sdk.UpdateAiCoachConfig({ input: input }), 'updateAiCoachConfig', (r) => r?.updateAiCoachConfig?.athleteId !== undefined, 'updateAiCoachConfig');
|
|
813
|
+
}
|
|
814
|
+
async getAiCoachNudges(input) {
|
|
815
|
+
return this.execute(() => this.sdk.GetAiCoachNudges({ input: input }), 'getAiCoachNudges', (r) => r?.getAiCoachNudges !== undefined, 'getAiCoachNudges');
|
|
816
|
+
}
|
|
817
|
+
async getAiCoachUnreadNudgeCount() {
|
|
818
|
+
return this.execute(() => this.sdk.GetAiCoachUnreadNudgeCount(), 'getAiCoachUnreadNudgeCount', (r) => r?.getAiCoachUnreadNudgeCount !== undefined, 'getAiCoachUnreadNudgeCount');
|
|
819
|
+
}
|
|
820
|
+
async markAiCoachNudgeRead(nudgeId) {
|
|
821
|
+
return this.execute(() => this.sdk.MarkAiCoachNudgeRead({ nudgeId }), 'markAiCoachNudgeRead', (r) => r?.markAiCoachNudgeRead !== undefined, 'markAiCoachNudgeRead');
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
exports.VTXBaseAPI = VTXBaseAPI;
|
|
825
|
+
VTXBaseAPI.Logger = {
|
|
826
|
+
debug: (str) => {
|
|
827
|
+
},
|
|
828
|
+
log: (str) => {
|
|
829
|
+
console.log(str);
|
|
830
|
+
},
|
|
831
|
+
warn: (str) => {
|
|
832
|
+
},
|
|
833
|
+
error: (str) => {
|
|
834
|
+
},
|
|
835
|
+
};
|
|
836
|
+
//# sourceMappingURL=vtx-base-api.js.map
|