@vertikalx/vtx-backend-client 1.0.0-dev.82 → 1.0.0-dev.83
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 +16 -0
- package/libs/vtx-backend-client/src/api/api-call-headers.js.map +1 -0
- package/libs/vtx-backend-client/src/api/backend-response.js.map +1 -0
- package/libs/vtx-backend-client/src/api/domains.js.map +1 -0
- package/libs/vtx-backend-client/src/api/response-builder.js.map +1 -0
- package/libs/vtx-backend-client/src/api/types.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-apikey-api.js.map +1 -0
- package/{src → libs/vtx-backend-client/src}/api/vtx-base-api.d.ts +15 -1
- package/{src → libs/vtx-backend-client/src}/api/vtx-base-api.js +1057 -0
- package/libs/vtx-backend-client/src/api/vtx-base-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-mobile-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-web-browser-api.js.map +1 -0
- package/libs/vtx-backend-client/src/api/vtx-web-server-api.js.map +1 -0
- package/libs/vtx-backend-client/src/client/index.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/batcher.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/createClient.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/error.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/fetcher.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/generateGraphqlOperation.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/index.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/linkTypeMap.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/typeSelection.js.map +1 -0
- package/libs/vtx-backend-client/src/client/runtime/types.js.map +1 -0
- package/{src → libs/vtx-backend-client/src}/client/schema.d.ts +531 -8
- package/{src → libs/vtx-backend-client/src}/client/schema.js +108 -2
- package/libs/vtx-backend-client/src/client/schema.js.map +1 -0
- package/{src → libs/vtx-backend-client/src}/client/types.d.ts +288 -9
- package/{src → libs/vtx-backend-client/src}/client/types.js +1035 -311
- package/libs/vtx-backend-client/src/client/types.js.map +1 -0
- package/libs/vtx-backend-client/src/index.js.map +1 -0
- package/package.json +1 -1
- package/src/api/dto/edit-picture.dto.d.ts +5 -0
- package/src/api/dto/edit-picture.dto.js +31 -0
- package/src/api/dto/edit-picture.dto.js.map +1 -0
- package/src/api/types/add-values-response.type.d.ts +7 -0
- package/src/api/types/add-values-response.type.js +42 -0
- package/src/api/types/add-values-response.type.js.map +1 -0
- package/src/api/types/delete-single-value-response.type.d.ts +6 -0
- package/src/api/types/delete-single-value-response.type.js +36 -0
- package/src/api/types/delete-single-value-response.type.js.map +1 -0
- package/src/api/types/edit-picture-response.type.d.ts +7 -0
- package/src/api/types/edit-picture-response.type.js +39 -0
- package/src/api/types/edit-picture-response.type.js.map +1 -0
- package/src/api/types/error.type.d.ts +4 -0
- package/src/api/types/error.type.js +28 -0
- package/src/api/types/error.type.js.map +1 -0
- package/src/client/schema.graphql +274 -9
- package/tsconfig.lib.tsbuildinfo +1 -1
- package/src/api/api-call-headers.js.map +0 -1
- package/src/api/backend-response.js.map +0 -1
- package/src/api/domains.js.map +0 -1
- package/src/api/response-builder.js.map +0 -1
- package/src/api/types.js.map +0 -1
- package/src/api/vtx-apikey-api.js.map +0 -1
- package/src/api/vtx-base-api.js.map +0 -1
- package/src/api/vtx-mobile-api.js.map +0 -1
- package/src/api/vtx-web-browser-api.js.map +0 -1
- package/src/api/vtx-web-server-api.js.map +0 -1
- package/src/client/index.js.map +0 -1
- package/src/client/runtime/batcher.js.map +0 -1
- package/src/client/runtime/createClient.js.map +0 -1
- package/src/client/runtime/error.js.map +0 -1
- package/src/client/runtime/fetcher.js.map +0 -1
- package/src/client/runtime/generateGraphqlOperation.js.map +0 -1
- package/src/client/runtime/index.js.map +0 -1
- package/src/client/runtime/linkTypeMap.js.map +0 -1
- package/src/client/runtime/typeSelection.js.map +0 -1
- package/src/client/runtime/types.js.map +0 -1
- package/src/client/schema.js.map +0 -1
- package/src/client/types.js.map +0 -1
- package/src/index.js.map +0 -1
- /package/{src → libs/vtx-backend-client/src}/api/api-call-headers.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/api-call-headers.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/backend-response.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/backend-response.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/domains.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/domains.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/response-builder.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/response-builder.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/types.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/types.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-apikey-api.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-apikey-api.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-mobile-api.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-mobile-api.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-web-browser-api.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-web-browser-api.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-web-server-api.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/api/vtx-web-server-api.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/index.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/index.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/batcher.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/batcher.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/createClient.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/createClient.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/error.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/error.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/fetcher.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/fetcher.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/generateGraphqlOperation.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/generateGraphqlOperation.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/index.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/index.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/linkTypeMap.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/linkTypeMap.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/typeSelection.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/typeSelection.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/types.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/client/runtime/types.js +0 -0
- /package/{src → libs/vtx-backend-client/src}/index.d.ts +0 -0
- /package/{src → libs/vtx-backend-client/src}/index.js +0 -0
|
@@ -12,6 +12,9 @@ class VTXBaseAPI {
|
|
|
12
12
|
this.headers = headers ?? api_call_headers_1.DEFAULT_HEADERS;
|
|
13
13
|
this.backendUrl = backendUrl ?? VTXBaseAPI.getDefaultBackendUrl();
|
|
14
14
|
}
|
|
15
|
+
getHeaders() {
|
|
16
|
+
return this.headers;
|
|
17
|
+
}
|
|
15
18
|
setHeader(key, value) {
|
|
16
19
|
this.headers[key] = value;
|
|
17
20
|
}
|
|
@@ -2260,6 +2263,112 @@ class VTXBaseAPI {
|
|
|
2260
2263
|
resultWebLink: true
|
|
2261
2264
|
}
|
|
2262
2265
|
}
|
|
2266
|
+
},
|
|
2267
|
+
stripeAccountReference: {
|
|
2268
|
+
_id: true,
|
|
2269
|
+
stripeAccountId: true,
|
|
2270
|
+
account: {
|
|
2271
|
+
id: true,
|
|
2272
|
+
object: true,
|
|
2273
|
+
business_type: true,
|
|
2274
|
+
country: true,
|
|
2275
|
+
email: true,
|
|
2276
|
+
capabilities: {
|
|
2277
|
+
acss_debit_payments: true,
|
|
2278
|
+
affirm_payments: true,
|
|
2279
|
+
afterpay_clearpay_payments: true,
|
|
2280
|
+
alma_payments: true,
|
|
2281
|
+
amazon_pay_payments: true,
|
|
2282
|
+
au_becs_debit_payments: true,
|
|
2283
|
+
bacs_debit_payments: true,
|
|
2284
|
+
bancontact_payments: true,
|
|
2285
|
+
bank_transfer_payments: true,
|
|
2286
|
+
blik_payments: true,
|
|
2287
|
+
boleto_payments: true,
|
|
2288
|
+
card_issuing: true,
|
|
2289
|
+
card_payments: true,
|
|
2290
|
+
cartes_bancaires_payments: true,
|
|
2291
|
+
cashapp_payments: true,
|
|
2292
|
+
eps_payments: true,
|
|
2293
|
+
fpx_payments: true,
|
|
2294
|
+
gb_bank_transfer_payments: true,
|
|
2295
|
+
giropay_payments: true,
|
|
2296
|
+
grabpay_payments: true,
|
|
2297
|
+
ideal_payments: true,
|
|
2298
|
+
india_international_payments: true,
|
|
2299
|
+
jcb_payments: true,
|
|
2300
|
+
jp_bank_transfer_payments: true,
|
|
2301
|
+
kakao_pay_payments: true,
|
|
2302
|
+
klarna_payments: true,
|
|
2303
|
+
konbini_payments: true,
|
|
2304
|
+
kr_card_payments: true,
|
|
2305
|
+
legacy_payments: true,
|
|
2306
|
+
link_payments: true,
|
|
2307
|
+
mobilepay_payments: true,
|
|
2308
|
+
multibanco_payments: true,
|
|
2309
|
+
mx_bank_transfer_payments: true,
|
|
2310
|
+
naver_pay_payments: true,
|
|
2311
|
+
oxxo_payments: true,
|
|
2312
|
+
p24_payments: true,
|
|
2313
|
+
pay_by_bank_payments: true,
|
|
2314
|
+
payco_payments: true,
|
|
2315
|
+
paynow_payments: true,
|
|
2316
|
+
promptpay_payments: true,
|
|
2317
|
+
revolut_pay_payments: true,
|
|
2318
|
+
samsung_pay_payments: true,
|
|
2319
|
+
sepa_bank_transfer_payments: true,
|
|
2320
|
+
sepa_debit_payments: true,
|
|
2321
|
+
sofort_payments: true,
|
|
2322
|
+
swish_payments: true,
|
|
2323
|
+
tax_reporting_us_1099_k: true,
|
|
2324
|
+
tax_reporting_us_1099_misc: true,
|
|
2325
|
+
transfers: true,
|
|
2326
|
+
treasury: true,
|
|
2327
|
+
twint_payments: true,
|
|
2328
|
+
us_bank_account_ach_payments: true,
|
|
2329
|
+
us_bank_transfer_payments: true,
|
|
2330
|
+
zip_payments: true
|
|
2331
|
+
},
|
|
2332
|
+
requirements: {
|
|
2333
|
+
alternatives: {
|
|
2334
|
+
alternative_fields_due: true,
|
|
2335
|
+
original_fields_due: true
|
|
2336
|
+
},
|
|
2337
|
+
current_deadline: true,
|
|
2338
|
+
currently_due: true,
|
|
2339
|
+
disabled_reason: true,
|
|
2340
|
+
errors: {
|
|
2341
|
+
code: true,
|
|
2342
|
+
reason: true,
|
|
2343
|
+
requirement: true
|
|
2344
|
+
},
|
|
2345
|
+
eventually_due: true,
|
|
2346
|
+
past_due: true,
|
|
2347
|
+
pending_verification: true
|
|
2348
|
+
},
|
|
2349
|
+
future_requirements: {
|
|
2350
|
+
alternatives: {
|
|
2351
|
+
alternative_fields_due: true,
|
|
2352
|
+
original_fields_due: true
|
|
2353
|
+
},
|
|
2354
|
+
current_deadline: true,
|
|
2355
|
+
currently_due: true,
|
|
2356
|
+
disabled_reason: true,
|
|
2357
|
+
errors: {
|
|
2358
|
+
code: true,
|
|
2359
|
+
reason: true,
|
|
2360
|
+
requirement: true
|
|
2361
|
+
},
|
|
2362
|
+
eventually_due: true,
|
|
2363
|
+
past_due: true,
|
|
2364
|
+
pending_verification: true
|
|
2365
|
+
},
|
|
2366
|
+
type: true,
|
|
2367
|
+
charges_enabled: true,
|
|
2368
|
+
payouts_enabled: true,
|
|
2369
|
+
created: true,
|
|
2370
|
+
default_currency: true
|
|
2371
|
+
}
|
|
2263
2372
|
}
|
|
2264
2373
|
};
|
|
2265
2374
|
try {
|
|
@@ -4652,6 +4761,954 @@ class VTXBaseAPI {
|
|
|
4652
4761
|
}
|
|
4653
4762
|
return retValue;
|
|
4654
4763
|
}
|
|
4764
|
+
async createStripeAccount(dto, desiredFields) {
|
|
4765
|
+
const client = (0, client_1.createClient)({
|
|
4766
|
+
url: this.backendUrl + "/graphql",
|
|
4767
|
+
headers: this.headers,
|
|
4768
|
+
});
|
|
4769
|
+
const fields = desiredFields ?? {
|
|
4770
|
+
_id: true,
|
|
4771
|
+
stripeAccountId: true,
|
|
4772
|
+
account: {
|
|
4773
|
+
id: true,
|
|
4774
|
+
object: true,
|
|
4775
|
+
business_type: true,
|
|
4776
|
+
country: true,
|
|
4777
|
+
email: true,
|
|
4778
|
+
capabilities: {
|
|
4779
|
+
acss_debit_payments: true,
|
|
4780
|
+
affirm_payments: true,
|
|
4781
|
+
afterpay_clearpay_payments: true,
|
|
4782
|
+
alma_payments: true,
|
|
4783
|
+
amazon_pay_payments: true,
|
|
4784
|
+
au_becs_debit_payments: true,
|
|
4785
|
+
bacs_debit_payments: true,
|
|
4786
|
+
bancontact_payments: true,
|
|
4787
|
+
bank_transfer_payments: true,
|
|
4788
|
+
blik_payments: true,
|
|
4789
|
+
boleto_payments: true,
|
|
4790
|
+
card_issuing: true,
|
|
4791
|
+
card_payments: true,
|
|
4792
|
+
cartes_bancaires_payments: true,
|
|
4793
|
+
cashapp_payments: true,
|
|
4794
|
+
eps_payments: true,
|
|
4795
|
+
fpx_payments: true,
|
|
4796
|
+
gb_bank_transfer_payments: true,
|
|
4797
|
+
giropay_payments: true,
|
|
4798
|
+
grabpay_payments: true,
|
|
4799
|
+
ideal_payments: true,
|
|
4800
|
+
india_international_payments: true,
|
|
4801
|
+
jcb_payments: true,
|
|
4802
|
+
jp_bank_transfer_payments: true,
|
|
4803
|
+
kakao_pay_payments: true,
|
|
4804
|
+
klarna_payments: true,
|
|
4805
|
+
konbini_payments: true,
|
|
4806
|
+
kr_card_payments: true,
|
|
4807
|
+
legacy_payments: true,
|
|
4808
|
+
link_payments: true,
|
|
4809
|
+
mobilepay_payments: true,
|
|
4810
|
+
multibanco_payments: true,
|
|
4811
|
+
mx_bank_transfer_payments: true,
|
|
4812
|
+
naver_pay_payments: true,
|
|
4813
|
+
oxxo_payments: true,
|
|
4814
|
+
p24_payments: true,
|
|
4815
|
+
pay_by_bank_payments: true,
|
|
4816
|
+
payco_payments: true,
|
|
4817
|
+
paynow_payments: true,
|
|
4818
|
+
promptpay_payments: true,
|
|
4819
|
+
revolut_pay_payments: true,
|
|
4820
|
+
samsung_pay_payments: true,
|
|
4821
|
+
sepa_bank_transfer_payments: true,
|
|
4822
|
+
sepa_debit_payments: true,
|
|
4823
|
+
sofort_payments: true,
|
|
4824
|
+
swish_payments: true,
|
|
4825
|
+
tax_reporting_us_1099_k: true,
|
|
4826
|
+
tax_reporting_us_1099_misc: true,
|
|
4827
|
+
transfers: true,
|
|
4828
|
+
treasury: true,
|
|
4829
|
+
twint_payments: true,
|
|
4830
|
+
us_bank_account_ach_payments: true,
|
|
4831
|
+
us_bank_transfer_payments: true,
|
|
4832
|
+
zip_payments: true
|
|
4833
|
+
},
|
|
4834
|
+
requirements: {
|
|
4835
|
+
alternatives: {
|
|
4836
|
+
alternative_fields_due: true,
|
|
4837
|
+
original_fields_due: true
|
|
4838
|
+
},
|
|
4839
|
+
current_deadline: true,
|
|
4840
|
+
currently_due: true,
|
|
4841
|
+
disabled_reason: true,
|
|
4842
|
+
errors: {
|
|
4843
|
+
code: true,
|
|
4844
|
+
reason: true,
|
|
4845
|
+
requirement: true
|
|
4846
|
+
},
|
|
4847
|
+
eventually_due: true,
|
|
4848
|
+
past_due: true,
|
|
4849
|
+
pending_verification: true
|
|
4850
|
+
},
|
|
4851
|
+
future_requirements: {
|
|
4852
|
+
alternatives: {
|
|
4853
|
+
alternative_fields_due: true,
|
|
4854
|
+
original_fields_due: true
|
|
4855
|
+
},
|
|
4856
|
+
current_deadline: true,
|
|
4857
|
+
currently_due: true,
|
|
4858
|
+
disabled_reason: true,
|
|
4859
|
+
errors: {
|
|
4860
|
+
code: true,
|
|
4861
|
+
reason: true,
|
|
4862
|
+
requirement: true
|
|
4863
|
+
},
|
|
4864
|
+
eventually_due: true,
|
|
4865
|
+
past_due: true,
|
|
4866
|
+
pending_verification: true
|
|
4867
|
+
},
|
|
4868
|
+
type: true,
|
|
4869
|
+
charges_enabled: true,
|
|
4870
|
+
payouts_enabled: true,
|
|
4871
|
+
created: true,
|
|
4872
|
+
default_currency: true
|
|
4873
|
+
}
|
|
4874
|
+
};
|
|
4875
|
+
fields._id = true;
|
|
4876
|
+
let retValue = {};
|
|
4877
|
+
try {
|
|
4878
|
+
const response = await client.mutation({
|
|
4879
|
+
createStripeAccount: {
|
|
4880
|
+
__args: {
|
|
4881
|
+
input: dto
|
|
4882
|
+
},
|
|
4883
|
+
...fields
|
|
4884
|
+
}
|
|
4885
|
+
});
|
|
4886
|
+
VTXBaseAPI.Logger.debug('createStripeAccount Response:');
|
|
4887
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4888
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createStripeAccount', (r) => {
|
|
4889
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4890
|
+
const isResponseOk = true && response?.createStripeAccount?._id;
|
|
4891
|
+
return isResponseOk;
|
|
4892
|
+
});
|
|
4893
|
+
}
|
|
4894
|
+
catch (error1) {
|
|
4895
|
+
VTXBaseAPI.Logger.error('createStripeAccount err1:');
|
|
4896
|
+
VTXBaseAPI.Logger.error(error1);
|
|
4897
|
+
retValue = (0, response_builder_1.buildErrorResponse)(error1);
|
|
4898
|
+
}
|
|
4899
|
+
return retValue;
|
|
4900
|
+
}
|
|
4901
|
+
async createAthleteStripeSession(desiredFields) {
|
|
4902
|
+
const client = (0, client_1.createClient)({
|
|
4903
|
+
url: this.backendUrl + "/graphql",
|
|
4904
|
+
headers: this.headers,
|
|
4905
|
+
});
|
|
4906
|
+
const fields = desiredFields ?? {
|
|
4907
|
+
account: true,
|
|
4908
|
+
client_secret: true,
|
|
4909
|
+
expires_at: true,
|
|
4910
|
+
livemode: true
|
|
4911
|
+
};
|
|
4912
|
+
fields.client_secret = true;
|
|
4913
|
+
let retValue = {};
|
|
4914
|
+
try {
|
|
4915
|
+
const response = await client.mutation({
|
|
4916
|
+
createAthleteStripeSession: {
|
|
4917
|
+
__args: {},
|
|
4918
|
+
...fields
|
|
4919
|
+
}
|
|
4920
|
+
});
|
|
4921
|
+
VTXBaseAPI.Logger.debug('createAthleteStripeSession Response:');
|
|
4922
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4923
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createAthleteStripeSession', (r) => {
|
|
4924
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4925
|
+
const isResponseOk = true && response?.createAthleteStripeSession?.client_secret;
|
|
4926
|
+
return isResponseOk;
|
|
4927
|
+
});
|
|
4928
|
+
}
|
|
4929
|
+
catch (error1) {
|
|
4930
|
+
VTXBaseAPI.Logger.error('createAthleteStripeSession err1:');
|
|
4931
|
+
VTXBaseAPI.Logger.error(error1);
|
|
4932
|
+
retValue = (0, response_builder_1.buildErrorResponse)(error1);
|
|
4933
|
+
}
|
|
4934
|
+
return retValue;
|
|
4935
|
+
}
|
|
4936
|
+
async createStripeCheckoutSession(dto, desiredFields) {
|
|
4937
|
+
const client = (0, client_1.createClient)({
|
|
4938
|
+
url: this.backendUrl + "/graphql",
|
|
4939
|
+
headers: this.headers,
|
|
4940
|
+
});
|
|
4941
|
+
const fields = desiredFields ?? {
|
|
4942
|
+
client_secret: true,
|
|
4943
|
+
expires_at: true,
|
|
4944
|
+
livemode: true
|
|
4945
|
+
};
|
|
4946
|
+
fields.client_secret = true;
|
|
4947
|
+
let retValue = {};
|
|
4948
|
+
try {
|
|
4949
|
+
const response = await client.mutation({
|
|
4950
|
+
createStripeCheckoutSession: {
|
|
4951
|
+
__args: {
|
|
4952
|
+
input: dto
|
|
4953
|
+
},
|
|
4954
|
+
...fields
|
|
4955
|
+
}
|
|
4956
|
+
});
|
|
4957
|
+
VTXBaseAPI.Logger.debug('createStripeCheckoutSession Response:');
|
|
4958
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4959
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'createStripeCheckoutSession', (r) => {
|
|
4960
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4961
|
+
const isResponseOk = true && response?.createStripeCheckoutSession?.client_secret;
|
|
4962
|
+
return isResponseOk;
|
|
4963
|
+
});
|
|
4964
|
+
}
|
|
4965
|
+
catch (error1) {
|
|
4966
|
+
VTXBaseAPI.Logger.error('createStripeCheckoutSession err1:');
|
|
4967
|
+
VTXBaseAPI.Logger.error(error1);
|
|
4968
|
+
retValue = (0, response_builder_1.buildErrorResponse)(error1);
|
|
4969
|
+
}
|
|
4970
|
+
return retValue;
|
|
4971
|
+
}
|
|
4972
|
+
async getDatabaseTextFile(dto, desiredFields) {
|
|
4973
|
+
const client = (0, client_1.createClient)({
|
|
4974
|
+
url: this.backendUrl + "/graphql",
|
|
4975
|
+
headers: this.headers,
|
|
4976
|
+
});
|
|
4977
|
+
const fields = desiredFields ? { ...desiredFields } : {
|
|
4978
|
+
_id: true,
|
|
4979
|
+
identifier: true,
|
|
4980
|
+
version: true,
|
|
4981
|
+
contentType: true,
|
|
4982
|
+
updated: true,
|
|
4983
|
+
created: true,
|
|
4984
|
+
content: true
|
|
4985
|
+
};
|
|
4986
|
+
fields._id = true;
|
|
4987
|
+
let retValue;
|
|
4988
|
+
try {
|
|
4989
|
+
const response = await client.query({
|
|
4990
|
+
getDatabaseTextFile: {
|
|
4991
|
+
__args: { input: dto },
|
|
4992
|
+
...fields
|
|
4993
|
+
}
|
|
4994
|
+
});
|
|
4995
|
+
VTXBaseAPI.Logger.debug('getDatabaseTextFile Response:');
|
|
4996
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4997
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'getDatabaseTextFile', (r) => {
|
|
4998
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
4999
|
+
const isResponseOk = true && response?.getDatabaseTextFile._id;
|
|
5000
|
+
return isResponseOk;
|
|
5001
|
+
});
|
|
5002
|
+
}
|
|
5003
|
+
catch (err1) {
|
|
5004
|
+
VTXBaseAPI.Logger.error('getDatabaseTextFile err1:');
|
|
5005
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5006
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5007
|
+
}
|
|
5008
|
+
return retValue;
|
|
5009
|
+
}
|
|
5010
|
+
async stripeQuery(dto) {
|
|
5011
|
+
const client = (0, client_1.createClient)({
|
|
5012
|
+
url: this.backendUrl + "/graphql",
|
|
5013
|
+
headers: this.headers,
|
|
5014
|
+
});
|
|
5015
|
+
const fields = {
|
|
5016
|
+
type: true,
|
|
5017
|
+
json: true
|
|
5018
|
+
};
|
|
5019
|
+
let retValue;
|
|
5020
|
+
try {
|
|
5021
|
+
const response = await client.query({
|
|
5022
|
+
stripeQuery: {
|
|
5023
|
+
__args: { input: dto },
|
|
5024
|
+
...fields
|
|
5025
|
+
}
|
|
5026
|
+
});
|
|
5027
|
+
VTXBaseAPI.Logger.debug('stripeQuery Response:');
|
|
5028
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5029
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'stripeQuery', (r) => {
|
|
5030
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5031
|
+
const isResponseOk = true && response?.stripeQuery.type;
|
|
5032
|
+
return isResponseOk;
|
|
5033
|
+
});
|
|
5034
|
+
}
|
|
5035
|
+
catch (err1) {
|
|
5036
|
+
VTXBaseAPI.Logger.error('stripeQuery err1:');
|
|
5037
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5038
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5039
|
+
}
|
|
5040
|
+
return retValue;
|
|
5041
|
+
}
|
|
5042
|
+
async setFundingStatus(dto, desiredFields) {
|
|
5043
|
+
const client = (0, client_1.createClient)({
|
|
5044
|
+
url: this.backendUrl + '/graphql',
|
|
5045
|
+
headers: this.headers,
|
|
5046
|
+
});
|
|
5047
|
+
let retValue = {};
|
|
5048
|
+
const fields = desiredFields ?? {
|
|
5049
|
+
_id: true,
|
|
5050
|
+
budgetMode: true,
|
|
5051
|
+
status: true,
|
|
5052
|
+
title: true,
|
|
5053
|
+
motivation: true,
|
|
5054
|
+
website: true,
|
|
5055
|
+
fundsRequired: true,
|
|
5056
|
+
initialFundsObtained: true,
|
|
5057
|
+
fundsObtained: true,
|
|
5058
|
+
location: {
|
|
5059
|
+
userProvidedLatitude: true,
|
|
5060
|
+
userProvidedLongitude: true,
|
|
5061
|
+
cityNameGeocode: true,
|
|
5062
|
+
stateNameGeocode: true,
|
|
5063
|
+
countryIso2CodeGeocode: true,
|
|
5064
|
+
timeZoneGeocode: true,
|
|
5065
|
+
latitudeGeocode: true,
|
|
5066
|
+
longitudeGeocode: true,
|
|
5067
|
+
city: {
|
|
5068
|
+
_id: true,
|
|
5069
|
+
name: true,
|
|
5070
|
+
localizedName: true,
|
|
5071
|
+
state: {
|
|
5072
|
+
_id: true,
|
|
5073
|
+
name: true,
|
|
5074
|
+
country: {
|
|
5075
|
+
_id: true,
|
|
5076
|
+
name: true
|
|
5077
|
+
}
|
|
5078
|
+
},
|
|
5079
|
+
latitude: true,
|
|
5080
|
+
longitude: true,
|
|
5081
|
+
timezone: true,
|
|
5082
|
+
}
|
|
5083
|
+
},
|
|
5084
|
+
endingDate: true,
|
|
5085
|
+
budget: {
|
|
5086
|
+
initialFunds: true,
|
|
5087
|
+
totalRequired: true,
|
|
5088
|
+
items: {
|
|
5089
|
+
_id: true,
|
|
5090
|
+
quantity: true,
|
|
5091
|
+
concept: true,
|
|
5092
|
+
itemCost: true
|
|
5093
|
+
}
|
|
5094
|
+
},
|
|
5095
|
+
competitions: {
|
|
5096
|
+
_id: true,
|
|
5097
|
+
event: {
|
|
5098
|
+
_id: true,
|
|
5099
|
+
name: true,
|
|
5100
|
+
mainSport: {
|
|
5101
|
+
_id: true,
|
|
5102
|
+
name: true
|
|
5103
|
+
},
|
|
5104
|
+
eventWebSite: true,
|
|
5105
|
+
startDate: true,
|
|
5106
|
+
endDate: true,
|
|
5107
|
+
verified: true,
|
|
5108
|
+
banner: {
|
|
5109
|
+
_id: true,
|
|
5110
|
+
name: true,
|
|
5111
|
+
contentType: true,
|
|
5112
|
+
size: true,
|
|
5113
|
+
useType: true,
|
|
5114
|
+
url: true,
|
|
5115
|
+
key: true
|
|
5116
|
+
},
|
|
5117
|
+
location: {
|
|
5118
|
+
_id: true,
|
|
5119
|
+
userProvidedLatitude: true,
|
|
5120
|
+
userProvidedLongitude: true,
|
|
5121
|
+
cityNameGeocode: true,
|
|
5122
|
+
stateNameGeocode: true,
|
|
5123
|
+
countryIso2CodeGeocode: true,
|
|
5124
|
+
timeZoneGeocode: true,
|
|
5125
|
+
latitudeGeocode: true,
|
|
5126
|
+
longitudeGeocode: true,
|
|
5127
|
+
city: {
|
|
5128
|
+
_id: true,
|
|
5129
|
+
name: true,
|
|
5130
|
+
localizedName: true,
|
|
5131
|
+
state: {
|
|
5132
|
+
_id: true,
|
|
5133
|
+
name: true,
|
|
5134
|
+
country: {
|
|
5135
|
+
_id: true,
|
|
5136
|
+
name: true
|
|
5137
|
+
}
|
|
5138
|
+
},
|
|
5139
|
+
latitude: true,
|
|
5140
|
+
longitude: true,
|
|
5141
|
+
timezone: true,
|
|
5142
|
+
}
|
|
5143
|
+
},
|
|
5144
|
+
},
|
|
5145
|
+
participationDate: true,
|
|
5146
|
+
competitionNumber: true,
|
|
5147
|
+
result: {
|
|
5148
|
+
resultType: true,
|
|
5149
|
+
position: true,
|
|
5150
|
+
score: true,
|
|
5151
|
+
finishTimeMS: true,
|
|
5152
|
+
resultWebLink: true
|
|
5153
|
+
},
|
|
5154
|
+
fundRaisingCampaignIds: true
|
|
5155
|
+
}
|
|
5156
|
+
};
|
|
5157
|
+
fields._id = true;
|
|
5158
|
+
try {
|
|
5159
|
+
const response = await client.mutation({
|
|
5160
|
+
setFundingStatus: {
|
|
5161
|
+
__args: {
|
|
5162
|
+
input: dto
|
|
5163
|
+
},
|
|
5164
|
+
...fields
|
|
5165
|
+
},
|
|
5166
|
+
});
|
|
5167
|
+
VTXBaseAPI.Logger.log("==================HERE=====================================");
|
|
5168
|
+
VTXBaseAPI.Logger.log('setFundingStatus Response:');
|
|
5169
|
+
VTXBaseAPI.Logger.log(JSON.stringify(response, null, 2));
|
|
5170
|
+
VTXBaseAPI.Logger.log("==================DONE=====================================");
|
|
5171
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'setFundingStatus', (r) => {
|
|
5172
|
+
const isResponseOk = true && response?.setFundingStatus?._id;
|
|
5173
|
+
return isResponseOk;
|
|
5174
|
+
});
|
|
5175
|
+
}
|
|
5176
|
+
catch (err1) {
|
|
5177
|
+
VTXBaseAPI.Logger.log("************** ERROR *******************************");
|
|
5178
|
+
VTXBaseAPI.Logger.log('setFundingStatus err1:');
|
|
5179
|
+
VTXBaseAPI.Logger.log(err1);
|
|
5180
|
+
VTXBaseAPI.Logger.log("************** DONE ERROR **************************");
|
|
5181
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5182
|
+
}
|
|
5183
|
+
return retValue;
|
|
5184
|
+
}
|
|
5185
|
+
async findAthleteForIdPublic(id) {
|
|
5186
|
+
const client = (0, client_1.createClient)({
|
|
5187
|
+
url: this.backendUrl + "/graphql",
|
|
5188
|
+
headers: this.headers,
|
|
5189
|
+
});
|
|
5190
|
+
let retValue = {};
|
|
5191
|
+
const fields = {
|
|
5192
|
+
_id: true,
|
|
5193
|
+
firstName: true,
|
|
5194
|
+
lastName: true,
|
|
5195
|
+
screenName: true,
|
|
5196
|
+
dob: true,
|
|
5197
|
+
lgbt: true,
|
|
5198
|
+
competitionGender: true,
|
|
5199
|
+
country: {
|
|
5200
|
+
_id: true,
|
|
5201
|
+
name: true
|
|
5202
|
+
},
|
|
5203
|
+
location: {
|
|
5204
|
+
userProvidedLatitude: true,
|
|
5205
|
+
userProvidedLongitude: true,
|
|
5206
|
+
cityNameGeocode: true,
|
|
5207
|
+
stateNameGeocode: true,
|
|
5208
|
+
countryIso2CodeGeocode: true,
|
|
5209
|
+
timeZoneGeocode: true,
|
|
5210
|
+
latitudeGeocode: true,
|
|
5211
|
+
longitudeGeocode: true,
|
|
5212
|
+
city: {
|
|
5213
|
+
_id: true,
|
|
5214
|
+
name: true,
|
|
5215
|
+
localizedName: true,
|
|
5216
|
+
state: {
|
|
5217
|
+
_id: true,
|
|
5218
|
+
name: true,
|
|
5219
|
+
country: {
|
|
5220
|
+
_id: true,
|
|
5221
|
+
name: true
|
|
5222
|
+
}
|
|
5223
|
+
},
|
|
5224
|
+
latitude: true,
|
|
5225
|
+
longitude: true,
|
|
5226
|
+
timezone: true,
|
|
5227
|
+
}
|
|
5228
|
+
},
|
|
5229
|
+
trainer: true,
|
|
5230
|
+
trainerUrl: true,
|
|
5231
|
+
aboutMe: true,
|
|
5232
|
+
followStats: {
|
|
5233
|
+
followers: true,
|
|
5234
|
+
followed: true,
|
|
5235
|
+
raves: true,
|
|
5236
|
+
favorites: true
|
|
5237
|
+
},
|
|
5238
|
+
mainSport: {
|
|
5239
|
+
_id: true,
|
|
5240
|
+
name: true
|
|
5241
|
+
},
|
|
5242
|
+
mainSportLevel: {
|
|
5243
|
+
_id: true,
|
|
5244
|
+
label: true,
|
|
5245
|
+
index: true
|
|
5246
|
+
},
|
|
5247
|
+
scores: {
|
|
5248
|
+
vtxScore: true,
|
|
5249
|
+
socialScore: true,
|
|
5250
|
+
trainingScore: true,
|
|
5251
|
+
competitionScore: true
|
|
5252
|
+
},
|
|
5253
|
+
rankings: {
|
|
5254
|
+
worldRanking: {
|
|
5255
|
+
scope: true,
|
|
5256
|
+
scopeId: true,
|
|
5257
|
+
scopeName: true,
|
|
5258
|
+
position: true,
|
|
5259
|
+
total: true
|
|
5260
|
+
},
|
|
5261
|
+
countryRanking: {
|
|
5262
|
+
scope: true,
|
|
5263
|
+
scopeId: true,
|
|
5264
|
+
scopeName: true,
|
|
5265
|
+
position: true,
|
|
5266
|
+
total: true
|
|
5267
|
+
},
|
|
5268
|
+
stateRanking: {
|
|
5269
|
+
scope: true,
|
|
5270
|
+
scopeId: true,
|
|
5271
|
+
scopeName: true,
|
|
5272
|
+
position: true,
|
|
5273
|
+
total: true
|
|
5274
|
+
},
|
|
5275
|
+
cityRanking: {
|
|
5276
|
+
scope: true,
|
|
5277
|
+
scopeId: true,
|
|
5278
|
+
scopeName: true,
|
|
5279
|
+
position: true,
|
|
5280
|
+
total: true
|
|
5281
|
+
},
|
|
5282
|
+
},
|
|
5283
|
+
allSports: {
|
|
5284
|
+
_id: true,
|
|
5285
|
+
name: true
|
|
5286
|
+
},
|
|
5287
|
+
teams: {
|
|
5288
|
+
_id: true,
|
|
5289
|
+
name: true,
|
|
5290
|
+
description: true,
|
|
5291
|
+
approved: true,
|
|
5292
|
+
logo: {
|
|
5293
|
+
_id: true,
|
|
5294
|
+
name: true,
|
|
5295
|
+
contentType: true,
|
|
5296
|
+
size: true,
|
|
5297
|
+
useType: true,
|
|
5298
|
+
url: true,
|
|
5299
|
+
key: true
|
|
5300
|
+
},
|
|
5301
|
+
banner: {
|
|
5302
|
+
_id: true,
|
|
5303
|
+
name: true,
|
|
5304
|
+
contentType: true,
|
|
5305
|
+
size: true,
|
|
5306
|
+
useType: true,
|
|
5307
|
+
url: true,
|
|
5308
|
+
key: true
|
|
5309
|
+
}
|
|
5310
|
+
},
|
|
5311
|
+
sponsorBrands: {
|
|
5312
|
+
_id: true,
|
|
5313
|
+
name: true,
|
|
5314
|
+
slogan: true,
|
|
5315
|
+
website: true,
|
|
5316
|
+
description: true,
|
|
5317
|
+
approved: true,
|
|
5318
|
+
published: true,
|
|
5319
|
+
logo: {
|
|
5320
|
+
_id: true,
|
|
5321
|
+
name: true,
|
|
5322
|
+
contentType: true,
|
|
5323
|
+
size: true,
|
|
5324
|
+
useType: true,
|
|
5325
|
+
url: true,
|
|
5326
|
+
key: true
|
|
5327
|
+
},
|
|
5328
|
+
stats: {
|
|
5329
|
+
campaigns: true,
|
|
5330
|
+
sponsorships: true,
|
|
5331
|
+
sports: true,
|
|
5332
|
+
athletes: true
|
|
5333
|
+
},
|
|
5334
|
+
operatorIds: true,
|
|
5335
|
+
},
|
|
5336
|
+
competitions: {
|
|
5337
|
+
_id: true,
|
|
5338
|
+
event: {
|
|
5339
|
+
_id: true,
|
|
5340
|
+
name: true,
|
|
5341
|
+
mainSport: {
|
|
5342
|
+
_id: true,
|
|
5343
|
+
name: true
|
|
5344
|
+
},
|
|
5345
|
+
eventWebSite: true,
|
|
5346
|
+
startDate: true,
|
|
5347
|
+
endDate: true,
|
|
5348
|
+
verified: true,
|
|
5349
|
+
location: {
|
|
5350
|
+
_id: true,
|
|
5351
|
+
userProvidedLatitude: true,
|
|
5352
|
+
userProvidedLongitude: true,
|
|
5353
|
+
cityNameGeocode: true,
|
|
5354
|
+
stateNameGeocode: true,
|
|
5355
|
+
countryIso2CodeGeocode: true,
|
|
5356
|
+
timeZoneGeocode: true,
|
|
5357
|
+
latitudeGeocode: true,
|
|
5358
|
+
longitudeGeocode: true,
|
|
5359
|
+
city: {
|
|
5360
|
+
_id: true,
|
|
5361
|
+
name: true,
|
|
5362
|
+
localizedName: true,
|
|
5363
|
+
state: {
|
|
5364
|
+
_id: true,
|
|
5365
|
+
name: true,
|
|
5366
|
+
country: {
|
|
5367
|
+
_id: true,
|
|
5368
|
+
name: true
|
|
5369
|
+
}
|
|
5370
|
+
},
|
|
5371
|
+
latitude: true,
|
|
5372
|
+
longitude: true,
|
|
5373
|
+
timezone: true,
|
|
5374
|
+
}
|
|
5375
|
+
},
|
|
5376
|
+
banner: {
|
|
5377
|
+
_id: true,
|
|
5378
|
+
name: true,
|
|
5379
|
+
contentType: true,
|
|
5380
|
+
size: true,
|
|
5381
|
+
useType: true,
|
|
5382
|
+
url: true,
|
|
5383
|
+
key: true
|
|
5384
|
+
}
|
|
5385
|
+
},
|
|
5386
|
+
participationDate: true,
|
|
5387
|
+
result: {
|
|
5388
|
+
_id: true,
|
|
5389
|
+
resultType: true,
|
|
5390
|
+
position: true,
|
|
5391
|
+
score: true,
|
|
5392
|
+
finishTimeMS: true,
|
|
5393
|
+
resultWebLink: true
|
|
5394
|
+
}
|
|
5395
|
+
},
|
|
5396
|
+
affiliations: {
|
|
5397
|
+
_id: true,
|
|
5398
|
+
organization: {
|
|
5399
|
+
_id: true,
|
|
5400
|
+
shortName: true,
|
|
5401
|
+
acronym: true,
|
|
5402
|
+
fullName: true,
|
|
5403
|
+
website: true,
|
|
5404
|
+
logo: {
|
|
5405
|
+
_id: true,
|
|
5406
|
+
name: true,
|
|
5407
|
+
contentType: true,
|
|
5408
|
+
size: true,
|
|
5409
|
+
useType: true,
|
|
5410
|
+
url: true,
|
|
5411
|
+
key: true
|
|
5412
|
+
}
|
|
5413
|
+
},
|
|
5414
|
+
membershipNumber: true,
|
|
5415
|
+
membershipType: true,
|
|
5416
|
+
issueDate: true,
|
|
5417
|
+
expirationDate: true,
|
|
5418
|
+
},
|
|
5419
|
+
totalUpcomingCompetitions: true,
|
|
5420
|
+
totalPastCompetitions: true,
|
|
5421
|
+
profilePicture: {
|
|
5422
|
+
_id: true,
|
|
5423
|
+
name: true,
|
|
5424
|
+
contentType: true,
|
|
5425
|
+
size: true,
|
|
5426
|
+
useType: true,
|
|
5427
|
+
url: true,
|
|
5428
|
+
key: true
|
|
5429
|
+
},
|
|
5430
|
+
cardPicture: {
|
|
5431
|
+
_id: true,
|
|
5432
|
+
name: true,
|
|
5433
|
+
contentType: true,
|
|
5434
|
+
size: true,
|
|
5435
|
+
useType: true,
|
|
5436
|
+
url: true,
|
|
5437
|
+
key: true
|
|
5438
|
+
},
|
|
5439
|
+
preferences: {
|
|
5440
|
+
_id: true,
|
|
5441
|
+
showProfileHelper: true
|
|
5442
|
+
},
|
|
5443
|
+
currentCampaign: {
|
|
5444
|
+
_id: true,
|
|
5445
|
+
budgetMode: true,
|
|
5446
|
+
status: true,
|
|
5447
|
+
title: true,
|
|
5448
|
+
motivation: true,
|
|
5449
|
+
website: true,
|
|
5450
|
+
fundsRequired: true,
|
|
5451
|
+
initialFundsObtained: true,
|
|
5452
|
+
fundsObtained: true,
|
|
5453
|
+
location: {
|
|
5454
|
+
_id: true,
|
|
5455
|
+
userProvidedLatitude: true,
|
|
5456
|
+
userProvidedLongitude: true,
|
|
5457
|
+
cityNameGeocode: true,
|
|
5458
|
+
stateNameGeocode: true,
|
|
5459
|
+
countryIso2CodeGeocode: true,
|
|
5460
|
+
timeZoneGeocode: true,
|
|
5461
|
+
latitudeGeocode: true,
|
|
5462
|
+
longitudeGeocode: true,
|
|
5463
|
+
city: {
|
|
5464
|
+
_id: true,
|
|
5465
|
+
name: true,
|
|
5466
|
+
localizedName: true,
|
|
5467
|
+
state: {
|
|
5468
|
+
_id: true,
|
|
5469
|
+
name: true,
|
|
5470
|
+
country: {
|
|
5471
|
+
_id: true,
|
|
5472
|
+
name: true
|
|
5473
|
+
}
|
|
5474
|
+
},
|
|
5475
|
+
latitude: true,
|
|
5476
|
+
longitude: true,
|
|
5477
|
+
timezone: true,
|
|
5478
|
+
}
|
|
5479
|
+
},
|
|
5480
|
+
endingDate: true,
|
|
5481
|
+
budget: {
|
|
5482
|
+
_id: true,
|
|
5483
|
+
initialFunds: true,
|
|
5484
|
+
totalRequired: true,
|
|
5485
|
+
items: {
|
|
5486
|
+
_id: true,
|
|
5487
|
+
quantity: true,
|
|
5488
|
+
concept: true,
|
|
5489
|
+
itemCost: true
|
|
5490
|
+
}
|
|
5491
|
+
},
|
|
5492
|
+
competitions: {
|
|
5493
|
+
_id: true,
|
|
5494
|
+
event: {
|
|
5495
|
+
_id: true,
|
|
5496
|
+
name: true,
|
|
5497
|
+
mainSport: {
|
|
5498
|
+
_id: true,
|
|
5499
|
+
name: true
|
|
5500
|
+
},
|
|
5501
|
+
eventWebSite: true,
|
|
5502
|
+
startDate: true,
|
|
5503
|
+
endDate: true,
|
|
5504
|
+
verified: true,
|
|
5505
|
+
banner: {
|
|
5506
|
+
_id: true,
|
|
5507
|
+
name: true,
|
|
5508
|
+
contentType: true,
|
|
5509
|
+
size: true,
|
|
5510
|
+
useType: true,
|
|
5511
|
+
url: true,
|
|
5512
|
+
key: true
|
|
5513
|
+
},
|
|
5514
|
+
location: {
|
|
5515
|
+
_id: true,
|
|
5516
|
+
userProvidedLatitude: true,
|
|
5517
|
+
userProvidedLongitude: true,
|
|
5518
|
+
cityNameGeocode: true,
|
|
5519
|
+
stateNameGeocode: true,
|
|
5520
|
+
countryIso2CodeGeocode: true,
|
|
5521
|
+
timeZoneGeocode: true,
|
|
5522
|
+
latitudeGeocode: true,
|
|
5523
|
+
longitudeGeocode: true,
|
|
5524
|
+
city: {
|
|
5525
|
+
_id: true,
|
|
5526
|
+
name: true,
|
|
5527
|
+
localizedName: true,
|
|
5528
|
+
state: {
|
|
5529
|
+
_id: true,
|
|
5530
|
+
name: true,
|
|
5531
|
+
country: {
|
|
5532
|
+
_id: true,
|
|
5533
|
+
name: true
|
|
5534
|
+
}
|
|
5535
|
+
},
|
|
5536
|
+
latitude: true,
|
|
5537
|
+
longitude: true,
|
|
5538
|
+
timezone: true,
|
|
5539
|
+
}
|
|
5540
|
+
},
|
|
5541
|
+
},
|
|
5542
|
+
participationDate: true,
|
|
5543
|
+
result: {
|
|
5544
|
+
_id: true,
|
|
5545
|
+
resultType: true,
|
|
5546
|
+
position: true,
|
|
5547
|
+
score: true,
|
|
5548
|
+
finishTimeMS: true,
|
|
5549
|
+
resultWebLink: true
|
|
5550
|
+
}
|
|
5551
|
+
}
|
|
5552
|
+
}
|
|
5553
|
+
};
|
|
5554
|
+
try {
|
|
5555
|
+
let response = null;
|
|
5556
|
+
response = await client.query({
|
|
5557
|
+
findAthletebyIdpublic: {
|
|
5558
|
+
__args: {
|
|
5559
|
+
athleteId: id
|
|
5560
|
+
},
|
|
5561
|
+
...fields
|
|
5562
|
+
}
|
|
5563
|
+
});
|
|
5564
|
+
VTXBaseAPI.Logger.debug('findAthletebyIdpublic Response:');
|
|
5565
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5566
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'findAthletebyIdpublic', (r) => {
|
|
5567
|
+
const isResponseOk = true && response?.findAthletebyIdpublic?._id;
|
|
5568
|
+
return isResponseOk;
|
|
5569
|
+
});
|
|
5570
|
+
}
|
|
5571
|
+
catch (err1) {
|
|
5572
|
+
VTXBaseAPI.Logger.error('findAthleteForUser err1:');
|
|
5573
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5574
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5575
|
+
}
|
|
5576
|
+
return retValue;
|
|
5577
|
+
}
|
|
5578
|
+
async editPicture(newPicDto) {
|
|
5579
|
+
console.log('HEADERS:');
|
|
5580
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5581
|
+
const client = (0, client_1.createClient)({
|
|
5582
|
+
url: this.backendUrl + '/graphql',
|
|
5583
|
+
headers: this.headers,
|
|
5584
|
+
});
|
|
5585
|
+
let retValue = {};
|
|
5586
|
+
const fields = {
|
|
5587
|
+
field: true,
|
|
5588
|
+
oldValue: {
|
|
5589
|
+
_id: true,
|
|
5590
|
+
name: true,
|
|
5591
|
+
contentType: true,
|
|
5592
|
+
size: true,
|
|
5593
|
+
useType: true,
|
|
5594
|
+
url: true,
|
|
5595
|
+
key: true
|
|
5596
|
+
},
|
|
5597
|
+
newValue: {
|
|
5598
|
+
_id: true,
|
|
5599
|
+
name: true,
|
|
5600
|
+
contentType: true,
|
|
5601
|
+
size: true,
|
|
5602
|
+
useType: true,
|
|
5603
|
+
url: true,
|
|
5604
|
+
key: true
|
|
5605
|
+
},
|
|
5606
|
+
changed: true
|
|
5607
|
+
};
|
|
5608
|
+
try {
|
|
5609
|
+
const response = await client.mutation({
|
|
5610
|
+
editPicture: {
|
|
5611
|
+
__args: {
|
|
5612
|
+
input: newPicDto
|
|
5613
|
+
},
|
|
5614
|
+
...fields
|
|
5615
|
+
},
|
|
5616
|
+
});
|
|
5617
|
+
VTXBaseAPI.Logger.debug('editPicture Response:');
|
|
5618
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5619
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'editPicture', (r) => {
|
|
5620
|
+
const isResponseOk = true && response?.editPicture?.field;
|
|
5621
|
+
return isResponseOk;
|
|
5622
|
+
});
|
|
5623
|
+
}
|
|
5624
|
+
catch (err1) {
|
|
5625
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
5626
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5627
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5628
|
+
}
|
|
5629
|
+
return retValue;
|
|
5630
|
+
}
|
|
5631
|
+
async DeletePictureFromBuket(deleteDto) {
|
|
5632
|
+
console.log('HEADERS:');
|
|
5633
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5634
|
+
const client = (0, client_1.createClient)({
|
|
5635
|
+
url: this.backendUrl + '/graphql',
|
|
5636
|
+
headers: this.headers,
|
|
5637
|
+
});
|
|
5638
|
+
let retValue = {};
|
|
5639
|
+
const fields = {
|
|
5640
|
+
idToDelete: true,
|
|
5641
|
+
deleted: true,
|
|
5642
|
+
failureReason: {
|
|
5643
|
+
code: true,
|
|
5644
|
+
message: true
|
|
5645
|
+
}
|
|
5646
|
+
};
|
|
5647
|
+
try {
|
|
5648
|
+
const response = await client.mutation({
|
|
5649
|
+
DeletePictureBuket: {
|
|
5650
|
+
__args: {
|
|
5651
|
+
input: deleteDto
|
|
5652
|
+
},
|
|
5653
|
+
...fields
|
|
5654
|
+
},
|
|
5655
|
+
});
|
|
5656
|
+
VTXBaseAPI.Logger.debug('deletePicture Response:');
|
|
5657
|
+
VTXBaseAPI.Logger.debug(JSON.stringify(response, null, 2));
|
|
5658
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'DeletePictureBuket', (r) => {
|
|
5659
|
+
const isResponseOk = true && response?.DeletePictureBuket?.idToDelete;
|
|
5660
|
+
return isResponseOk;
|
|
5661
|
+
});
|
|
5662
|
+
}
|
|
5663
|
+
catch (err1) {
|
|
5664
|
+
VTXBaseAPI.Logger.error('editProfileValue err1:');
|
|
5665
|
+
VTXBaseAPI.Logger.error(err1);
|
|
5666
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5667
|
+
}
|
|
5668
|
+
return retValue;
|
|
5669
|
+
}
|
|
5670
|
+
async addAlbumsPictures(dto) {
|
|
5671
|
+
console.log('HEADERS:');
|
|
5672
|
+
console.log(JSON.stringify(this.headers, null, 2));
|
|
5673
|
+
const client = (0, client_1.createClient)({
|
|
5674
|
+
url: this.backendUrl + '/graphql',
|
|
5675
|
+
headers: this.headers,
|
|
5676
|
+
});
|
|
5677
|
+
let retValue = {};
|
|
5678
|
+
const fields = {
|
|
5679
|
+
added: true,
|
|
5680
|
+
failedToAdd: true,
|
|
5681
|
+
failureReason: {
|
|
5682
|
+
code: true,
|
|
5683
|
+
message: true
|
|
5684
|
+
},
|
|
5685
|
+
result: true,
|
|
5686
|
+
};
|
|
5687
|
+
try {
|
|
5688
|
+
const response = await client.mutation({
|
|
5689
|
+
AddAlbumPictures: {
|
|
5690
|
+
__args: {
|
|
5691
|
+
input: dto
|
|
5692
|
+
},
|
|
5693
|
+
...fields
|
|
5694
|
+
},
|
|
5695
|
+
});
|
|
5696
|
+
console.log('AddAlbumsPictures Response:');
|
|
5697
|
+
console.log(JSON.stringify(response, null, 2));
|
|
5698
|
+
retValue = (0, response_builder_1.buildResponse)(response, 'AddAlbumPictures', (r) => {
|
|
5699
|
+
const isResponseOk = response?.AddAlbumPictures?.result === 'success' || response?.AddAlbumPictures?.result === 'partial';
|
|
5700
|
+
return isResponseOk;
|
|
5701
|
+
});
|
|
5702
|
+
}
|
|
5703
|
+
catch (err1) {
|
|
5704
|
+
console.error('addPictures err1:');
|
|
5705
|
+
console.error(err1);
|
|
5706
|
+
retValue = (0, response_builder_1.buildErrorResponse)(err1);
|
|
5707
|
+
}
|
|
5708
|
+
console.log('retValue:');
|
|
5709
|
+
console.log(JSON.stringify(retValue, null, 2));
|
|
5710
|
+
return retValue;
|
|
5711
|
+
}
|
|
4655
5712
|
}
|
|
4656
5713
|
exports.VTXBaseAPI = VTXBaseAPI;
|
|
4657
5714
|
VTXBaseAPI.Logger = {
|