@fiado/api-invoker 1.1.7 → 1.1.8

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 (92) hide show
  1. package/README.md +64 -64
  2. package/bin/exchangeRates/ExchangeRatesApi.d.ts +2 -0
  3. package/bin/exchangeRates/ExchangeRatesApi.js +6 -0
  4. package/bin/exchangeRates/interfaces/IExchangeRatesApi.d.ts +2 -0
  5. package/package.json +28 -28
  6. package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
  7. package/src/account-beneficiary/index.ts +2 -2
  8. package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
  9. package/src/account-fiadoinc/AccountFiadoIncApi.ts +60 -60
  10. package/src/account-fiadoinc/index.ts +1 -1
  11. package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +29 -29
  12. package/src/account-fiadosa/AccountFiadoSAApi.ts +22 -22
  13. package/src/account-fiadosa/index.ts +1 -1
  14. package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +9 -9
  15. package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +27 -27
  16. package/src/account-pagoconfiado/index.ts +2 -2
  17. package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +8 -8
  18. package/src/address/AddressApi.ts +46 -46
  19. package/src/address/index.ts +3 -3
  20. package/src/address/interfaces/IAddressApi.ts +30 -30
  21. package/src/authentication/AuthenticationApi.ts +16 -16
  22. package/src/authentication/index.ts +4 -4
  23. package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
  24. package/src/bankAccount/BankAccountApi.ts +37 -37
  25. package/src/bankAccount/index.ts +1 -1
  26. package/src/bankAccount/interfaces/IBankAccountApi.ts +4 -4
  27. package/src/bbvaRst/api/BBVARstApi.ts +16 -16
  28. package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
  29. package/src/bbvaRst/index.ts +1 -1
  30. package/src/card/CardApi.ts +33 -33
  31. package/src/card/index.ts +3 -3
  32. package/src/card/interfaces/ICardApi.ts +10 -10
  33. package/src/collector/CollectorApi.ts +21 -21
  34. package/src/collector/index.ts +2 -2
  35. package/src/collector/interfaces/ICollectorApi.ts +19 -19
  36. package/src/container.config.ts +70 -70
  37. package/src/contract-generator/ContractGeneratorApi.ts +18 -18
  38. package/src/contract-generator/index.ts +2 -2
  39. package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
  40. package/src/directory/DirectoryApi.ts +115 -115
  41. package/src/directory/index.ts +3 -3
  42. package/src/directory/interfaces/IDirectoryApi.ts +66 -66
  43. package/src/exchangeRates/ExchangeRatesApi.ts +27 -18
  44. package/src/exchangeRates/index.ts +1 -1
  45. package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -5
  46. package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
  47. package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
  48. package/src/fraudPreventionEngine/index.ts +1 -1
  49. package/src/group/GroupApi.ts +24 -24
  50. package/src/group/index.ts +1 -1
  51. package/src/group/interfaces/IGroupApi.ts +23 -23
  52. package/src/identity/IdentityApi.ts +47 -47
  53. package/src/identity/index.ts +3 -3
  54. package/src/identity/interfaces/IIdentityApi.ts +33 -33
  55. package/src/index.ts +25 -25
  56. package/src/notificationMessages/index.ts +1 -1
  57. package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
  58. package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
  59. package/src/p2pContact/api/P2pContactApi.ts +19 -19
  60. package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
  61. package/src/p2pContact/index.ts +1 -1
  62. package/src/pomelo/api/PomeloApi.ts +99 -99
  63. package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
  64. package/src/pomelo/index.ts +1 -1
  65. package/src/product-catalog/ProductCatalogApi.ts +17 -17
  66. package/src/product-catalog/index.ts +1 -1
  67. package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
  68. package/src/sessionActivity/index.ts +2 -2
  69. package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
  70. package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
  71. package/src/stpAccount/api/STPAccountApi.ts +102 -102
  72. package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +6 -6
  73. package/src/stpAccount/index.ts +1 -1
  74. package/src/stpServicePayment/api/StpServicePaymentApi.ts +35 -35
  75. package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +11 -11
  76. package/src/stpServicePayment/index.ts +1 -1
  77. package/src/stpSpei/api/StpSpeiApi.ts +20 -20
  78. package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +4 -4
  79. package/src/stpSpei/index.ts +1 -1
  80. package/src/tern/api/TernApi.ts +96 -96
  81. package/src/tern/api/interfaces/ITernApi.ts +29 -29
  82. package/src/tern/index.ts +1 -1
  83. package/src/transaction/index.ts +2 -2
  84. package/src/transaction/queue/TransactionPublisher.ts +24 -24
  85. package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
  86. package/tsconfig.json +21 -21
  87. package/bin/activity/ActivityApi.d.ts +0 -17
  88. package/bin/activity/ActivityApi.js +0 -72
  89. package/bin/activity/index.d.ts +0 -2
  90. package/bin/activity/index.js +0 -18
  91. package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
  92. package/bin/activity/interfaces/IActivityApi.js +0 -2
