@abyss-project/banking 1.0.0

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 (204) hide show
  1. package/.eslintrc.js +34 -0
  2. package/README.md +2 -0
  3. package/dist/api/abyss.admin.api.d.ts +2 -0
  4. package/dist/api/abyss.admin.api.js +8 -0
  5. package/dist/api/banking.admin.api.d.ts +13 -0
  6. package/dist/api/banking.admin.api.js +52 -0
  7. package/dist/api/banking.api.d.ts +18 -0
  8. package/dist/api/banking.api.js +76 -0
  9. package/dist/api/categorization-rule.admin.api.d.ts +7 -0
  10. package/dist/api/categorization-rule.admin.api.js +28 -0
  11. package/dist/api/categorization-rule.api.d.ts +7 -0
  12. package/dist/api/categorization-rule.api.js +28 -0
  13. package/dist/api/category.admin.api.d.ts +6 -0
  14. package/dist/api/category.admin.api.js +27 -0
  15. package/dist/api/category.api.d.ts +9 -0
  16. package/dist/api/category.api.js +34 -0
  17. package/dist/api/index.d.ts +12 -0
  18. package/dist/api/index.js +24 -0
  19. package/dist/api/monitor.api.d.ts +2 -0
  20. package/dist/api/monitor.api.js +8 -0
  21. package/dist/api/panel.admin.api.d.ts +6 -0
  22. package/dist/api/panel.admin.api.js +27 -0
  23. package/dist/api/panel.api.d.ts +6 -0
  24. package/dist/api/panel.api.js +28 -0
  25. package/dist/api/user.admin.api.d.ts +5 -0
  26. package/dist/api/user.admin.api.js +23 -0
  27. package/dist/api/user.api.d.ts +4 -0
  28. package/dist/api/user.api.js +17 -0
  29. package/dist/index.d.ts +19 -0
  30. package/dist/index.js +84 -0
  31. package/dist/types/enum/aggregator-type.enum.d.ts +4 -0
  32. package/dist/types/enum/aggregator-type.enum.js +8 -0
  33. package/dist/types/enum/api-error.enum.d.ts +16 -0
  34. package/dist/types/enum/api-error.enum.js +21 -0
  35. package/dist/types/enum/bank-connection-status.enum.d.ts +6 -0
  36. package/dist/types/enum/bank-connection-status.enum.js +10 -0
  37. package/dist/types/enum/cash-account-type.enum.d.ts +26 -0
  38. package/dist/types/enum/cash-account-type.enum.js +30 -0
  39. package/dist/types/enum/index.d.ts +6 -0
  40. package/dist/types/enum/index.js +18 -0
  41. package/dist/types/enum/panel-component-type.enum.d.ts +12 -0
  42. package/dist/types/enum/panel-component-type.enum.js +16 -0
  43. package/dist/types/enum/period-configuration.enum.d.ts +7 -0
  44. package/dist/types/enum/period-configuration.enum.js +11 -0
  45. package/dist/types/index.d.ts +2 -0
  46. package/dist/types/index.js +14 -0
  47. package/dist/types/interface/api/index.d.ts +27 -0
  48. package/dist/types/interface/api/index.js +39 -0
  49. package/dist/types/interface/api/requests/abyss.admin.request.d.ts +3 -0
  50. package/dist/types/interface/api/requests/abyss.admin.request.js +2 -0
  51. package/dist/types/interface/api/requests/banking.admin.request.d.ts +47 -0
  52. package/dist/types/interface/api/requests/banking.admin.request.js +2 -0
  53. package/dist/types/interface/api/requests/banking.request.d.ts +75 -0
  54. package/dist/types/interface/api/requests/banking.request.js +2 -0
  55. package/dist/types/interface/api/requests/categorization-rule.admin.request.d.ts +34 -0
  56. package/dist/types/interface/api/requests/categorization-rule.admin.request.js +2 -0
  57. package/dist/types/interface/api/requests/categorization-rule.request.d.ts +32 -0
  58. package/dist/types/interface/api/requests/categorization-rule.request.js +2 -0
  59. package/dist/types/interface/api/requests/category.admin.request.d.ts +22 -0
  60. package/dist/types/interface/api/requests/category.admin.request.js +2 -0
  61. package/dist/types/interface/api/requests/category.request.d.ts +26 -0
  62. package/dist/types/interface/api/requests/category.request.js +2 -0
  63. package/dist/types/interface/api/requests/panel.admin.request.d.ts +23 -0
  64. package/dist/types/interface/api/requests/panel.admin.request.js +2 -0
  65. package/dist/types/interface/api/requests/panel.request.d.ts +22 -0
  66. package/dist/types/interface/api/requests/panel.request.js +2 -0
  67. package/dist/types/interface/api/requests/user.admin.request.d.ts +15 -0
  68. package/dist/types/interface/api/requests/user.admin.request.js +2 -0
  69. package/dist/types/interface/api/requests/user.request.d.ts +2 -0
  70. package/dist/types/interface/api/requests/user.request.js +2 -0
  71. package/dist/types/interface/api/responses/abyss.admin.response.d.ts +6 -0
  72. package/dist/types/interface/api/responses/abyss.admin.response.js +2 -0
  73. package/dist/types/interface/api/responses/banking.admin.response.d.ts +48 -0
  74. package/dist/types/interface/api/responses/banking.admin.response.js +2 -0
  75. package/dist/types/interface/api/responses/banking.response.d.ts +86 -0
  76. package/dist/types/interface/api/responses/banking.response.js +2 -0
  77. package/dist/types/interface/api/responses/categorization-rule.admin.response.d.ts +22 -0
  78. package/dist/types/interface/api/responses/categorization-rule.admin.response.js +2 -0
  79. package/dist/types/interface/api/responses/categorization-rule.response.d.ts +22 -0
  80. package/dist/types/interface/api/responses/categorization-rule.response.js +2 -0
  81. package/dist/types/interface/api/responses/category.admin.response.d.ts +19 -0
  82. package/dist/types/interface/api/responses/category.admin.response.js +2 -0
  83. package/dist/types/interface/api/responses/category.response.d.ts +32 -0
  84. package/dist/types/interface/api/responses/category.response.js +2 -0
  85. package/dist/types/interface/api/responses/monitor.response.d.ts +7 -0
  86. package/dist/types/interface/api/responses/monitor.response.js +2 -0
  87. package/dist/types/interface/api/responses/panel.admin.response.d.ts +19 -0
  88. package/dist/types/interface/api/responses/panel.admin.response.js +2 -0
  89. package/dist/types/interface/api/responses/panel.response.d.ts +19 -0
  90. package/dist/types/interface/api/responses/panel.response.js +2 -0
  91. package/dist/types/interface/api/responses/storage.admin.response.d.ts +3 -0
  92. package/dist/types/interface/api/responses/storage.admin.response.js +2 -0
  93. package/dist/types/interface/api/responses/user.admin.response.d.ts +14 -0
  94. package/dist/types/interface/api/responses/user.admin.response.js +2 -0
  95. package/dist/types/interface/api/responses/user.response.d.ts +13 -0
  96. package/dist/types/interface/api/responses/user.response.js +2 -0
  97. package/dist/types/interface/api/type-message/api-error.d.ts +8 -0
  98. package/dist/types/interface/api/type-message/api-error.js +2 -0
  99. package/dist/types/interface/api/type-message/base-order.d.ts +4 -0
  100. package/dist/types/interface/api/type-message/base-order.js +2 -0
  101. package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
  102. package/dist/types/interface/api/type-message/base-paginate.js +2 -0
  103. package/dist/types/interface/api/type-message/response.d.ts +5 -0
  104. package/dist/types/interface/api/type-message/response.js +2 -0
  105. package/dist/types/interface/index.d.ts +13 -0
  106. package/dist/types/interface/index.js +25 -0
  107. package/dist/types/interface/models/account-transaction.model.d.ts +46 -0
  108. package/dist/types/interface/models/account-transaction.model.js +2 -0
  109. package/dist/types/interface/models/aggregator-bank.model.d.ts +12 -0
  110. package/dist/types/interface/models/aggregator-bank.model.js +2 -0
  111. package/dist/types/interface/models/aggregator-link.model.d.ts +12 -0
  112. package/dist/types/interface/models/aggregator-link.model.js +2 -0
  113. package/dist/types/interface/models/bank-account-history.model.d.ts +11 -0
  114. package/dist/types/interface/models/bank-account-history.model.js +2 -0
  115. package/dist/types/interface/models/bank-account-transaction.model.d.ts +14 -0
  116. package/dist/types/interface/models/bank-account-transaction.model.js +2 -0
  117. package/dist/types/interface/models/bank-account.model.d.ts +26 -0
  118. package/dist/types/interface/models/bank-account.model.js +2 -0
  119. package/dist/types/interface/models/bank-connection.model.d.ts +17 -0
  120. package/dist/types/interface/models/bank-connection.model.js +2 -0
  121. package/dist/types/interface/models/categorization-rule-category.model.d.ts +11 -0
  122. package/dist/types/interface/models/categorization-rule-category.model.js +2 -0
  123. package/dist/types/interface/models/categorization-rule.model.d.ts +44 -0
  124. package/dist/types/interface/models/categorization-rule.model.js +2 -0
  125. package/dist/types/interface/models/category.model.d.ts +14 -0
  126. package/dist/types/interface/models/category.model.js +2 -0
  127. package/dist/types/interface/models/panel.model.d.ts +108 -0
  128. package/dist/types/interface/models/panel.model.js +2 -0
  129. package/dist/types/interface/models/transaction-category.model.d.ts +14 -0
  130. package/dist/types/interface/models/transaction-category.model.js +2 -0
  131. package/dist/types/interface/models/user.model.d.ts +13 -0
  132. package/dist/types/interface/models/user.model.js +2 -0
  133. package/dist/utils/error.utils.d.ts +15 -0
  134. package/dist/utils/error.utils.js +24 -0
  135. package/dist/utils/index.d.ts +1 -0
  136. package/dist/utils/index.js +13 -0
  137. package/package.json +48 -0
  138. package/src/api/abyss.admin.api.ts +16 -0
  139. package/src/api/banking.admin.api.ts +141 -0
  140. package/src/api/banking.api.ts +197 -0
  141. package/src/api/categorization-rule.admin.api.ts +80 -0
  142. package/src/api/categorization-rule.api.ts +80 -0
  143. package/src/api/category.admin.api.ts +63 -0
  144. package/src/api/category.api.ts +74 -0
  145. package/src/api/index.ts +12 -0
  146. package/src/api/monitor.api.ts +6 -0
  147. package/src/api/panel.admin.api.ts +57 -0
  148. package/src/api/panel.api.ts +45 -0
  149. package/src/api/user.admin.api.ts +44 -0
  150. package/src/api/user.api.ts +20 -0
  151. package/src/index.ts +72 -0
  152. package/src/types/enum/aggregator-type.enum.ts +4 -0
  153. package/src/types/enum/api-error.enum.ts +18 -0
  154. package/src/types/enum/bank-connection-status.enum.ts +6 -0
  155. package/src/types/enum/cash-account-type.enum.ts +54 -0
  156. package/src/types/enum/index.ts +7 -0
  157. package/src/types/enum/panel-component-type.enum.ts +12 -0
  158. package/src/types/enum/period-configuration.enum.ts +7 -0
  159. package/src/types/index.ts +2 -0
  160. package/src/types/interface/api/index.ts +29 -0
  161. package/src/types/interface/api/requests/abyss.admin.request.ts +3 -0
  162. package/src/types/interface/api/requests/banking.admin.request.ts +57 -0
  163. package/src/types/interface/api/requests/banking.request.ts +89 -0
  164. package/src/types/interface/api/requests/categorization-rule.admin.request.ts +40 -0
  165. package/src/types/interface/api/requests/categorization-rule.request.ts +38 -0
  166. package/src/types/interface/api/requests/category.admin.request.ts +27 -0
  167. package/src/types/interface/api/requests/category.request.ts +31 -0
  168. package/src/types/interface/api/requests/panel.admin.request.ts +28 -0
  169. package/src/types/interface/api/requests/panel.request.ts +27 -0
  170. package/src/types/interface/api/requests/user.admin.request.ts +20 -0
  171. package/src/types/interface/api/requests/user.request.ts +2 -0
  172. package/src/types/interface/api/responses/abyss.admin.response.ts +7 -0
  173. package/src/types/interface/api/responses/banking.admin.response.ts +73 -0
  174. package/src/types/interface/api/responses/banking.response.ts +119 -0
  175. package/src/types/interface/api/responses/categorization-rule.admin.response.ts +28 -0
  176. package/src/types/interface/api/responses/categorization-rule.response.ts +28 -0
  177. package/src/types/interface/api/responses/category.admin.response.ts +24 -0
  178. package/src/types/interface/api/responses/category.response.ts +39 -0
  179. package/src/types/interface/api/responses/monitor.response.ts +8 -0
  180. package/src/types/interface/api/responses/panel.admin.response.ts +24 -0
  181. package/src/types/interface/api/responses/panel.response.ts +24 -0
  182. package/src/types/interface/api/responses/storage.admin.response.ts +4 -0
  183. package/src/types/interface/api/responses/user.admin.response.ts +18 -0
  184. package/src/types/interface/api/responses/user.response.ts +16 -0
  185. package/src/types/interface/api/type-message/api-error.ts +9 -0
  186. package/src/types/interface/api/type-message/base-order.ts +4 -0
  187. package/src/types/interface/api/type-message/base-paginate.ts +11 -0
  188. package/src/types/interface/api/type-message/response.ts +6 -0
  189. package/src/types/interface/index.ts +15 -0
  190. package/src/types/interface/models/account-transaction.model.ts +53 -0
  191. package/src/types/interface/models/aggregator-bank.model.ts +15 -0
  192. package/src/types/interface/models/aggregator-link.model.ts +15 -0
  193. package/src/types/interface/models/bank-account-history.model.ts +14 -0
  194. package/src/types/interface/models/bank-account.model.ts +29 -0
  195. package/src/types/interface/models/bank-connection.model.ts +20 -0
  196. package/src/types/interface/models/categorization-rule-category.model.ts +14 -0
  197. package/src/types/interface/models/categorization-rule.model.ts +48 -0
  198. package/src/types/interface/models/category.model.ts +17 -0
  199. package/src/types/interface/models/panel.model.ts +135 -0
  200. package/src/types/interface/models/transaction-category.model.ts +17 -0
  201. package/src/types/interface/models/user.model.ts +16 -0
  202. package/src/utils/error.utils.ts +30 -0
  203. package/src/utils/index.ts +1 -0
  204. package/tsconfig.json +105 -0
