@fiado/api-invoker 1.2.61 → 1.2.63

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 (150) hide show
  1. package/README.md +64 -64
  2. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
  3. package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
  4. package/bin/service-business/ServiceApi.d.ts +7 -5
  5. package/bin/service-business/ServiceApi.js +5 -1
  6. package/bin/service-business/interfaces/IServiceApi.d.ts +7 -5
  7. package/package.json +27 -27
  8. package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
  9. package/src/account-beneficiary/index.ts +2 -2
  10. package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
  11. package/src/account-fiadoinc/AccountFiadoIncApi.ts +73 -73
  12. package/src/account-fiadoinc/index.ts +1 -1
  13. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +36 -36
  14. package/src/account-fiadosa/AccountFiadoSAApi.ts +37 -37
  15. package/src/account-fiadosa/index.ts +1 -1
  16. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +15 -15
  17. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
  18. package/src/account-pagoconfiado/index.ts +2 -2
  19. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
  20. package/src/activity-business/ActivityApi.ts +36 -36
  21. package/src/activity-business/index.ts +5 -5
  22. package/src/activity-business/interfaces/IActivityApi.ts +13 -13
  23. package/src/activity-business/queue/ActivityPublisher.ts +28 -28
  24. package/src/activity-business/queue/IActivityPublisher.ts +4 -4
  25. package/src/address/AddressApi.ts +46 -46
  26. package/src/address/index.ts +3 -3
  27. package/src/address/interfaces/IAddressApi.ts +30 -30
  28. package/src/authentication/AuthenticationApi.ts +16 -16
  29. package/src/authentication/index.ts +4 -4
  30. package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
  31. package/src/bankAccount/BankAccountApi.ts +48 -48
  32. package/src/bankAccount/index.ts +1 -1
  33. package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
  34. package/src/bbvaRst/api/BBVARstApi.ts +16 -16
  35. package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
  36. package/src/bbvaRst/index.ts +1 -1
  37. package/src/blacklist/BlackListApi.ts +19 -19
  38. package/src/blacklist/index.ts +2 -2
  39. package/src/blacklist/interfaces/IBlackListApi.ts +20 -20
  40. package/src/card/CardApi.ts +53 -53
  41. package/src/card/index.ts +3 -3
  42. package/src/card/interfaces/ICardApi.ts +16 -16
  43. package/src/centralPayments/CentralPaymentsConnectorApi.ts +183 -183
  44. package/src/centralPayments/index.ts +1 -1
  45. package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +85 -85
  46. package/src/cnbv-business/CnbvApi.ts +22 -22
  47. package/src/cnbv-business/index.ts +4 -4
  48. package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
  49. package/src/cognitoConnector/CognitoConnectorApi.ts +106 -106
  50. package/src/cognitoConnector/CognitoConnectorV2.ts +81 -81
  51. package/src/cognitoConnector/index.ts +11 -11
  52. package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +15 -15
  53. package/src/cognitoConnector/interfaces/ICognitoV2Api.ts +58 -58
  54. package/src/collector/CollectorApi.ts +25 -25
  55. package/src/collector/index.ts +2 -2
  56. package/src/collector/interfaces/ICollectorApi.ts +21 -21
  57. package/src/contactInformation/ContactInformationApi.ts +20 -20
  58. package/src/contactInformation/index.ts +2 -2
  59. package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
  60. package/src/container.config.ts +126 -126
  61. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  62. package/src/contract-generator/index.ts +2 -2
  63. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  64. package/src/device/DeviceApi.ts +23 -23
  65. package/src/device/index.ts +2 -2
  66. package/src/device/interfaces/IDeviceApi.ts +24 -24
  67. package/src/directories/DirectoriesApi.ts +53 -53
  68. package/src/directories/index.ts +3 -3
  69. package/src/directories/interfaces/IDirectoriesApi.ts +16 -16
  70. package/src/directory/DirectoryApi.ts +150 -150
  71. package/src/directory/index.ts +3 -3
  72. package/src/directory/interfaces/IDirectoryApi.ts +69 -69
  73. package/src/disputes/DisputesApi.ts +50 -50
  74. package/src/disputes/index.ts +2 -2
  75. package/src/disputes/interfaces/IDisputesApi.ts +54 -54
  76. package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
  77. package/src/exchangeRates/index.ts +1 -1
  78. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
  79. package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
  80. package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
  81. package/src/fiadoMessages/index.ts +1 -1
  82. package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
  83. package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
  84. package/src/fraudPreventionEngine/index.ts +1 -1
  85. package/src/group/GroupApi.ts +24 -24
  86. package/src/group/index.ts +1 -1
  87. package/src/group/interfaces/IGroupApi.ts +23 -23
  88. package/src/identity/IdentityApi.ts +78 -78
  89. package/src/identity/index.ts +3 -3
  90. package/src/identity/interfaces/IIdentityApi.ts +38 -38
  91. package/src/index.ts +41 -41
  92. package/src/legalDocument/api/LegalDocumentApi.ts +26 -26
  93. package/src/legalDocument/api/interfaces/ILegalDocumentApi.ts +6 -6
  94. package/src/legalDocument/index.ts +3 -3
  95. package/src/notificationMessages/index.ts +1 -1
  96. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  97. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  98. package/src/observations/ObservationsApi.ts +23 -23
  99. package/src/observations/index.ts +3 -3
  100. package/src/observations/interfaces/IObservationsApi.ts +9 -9
  101. package/src/p2pContact/api/P2pContactApi.ts +19 -19
  102. package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
  103. package/src/p2pContact/index.ts +1 -1
  104. package/src/pomelo/api/PomeloApi.ts +99 -99
  105. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  106. package/src/pomelo/index.ts +1 -1
  107. package/src/pomeloProcessor/api/PomeloProcessorApi.ts +17 -17
  108. package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +2 -2
  109. package/src/pomeloProcessor/index.ts +2 -2
  110. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  111. package/src/product-catalog/index.ts +1 -1
  112. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  113. package/src/riskProfile/api/RiskProfileApi.ts +39 -39
  114. package/src/riskProfile/api/TransactionAlertApi.ts +22 -22
  115. package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +14 -14
  116. package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +7 -7
  117. package/src/riskProfile/index.ts +7 -7
  118. package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
  119. package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
  120. package/src/service-business/ServiceApi.ts +66 -60
  121. package/src/service-business/index.ts +2 -2
  122. package/src/service-business/interfaces/IServiceApi.ts +48 -44
  123. package/src/sessionActivity/index.ts +2 -2
  124. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  125. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  126. package/src/stpAccount/api/STPAccountApi.ts +111 -111
  127. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
  128. package/src/stpAccount/index.ts +1 -1
  129. package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
  130. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
  131. package/src/stpServicePayment/index.ts +1 -1
  132. package/src/stpSpei/api/StpSpeiApi.ts +32 -32
  133. package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
  134. package/src/stpSpei/index.ts +1 -1
  135. package/src/tern/api/TernApi.ts +147 -147
  136. package/src/tern/api/interfaces/ITernApi.ts +47 -47
  137. package/src/tern/index.ts +1 -1
  138. package/src/transaction/api/TransactionApi.ts +92 -92
  139. package/src/transaction/api/interfaces/ITransactionApi.ts +35 -35
  140. package/src/transaction/index.ts +5 -5
  141. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  142. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  143. package/src/transactionProcessor/api/TransactionProcessorApi.ts +42 -42
  144. package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +18 -18
  145. package/src/transactionProcessor/index.ts +1 -1
  146. package/src/utils/InvokerUtils.ts +18 -18
  147. package/src/zendesk/ZendeskApi.ts +24 -24
  148. package/src/zendesk/index.ts +3 -3
  149. package/src/zendesk/interfaces/IZendeskApi.ts +10 -10
  150. package/tsconfig.json +21 -21