@@ -1,99 +1,99 @@
1
- import { IPomeloApi } from "./interfaces/IPomeloApi";
2
- import { inject, injectable } from "inversify";
3
- import { IHttpRequest } from "@fiado/http-client";
4
- import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
5
- import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
6
-
7
-
8
- @injectable()
9
- export default class PomeloApi implements IPomeloApi {
10
-
11
- private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
12
-
13
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
14
- }
15
-
16
- //USER
17
- async createUser(request: CreateBankAccountUserRequest): Promise<any> {
18
- const url: string = `${this.baseUrl}users/create`;
19
- return await this.httpRequest.post(url, request);
20
- }
21
-
22
- public async getUserById(externalUserId: string): Promise<any> {
23
- const url: string = `${this.baseUrl}users/${externalUserId}`;
24
- return await this.httpRequest.get(url);
25
- }
26
-
27
- public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
28
- const url: string = `${this.baseUrl}/users/${object.id}`;
29
- return await this.httpRequest.put(url, object);
30
- }
31
-
32
- // //Card
33
- public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
34
- const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
35
- return await this.httpRequest.get(url);
36
- }
37
-
38
- public async getCardsById(externalCardId: string): Promise<any> {
39
- const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
40
- return await this.httpRequest.get(url);
41
- }
42
-
43
- public async getCardsByUserId(externalUserId: string): Promise<any> {
44
- const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
45
- return await this.httpRequest.get(url);
46
- }
47
-
48
- public async createCard(object: CreateBankAccountRequest): Promise<any> {
49
- const url: string = `${this.baseUrl}cards/create`;
50
- return await this.httpRequest.post(url, object);
51
- }
52
-
53
- public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
54
- const url: string = `${this.baseUrl}cards/${object.cardId}/`;
55
- return await this.httpRequest.put(url, object);
56
- }
57
-
58
- public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
59
- const url: string = `${this.baseUrl}cards/${object.cardId}/`;
60
- return await this.httpRequest.put(url, object);
61
- }
62
-
63
- public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
64
- const url: string = `${this.baseUrl}cards/${object.cardId}/`;
65
- return await this.httpRequest.put(url, object);
66
- }
67
-
68
- public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
69
- const url: string = `${this.baseUrl}cards/activate`;
70
- return await this.httpRequest.post(url, object);
71
- }
72
-
73
- public async assignCardToUser(request: AssignCardRequest): Promise<any> {
74
- const url: string = `${this.baseUrl}cards/activate`;
75
- return await this.httpRequest.post(url, request);
76
- }
77
-
78
-
79
- // //Shipping
80
-
81
- public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
82
- const url: string = `${this.baseUrl}shipment/create`;
83
- return await this.httpRequest.post(url, object);
84
- }
85
-
86
- public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
87
- const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
88
- return await this.httpRequest.get(url);
89
- }
90
-
91
- // public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
92
- // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
93
- // return await this.httpRequest.put(url, object);
94
- // }
95
-
96
-
97
-
98
-
99
- }
1
+ import { IPomeloApi } from "./interfaces/IPomeloApi";
2
+ import { inject, injectable } from "inversify";
3
+ import { IHttpRequest } from "@fiado/http-client";
4
+ import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
5
+ import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
6
+
7
+
8
+ @injectable()
9
+ export default class PomeloApi implements IPomeloApi {
10
+
11
+ private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
12
+
13
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
14
+ }
15
+
16
+ //USER
17
+ async createUser(request: CreateBankAccountUserRequest): Promise<any> {
18
+ const url: string = `${this.baseUrl}users/create`;
19
+ return await this.httpRequest.post(url, request);
20
+ }
21
+
22
+ public async getUserById(externalUserId: string): Promise<any> {
23
+ const url: string = `${this.baseUrl}users/${externalUserId}`;
24
+ return await this.httpRequest.get(url);
25
+ }
26
+
27
+ public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
28
+ const url: string = `${this.baseUrl}/users/${object.id}`;
29
+ return await this.httpRequest.put(url, object);
30
+ }
31
+
32
+ // //Card
33
+ public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
34
+ const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
35
+ return await this.httpRequest.get(url);
36
+ }
37
+
38
+ public async getCardsById(externalCardId: string): Promise<any> {
39
+ const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
40
+ return await this.httpRequest.get(url);
41
+ }
42
+
43
+ public async getCardsByUserId(externalUserId: string): Promise<any> {
44
+ const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
45
+ return await this.httpRequest.get(url);
46
+ }
47
+
48
+ public async createCard(object: CreateBankAccountRequest): Promise<any> {
49
+ const url: string = `${this.baseUrl}cards/create`;
50
+ return await this.httpRequest.post(url, object);
51
+ }
52
+
53
+ public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
54
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
55
+ return await this.httpRequest.put(url, object);
56
+ }
57
+
58
+ public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
59
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
60
+ return await this.httpRequest.put(url, object);
61
+ }
62
+
63
+ public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
64
+ const url: string = `${this.baseUrl}cards/${object.cardId}/`;
65
+ return await this.httpRequest.put(url, object);
66
+ }
67
+
68
+ public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
69
+ const url: string = `${this.baseUrl}cards/activate`;
70
+ return await this.httpRequest.post(url, object);
71
+ }
72
+
73
+ public async assignCardToUser(request: AssignCardRequest): Promise<any> {
74
+ const url: string = `${this.baseUrl}cards/activate`;
75
+ return await this.httpRequest.post(url, request);
76
+ }
77
+
78
+
79
+ // //Shipping
80
+
81
+ public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
82
+ const url: string = `${this.baseUrl}shipment/create`;
83
+ return await this.httpRequest.post(url, object);
84
+ }
85
+
86
+ public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
87
+ const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
88
+ return await this.httpRequest.get(url);
89
+ }
90
+
91
+ // public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
92
+ // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
93
+ // return await this.httpRequest.put(url, object);
94
+ // }
95
+
96
+
97
+
98
+
99
+ }
@@ -1,28 +1,28 @@
1
- import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
- import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
3
-
4
- export interface IPomeloApi {
5
-
6
- updateUser(object: UpdateBankAccountUserRequest): Promise<any>
7
- getUserById(externalUserId: string): Promise<any>
8
- createUser(request: CreateBankAccountUserRequest): Promise<any>;
9
-
10
-
11
- // //Card
12
- getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
13
- getCardsById(externalCardId: string): Promise<any>
14
- getCardsByUserId(externalUserId: string): Promise<any>
15
- createCard(object: CreateBankAccountRequest): Promise<any>
16
- blockCard(object: UpdateBankAccountCardRequest): Promise<any>
17
- changePin(object: UpdateBankAccountCardRequest): Promise<any>
18
- activateCard(object: ActivateBankAccountCardRequest): Promise<any>
19
-
20
- assignCardToUser(request: AssignCardRequest): Promise<any>;
21
- // //Shipping
22
-
23
- createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>
24
- getShipment(object: GetBankAccountShippingRequest): Promise<any>
25
-
26
-
27
-
1
+ import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
2
+ import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
3
+
4
+ export interface IPomeloApi {
5
+
6
+ updateUser(object: UpdateBankAccountUserRequest): Promise<any>
7
+ getUserById(externalUserId: string): Promise<any>
8
+ createUser(request: CreateBankAccountUserRequest): Promise<any>;
9
+
10
+
11
+ // //Card
12
+ getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
13
+ getCardsById(externalCardId: string): Promise<any>
14
+ getCardsByUserId(externalUserId: string): Promise<any>
15
+ createCard(object: CreateBankAccountRequest): Promise<any>
16
+ blockCard(object: UpdateBankAccountCardRequest): Promise<any>
17
+ changePin(object: UpdateBankAccountCardRequest): Promise<any>
18
+ activateCard(object: ActivateBankAccountCardRequest): Promise<any>
19
+
20
+ assignCardToUser(request: AssignCardRequest): Promise<any>;
21
+ // //Shipping
22
+
23
+ createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>
24
+ getShipment(object: GetBankAccountShippingRequest): Promise<any>
25
+
26
+
27
+
28
28
  }
@@ -1,2 +1,2 @@
1
- export * from './api/PomeloApi';
1
+ export * from './api/PomeloApi';
2
2
  export * from './api/interfaces/IPomeloApi';
@@ -1,18 +1,18 @@
1
- import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
5
- import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
6
-
7
- @injectable()
8
- export default class ProductCatalogApi implements IProductCatalogApi {
9
- private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
10
-
11
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
- }
13
-
14
- async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
15
- const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
16
- return await this.httpRequest.get(url);
17
- }
1
+ import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
5
+ import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
6
+
7
+ @injectable()
8
+ export default class ProductCatalogApi implements IProductCatalogApi {
9
+ private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
10
+
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
+ }
13
+
14
+ async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
15
+ const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
16
+ return await this.httpRequest.get(url);
17
+ }
18
18
  }
