@tonder.io/ionic-lite-sdk 0.0.35-beta.2 → 0.0.35-beta.21

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.
Files changed (40) hide show
  1. package/.idea/prettier.xml +6 -0
  2. package/.idea/workspace.xml +37 -47
  3. package/dist/classes/BaseInlineCheckout.d.ts +15 -16
  4. package/dist/classes/liteCheckout.d.ts +8 -9
  5. package/dist/data/paymentMethodApi.d.ts +1 -1
  6. package/dist/helpers/skyflow.d.ts +1 -1
  7. package/dist/helpers/utils.d.ts +1 -1
  8. package/dist/index.d.ts +3 -1
  9. package/dist/index.js +1 -1
  10. package/dist/types/card.d.ts +1 -0
  11. package/dist/types/checkout.d.ts +2 -1
  12. package/dist/types/commons.d.ts +6 -3
  13. package/dist/types/customer.d.ts +10 -0
  14. package/dist/types/transaction.d.ts +101 -0
  15. package/package.json +3 -1
  16. package/src/classes/BaseInlineCheckout.ts +363 -300
  17. package/src/classes/errorResponse.ts +1 -1
  18. package/src/classes/liteCheckout.ts +267 -213
  19. package/src/data/businessApi.ts +16 -12
  20. package/src/data/cardApi.ts +65 -62
  21. package/src/data/checkoutApi.ts +73 -60
  22. package/src/data/customerApi.ts +26 -26
  23. package/src/data/openPayApi.ts +12 -7
  24. package/src/data/paymentMethodApi.ts +32 -29
  25. package/src/data/skyflowApi.ts +18 -14
  26. package/src/helpers/mercadopago.ts +14 -14
  27. package/src/helpers/skyflow.ts +35 -29
  28. package/src/helpers/utils.ts +51 -39
  29. package/src/helpers/validations.ts +35 -35
  30. package/src/index.ts +9 -1
  31. package/src/shared/catalog/paymentMethodsCatalog.ts +8 -8
  32. package/src/shared/constants/paymentMethodAPM.ts +59 -59
  33. package/src/shared/constants/tonderUrl.ts +4 -4
  34. package/src/types/card.ts +1 -0
  35. package/src/types/checkout.ts +2 -1
  36. package/src/types/commons.ts +101 -99
  37. package/src/types/customer.ts +10 -0
  38. package/src/types/liteInlineCheckout.d.ts +207 -184
  39. package/src/types/transaction.ts +101 -0
  40. package/src/types/index.d.ts +0 -10
@@ -1,14 +1,18 @@
1
1
  import {GetBusinessResponse} from "../types/responses";
2
2
 
3
- export async function fetchBusiness(baseUrl: string, apiKey: string, signal: AbortSignal): Promise<GetBusinessResponse> {
4
- const getBusiness = await fetch(
5
- `${baseUrl}/api/v1/payments/business/${apiKey}`,
6
- {
7
- headers: {
8
- Authorization: `Token ${apiKey}`,
9
- },
10
- signal: signal,
11
- }
12
- );
13
- return await getBusiness.json();
14
- }
3
+ export async function fetchBusiness(
4
+ baseUrl: string,
5
+ apiKey: string,
6
+ signal: AbortSignal,
7
+ ): Promise<GetBusinessResponse> {
8
+ const getBusiness = await fetch(
9
+ `${baseUrl}/api/v1/payments/business/${apiKey}`,
10
+ {
11
+ headers: {
12
+ Authorization: `Token ${apiKey}`,
13
+ },
14
+ signal: signal,
15
+ },
16
+ );
17
+ return await getBusiness.json();
18
+ }
@@ -1,82 +1,85 @@
1
- import {buildErrorResponse, buildErrorResponseFromCatch} from "../helpers/utils";
1
+ import {
2
+ buildErrorResponse,
3
+ buildErrorResponseFromCatch,
4
+ } from "../helpers/utils";
5
+ import { MESSAGES } from "../shared/constants/messages";
2
6
  import {ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest} from "../types/card";
3
- import {MESSAGES} from "../shared/constants/messages";
4
7
 