package/src/index.ts ADDED
@@ -0,0 +1,72 @@
1
+ import axios from 'axios';
2
+ import axiosRetry, { IAxiosRetryConfig, isNetworkOrIdempotentRequestError } from 'axios-retry';
3
+
4
+ export * from './types';
5
+ export * from './utils';
6
+ export * from './api';
7
+
8
+ const DEFAULT_BASE_URL = 'https://banking-api.abyss-project.fr/api/';
9
+
10
+ export const API_KEY_HEADER = 'abyss-banking-api-key';
11
+ export const ADMIN_TOKEN_HEADER = 'abyss-admin-token';
12
+
13
+ const NUMBER_RETRY_API = 10;
14
+ const BASE_DELAY_BETWEEN_RETRY = 5000;
15
+ const RETRY_CODES = [
16
+ 502, // Note(Mehdi): Bad Gateway
17
+ 503, // Note(Mehdi): Service Unavailable
18
+ ];
19
+
20
+ type CoreConfig = {
21
+ token?: string;
22
+ apiKey?: string;
23
+ adminToken?: string;
24
+ baseURL?: string;
25
+ };
26
+
27
+ export class AbyssBankingCore {
28
+ private static config = {
29
+ token: '',
30
+ apiKey: '',
31
+ apiKeyApplication: '',
32
+ applicationId: '',
33
+ adminToken: '',
34
+ baseURL: DEFAULT_BASE_URL,
35
+ };
36
+ static axios = axios.create({ baseURL: `` });
37
+
38
+ public static enableAxiosRetry(axiosRetryConfig?: IAxiosRetryConfig): void {
39
+ axiosRetry(AbyssBankingCore.axios, {
40
+ retries: NUMBER_RETRY_API,
41
+ retryDelay: (retryCount) => retryCount * BASE_DELAY_BETWEEN_RETRY,
42
+ retryCondition: (error) =>
43
+ isNetworkOrIdempotentRequestError(error) ||
44
+ RETRY_CODES.includes(error.response?.status || 502),
45
+ ...axiosRetryConfig,
46
+ });
47
+ }
48
+
49
+ public static setConfig(config: CoreConfig): void {
50
+ AbyssBankingCore.config = { ...AbyssBankingCore.config, ...config };
51
+
52
+ if (config.baseURL) {
53
+ AbyssBankingCore.axios.defaults.baseURL = config.baseURL;
54
+ }
55
+
56
+ if (config.token) {
57
+ AbyssBankingCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
58
+ }
59
+
60
+ if (config.apiKey) {
61
+ AbyssBankingCore.axios.defaults.headers.common[API_KEY_HEADER] = `${config.apiKey}`;
62
+ }
63
+
64
+ if (config.adminToken) {
65
+ AbyssBankingCore.axios.defaults.headers.common[ADMIN_TOKEN_HEADER] = `${config.adminToken}`;
66
+ }
67
+ }
68
+
69
+ public static getConfig(): CoreConfig {
70
+ return AbyssBankingCore.config;
71
+ }
72
+ }
@@ -0,0 +1,4 @@
1
+ export enum AggregatorType {
2
+ GOCARDLESS = 'GOCARDLESS',
3
+ DEMO_DATA_BANKING = 'DEMO_DATA_BANKING',
4
+ }
@@ -0,0 +1,18 @@
1
+ export enum ErrorType {
2
+ apiError = 'api_error',
3
+ authError = 'authentication_error',
4
+ resourceError = 'resource_error',
5
+ }
6
+
7
+ export enum Code {
8
+ // HTTP Error
9
+ tokenFailure = 'token_authentication_failure',
10
+ authenticationFailure = 'authentication_credentials_failure',
11
+ accessNotAllowed = 'access_not_allowed',
12
+ notFound = 'not_found',
13
+ validationError = 'resource_validation_error',
14
+ constraintError = 'resource_constraint_error',
15
+ internalServerError = 'internal_server_error',
16
+ serviceUnavailable = 'service_unavailable',
17
+ invalidData = 'invalid_data',
18
+ }
@@ -0,0 +1,6 @@
1
+ export enum BankConnectionStatus {
2
+ PENDING = 'PENDING',
3
+ FAILED = 'FAILED',
4
+ SUCCESS = 'SUCCESS',
5
+ EXPIRED = 'EXPIRED',
6
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ External code sets can be downloaded from www.iso20022.org.
3
+
4
+ CACC Account used to post debits and credits when no specific account has been nominated.
5
+ CARD Account used for credit card payments.
6
+ CASH Account used for the payment of cash.
7
+ CHAR Account used for charges if different from the account for payment.
8
+ CISH Account used for payment of income if different from the current cash account
9
+ COMM Account used for commission if different from the account for payment.
10
+ CPAC Account used to post settlement debit and credit entries on behalf of a designated Clearing Participant.
11
+ LLSV Account used for savings with special interest and withdrawal terms.
12
+ LOAN Account used for loans.
13
+ MGLD Account used for a marginal lending facility.
14
+ MOMA Account used for money markets if different from the cash account.
15
+ NREX Account used for non-resident external.
16
+ ODFT Account is used for overdrafts.
17
+ ONDP Account used for overnight deposits.
18
+ OTHR Account not otherwise specified.
19
+ SACC Account used to post debit and credit entries, as a result of transactions cleared and settled through a specific clearing and settlement system.
20
+ SLRY Accounts used for salary payments.
21
+ SVGS Account used for savings.
22
+ TAXE Account used for taxes if different from the account for payment.
23
+ TRAN A transacting account is the most basic type of bank account that you can get. The main difference between transaction and cheque accounts is that you usually do not get a cheque book with your transacting account and neither are you offered an overdraft facility.
24
+ TRAS Account used for trading if different from the current cash account.
25
+ VACC Account created virtually to facilitate collection and reconciliation.
26
+ NFCA Non-Resident Individual / Entity Foreign Current held domestically.
27
+ */
28
+
29
+ export enum CashAccountType {
30
+ 'CACC' = 'CACC',
31
+ 'CARD' = 'CARD',
32
+ 'CASH' = 'CASH',
33
+ 'CHAR' = 'CHAR',
34
+ 'CISH' = 'CISH',
35
+ 'COMM' = 'COMM',
36
+ 'CPAC' = 'CPAC',
37
+ 'LLSV' = 'LLSV',
38
+ 'LOAN' = 'LOAN',
39
+ 'MGLD' = 'MGLD',
40
+ 'MOMA' = 'MOMA',
41
+ 'NREX' = 'NREX',
42
+ 'ODFT' = 'ODFT',
43
+ 'ONDP' = 'ONDP',
44
+ 'OTHR' = 'OTHR',
45
+ 'SACC' = 'SACC',
46
+ 'SLRY' = 'SLRY',
47
+ 'SVGS' = 'SVGS',
48
+ 'TAXE' = 'TAXE',
49
+ 'TRAN' = 'TRAN',
50
+ 'TRAS' = 'TRAS',
51
+ 'VACC' = 'VACC',
52
+ 'NFCA' = 'NFCA',
53
+ 'UNKNOWN' = 'UNKNOWN',
54
+ }
@@ -0,0 +1,7 @@
1
+ export * from './api-error.enum';
2
+
3
+ export * from './aggregator-type.enum';
4
+ export * from './bank-connection-status.enum';
5
+ export * from './cash-account-type.enum';
6
+ export * from './period-configuration.enum';
7
+ export * from './panel-component-type.enum';
@@ -0,0 +1,12 @@
1
+ export enum PanelComponentType {
2
+ ACCOUNT_BALANCE = 'ACCOUNT_BALANCE',
3
+ ACCOUNT_CASH_POSITION = 'ACCOUNT_CASH_POSITION',
4
+ SUM_PER_CATEGORY = 'SUM_PER_CATEGORY',
5
+ SUM_PER_CATEGORY_PER_MONTH = 'SUM_PER_CATEGORY_PER_MONTH',
6
+ TRANSACTION_PER_ACCOUNT = 'TRANSACTION_PER_ACCOUNT',
7
+ TRANSACTION_PER_CATEGORY = 'TRANSACTION_PER_CATEGORY',
8
+ TRANSACTION_PER_DAY = 'TRANSACTION_PER_DAY',
9
+ TRANSACTION_TABLE = 'TRANSACTION_TABLE',
10
+ PERIOD_REPORT = 'PERIOD_REPORT',
11
+ MONTHLY_REPORT = 'MONTHLY_REPORT',
12
+ }
@@ -0,0 +1,7 @@
1
+ export enum PeriodConfiguration {
2
+ LAST_7_DAYS = 'LAST_7_DAYS',
3
+ LAST_30_DAYS = 'LAST_30_DAYS',
4
+ LAST_60_DAYS = 'LAST_60_DAYS',
5
+ SINCE_START_OF_MONTH = 'SINCE_START_OF_MONTH',
6
+ SINCE_START_OF_YEAR = 'SINCE_START_OF_YEAR',
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './enum';
2
+ export * from './interface';
@@ -0,0 +1,29 @@
1
+ export * from './type-message/api-error';
2
+ export * from './type-message/response';
3
+ export * from './type-message/base-order';
4
+ export * from './type-message/base-paginate';
5
+
6
+ export * from './requests/abyss.admin.request';
7
+ export * from './requests/user.admin.request';
8
+ export * from './requests/user.request';
9
+ export * from './requests/banking.request';
10
+ export * from './requests/category.request';
11
+ export * from './requests/category.admin.request';
12
+ export * from './requests/banking.admin.request';
13
+ export * from './requests/categorization-rule.request';
14
+ export * from './requests/categorization-rule.admin.request';
15
+ export * from './requests/panel.request';
16
+ export * from './requests/panel.admin.request';
17
+
18
+ export * from './responses/abyss.admin.response';
19
+ export * from './responses/monitor.response';
20
+ export * from './responses/user.admin.response';
21
+ export * from './responses/user.response';
22
+ export * from './responses/banking.response';
23
+ export * from './responses/category.response';
24
+ export * from './responses/category.admin.response';
25
+ export * from './responses/banking.admin.response';
26
+ export * from './responses/categorization-rule.response';
27
+ export * from './responses/categorization-rule.admin.response';
28
+ export * from './responses/panel.response';
29
+ export * from './responses/panel.admin.response';
@@ -0,0 +1,3 @@
1
+ export interface IActivateUserServiceAbyssAdminBody {
2
+ userId: string;
3
+ }
@@ -0,0 +1,57 @@
1
+ import { QueryPaginate } from '../type-message/base-paginate';
2
+
3
+ export type IListInstitutionBankingAdminQuery = {
4
+ countryCode: string;
5
+ };
6
+
7
+ export interface IConfirmRequisitionBankingAdminParams {
8
+ userId: string;
9
+ reference: string;
10
+ }
11
+
12
+ export interface IListBankConnectionBankingAdminParams {
13
+ userId: string;
14
+ }
15
+
16
+ export interface IGetBankConnectionBankingAdminParams {
17
+ bankConnectionId: string;
18
+ }
19
+
20
+ export interface IGetAccountTransactionBankingAdminParams {
21
+ accountTransactionId: string;
22
+ }
23
+
24
+ export interface IUpdateAccountTransactionBankingAdminParams {
25
+ accountTransactionId: string;
26
+ }
27
+ export interface IUpdateAccountTransactionBankingAdminBody {
28
+ comment?: string;
29
+ }
30
+
31
+ export type IPaginateAccountTransactionBankingAdminQuery = {
32
+ description?: string;
33
+ currency?: string;
34
+ bankAccountId: string[];
35
+ categoryId?: string[];
36
+ before?: Date;
37
+ after?: Date;
38
+ onlyWithoutCategories?: boolean;
39
+ categorizationRuleId?: string;
40
+ order?: 'ASC' | 'DESC';
41
+ } & QueryPaginate;
42
+
43
+ export interface IUpdateBankAccountBankingAdminParams {
44
+ bankAccountId: string;
45
+ }
46
+ export interface IUpdateBankAccountBankingAdminBody {
47
+ isMasked?: boolean;
48
+ color?: string;
49
+ }
50
+
51
+ export interface ILoadDemoDataBankingAdminParams {
52
+ userId: string;
53
+ }
54
+
55
+ export interface IDeleteDemoDataBankingAdminParams {
56
+ userId: string;
57
+ }
@@ -0,0 +1,89 @@
1
+ import { QueryPaginate } from '../type-message/base-paginate';
2
+
3
+ export interface ICreateRequisitionBankingBody {
4
+ institutionId: string;
5
+ redirectUrl: string;
6
+ }
7
+
8
+ export interface IRenewRequisitionBankingParams {
9
+ bankConnectionId: string;
10
+ }
11
+ export interface IRenewRequisitionBankingBody {
12
+ redirectUrl: string;
13
+ }
14
+
15
+ export type IListInstitutionBankingQuery = {
16
+ countryCode: string;
17
+ };
18
+
19
+ export interface IConfirmRequisitionBankingParams {
20
+ reference: string;
21
+ }
22
+
23
+ export interface IGetBankConnectionBankingParams {
24
+ bankConnectionId: string;
25
+ }
26
+
27
+ export interface IGetAccountTransactionBankingParams {
28
+ accountTransactionId: string;
29
+ }
30
+
31
+ export interface IUpdateAccountTransactionBankingParams {
32
+ accountTransactionId: string;
33
+ }
34
+ export interface IUpdateAccountTransactionBankingBody {
35
+ comment?: string;
36
+ }
37
+
38
+ export type IPaginateAccountTransactionBankingQuery = {
39
+ description?: string;
40
+ currency?: string;
41
+ bankAccountId?: string[];
42
+ categoryId?: string[];
43
+ before?: Date;
44
+ after?: Date;
45
+ onlyWithoutCategories?: boolean;
46
+ categorizationRuleId?: string;
47
+ order?: 'ASC' | 'DESC';
48
+ } & QueryPaginate;
49
+
50
+ export interface IUpdateBankAccountBankingParams {
51
+ bankAccountId: string;
52
+ }
53
+ export interface IUpdateBankAccountBankingBody {
54
+ isMasked?: boolean;
55
+ color?: string;
56
+ commonName?: string | null;
57
+ }
58
+
59
+ export interface IGetTransactionPerCategoryBankingQuery {
60
+ bankAccountId?: string[];
61
+ before?: Date;
62
+ after?: Date;
63
+ }
64
+
65
+ export interface IGetSumTransactionPerBankAccountPerCategoryQuery {
66
+ bankAccountId: string[];
67
+ before?: Date;
68
+ after?: Date;
69
+ }
70
+
71
+ export interface IGetSumTransactionPerBankAccountPerCategoryPerMonthQuery {
72
+ bankAccountId?: string[];
73
+ before?: Date;
74
+ after?: Date;
75
+ }
76
+
77
+ export type IPaginateBankAccountHistoryBankingQuery = {
78
+ bankAccountId?: string[];
79
+ before?: Date;
80
+ after?: Date;
81
+ order?: 'ASC' | 'DESC';
82
+ } & QueryPaginate;
83
+
84
+ export type IListBankAccountHistoryBankingQuery = {
85
+ bankAccountId?: string[];
86
+ before?: Date;
87
+ after?: Date;
88
+ order?: 'ASC' | 'DESC';
89
+ };
@@ -0,0 +1,40 @@
1
+ import { CategorizationRules } from '../../models/categorization-rule.model';
2
+ import { QueryPaginate } from '../type-message/base-paginate';
3
+
4
+ export type IPaginateCategorizationRuleAdminQuery = {
5
+ isActive?: boolean;
6
+ userId?: string;
7
+ name?: string;
8
+ } & QueryPaginate;
9
+
10
+ export interface IGetCategorizationRuleAdminParams {
11
+ categorizationRuleId: string;
12
+ }
13
+
14
+ export interface IDeleteCategorizationRuleAdminParams {
15
+ categorizationRuleId: string;
16
+ }
17
+
18
+ export interface ICreateCategorizationRuleAdminBody {
19
+ userId: string;
20
+ name: string;
21
+ description: string | null;
22
+ rules: CategorizationRules[];
23
+ isActive: boolean;
24
+ categoryIds: string[];
25
+ }
26
+
27
+ export interface IUpdateCategorizationRuleAdminParams {
28
+ categorizationRuleId: string;
29
+ }
30
+ export interface IUpdateCategorizationRuleAdminBody {
31
+ name?: string;
32
+ description?: string | null;
33
+ rules?: CategorizationRules[];
34
+ isActive?: boolean;
35
+ categoryIds?: string[];
36
+ }
37
+
38
+ export interface IApplyCategorizationRuleAdminParams {
39
+ categorizationRuleId: string;
40
+ }
@@ -0,0 +1,38 @@
1
+ import { CategorizationRules } from '../../models/categorization-rule.model';
2
+ import { QueryPaginate } from '../type-message/base-paginate';
3
+
4
+ export type IPaginateCategorizationRuleQuery = {
5
+ name?: string;
6
+ isActive?: boolean;
7
+ } & QueryPaginate;
8
+
9
+ export interface IGetCategorizationRuleParams {
10
+ categorizationRuleId: string;
11
+ }
12
+
13
+ export interface IDeleteCategorizationRuleParams {
14
+ categorizationRuleId: string;
15
+ }
16
+
17
+ export interface IApplyCategorizationRuleParams {
18
+ categorizationRuleId: string;
19
+ }
20
+
21
+ export interface ICreateCategorizationRuleBody {
22
+ name: string;
23
+ description: string | null;
24
+ rules: CategorizationRules[];
25
+ isActive: boolean;
26
+ categoryIds: string[];
27
+ }
28
+
29
+ export interface IUpdateCategorizationRuleParams {
30
+ categorizationRuleId: string;
31
+ }
32
+ export interface IUpdateCategorizationRuleBody {
33
+ name?: string;
34
+ description?: string | null;
35
+ rules?: CategorizationRules[];
36
+ isActive?: boolean;
37
+ categoryIds?: string[];
38
+ }
@@ -0,0 +1,27 @@
1
+ import { QueryPaginate } from '..';
2
+
3
+ export interface IDeleteCategoryAdminParams {
4
+ categoryId: string;
5
+ }
6
+
7
+ export interface ICreateCategoryAdminBody {
8
+ userId: string;
9
+ name: string;
10
+ color: string;
11
+ }
12
+
13
+ export interface IUpdateCategoryAdminParams {
14
+ categoryId: string;
15
+ }
16
+ export interface IUpdateCategoryAdminBody {
17
+ name?: string;
18
+ color?: string;
19
+ }
20
+
21
+ export type IPaginateCategoryAdminQuery = {
22
+ userId?: string;
23
+ } & QueryPaginate;
24
+
25
+ export interface IGetCategoryAdminParams {
26
+ categoryId: string;
27
+ }
@@ -0,0 +1,31 @@
1
+ export interface IRemoveCategoryParams {
2
+ transactionCategoryId: string;
3
+ }
4
+
5
+ export interface IAddCategoryParams {
6
+ categoryId: string;
7
+ accountTransactionId: string;
8
+ }
9
+
10
+ export interface IDeleteCategoryParams {
11
+ categoryId: string;
12
+ }
13
+
14
+ export interface ICreateCategoryBody {
15
+ name: string;
16
+ color: string;
17
+ }
18
+
19
+ export interface IUpdateCategoryParams {
20
+ categoryId: string;
21
+ }
22
+ export interface IUpdateCategoryBody {
23
+ name?: string;
24
+ color?: string;
25
+ }
26
+
27
+ export interface IListAnalyticsCategoryQuery {
28
+ bankAccountId?: string[];
29
+ before?: Date;
30
+ after?: Date;
31
+ }
@@ -0,0 +1,28 @@
1
+ import { PanelComposition } from '../../models/panel.model';
2
+ import { QueryPaginate } from '../type-message/base-paginate';
3
+
4
+ export type IPaginatePanelAdminQuery = {
5
+ name?: string;
6
+ } & QueryPaginate;
7
+
8
+ export interface IGetPanelAdminParams {
9
+ panelId: string;
10
+ }
11
+
12
+ export interface IDeletePanelAdminParams {
13
+ panelId: string;
14
+ }
15
+
16
+ export interface ICreatePanelAdminBody {
17
+ userId: string;
18
+ name: string;
19
+ composition: PanelComposition;
20
+ }
21
+
22
+ export interface IUpdatePanelAdminParams {
23
+ panelId: string;
24
+ }
25
+ export interface IUpdatePanelAdminBody {
26
+ name?: string;
27
+ composition?: PanelComposition;
28
+ }
@@ -0,0 +1,27 @@
1
+ import { PanelComposition } from '../../models/panel.model';
2
+ import { QueryPaginate } from '../type-message/base-paginate';
3
+
4
+ export type IPaginatePanelQuery = {
5
+ name?: string;
6
+ } & QueryPaginate;
7
+
8
+ export interface IGetPanelParams {
9
+ panelId: string;
10
+ }
11
+
12
+ export interface IDeletePanelParams {
13
+ panelId: string;
14
+ }
15
+
16
+ export interface ICreatePanelBody {
17
+ name: string;
18
+ composition: PanelComposition;
19
+ }
20
+
21
+ export interface IUpdatePanelParams {
22
+ panelId: string;
23
+ }
24
+ export interface IUpdatePanelBody {
25
+ name?: string;
26
+ composition?: PanelComposition;
27
+ }
@@ -0,0 +1,20 @@
1
+ import { QueryPaginate } from '..';
2
+
3
+ import * as core from 'express-serve-static-core';
4
+
5
+ export interface IGetUserAdminParams extends core.ParamsDictionary {
6
+ userId: string;
7
+ }
8
+
9
+ export interface IResetApiKeyUserAdminParams extends core.ParamsDictionary {
10
+ userId: string;
11
+ }
12
+
13
+ export type IPaginateUserAdminQuery = QueryPaginate;
14
+
15
+ export interface IUpdateUserAdminParams extends core.ParamsDictionary {
16
+ userId: string;
17
+ }
18
+ export interface IUpdateUserAdminBody {
19
+ isAdmin?: boolean;
20
+ }
@@ -0,0 +1,2 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
2
+ export interface IUpdateUserBody {}
@@ -0,0 +1,7 @@
1
+ import { IUser } from '../../models/user.model';
2
+ import { IResponse } from '../type-message/response';
3
+
4
+ export interface IActivateUserServiceAbyssAdminData {
5
+ user: IUser;
6
+ }
7
+ export type IActivateUserServiceAbyssAdminResponse = IResponse<IActivateUserServiceAbyssAdminData>;
@@ -0,0 +1,73 @@
1
+ import {
2
+ BasePaginate,
3
+ IAccountTransaction,
4
+ IAggregatorBank,
5
+ IAggregatorLink,
6
+ IBankAccount,
7
+ IBankConnection,
8
+ IResponse,
9
+ } from '../..';
10
+
11
+ export interface IListBankConnectionBankingAdminData {
12
+ aggregatorLink: IAggregatorLink[];
13
+ }
14
+ export type IListBankConnectionBankingAdminResponse =
15
+ IResponse<IListBankConnectionBankingAdminData>;
16
+
17
+ export interface IGetBankConnectionBankingAdminData {
18
+ bankConnection: IBankConnection;
19
+ }
20
+ export type IGetBankConnectionBankingAdminResponse = IResponse<IGetBankConnectionBankingAdminData>;
21
+
22
+ export interface IListInstitutionBankingAdminData {
23
+ institution: {
24
+ id: string;
25
+ name: string;
26
+ countries: string[];
27
+ logoUrl: string;
28
+ bic: string;
29
+ transactionTotalDays: string;
30
+ }[];
31
+ }
32
+ export type IListInstitutionBankingAdminResponse = IResponse<IListInstitutionBankingAdminData>;
33
+
34
+ export interface IListBankBankingAdminData {
35
+ aggregatorBank: IAggregatorBank[];
36
+ }
37
+ export type IListBankBankingAdminResponse = IResponse<IListBankBankingAdminData>;
38
+
39
+ export interface IConfirmRequisitionBankingAdminData {
40
+ bankConnection: IBankConnection;
41
+ }
42
+ export type IConfirmRequisitionBankingAdminResponse =
43
+ IResponse<IConfirmRequisitionBankingAdminData>;
44
+
45
+ export type IPaginateAccountTransactionBankingAdminResponse = IResponse<
46
+ BasePaginate<IAccountTransaction>
47
+ >;
48
+
49
+ export interface IGetAccountTransactionBankingAdminData {
50
+ accountTransaction: IAccountTransaction;
51
+ }
52
+ export type IGetAccountTransactionBankingAdminResponse =
53
+ IResponse<IGetAccountTransactionBankingAdminData>;
54
+
55
+ export interface IUpdateAccountTransactionBankingAdminData {
56
+ accountTransaction: IAccountTransaction;
57
+ }
58
+ export type IUpdateAccountTransactionBankingAdminResponse =
59
+ IResponse<IUpdateAccountTransactionBankingAdminData>;
60
+
61
+ export interface IUpdateBankAccountBankingAdminData {
62
+ bankAccount: IBankAccount;
63
+ }
64
+ export type IUpdateBankAccountBankingAdminResponse = IResponse<IUpdateBankAccountBankingAdminData>;
65
+
66
+ export interface ILoadDemoDataBankingAdminData {
67
+ aggregatorLink: IAggregatorLink;
68
+ }
69
+ export type ILoadDemoDataBankingAdminResponse = IResponse<ILoadDemoDataBankingAdminData>;
70
+
71
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
72
+ export interface IDeleteDemoDataBankingAdminData {}
73
+ export type IDeleteDemoDataBankingAdminResponse = IResponse<IDeleteDemoDataBankingAdminData>;