@@ -1,2 +1,2 @@
1
- export * from './interfaces/IProductCatalogApi';
1
+ export * from './interfaces/IProductCatalogApi';
2
2
  export * from './ProductCatalogApi';
@@ -1,7 +1,7 @@
1
- import {ApiGatewayResponse} from "@fiado/gateway-adapter";
2
- import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
3
-
4
-
5
- export interface IProductCatalogApi {
6
- getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
1
+ import {ApiGatewayResponse} from "@fiado/gateway-adapter";
2
+ import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
3
+
4
+
5
+ export interface IProductCatalogApi {
6
+ getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
7
7
  }
@@ -1,2 +1,2 @@
1
- export * from './queue/SessionActivityPublisher';
2
- export * from './queue/interfaces/ISessionActivityPublisher';
1
+ export * from './queue/SessionActivityPublisher';
2
+ export * from './queue/interfaces/ISessionActivityPublisher';
@@ -1,23 +1,23 @@
1
- import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
- import {ISessionActivityPublisher} from "./interfaces/ISessionActivityPublisher";
3
- import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
4
- import {injectable} from "inversify";
5
-
6
- @injectable()
7
- export class SessionActivityPublisher implements ISessionActivityPublisher {
8
- private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
9
-
10
- async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
11
- try {
12
- const client: SQSClient = new SQSClient();
13
- const sendMessageRequest: SendMessageRequest = {
14
- QueueUrl: this.SESSION_ACTIVITY_QUEUE,
15
- MessageBody: JSON.stringify(message)
16
- };
17
- const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
18
- await client.send(command);
19
- } catch (error) {
20
- throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
21
- }
22
- }
1
+ import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
2
+ import {ISessionActivityPublisher} from "./interfaces/ISessionActivityPublisher";
3
+ import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
4
+ import {injectable} from "inversify";
5
+
6
+ @injectable()
7
+ export class SessionActivityPublisher implements ISessionActivityPublisher {
8
+ private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
9
+
10
+ async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
11
+ try {
12
+ const client: SQSClient = new SQSClient();
13
+ const sendMessageRequest: SendMessageRequest = {
14
+ QueueUrl: this.SESSION_ACTIVITY_QUEUE,
15
+ MessageBody: JSON.stringify(message)
16
+ };
17
+ const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
18
+ await client.send(command);
19
+ } catch (error) {
20
+ throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
21
+ }
22
+ }
23
23
  }