5
8
  export async function fetchCustomerCards(
6
- baseUrl: string,
7
- customerToken: string,
8
- businessId: string | number,
9
- signal= null,
9
+ baseUrl: string,
10
+ customerToken: string,
11
+ businessId: string | number,
12
+ signal = null,
10
13
  ): Promise<ICustomerCardsResponse> {
11
- try {
12
- const url = `${baseUrl}/api/v1/business/${businessId}/cards/`;
13
- const response = await fetch(url, {
14
- method: "GET",
15
- headers: {
16
- Authorization: `Token ${customerToken}`,
17
- "Content-Type": "application/json",
18
- },
19
- signal,
20
- });
21
- if (response.ok) return await response.json();
22
- const res_json = await response.json();
14
+ try {
15
+ const url = `${baseUrl}/api/v1/business/${businessId}/cards/`;
16
+ const response = await fetch(url, {
17
+ method: "GET",
18
+ headers: {
19
+ Authorization: `Token ${customerToken}`,
20
+ "Content-Type": "application/json",
21
+ },
22
+ signal,
23
+ });
24
+ if (response.ok) return await response.json();
25
+ const res_json = await response.json();
23
26
 
24
- throw await buildErrorResponse(response, res_json);
25
- } catch (error) {
26
- throw buildErrorResponseFromCatch(error);
27
- }
27
+ throw await buildErrorResponse(response, res_json);
28
+ } catch (error) {
29
+ throw buildErrorResponseFromCatch(error);
30
+ }
28
31
  }
29
32
 
30
33
  export async function saveCustomerCard(
31
- baseUrl: string,
32
- customerToken: string,
33
- businessId: string | number,
34
- data: ISaveCardSkyflowRequest,
34
+ baseUrl: string,
35
+ customerToken: string,
36
+ businessId: string | number,
37
+ data: ISaveCardSkyflowRequest,
35
38
  ): Promise<ISaveCardResponse> {
36
- try {
37
- const url = `${baseUrl}/api/v1/business/${businessId}/cards/`;
38
- const response = await fetch(url, {
39
- method: "POST",
40
- headers: {
41
- Authorization: `Token ${customerToken}`,
42
- "Content-Type": "application/json",
43
- },
44
- body: JSON.stringify(data),
45
- });
39
+ try {
40
+ const url = `${baseUrl}/api/v1/business/${businessId}/cards/`;
41
+ const response = await fetch(url, {
42
+ method: "POST",
43
+ headers: {
44
+ Authorization: `Token ${customerToken}`,
45
+ "Content-Type": "application/json",
46
+ },
47
+ body: JSON.stringify(data),
48
+ });
46
49
 
47
- if (response.ok) return await response.json();
50
+ if (response.ok) return await response.json();
48
51
 
49
- const res_json = await response.json();
52
+ const res_json = await response.json();
50
53
 
51
- throw await buildErrorResponse(response, res_json);
52
- } catch (error) {
53
- throw buildErrorResponseFromCatch(error);
54
- }
54
+ throw await buildErrorResponse(response, res_json);
55
+ } catch (error) {
56
+ throw buildErrorResponseFromCatch(error);
57
+ }
55
58
  }
56
59
 
57
60
  export async function removeCustomerCard(
58
- baseUrl: string,
59
- customerToken: string,
60
- skyflowId = "",
61
- businessId: string | number,
61
+ baseUrl: string,
62
+ customerToken: string,
63
+ skyflowId = "",
64
+ businessId: string | number,
62
65
  ): Promise<string> {
63
- try {
64
- const url = `${baseUrl}/api/v1/business/${businessId}/cards/${skyflowId}`;
66
+ try {
67
+ const url = `${baseUrl}/api/v1/business/${businessId}/cards/${skyflowId}`;
65
68
 
66
- const response = await fetch(url, {
67
- method: "DELETE",
68
- headers: {
69
- Authorization: `Token ${customerToken}`,
70
- "Content-Type": "application/json",
71
- },
72
- });
69
+ const response = await fetch(url, {
70
+ method: "DELETE",
71
+ headers: {
72
+ Authorization: `Token ${customerToken}`,
73
+ "Content-Type": "application/json",
74
+ },
75
+ });
73
76
 
74
- if(response.status === 204) return MESSAGES.cardSaved;
75
- if (response.ok && "json" in response) return await response.json();
76
- const res_json = await response.json();
77
+ if (response.status === 204) return MESSAGES.cardSaved;
78
+ if (response.ok && "json" in response) return await response.json();
79
+ const res_json = await response.json();
77
80
 
78
- throw await buildErrorResponse(response, res_json);
79
- } catch (error) {
80
- throw buildErrorResponseFromCatch(error);
81
- }
81
+ throw await buildErrorResponse(response, res_json);
82
+ } catch (error) {
83
+ throw buildErrorResponseFromCatch(error);
84
+ }
82
85
  }