@@ -1,16 +1,16 @@
1
- import FiadoApiResponse from '@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse';
2
- import { DirectoryBackofficeCreateRequest, DirectoryBackofficeResponse, DirectoryBackofficeUpdateRequest } from "@fiado/type-kit/bin/directory";
3
-
4
- /**
5
- * Interfaz para el servicio Directory que permite operaciones sobre directorios.
6
- */
7
- export interface IDirectoriesApi {
8
- /**
9
- * Obtiene una directorio.
10
- */
11
- getBackofficeDirectoryById(id:string):Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
12
- createBackofficeDirectory(directory: DirectoryBackofficeCreateRequest): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
13
- getBackofficeDirectoryByEmail(email:string): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
14
- getBackofficeDirectoryList(params:{pageSize?:number, index?:string}): Promise<FiadoApiResponse<{index:string|null, items: DirectoryBackofficeResponse[]}>>;
15
- updateBackofficeDirectory(directoryId:string,params:DirectoryBackofficeUpdateRequest): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
16
- }
1
+ import FiadoApiResponse from '@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse';
2
+ import { DirectoryBackofficeCreateRequest, DirectoryBackofficeResponse, DirectoryBackofficeUpdateRequest } from "@fiado/type-kit/bin/directory";
3
+
4
+ /**
5
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
6
+ */
7
+ export interface IDirectoriesApi {
8
+ /**
9
+ * Obtiene una directorio.
10
+ */
11
+ getBackofficeDirectoryById(id:string):Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
12
+ createBackofficeDirectory(directory: DirectoryBackofficeCreateRequest): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
13
+ getBackofficeDirectoryByEmail(email:string): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
14
+ getBackofficeDirectoryList(params:{pageSize?:number, index?:string}): Promise<FiadoApiResponse<{index:string|null, items: DirectoryBackofficeResponse[]}>>;
15
+ updateBackofficeDirectory(directoryId:string,params:DirectoryBackofficeUpdateRequest): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
16
+ }
@@ -1,150 +1,150 @@
1
- import dotenv from 'dotenv';
2
- import { inject, injectable } from "inversify";
3
- import { IHttpRequest } from "@fiado/http-client";
4
- import { IDirectoryApi } from "./interfaces/IDirectoryApi";
5
- import { Provider } from '@fiado/type-kit/bin/provider';
6
- import { Profile } from '@fiado/type-kit/bin/directory/enums/Profile';
7
- import { Status } from '@fiado/type-kit/bin/directory/enums/Status';
8
- dotenv.config();
9
-
10
- @injectable()
11
- export class DirectoryApi implements IDirectoryApi {
12
-
13
- private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
14
-
15
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
16
- }
17
-
18
-
19
- public async validateSecretNumber(directoryId: string, secretNumber: string): Promise<void> {
20
-
21
- const url = `${this.baseUrl}`;
22
- const operationName = "validateSecretNumber";
23
-
24
- const body = {
25
- directoryId,
26
- secretNumber,
27
- }
28
-
29
- return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
30
- }
31
-
32
- public async getByIds(ids: string[]): Promise<any> {
33
-
34
- if (ids.length === 0) {
35
- throw new Error("At least one directory ID is required.")
36
- }
37
-
38
- const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
39
- const operationName = "getUserInfoByIds";
40
-
41
- return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
42
- }
43
-
44
- public async updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void> {
45
-
46
- const url = `${this.baseUrl}`;
47
- const operationName = "updateExternalUser";
48
-
49
- const body = {
50
- directoryId: directoryId,
51
- typeOfDirectoryId: "USER",
52
- provider: provider,
53
- user: externalUserId
54
- }
55
-
56
- return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
57
- }
58
-
59
- public async updateScope(directoryId: string, scope: string[]): Promise<void> {
60
-
61
- const url = `${this.baseUrl}`;
62
- const operationName = "updateScope";
63
-
64
- const body = {
65
- directoryId: directoryId,
66
- typeOfDirectoryId: "USER",
67
- scope: scope
68
- }
69
-
70
- return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
71
- }
72
-
73
- public async getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any> {
74
-
75
- const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
76
- const operationName = "getByOwnerDirectoryId";
77
-
78
-
79
- return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
80
- }
81
-
82
- public async getByPhoneNumber(phoneNumber: string): Promise<any> {
83
-
84
- const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
85
- const operationName = "getUserInfoByParams";
86
-
87
- return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
88
- }
89
-
90
- public async addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
91
-
92
- const url = `${this.baseUrl}`;
93
- const operationName = "addOwnerDirectoryId";
94
-
95
- const data = {
96
- directoryId: directoryId,
97
- ownerDirectoryId: newOwnerDirectoryId
98
- }
99
-
100
- return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
101
- }
102
-
103
- public async updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
104
-
105
- const url = `${this.baseUrl}`;
106
- const operationName = "updateOwnerDirectoryId";
107
-
108
- const data = {
109
- directoryId: directoryId,
110
- ownerDirectoryId: newOwnerDirectoryId
111
- }
112
-
113
- return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
114
- }
115
-
116
- public async updateUserProfile(directoryId: string, profile: Profile): Promise<void> {
117
-
118
- const url = `${this.baseUrl}`;
119
- const operationName = "updateUserProfile";
120
-
121
- const body = {
122
- directoryId: directoryId,
123
- typeOfDirectoryId: "USER",
124
- profile: profile
125
- }
126
-
127
- return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
128
- }
129
-
130
- public async updateStatus(directoryId: string, status: Status): Promise<void> {
131
-
132
- const url = `${this.baseUrl}`;
133
- const operationName = "updateStatus";
134
-
135
- const body = {
136
- directoryId: directoryId,
137
- status: status
138
- }
139
-
140
- await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
141
- }
142
-
143
- public async getByPeopleId(peopleId: string): Promise<any> {
144
-
145
- const url = `${this.baseUrl}?peopleId=${peopleId}`;
146
- const operationName = "getUserInfoByParams";
147
-
148
- return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
149
- }
150
- }
1
+ import dotenv from 'dotenv';
2
+ import { inject, injectable } from "inversify";
3
+ import { IHttpRequest } from "@fiado/http-client";
4
+ import { IDirectoryApi } from "./interfaces/IDirectoryApi";
5
+ import { Provider } from '@fiado/type-kit/bin/provider';
6
+ import { Profile } from '@fiado/type-kit/bin/directory/enums/Profile';
7
+ import { Status } from '@fiado/type-kit/bin/directory/enums/Status';
8
+ dotenv.config();
9
+
10
+ @injectable()
11
+ export class DirectoryApi implements IDirectoryApi {
12
+
13
+ private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
14
+
15
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
16
+ }
17
+
18
+
19
+ public async validateSecretNumber(directoryId: string, secretNumber: string): Promise<void> {
20
+
21
+ const url = `${this.baseUrl}`;
22
+ const operationName = "validateSecretNumber";
23
+
24
+ const body = {
25
+ directoryId,
26
+ secretNumber,
27
+ }
28
+
29
+ return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
30
+ }
31
+
32
+ public async getByIds(ids: string[]): Promise<any> {
33
+
34
+ if (ids.length === 0) {
35
+ throw new Error("At least one directory ID is required.")
36
+ }
37
+
38
+ const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
39
+ const operationName = "getUserInfoByIds";
40
+
41
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
42
+ }
43
+
44
+ public async updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void> {
45
+
46
+ const url = `${this.baseUrl}`;
47
+ const operationName = "updateExternalUser";
48
+
49
+ const body = {
50
+ directoryId: directoryId,
51
+ typeOfDirectoryId: "USER",
52
+ provider: provider,
53
+ user: externalUserId
54
+ }
55
+
56
+ return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
57
+ }
58
+
59
+ public async updateScope(directoryId: string, scope: string[]): Promise<void> {
60
+
61
+ const url = `${this.baseUrl}`;
62
+ const operationName = "updateScope";
63
+
64
+ const body = {
65
+ directoryId: directoryId,
66
+ typeOfDirectoryId: "USER",
67
+ scope: scope
68
+ }
69
+
70
+ return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
71
+ }
72
+
73
+ public async getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any> {
74
+
75
+ const url = `${this.baseUrl}?ownerDirectoryId=${ownerDirectoryId}`;
76
+ const operationName = "getByOwnerDirectoryId";
77
+
78
+
79
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
80
+ }
81
+
82
+ public async getByPhoneNumber(phoneNumber: string): Promise<any> {
83
+
84
+ const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
85
+ const operationName = "getUserInfoByParams";
86
+
87
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
88
+ }
89
+
90
+ public async addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
91
+
92
+ const url = `${this.baseUrl}`;
93
+ const operationName = "addOwnerDirectoryId";
94
+
95
+ const data = {
96
+ directoryId: directoryId,
97
+ ownerDirectoryId: newOwnerDirectoryId
98
+ }
99
+
100
+ return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
101
+ }
102
+
103
+ public async updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any> {
104
+
105
+ const url = `${this.baseUrl}`;
106
+ const operationName = "updateOwnerDirectoryId";
107
+
108
+ const data = {
109
+ directoryId: directoryId,
110
+ ownerDirectoryId: newOwnerDirectoryId
111
+ }
112
+
113
+ return await this.httpRequest.post(`${url}`, data, { 'operationName': operationName });
114
+ }
115
+
116
+ public async updateUserProfile(directoryId: string, profile: Profile): Promise<void> {
117
+
118
+ const url = `${this.baseUrl}`;
119
+ const operationName = "updateUserProfile";
120
+
121
+ const body = {
122
+ directoryId: directoryId,
123
+ typeOfDirectoryId: "USER",
124
+ profile: profile
125
+ }
126
+
127
+ return await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
128
+ }
129
+
130
+ public async updateStatus(directoryId: string, status: Status): Promise<void> {
131
+
132
+ const url = `${this.baseUrl}`;
133
+ const operationName = "updateStatus";
134
+
135
+ const body = {
136
+ directoryId: directoryId,
137
+ status: status
138
+ }
139
+
140
+ await this.httpRequest.post(`${url}`, body, { 'operationName': operationName });
141
+ }
142
+
143
+ public async getByPeopleId(peopleId: string): Promise<any> {
144
+
145
+ const url = `${this.baseUrl}?peopleId=${peopleId}`;
146
+ const operationName = "getUserInfoByParams";
147
+
148
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
149
+ }
150
+ }
@@ -1,3 +1,3 @@
1
-
2
- export * from './interfaces/IDirectoryApi';
3
- export * from './DirectoryApi';
1
+
2
+ export * from './interfaces/IDirectoryApi';
3
+ export * from './DirectoryApi';
@@ -1,69 +1,69 @@
1
- import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
2
- import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
3
- import { Provider } from "@fiado/type-kit/bin/provider";
4
-
5
- /**
6
- * Interfaz para el servicio Directory que permite operaciones sobre directorios.
7
- */
8
- export interface IDirectoryApi {
9
- /**
10
- * Obtiene una lista de directorios por sus IDs.
11
- * @param ids Array de IDs de directorios (UUIDs) a buscar.
12
- * @returns Una promesa que resuelve a un arreglo de objetos de directorio.
13
- * Puede devolver un arreglo vacío si no se encuentran coincidencias.
14
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
- */
16
- getByIds(ids: string[]): Promise<any>;
17
-
18
- /**
19
- * Actualiza el ID de usuario externo en un directorio.
20
- * @param directoryId ID del directorio (UUID) a actualizar.
21
- * @param provider Proveedor de autenticación del usuario.
22
- * @param externalUserId ID de usuario externo.
23
- * @returns Una promesa que resuelve a un objeto vacío.
24
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
25
- */
26
-
27
- updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
28
-
29
- /**
30
- * Actualiza el alcance de un directorio.
31
- * @param directoryId ID del directorio (UUID) a actualizar.
32
- * @param scope Alcance a actualizar.
33
- * @returns Una promesa que resuelve a un objeto vacío.
34
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
35
- */
36
- updateScope(directoryId: string, scope: string[]): Promise<void>;
37
-
38
- /**
39
- * Obtiene un directorio por su ID de directorio propietario.
40
- * @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
41
- * @returns Una promesa que resuelve a un objeto de directorio.
42
- * Puede devolver un objeto vacío si no se encuentra coincidencia.
43
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
44
- */
45
- getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
46
-
47
- /**
48
- * Obtiene un directorio por su número de teléfono.
49
- * @param phoneNumber Número de teléfono a buscar.
50
- * @returns Una promesa que resuelve a un objeto de directorio.
51
- * Puede devolver un objeto vacío si no se encuentra coincidencia.
52
- * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
53
- */
54
- getByPhoneNumber(phoneNumber: string): Promise<any>
55
-
56
- addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
57
-
58
- updateUserProfile(directoryId: string, profile: Profile): Promise<void>
59
-
60
- updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
61
-
62
- updateStatus(directoryId: string, status: Status): Promise<void>
63
-
64
- getByPeopleId(peopleId: string): Promise<any>;
65
-
66
- validateSecretNumber(directoryId: string, secretNumber: string): Promise<void>;
67
-
68
-
69
- }
1
+ import { Profile } from "@fiado/type-kit/bin/directory/enums/Profile";
2
+ import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
3
+ import { Provider } from "@fiado/type-kit/bin/provider";
4
+
5
+ /**
6
+ * Interfaz para el servicio Directory que permite operaciones sobre directorios.
7
+ */
8
+ export interface IDirectoryApi {
9
+ /**
10
+ * Obtiene una lista de directorios por sus IDs.
11
+ * @param ids Array de IDs de directorios (UUIDs) a buscar.
12
+ * @returns Una promesa que resuelve a un arreglo de objetos de directorio.
13
+ * Puede devolver un arreglo vacío si no se encuentran coincidencias.
14
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
15
+ */
16
+ getByIds(ids: string[]): Promise<any>;
17
+
18
+ /**
19
+ * Actualiza el ID de usuario externo en un directorio.
20
+ * @param directoryId ID del directorio (UUID) a actualizar.
21
+ * @param provider Proveedor de autenticación del usuario.
22
+ * @param externalUserId ID de usuario externo.
23
+ * @returns Una promesa que resuelve a un objeto vacío.
24
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
25
+ */
26
+
27
+ updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
28
+
29
+ /**
30
+ * Actualiza el alcance de un directorio.
31
+ * @param directoryId ID del directorio (UUID) a actualizar.
32
+ * @param scope Alcance a actualizar.
33
+ * @returns Una promesa que resuelve a un objeto vacío.
34
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
35
+ */
36
+ updateScope(directoryId: string, scope: string[]): Promise<void>;
37
+
38
+ /**
39
+ * Obtiene un directorio por su ID de directorio propietario.
40
+ * @param ownerDirectoryId ID de directorio propietario (UUID) a buscar.
41
+ * @returns Una promesa que resuelve a un objeto de directorio.
42
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
43
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
44
+ */
45
+ getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
46
+
47
+ /**
48
+ * Obtiene un directorio por su número de teléfono.
49
+ * @param phoneNumber Número de teléfono a buscar.
50
+ * @returns Una promesa que resuelve a un objeto de directorio.
51
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
52
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
53
+ */
54
+ getByPhoneNumber(phoneNumber: string): Promise<any>
55
+
56
+ addOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
57
+
58
+ updateUserProfile(directoryId: string, profile: Profile): Promise<void>
59
+
60
+ updateOwnerDirectoryId(directoryId: string, newOwnerDirectoryId): Promise<any>
61
+
62
+ updateStatus(directoryId: string, status: Status): Promise<void>
63
+
64
+ getByPeopleId(peopleId: string): Promise<any>;
65
+
66
+ validateSecretNumber(directoryId: string, secretNumber: string): Promise<void>;
67
+
68
+
69
+ }
@@ -1,51 +1,51 @@
1
- import { inject, injectable } from "inversify";
2
- import { IHttpRequest } from "@fiado/http-client";
3
- import dotenv from 'dotenv';
4
- import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity";
5
- import { IDisputesApi } from "./interfaces/IDisputesApi";
6
- dotenv.config();
7
-
8
- @injectable()
9
- export class DisputesApi implements IDisputesApi {
10
-
11
- private readonly baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
12
-
13
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
- async getListBetweenDates(params: { index?: string; pageSize?: number; startDate: string; endDate: string; }): Promise<void> {
15
- let queryParams = [];
16
-
17
- if (!params.index) {
18
- queryParams.push(`index=${params.index}`);
19
- }
20
-
21
- if (!params.pageSize) {
22
- queryParams.push(`pageSize=${params.pageSize}`);
23
- }
24
-
25
- queryParams.push(`startDate=${params.startDate}`);
26
- queryParams.push(`endDate=${params.endDate}`);
27
-
28
- const url = `${this.baseUrl}disputes/bdates?${queryParams.join('&')}`;
29
- return await this.httpRequest.get(url);
30
- }
31
- async addProvisional(params: { disputeId: string; amount: number; date: string; type: "PROV" | "REV_PROV"; }): Promise<void> {
32
- const url = `${this.baseUrl}disputes/provisional/add/${params.disputeId}`;
33
- return await this.httpRequest.put(url, {amount: params.amount, date: params.date, type: params.type});
34
- }
35
-
36
- async getByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void> {
37
-
38
- let queryParams = [];
39
- if (!params.index) {
40
- queryParams.push(`index=${params.index}`);
41
- }
42
-
43
- if (!params.pageSize) {
44
- queryParams.push(`pageSize=${params.pageSize}`);
45
- }
46
-
47
- const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
48
- return await this.httpRequest.get(url);
49
- }
50
-
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { PeopleUpdateRequest } from "@fiado/type-kit/bin/identity";
5
+ import { IDisputesApi } from "./interfaces/IDisputesApi";
6
+ dotenv.config();
7
+
8
+ @injectable()
9
+ export class DisputesApi implements IDisputesApi {
10
+
11
+ private readonly baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
12
+
13
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
+ async getListBetweenDates(params: { index?: string; pageSize?: number; startDate: string; endDate: string; }): Promise<void> {
15
+ let queryParams = [];
16
+
17
+ if (!params.index) {
18
+ queryParams.push(`index=${params.index}`);
19
+ }
20
+
21
+ if (!params.pageSize) {
22
+ queryParams.push(`pageSize=${params.pageSize}`);
23
+ }
24
+
25
+ queryParams.push(`startDate=${params.startDate}`);
26
+ queryParams.push(`endDate=${params.endDate}`);
27
+
28
+ const url = `${this.baseUrl}disputes/bdates?${queryParams.join('&')}`;
29
+ return await this.httpRequest.get(url);
30
+ }
31
+ async addProvisional(params: { disputeId: string; amount: number; date: string; type: "PROV" | "REV_PROV"; }): Promise<void> {
32
+ const url = `${this.baseUrl}disputes/provisional/add/${params.disputeId}`;
33
+ return await this.httpRequest.put(url, {amount: params.amount, date: params.date, type: params.type});
34
+ }
35
+
36
+ async getByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void> {
37
+
38
+ let queryParams = [];
39
+ if (!params.index) {
40
+ queryParams.push(`index=${params.index}`);
41
+ }
42
+
43
+ if (!params.pageSize) {
44
+ queryParams.push(`pageSize=${params.pageSize}`);
45
+ }
46
+
47
+ const url = `${this.baseUrl}disputes/${params.directoryId}?${queryParams.join('&')}`;
48
+ return await this.httpRequest.get(url);
49
+ }
50
+
51
51
  }
@@ -1,3 +1,3 @@
1
-
2
- export * from './interfaces/IDisputesApi';
1
+
2
+ export * from './interfaces/IDisputesApi';
3
3
  export * from './DisputesApi';