@@ -1,5 +1,5 @@
1
- import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
2
-
3
- export interface ISessionActivityPublisher {
4
- publish(message: SessionActivityQueueMessageRequest): Promise<void>;
1
+ import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
2
+
3
+ export interface ISessionActivityPublisher {
4
+ publish(message: SessionActivityQueueMessageRequest): Promise<void>;
5
5
  }
@@ -1,102 +1,102 @@
1
- import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
2
- import {inject, injectable} from "inversify";
3
- import {IHttpRequest} from "@fiado/http-client";
4
- import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
5
-
6
-
7
- @injectable()
8
- export default class PomeloApi implements ISTPAccountApi {
9
-
10
-
11
- private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
12
-
13
- constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
14
- }
15
-
16
- //ACCOUNT
17
- // //USER
18
- async createAccount(request: CreateBankAccountRequest): Promise<any> {
19
- const url: string = `${this.baseUrl}account/create`;
20
- return await this.httpRequest.post(url, request);
21
- }
22
-
23
-
24
- // //USER
25
- // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
26
- // const url: string = `${this.baseUrl}users/create`;
27
- // return await this.httpRequest.post(url, request);
28
- // }
29
-
30
- // public async getUserById(externalUserId: string): Promise<any> {
31
- // const url: string = `${this.baseUrl}users/${externalUserId}`;
32
- // return await this.httpRequest.get(url);
33
- // }
34
-
35
- // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
36
- // const url: string = `${this.baseUrl}/users/${object.id}`;
37
- // return await this.httpRequest.put(url, object);
38
- // }
39
-
40
- // //Card
41
- // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
42
- // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
43
- // return await this.httpRequest.get(url);
44
- // }
45
-
46
- // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
47
- // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
48
- // return await this.httpRequest.get(url);
49
- // }
50
-
51
- // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
52
- // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
53
- // return await this.httpRequest.get(url);
54
- // }
55
-
56
- // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
57
- // const url: string = `${this.baseUrl}cards/create`;
58
- // return await this.httpRequest.post(url, object);
59
- // }
60
-
61
- // public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
62
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
63
- // return await this.httpRequest.put(url, object);
64
- // }
65
-
66
- // public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
67
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
68
- // return await this.httpRequest.put(url, object);
69
- // }
70
-
71
- // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
72
- // const url: string = `${this.baseUrl}cards/activate`;
73
- // return await this.httpRequest.post(url, object);
74
- // }
75
-
76
- // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
77
- // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
78
- // return await this.httpRequest.put(url, object);
79
- // }
80
-
81
-
82
- // //Shipping
83
-
84
- // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
85
- // const url: string = `${this.baseUrl}shipment/create`;
86
- // return await this.httpRequest.post(url, object);
87
- // }
88
-
89
- // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
90
- // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
91
- // return await this.httpRequest.get(url);
92
- // }
93
-
94
- // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
95
- // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
96
- // return await this.httpRequest.put(url, object);
97
- // }
98
-
99
-
100
-
101
-
102
- }
1
+ import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+ import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
5
+
6
+
7
+ @injectable()
8
+ export default class PomeloApi implements ISTPAccountApi {
9
+
10
+
11
+ private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
12
+
13
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
14
+ }
15
+
16
+ //ACCOUNT
17
+ // //USER
18
+ async createAccount(request: CreateBankAccountRequest): Promise<any> {
19
+ const url: string = `${this.baseUrl}account/create`;
20
+ return await this.httpRequest.post(url, request);
21
+ }
22
+
23
+
24
+ // //USER
25
+ // async createUser(request: CreateBankAccountUserRequest): Promise<any> {
26
+ // const url: string = `${this.baseUrl}users/create`;
27
+ // return await this.httpRequest.post(url, request);
28
+ // }
29
+
30
+ // public async getUserById(externalUserId: string): Promise<any> {
31
+ // const url: string = `${this.baseUrl}users/${externalUserId}`;
32
+ // return await this.httpRequest.get(url);
33
+ // }
34
+
35
+ // public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
36
+ // const url: string = `${this.baseUrl}/users/${object.id}`;
37
+ // return await this.httpRequest.put(url, object);
38
+ // }
39
+
40
+ // //Card
41
+ // public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
42
+ // const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
43
+ // return await this.httpRequest.get(url);
44
+ // }
45
+
46
+ // public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
47
+ // const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
48
+ // return await this.httpRequest.get(url);
49
+ // }
50
+
51
+ // public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
52
+ // const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
53
+ // return await this.httpRequest.get(url);
54
+ // }
55
+
56
+ // public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
57
+ // const url: string = `${this.baseUrl}cards/create`;
58
+ // return await this.httpRequest.post(url, object);
59
+ // }
60
+
61
+ // public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
62
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
63
+ // return await this.httpRequest.put(url, object);
64
+ // }
65
+
66
+ // public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
67
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
68
+ // return await this.httpRequest.put(url, object);
69
+ // }
70
+
71
+ // public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
72
+ // const url: string = `${this.baseUrl}cards/activate`;
73
+ // return await this.httpRequest.post(url, object);
74
+ // }
75
+
76
+ // public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
77
+ // const url: string = `${this.baseUrl}cards/${object.cardId}/`;
78
+ // return await this.httpRequest.put(url, object);
79
+ // }
80
+
81
+
82
+ // //Shipping
83
+
84
+ // public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
85
+ // const url: string = `${this.baseUrl}shipment/create`;
86
+ // return await this.httpRequest.post(url, object);
87
+ // }
88
+
89
+ // public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
90
+ // const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
91
+ // return await this.httpRequest.get(url);
92
+ // }
93
+
94
+ // public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
95
+ // const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
96
+ // return await this.httpRequest.put(url, object);
97
+ // }
98
+
99
+
100
+
101
+
102
+ }
@@ -1,7 +1,7 @@
1
- import {CreateBankAccountRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserRequest, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
2
-
3
- export interface ISTPAccountApi {
4
- // updateUser(object: UpdateBankAccountUserRequest): Promise<any>
5
- // getUserById(externalUserId: string): Promise<any>
6
- createAccount(request: CreateBankAccountRequest): Promise<any>;
1
+ import {CreateBankAccountRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserRequest, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
2
+
3
+ export interface ISTPAccountApi {
4
+ // updateUser(object: UpdateBankAccountUserRequest): Promise<any>
5
+ // getUserById(externalUserId: string): Promise<any>
6
+ createAccount(request: CreateBankAccountRequest): Promise<any>;
7
7
  }
@@ -1,2 +1,2 @@
1
- export * from './api/STPAccountApi';
1
+ export * from './api/STPAccountApi';
2
2
  export * from './api/interfaces/ISTPAccountApi';