@@ -1,71 +1,84 @@
1
- declare const MP_DEVICE_SESSION_ID: string | undefined;
2
-
3
- import {
4
- CreateOrderRequest,
5
- CreatePaymentRequest,
6
- } from "../types/requests";
1
+ import {CreateOrderRequest, CreatePaymentRequest} from "../types/requests";
7
2
  import {IStartCheckoutIdRequest, IStartCheckoutRequest} from "../types/checkout";
8
3
 
4
+ declare const MP_DEVICE_SESSION_ID: string | undefined;
9
5
 
10
6
 
11
- export async function createOrder(baseUrl: string, apiKey: string, orderItems: CreateOrderRequest) {
12
- const url = `${baseUrl}/api/v1/orders/`;
13
- const data = orderItems;
14
- const response = await fetch(url, {
15
- method: "POST",
16
- headers: {
17
- "Content-Type": "application/json",
18
- Authorization: `Token ${apiKey}`,
19
- },
20
- body: JSON.stringify(data),
21
- });
22
- if (response.status === 201) {
23
- return await response.json();
24
- } else {
25
- throw new Error(`Error: ${response.statusText}`);
26
- }
7
+ export async function createOrder(
8
+ baseUrl: string,
9
+ apiKey: string,
10
+ orderItems: CreateOrderRequest,
11
+ ) {
12
+ const url = `${baseUrl}/api/v1/orders/`;
13
+ const data = orderItems;
14
+ const response = await fetch(url, {
15
+ method: "POST",
16
+ headers: {
17
+ "Content-Type": "application/json",
18
+ Authorization: `Token ${apiKey}`,
19
+ },
20
+ body: JSON.stringify(data),
21
+ });
22
+ if (response.status === 201) {
23
+ return await response.json();
24
+ } else {
25
+ throw new Error(`Error: ${response.statusText}`);
26
+ }
27
+ }
28
+
29
+ export async function createPayment(
30
+ baseUrl: string,
31
+ apiKey: string,
32
+ paymentItems: CreatePaymentRequest,
33
+ ) {
34
+ const url = `${baseUrl}/api/v1/business/${paymentItems.business_pk}/payments/`;
35
+ const data = paymentItems;
36
+ const response = await fetch(url, {
37
+ method: "POST",
38
+ headers: {
39
+ "Content-Type": "application/json",
40
+ Authorization: `Token ${apiKey}`,
41
+ },
42
+ body: JSON.stringify(data),
43
+ });
44
+ if (response.status >= 200 && response.status <= 299) {
45
+ return await response.json();
46
+ } else {
47
+ throw new Error(`Error: ${response.statusText}`);
48
+ }
27
49
  }
28
50
 
29
- export async function createPayment(baseUrl: string, apiKey: string, paymentItems: CreatePaymentRequest) {
30
- const url = `${baseUrl}/api/v1/business/${paymentItems.business_pk}/payments/`;
31
- const data = paymentItems;
51
+ export async function startCheckoutRouter(
52
+ baseUrl: string,
53
+ apiKey: string,
54
+ routerItems: IStartCheckoutRequest | IStartCheckoutIdRequest,
55
+ ) {
56
+ try {
57
+ const url = `${baseUrl}/api/v1/checkout-router/`;
58
+ const data = routerItems;
32
59
  const response = await fetch(url, {
33
- method: "POST",
34
- headers: {
35
- "Content-Type": "application/json",
36
- Authorization: `Token ${apiKey}`,
37
- },
38
- body: JSON.stringify(data),
60
+ method: "POST",
61
+ headers: {
62
+ "Content-Type": "application/json",
63
+ Authorization: `Token ${apiKey}`,
64
+ },
65
+ body: JSON.stringify({
66
+ ...data,
67
+ ...(typeof MP_DEVICE_SESSION_ID !== "undefined"
68
+ ? { mp_device_session_id: MP_DEVICE_SESSION_ID }
69
+ : {}),
70
+ }),
39
71
  });
40
- if (response.status >= 200 && response.status <=299) {
41
- return await response.json();
72
+ if (response.status >= 200 && response.status <= 299) {
73
+ return await response.json();
42
74
  } else {
43
- throw new Error(`Error: ${response.statusText}`);
75
+ const errorResponse = await response.json();
76
+ const error = new Error("Failed to start checkout router");
77
+ // @ts-ignore
78
+ error.details = errorResponse;
79
+ throw error;
44
80
  }
81
+ } catch (error) {
82
+ throw error;
83
+ }
45
84
  }
46
-
47
- export async function startCheckoutRouter(baseUrl: string, apiKey: string, routerItems: IStartCheckoutRequest | IStartCheckoutIdRequest) {
48
- try {
49
- const url = `${baseUrl}/api/v1/checkout-router/`;
50
- const data = routerItems;
51
- const response = await fetch(url, {
52
- method: "POST",
53
- headers: {
54
- "Content-Type": "application/json",
55
- Authorization: `Token ${apiKey}`,
56
- },
57
- body: JSON.stringify({...data, ...(typeof MP_DEVICE_SESSION_ID !== "undefined" ? {mp_device_session_id: MP_DEVICE_SESSION_ID}:{})}),
58
- });
59
- if (response.status >= 200 && response.status <= 299) {
60
- return await response.json();
61
- } else {
62
- const errorResponse = await response.json();
63
- const error = new Error("Failed to start checkout router");
64
- // @ts-ignore
65
- error.details = errorResponse;
66
- throw error;
67
- }
68
- } catch (error) {
69
- throw error
70
- }
71
- }
@@ -1,31 +1,31 @@
1
1
  import {CustomerRegisterResponse} from "../types/responses";
2
2
 
3
3
  export async function registerOrFetchCustomer(
4
- baseUrl: string,
5
- apiKey: string,
6
- customer: Record<string, any>,
7
- signal: AbortSignal | null = null,
4
+ baseUrl: string,
5
+ apiKey: string,
6
+ customer: Record<string, any>,
7
+ signal: AbortSignal | null = null,
8
8
  ): Promise<CustomerRegisterResponse> {
9
- const url = `${baseUrl}/api/v1/customer/`;
10
- const data = {
11
- email: customer.email,
12
- first_name: customer?.firstName,
13
- last_name: customer?.lastName,
14
- phone: customer?.phone,
15
- };
16
- const response = await fetch(url, {
17
- method: "POST",
18
- headers: {
19
- "Content-Type": "application/json",
20
- Authorization: `Token ${apiKey}`,
21
- },
22
- signal: signal,
23
- body: JSON.stringify(data),
24
- });
9
+ const url = `${baseUrl}/api/v1/customer/`;
10
+ const data = {
11
+ email: customer.email,
12
+ first_name: customer?.firstName,
13
+ last_name: customer?.lastName,
14
+ phone: customer?.phone,
15
+ };
16
+ const response = await fetch(url, {
17
+ method: "POST",
18
+ headers: {
19
+ "Content-Type": "application/json",
20
+ Authorization: `Token ${apiKey}`,
21
+ },
22
+ signal: signal,
23
+ body: JSON.stringify(data),
24
+ });
25
25
 
26
- if (response.status === 201) {
27
- return await response.json();
28
- } else {
29
- throw new Error(`Error: ${response.statusText}`);
30
- }
31
- }
26
+ if (response.status === 201) {
27
+ return await response.json();
28
+ } else {
29
+ throw new Error(`Error: ${response.statusText}`);
30
+ }
31
+ }
@@ -1,7 +1,12 @@
1
- export async function getOpenpayDeviceSessionID(merchant_id: string, public_key: string, isSandbox: boolean = true, signal: AbortSignal | null = null): Promise<string> {
2
- let openpay = await window.OpenPay;
3
- openpay.setId(merchant_id);
4
- openpay.setApiKey(public_key);
5
- openpay.setSandboxMode(isSandbox);
6
- return await openpay.deviceData.setup({signal});
7
- }
1
+ export async function getOpenpayDeviceSessionID(
2
+ merchant_id: string,
3
+ public_key: string,
4
+ isSandbox: boolean = true,
5
+ signal: AbortSignal | null = null,
6
+ ): Promise<string> {
7
+ let openpay = await window.OpenPay;
8
+ openpay.setId(merchant_id);
9
+ openpay.setApiKey(public_key);
10
+ openpay.setSandboxMode(isSandbox);
11
+ return await openpay.deviceData.setup({ signal });
12
+ }
@@ -1,34 +1,37 @@
1
- import {buildErrorResponse, buildErrorResponseFromCatch} from "../helpers/utils";
1
+ import {
2
+ buildErrorResponse,
3
+ buildErrorResponseFromCatch,
4
+ } from "../helpers/utils";
2
5
  import {IPaymentMethodResponse} from "../types/paymentMethod";
3
6
 
4
- export async function fetchCustomerAPMs(
5
- baseUrl: string,
6
- apiKey: string,
7
- params = {
8
- status: "active",
9
- pagesize: "10000",
10
- },
11
- signal = null,
7
+ export async function fetchCustomerPaymentMethods(
8
+ baseUrl: string,
9
+ apiKey: string,
10
+ params = {
11
+ status: "active",
12
+ pagesize: "10000",
13
+ },
14
+ signal = null,
12
15
  ): Promise<IPaymentMethodResponse> {
13
- try {
14
- const queryString = new URLSearchParams(params).toString();
16
+ try {
17
+ const queryString = new URLSearchParams(params).toString();
15
18
 
16
- const response = await fetch(
17
- `${baseUrl}/api/v1/payment_methods?${queryString}`,
18
- {
19
- method: "GET",
20
- headers: {
21
- Authorization: `Token ${apiKey}`,
22
- "Content-Type": "application/json",
23
- },
24
- signal,
25
- },
26
- );
19
+ const response = await fetch(
20
+ `${baseUrl}/api/v1/payment_methods?${queryString}`,
21
+ {
22
+ method: "GET",
23
+ headers: {
24
+ Authorization: `Token ${apiKey}`,
25
+ "Content-Type": "application/json",
26
+ },
27
+ signal,
28
+ },
29
+ );
27
30
 
28
- if (response.ok) return await response.json();
29
- const res_json = await response.json();
30
- throw await buildErrorResponse(response, res_json);
31
- } catch (error) {
32
- throw buildErrorResponseFromCatch(error);
33
- }
34
- }
31
+ if (response.ok) return await response.json();
32
+ const res_json = await response.json();
33
+ throw await buildErrorResponse(response, res_json);
34
+ } catch (error) {
35
+ throw buildErrorResponseFromCatch(error);
36
+ }
37
+ }
@@ -1,16 +1,20 @@
1
- export async function getVaultToken (baseUrl: string, apiKey: string, signal = null){
2
- const response = await fetch(`${baseUrl}/api/v1/vault-token/`, {
3
- method: 'GET',
4
- headers: {
5
- 'Authorization': `Token ${apiKey}`,
6
- },
7
- signal: signal,
8
- });
1
+ export async function getVaultToken(
2
+ baseUrl: string,
3
+ apiKey: string,
4
+ signal = null,
5
+ ) {
6
+ const response = await fetch(`${baseUrl}/api/v1/vault-token/`, {
7
+ method: "GET",
8
+ headers: {
9
+ Authorization: `Token ${apiKey}`,
10
+ },
11
+ signal: signal,
12
+ });
9
13
 
10
- if (response.ok) {
11
- const responseBody = await response.json();
12
- return responseBody.token;
13
- } else {
14
- throw new Error('Failed to retrieve bearer token');
15
- }
14
+ if (response.ok) {
15
+ const responseBody = await response.json();
16
+ return responseBody.token;
17
+ } else {
18
+ throw new Error("Failed to retrieve bearer token");
19
+ }
16
20
  }
@@ -1,16 +1,16 @@
1
1
  export function injectMercadoPagoSecurity() {
2
- try {
3
- const script = document.createElement('script');
4
- script.src = "https://www.mercadopago.com/v2/security.js";
5
- script.setAttribute('view', '');
6
- script.onload = () => {
7
- console.log("Mercado Pago script loaded successfully.");
8
- };
9
- script.onerror = (error) => {
10
- console.error("Error loading Mercado Pago script:", error);
11
- };
12
- document.head.appendChild(script);
13
- } catch (error) {
14
- console.error("Error attempting to inject Mercado Pago script:", error);
15
- }
2
+ try {
3
+ const script = document.createElement("script");
4
+ script.src = "https://www.mercadopago.com/v2/security.js";
5
+ script.setAttribute("view", "");
6
+ script.onload = () => {
7
+ console.log("Mercado Pago script loaded successfully.");
8
+ };
9
+ script.onerror = (error) => {
10
+ console.error("Error loading Mercado Pago script:", error);
11
+ };
12
+ document.head.appendChild(script);
13
+ } catch (error) {
14
+ console.error("Error attempting to inject Mercado Pago script:", error);
15
+ }
16
16
  }
@@ -4,46 +4,52 @@ import CollectContainer from "skyflow-js/types/core/external/collect/collect-con
4
4
  import {buildErrorResponseFromCatch} from "./utils";
5
5
  import CollectElement from "skyflow-js/types/core/external/collect/collect-element";
6
6
  import {getVaultToken} from "../data/skyflowApi";
7
- import {TokensSkyflowRequest} from "../types";
7
+ import {TokensSkyflowRequest} from "../types/requests";
8
8
 
9
9
  export async function getSkyflowTokens({
10
- baseUrl,
11
- apiKey,
12
- vault_id,
13
- vault_url,
14
- data,
10
+ baseUrl,
11
+ apiKey,
12
+ vault_id,
13
+ vault_url,
14
+ data,
15
15
  }: TokensSkyflowRequest): Promise<any | ErrorResponse> {
16
- const skyflow = Skyflow.init({
17
- vaultID: vault_id,
18
- vaultURL: vault_url,
19
- getBearerToken: async () => await getVaultToken(baseUrl, apiKey),
20
- options: {
21
- logLevel: Skyflow.LogLevel.ERROR,
22
- env: Skyflow.Env.DEV,
23
- },
24
- });
16
+ const skyflow = Skyflow.init({
17
+ vaultID: vault_id,
18
+ vaultURL: vault_url,
19
+ getBearerToken: async () => await getVaultToken(baseUrl, apiKey),
20
+ options: {
21
+ logLevel: Skyflow.LogLevel.ERROR,
22
+ env: Skyflow.Env.DEV,
23
+ },
24
+ });
25
25
 
26
- const collectContainer: CollectContainer = skyflow.container(
27
- Skyflow.ContainerType.COLLECT
28
- ) as CollectContainer;
26
+ const collectContainer: CollectContainer = skyflow.container(
27
+ Skyflow.ContainerType.COLLECT,
28
+ ) as CollectContainer;
29
29
 
30
- const fieldPromises = await getFieldsPromise(data, collectContainer);
30
+ const fieldPromises = await getFieldsPromise(data, collectContainer);
31
31
 
32
- const result = await Promise.all(fieldPromises);
32
+ const result = await Promise.all(fieldPromises);
33
33
 
34
- const mountFail = result.some((item: boolean) => !item);
34
+ const mountFail = result.some((item: boolean) => !item);
35
35
 
36
- if (mountFail) {
37
- throw buildErrorResponseFromCatch(Error("Ocurrió un error al montar los campos de la tarjeta"));
38
- } else {
36
+ if (mountFail) {
37
+ throw buildErrorResponseFromCatch(
38
+ Error("Ocurrió un error al montar los campos de la tarjeta"),
39
+ );
40
+ } else {
39
41
  try {
40
- const collectResponseSkyflowTonder = await collectContainer.collect() as any;
41
- if (collectResponseSkyflowTonder) return collectResponseSkyflowTonder["records"][0]["fields"];
42
- throw buildErrorResponseFromCatch(Error("Por favor, verifica todos los campos de tu tarjeta"))
42
+ const collectResponseSkyflowTonder =
43
+ (await collectContainer.collect()) as any;
44
+ if (collectResponseSkyflowTonder)
45
+ return collectResponseSkyflowTonder["records"][0]["fields"];
46
+ throw buildErrorResponseFromCatch(
47
+ Error("Por favor, verifica todos los campos de tu tarjeta"),
48
+ );
43
49
  } catch (error) {
44
- throw buildErrorResponseFromCatch(error);
50
+ throw buildErrorResponseFromCatch(error);
45
51
  }
46
- }
52
+ }
47
53
  }
48
54
 
49
55
  async function getFieldsPromise(data: any, collectContainer: CollectContainer): Promise<Promise<boolean>[]> {