@fiado/api-invoker 1.2.41 → 1.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +39 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +134 -0
- package/bin/centralPayments/index.d.ts +2 -0
- package/bin/centralPayments/index.js +18 -0
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +32 -0
- package/bin/container.config.js +6 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/utils/InvokerUtils.d.ts +4 -0
- package/bin/utils/InvokerUtils.js +34 -0
- package/package.json +8 -8
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +173 -0
- package/src/centralPayments/index.ts +2 -0
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +81 -0
- package/src/container.config.ts +22 -12
- package/src/index.ts +1 -0
- package/src/utils/InvokerUtils.ts +19 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- /package/bin/{cognitoConnector/interfaces/ICognitoConnectorApiV2.js → centralPayments/interfaces/ICentralPaymentsConnectorApi.js} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ICentralPaymentsConnectorApi } from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
4
|
+
import { CentralPaymentsDocumentUploadRequest, HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
|
|
5
|
+
import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
|
|
6
|
+
import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
|
|
7
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
8
|
+
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
9
|
+
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
10
|
+
export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
11
|
+
private readonly httpRequest;
|
|
12
|
+
private readonly _invokerUtils;
|
|
13
|
+
private readonly baseUrl;
|
|
14
|
+
constructor(httpRequest: IHttpRequest, _invokerUtils: InvokerUtils);
|
|
15
|
+
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
16
|
+
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
17
|
+
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
18
|
+
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
19
|
+
deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>>;
|
|
20
|
+
getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>>;
|
|
21
|
+
submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
22
|
+
uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>>;
|
|
23
|
+
setCardPin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
24
|
+
getCardInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
25
|
+
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
26
|
+
activateCard(externalCardId: string, request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
27
|
+
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
28
|
+
updateCardStatus(externalCardId: string, status: Status): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
29
|
+
updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
30
|
+
orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
31
|
+
getCardsByExternalUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
32
|
+
generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
33
|
+
getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
34
|
+
deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
35
|
+
getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>>;
|
|
36
|
+
getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
|
|
37
|
+
getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
|
|
38
|
+
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CentralPaymentsConnectorApi = void 0;
|
|
16
|
+
const inversify_1 = require("inversify");
|
|
17
|
+
const InvokerUtils_1 = require("../utils/InvokerUtils");
|
|
18
|
+
let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
|
|
19
|
+
constructor(httpRequest, _invokerUtils) {
|
|
20
|
+
this.httpRequest = httpRequest;
|
|
21
|
+
this._invokerUtils = _invokerUtils;
|
|
22
|
+
this.baseUrl = process.env.CENTRAL_PAYMENTS_LAMBDA_URL || "";
|
|
23
|
+
}
|
|
24
|
+
/* HEALTHCHECK */
|
|
25
|
+
async healthcheck() {
|
|
26
|
+
const url = `${this.baseUrl}/healthcheck`;
|
|
27
|
+
return await this.httpRequest.get(url);
|
|
28
|
+
}
|
|
29
|
+
/* CARDHOLDERS */
|
|
30
|
+
async createCardholder(request) {
|
|
31
|
+
const url = `${this.baseUrl}/cardholders`;
|
|
32
|
+
return await this.httpRequest.post(url, request);
|
|
33
|
+
}
|
|
34
|
+
async getCardholder(externalUserId) {
|
|
35
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
38
|
+
async updateCardholder(externalUserId, request) {
|
|
39
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
40
|
+
return await this.httpRequest.put(url, request);
|
|
41
|
+
}
|
|
42
|
+
async deleteCardholder(externalUserId) {
|
|
43
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
44
|
+
return await this.httpRequest.delete(url);
|
|
45
|
+
}
|
|
46
|
+
/* KYC DOCUMENTS */
|
|
47
|
+
async getOOWQuestions(externalUserId) {
|
|
48
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
49
|
+
return await this.httpRequest.get(url);
|
|
50
|
+
}
|
|
51
|
+
async submitOOWQuestionAnswers(externalUserId, request) {
|
|
52
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
53
|
+
return await this.httpRequest.post(url, request);
|
|
54
|
+
}
|
|
55
|
+
async uploadDocuments(externalUserId, request) {
|
|
56
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/documents/upload`;
|
|
57
|
+
return await this.httpRequest.post(url, request);
|
|
58
|
+
}
|
|
59
|
+
/* CARDS */
|
|
60
|
+
async setCardPin(request) {
|
|
61
|
+
const url = `${this.baseUrl}/cards/pin/change`;
|
|
62
|
+
return await this.httpRequest.post(url, request);
|
|
63
|
+
}
|
|
64
|
+
async getCardInformation(externalCardId) {
|
|
65
|
+
const url = `${this.baseUrl}/cards/${externalCardId}`;
|
|
66
|
+
return await this.httpRequest.get(url);
|
|
67
|
+
}
|
|
68
|
+
async getCardSensitiveInformation(externalCardId) {
|
|
69
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
70
|
+
return await this.httpRequest.get(url);
|
|
71
|
+
}
|
|
72
|
+
async activateCard(externalCardId, request) {
|
|
73
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/activate`;
|
|
74
|
+
return await this.httpRequest.post(url, request);
|
|
75
|
+
}
|
|
76
|
+
async getCardBalance(externalCardId) {
|
|
77
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/balance`;
|
|
78
|
+
return await this.httpRequest.get(url);
|
|
79
|
+
}
|
|
80
|
+
async updateCardStatus(externalCardId, status) {
|
|
81
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/status/${status}`;
|
|
82
|
+
return await this.httpRequest.put(url);
|
|
83
|
+
}
|
|
84
|
+
async updateCardProgram(externalCardId, programId) {
|
|
85
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/programs/${programId}`;
|
|
86
|
+
return await this.httpRequest.put(url);
|
|
87
|
+
}
|
|
88
|
+
async orderPhysicalCard(externalUserId) {
|
|
89
|
+
const url = `${this.baseUrl}/cards/physical/order/${externalUserId}`;
|
|
90
|
+
return await this.httpRequest.put(url);
|
|
91
|
+
}
|
|
92
|
+
async getCardsByExternalUserId(externalUserId) {
|
|
93
|
+
const url = `${this.baseUrl}/cards/cardholders/${externalUserId}`;
|
|
94
|
+
return await this.httpRequest.get(url);
|
|
95
|
+
}
|
|
96
|
+
async generateCardsInBatch(request) {
|
|
97
|
+
const url = `${this.baseUrl}/cards/batch`;
|
|
98
|
+
return await this.httpRequest.post(url, request);
|
|
99
|
+
}
|
|
100
|
+
async getCardBatch(batchId) {
|
|
101
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
102
|
+
return await this.httpRequest.get(url);
|
|
103
|
+
}
|
|
104
|
+
async deleteCardBatch(batchId) {
|
|
105
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
106
|
+
return await this.httpRequest.delete(url);
|
|
107
|
+
}
|
|
108
|
+
/* STATEMENTS */
|
|
109
|
+
async getStatementsList(externalCardId) {
|
|
110
|
+
const url = `${this.baseUrl}/statements/cards/${externalCardId}`;
|
|
111
|
+
return await this.httpRequest.get(url);
|
|
112
|
+
}
|
|
113
|
+
async getStatementDocument(statementId) {
|
|
114
|
+
const url = `${this.baseUrl}/statements/document-url/${statementId}`;
|
|
115
|
+
return await this.httpRequest.get(url);
|
|
116
|
+
}
|
|
117
|
+
/* TRANSACTIONS */
|
|
118
|
+
async getTransactionHistory(externalCardId, params) {
|
|
119
|
+
const queryParams = this._invokerUtils.toQueryStringParameters(params);
|
|
120
|
+
const url = `${this.baseUrl}/transactions/history/${externalCardId}?${queryParams}`;
|
|
121
|
+
return await this.httpRequest.get(url);
|
|
122
|
+
}
|
|
123
|
+
async getTransactionDetails(externalTransactionId) {
|
|
124
|
+
const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
|
|
125
|
+
return await this.httpRequest.get(url);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
exports.CentralPaymentsConnectorApi = CentralPaymentsConnectorApi;
|
|
129
|
+
exports.CentralPaymentsConnectorApi = CentralPaymentsConnectorApi = __decorate([
|
|
130
|
+
(0, inversify_1.injectable)(),
|
|
131
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
132
|
+
__param(1, (0, inversify_1.inject)("InvokerUtils")),
|
|
133
|
+
__metadata("design:paramtypes", [Object, InvokerUtils_1.InvokerUtils])
|
|
134
|
+
], CentralPaymentsConnectorApi);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./interfaces/ICentralPaymentsConnectorApi"), exports);
|
|
18
|
+
__exportStar(require("./CentralPaymentsConnectorApi"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { CentralPaymentsDocumentUploadRequest, HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
|
|
3
|
+
import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
|
|
4
|
+
import { Status } from "@fiado/type-kit/bin/directory/enums/Status";
|
|
5
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
6
|
+
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
7
|
+
export interface ICentralPaymentsConnectorApi {
|
|
8
|
+
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
9
|
+
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
10
|
+
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
11
|
+
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
12
|
+
deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>>;
|
|
13
|
+
getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>>;
|
|
14
|
+
submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
15
|
+
uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>>;
|
|
16
|
+
setCardPin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
17
|
+
getCardInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
18
|
+
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
19
|
+
activateCard(externalCardId: string, request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
20
|
+
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
21
|
+
updateCardStatus(externalCardId: string, status: Status): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
22
|
+
updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
23
|
+
orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
24
|
+
getCardsByExternalUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
25
|
+
generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
26
|
+
getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
27
|
+
deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
28
|
+
getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>>;
|
|
29
|
+
getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
|
|
30
|
+
getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
|
|
31
|
+
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
32
|
+
}
|
package/bin/container.config.js
CHANGED
|
@@ -50,7 +50,12 @@ const blacklist_1 = require("./blacklist");
|
|
|
50
50
|
const device_1 = require("./device");
|
|
51
51
|
const observations_1 = require("./observations");
|
|
52
52
|
const CognitoConnectorV2_1 = __importDefault(require("./cognitoConnector/CognitoConnectorV2"));
|
|
53
|
+
const centralPayments_1 = require("./centralPayments");
|
|
54
|
+
const InvokerUtils_1 = require("./utils/InvokerUtils");
|
|
53
55
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
56
|
+
// UTILS bindings
|
|
57
|
+
bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
|
|
58
|
+
// API invoker bindings
|
|
54
59
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
55
60
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
56
61
|
bind("IAddressApi").to(address_1.AddressApi);
|
|
@@ -96,4 +101,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
96
101
|
bind("IBlackListApi").to(blacklist_1.BlackListApi);
|
|
97
102
|
bind("IDeviceApi").to(device_1.DeviceApi);
|
|
98
103
|
bind("IObservationsApi").to(observations_1.ObservationsApi);
|
|
104
|
+
bind("ICentralPaymentsConnectorApi").to(centralPayments_1.CentralPaymentsConnectorApi);
|
|
99
105
|
});
|
package/bin/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./pomeloProcessor";
|
|
|
33
33
|
export * from "./disputes";
|
|
34
34
|
export * from "./directories";
|
|
35
35
|
export * from "./cognitoConnector";
|
|
36
|
+
export * from "./centralPayments";
|
|
36
37
|
export * from "./zendesk";
|
|
37
38
|
export * from "./blacklist";
|
|
38
39
|
export * from "./legalDocument";
|
package/bin/index.js
CHANGED
|
@@ -49,6 +49,7 @@ __exportStar(require("./pomeloProcessor"), exports);
|
|
|
49
49
|
__exportStar(require("./disputes"), exports);
|
|
50
50
|
__exportStar(require("./directories"), exports);
|
|
51
51
|
__exportStar(require("./cognitoConnector"), exports);
|
|
52
|
+
__exportStar(require("./centralPayments"), exports);
|
|
52
53
|
__exportStar(require("./zendesk"), exports);
|
|
53
54
|
__exportStar(require("./blacklist"), exports);
|
|
54
55
|
__exportStar(require("./legalDocument"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InvokerUtils = void 0;
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
let InvokerUtils = class InvokerUtils {
|
|
15
|
+
constructor() {
|
|
16
|
+
}
|
|
17
|
+
toQueryStringParameters(object) {
|
|
18
|
+
const records = Object.entries(object).reduce((acc, [key, value]) => {
|
|
19
|
+
if (Array.isArray(value)) {
|
|
20
|
+
acc[key] = value.join(','); // Convierte arrays a una cadena separada por comas
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
acc[key] = String(value); // Convierte todos los demás valores a string
|
|
24
|
+
}
|
|
25
|
+
return acc;
|
|
26
|
+
}, {});
|
|
27
|
+
return new URLSearchParams(records).toString();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.InvokerUtils = InvokerUtils;
|
|
31
|
+
exports.InvokerUtils = InvokerUtils = __decorate([
|
|
32
|
+
(0, inversify_1.injectable)(),
|
|
33
|
+
__metadata("design:paramtypes", [])
|
|
34
|
+
], InvokerUtils);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.43",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"author": "Fiado Inc",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@aws-sdk/client-sqs": "^3.
|
|
15
|
+
"@aws-sdk/client-sqs": "^3.572.0",
|
|
16
16
|
"@fiado/gateway-adapter": "^1.1.40",
|
|
17
|
-
"@fiado/http-client": "^1.0.
|
|
17
|
+
"@fiado/http-client": "^1.0.2",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^1.6
|
|
20
|
-
"dotenv": "^16.4.
|
|
21
|
-
"inversify": "^6.
|
|
22
|
-
"reflect-metadata": "^0.2.
|
|
23
|
-
"typescript": "^5.
|
|
19
|
+
"@fiado/type-kit": "^1.8.6",
|
|
20
|
+
"dotenv": "^16.4.5",
|
|
21
|
+
"inversify": "^6.0.2",
|
|
22
|
+
"reflect-metadata": "^0.2.1",
|
|
23
|
+
"typescript": "^5.4.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^20.12.7"
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {ICentralPaymentsConnectorApi} from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {
|
|
5
|
+
CreateBankAccountUserRequest,
|
|
6
|
+
CreateBankAccountUserResponse,
|
|
7
|
+
GetBankAccountUserResponse,
|
|
8
|
+
UpdateBankAccountUserRequest
|
|
9
|
+
} from "@fiado/type-kit/bin/account";
|
|
10
|
+
import {
|
|
11
|
+
CentralPaymentsDocumentUploadRequest,
|
|
12
|
+
HealthcheckResponse,
|
|
13
|
+
OOWQuestionsResponse,
|
|
14
|
+
SubmitOOWQuestionAnswersRequest
|
|
15
|
+
} from "@fiado/type-kit/bin/centralPayments";
|
|
16
|
+
import {
|
|
17
|
+
ActivateBankAccountCardRequest,
|
|
18
|
+
ActivateBankAccountCardResponse,
|
|
19
|
+
CardBatchRequest,
|
|
20
|
+
CardBatchResponse,
|
|
21
|
+
CardStatementListResponse,
|
|
22
|
+
GetBankAccountCardBalanceResponse,
|
|
23
|
+
GetBankAccountCardResponse,
|
|
24
|
+
StatementDocumentResponse,
|
|
25
|
+
UpdateBankAccountCardRequest,
|
|
26
|
+
UpdateBankAccountCardResponse
|
|
27
|
+
} from "@fiado/type-kit/bin/card";
|
|
28
|
+
import {Status} from "@fiado/type-kit/bin/directory/enums/Status";
|
|
29
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
30
|
+
import {
|
|
31
|
+
CentralPaymentsQueryParams,
|
|
32
|
+
CentralPaymentsTransactionItem,
|
|
33
|
+
TransactionListResponse
|
|
34
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
35
|
+
import {InvokerUtils} from "../utils/InvokerUtils";
|
|
36
|
+
|
|
37
|
+
@injectable()
|
|
38
|
+
export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
39
|
+
private readonly baseUrl = process.env.CENTRAL_PAYMENTS_LAMBDA_URL || "";
|
|
40
|
+
|
|
41
|
+
constructor(
|
|
42
|
+
@inject("IHttpRequest") private readonly httpRequest: IHttpRequest,
|
|
43
|
+
@inject("InvokerUtils") private readonly _invokerUtils: InvokerUtils,
|
|
44
|
+
) {
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* HEALTHCHECK */
|
|
48
|
+
async healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>> {
|
|
49
|
+
const url = `${this.baseUrl}/healthcheck`;
|
|
50
|
+
return await this.httpRequest.get(url);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* CARDHOLDERS */
|
|
54
|
+
async createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
55
|
+
const url = `${this.baseUrl}/cardholders`;
|
|
56
|
+
return await this.httpRequest.post(url, request);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
60
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
61
|
+
return await this.httpRequest.get(url);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
65
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
66
|
+
return await this.httpRequest.put(url, request);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>> {
|
|
70
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}`;
|
|
71
|
+
return await this.httpRequest.delete(url);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* KYC DOCUMENTS */
|
|
75
|
+
async getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>> {
|
|
76
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
77
|
+
return await this.httpRequest.get(url);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>> {
|
|
81
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/oow/questions`;
|
|
82
|
+
return await this.httpRequest.post(url, request);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>> {
|
|
86
|
+
const url = `${this.baseUrl}/kyc/${externalUserId}/documents/upload`;
|
|
87
|
+
return await this.httpRequest.post(url, request);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* CARDS */
|
|
91
|
+
async setCardPin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>> {
|
|
92
|
+
const url = `${this.baseUrl}/cards/pin/change`;
|
|
93
|
+
return await this.httpRequest.post(url, request);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async getCardInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
97
|
+
const url = `${this.baseUrl}/cards/${externalCardId}`;
|
|
98
|
+
return await this.httpRequest.get(url);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
102
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/sensitive`;
|
|
103
|
+
return await this.httpRequest.get(url);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async activateCard(externalCardId: string, request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>> {
|
|
107
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/activate`;
|
|
108
|
+
return await this.httpRequest.post(url, request);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>> {
|
|
112
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/balance`;
|
|
113
|
+
return await this.httpRequest.get(url);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async updateCardStatus(externalCardId: string, status: Status): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
117
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/status/${status}`;
|
|
118
|
+
return await this.httpRequest.put(url);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
122
|
+
const url = `${this.baseUrl}/cards/${externalCardId}/programs/${programId}`;
|
|
123
|
+
return await this.httpRequest.put(url);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
127
|
+
const url = `${this.baseUrl}/cards/physical/order/${externalUserId}`;
|
|
128
|
+
return await this.httpRequest.put(url);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async getCardsByExternalUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>> {
|
|
132
|
+
const url = `${this.baseUrl}/cards/cardholders/${externalUserId}`;
|
|
133
|
+
return await this.httpRequest.get(url);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
137
|
+
const url = `${this.baseUrl}/cards/batch`;
|
|
138
|
+
return await this.httpRequest.post(url, request);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
142
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
143
|
+
return await this.httpRequest.get(url);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>> {
|
|
147
|
+
const url = `${this.baseUrl}/cards/batch/${batchId}`;
|
|
148
|
+
return await this.httpRequest.delete(url);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* STATEMENTS */
|
|
152
|
+
async getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>> {
|
|
153
|
+
const url = `${this.baseUrl}/statements/cards/${externalCardId}`;
|
|
154
|
+
return await this.httpRequest.get(url);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>> {
|
|
158
|
+
const url = `${this.baseUrl}/statements/document-url/${statementId}`;
|
|
159
|
+
return await this.httpRequest.get(url);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* TRANSACTIONS */
|
|
163
|
+
async getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>> {
|
|
164
|
+
const queryParams: string = this._invokerUtils.toQueryStringParameters(params);
|
|
165
|
+
const url = `${this.baseUrl}/transactions/history/${externalCardId}?${queryParams}`;
|
|
166
|
+
return await this.httpRequest.get(url);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>> {
|
|
170
|
+
const url = `${this.baseUrl}/transactions/${externalTransactionId}`;
|
|
171
|
+
return await this.httpRequest.get(url);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateBankAccountUserRequest,
|
|
3
|
+
CreateBankAccountUserResponse,
|
|
4
|
+
GetBankAccountUserResponse,
|
|
5
|
+
UpdateBankAccountUserRequest
|
|
6
|
+
} from "@fiado/type-kit/bin/account";
|
|
7
|
+
import {
|
|
8
|
+
CentralPaymentsDocumentUploadRequest,
|
|
9
|
+
HealthcheckResponse,
|
|
10
|
+
OOWQuestionsResponse,
|
|
11
|
+
SubmitOOWQuestionAnswersRequest
|
|
12
|
+
} from "@fiado/type-kit/bin/centralPayments";
|
|
13
|
+
import {
|
|
14
|
+
ActivateBankAccountCardRequest,
|
|
15
|
+
ActivateBankAccountCardResponse,
|
|
16
|
+
CardBatchRequest,
|
|
17
|
+
CardBatchResponse,
|
|
18
|
+
CardStatementListResponse,
|
|
19
|
+
GetBankAccountCardBalanceResponse,
|
|
20
|
+
GetBankAccountCardResponse,
|
|
21
|
+
StatementDocumentResponse,
|
|
22
|
+
UpdateBankAccountCardRequest,
|
|
23
|
+
UpdateBankAccountCardResponse
|
|
24
|
+
} from "@fiado/type-kit/bin/card";
|
|
25
|
+
import {Status} from "@fiado/type-kit/bin/directory/enums/Status";
|
|
26
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
27
|
+
import {
|
|
28
|
+
CentralPaymentsQueryParams,
|
|
29
|
+
CentralPaymentsTransactionItem,
|
|
30
|
+
TransactionListResponse
|
|
31
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
32
|
+
|
|
33
|
+
export interface ICentralPaymentsConnectorApi {
|
|
34
|
+
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
35
|
+
|
|
36
|
+
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
37
|
+
|
|
38
|
+
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
39
|
+
|
|
40
|
+
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
41
|
+
|
|
42
|
+
deleteCardholder(externalUserId: string): Promise<FiadoApiResponse<null>>;
|
|
43
|
+
|
|
44
|
+
getOOWQuestions(externalUserId: string): Promise<FiadoApiResponse<OOWQuestionsResponse[]>>;
|
|
45
|
+
|
|
46
|
+
submitOOWQuestionAnswers(externalUserId: string, request: SubmitOOWQuestionAnswersRequest[]): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
47
|
+
|
|
48
|
+
uploadDocuments(externalUserId: string, request: CentralPaymentsDocumentUploadRequest): Promise<FiadoApiResponse<null>>;
|
|
49
|
+
|
|
50
|
+
setCardPin(request: UpdateBankAccountCardRequest): Promise<FiadoApiResponse<UpdateBankAccountCardResponse>>;
|
|
51
|
+
|
|
52
|
+
getCardInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
53
|
+
|
|
54
|
+
getCardSensitiveInformation(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
55
|
+
|
|
56
|
+
activateCard(externalCardId: string, request: ActivateBankAccountCardRequest): Promise<FiadoApiResponse<ActivateBankAccountCardResponse>>;
|
|
57
|
+
|
|
58
|
+
getCardBalance(externalCardId: string): Promise<FiadoApiResponse<GetBankAccountCardBalanceResponse>>;
|
|
59
|
+
|
|
60
|
+
updateCardStatus(externalCardId: string, status: Status): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
61
|
+
|
|
62
|
+
updateCardProgram(externalCardId: string, programId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
63
|
+
|
|
64
|
+
orderPhysicalCard(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
65
|
+
|
|
66
|
+
getCardsByExternalUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountCardResponse>>;
|
|
67
|
+
|
|
68
|
+
generateCardsInBatch(request: CardBatchRequest): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
69
|
+
|
|
70
|
+
getCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
71
|
+
|
|
72
|
+
deleteCardBatch(batchId: string): Promise<FiadoApiResponse<CardBatchResponse>>;
|
|
73
|
+
|
|
74
|
+
getStatementsList(externalCardId: string): Promise<FiadoApiResponse<CardStatementListResponse[]>>;
|
|
75
|
+
|
|
76
|
+
getStatementDocument(statementId: string): Promise<FiadoApiResponse<StatementDocumentResponse>>;
|
|
77
|
+
|
|
78
|
+
getTransactionHistory(externalCardId: string, params: CentralPaymentsQueryParams): Promise<FiadoApiResponse<TransactionListResponse<CentralPaymentsTransactionItem>>>;
|
|
79
|
+
|
|
80
|
+
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
81
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -44,25 +44,36 @@ import TransactionProcessorApi from "./transactionProcessor/api/TransactionProce
|
|
|
44
44
|
import {ITransactionProcessorApi} from "./transactionProcessor";
|
|
45
45
|
import ActivityPublisher from "./activity-business/queue/ActivityPublisher";
|
|
46
46
|
import RiskProfileApi from "./riskProfile/api/RiskProfileApi";
|
|
47
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
IRiskProfileApi,
|
|
49
|
+
ITransactionAlarmPublisher,
|
|
50
|
+
ITransactionAlertApi,
|
|
51
|
+
TransactionAlarmPublisher
|
|
52
|
+
} from "./riskProfile";
|
|
48
53
|
import {ContactInformationApi, IContactInformationApi} from "./contactInformation";
|
|
49
54
|
import {FiadoMessagesApi, IFiadoMessagesApi} from "./fiadoMessages";
|
|
50
55
|
import CnbvApi from "./cnbv-business/CnbvApi";
|
|
51
|
-
import {
|
|
56
|
+
import {ICnbvApi} from "./cnbv-business";
|
|
52
57
|
import TransactionApi from "./transaction/api/TransactionApi";
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
58
|
+
import {IPomeloProcessorApi, PomeloProcessorApi} from "./pomeloProcessor";
|
|
59
|
+
import {DisputesApi, IDisputesApi} from "./disputes";
|
|
55
60
|
import TransactionAlertApi from "./riskProfile/api/TransactionAlertApi";
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
61
|
+
import {DirectoriesApi, IDirectoriesApi} from "./directories";
|
|
62
|
+
import {ICognitoConnectorApi, ICognitoV2Api} from "./cognitoConnector";
|
|
58
63
|
import CognitoConnectorApi from "./cognitoConnector/CognitoConnectorApi";
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
64
|
+
import {IZendeskApi, ZendeskApi} from "./zendesk";
|
|
65
|
+
import {BlackListApi, IBlackListApi} from "./blacklist";
|
|
66
|
+
import {DeviceApi, IDeviceApi} from "./device";
|
|
67
|
+
import {IObservationsApi, ObservationsApi} from "./observations";
|
|
63
68
|
import CognitoApi from "./cognitoConnector/CognitoConnectorV2";
|
|
69
|
+
import {CentralPaymentsConnectorApi, ICentralPaymentsConnectorApi} from "./centralPayments";
|
|
70
|
+
import {InvokerUtils} from "./utils/InvokerUtils";
|
|
64
71
|
|
|
65
72
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
73
|
+
// UTILS bindings
|
|
74
|
+
bind<InvokerUtils>("InvokerUtils").to(InvokerUtils);
|
|
75
|
+
|
|
76
|
+
// API invoker bindings
|
|
66
77
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
67
78
|
bind<IIdentityApi>("IIdentityApi").to(IdentityApi);
|
|
68
79
|
bind<IAddressApi>("IAddressApi").to(AddressApi);
|
|
@@ -108,6 +119,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
108
119
|
bind<IBlackListApi>("IBlackListApi").to(BlackListApi);
|
|
109
120
|
bind<IDeviceApi>("IDeviceApi").to(DeviceApi);
|
|
110
121
|
bind<IObservationsApi>("IObservationsApi").to(ObservationsApi);
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
bind<ICentralPaymentsConnectorApi>("ICentralPaymentsConnectorApi").to(CentralPaymentsConnectorApi);
|
|
113
123
|
});
|
package/src/index.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./pomeloProcessor";
|
|
|
33
33
|
export * from "./disputes";
|
|
34
34
|
export * from "./directories";
|
|
35
35
|
export * from "./cognitoConnector";
|
|
36
|
+
export * from "./centralPayments";
|
|
36
37
|
export * from "./zendesk";
|
|
37
38
|
export * from "./blacklist";
|
|
38
39
|
export * from "./legalDocument";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {injectable} from "inversify";
|
|
2
|
+
|
|
3
|
+
@injectable()
|
|
4
|
+
export class InvokerUtils {
|
|
5
|
+
constructor() {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
toQueryStringParameters(object: any): string {
|
|
9
|
+
const records: Record<string, string> = Object.entries(object).reduce((acc, [key, value]) => {
|
|
10
|
+
if (Array.isArray(value)) {
|
|
11
|
+
acc[key] = value.join(','); // Convierte arrays a una cadena separada por comas
|
|
12
|
+
} else {
|
|
13
|
+
acc[key] = String(value); // Convierte todos los demás valores a string
|
|
14
|
+
}
|
|
15
|
+
return acc;
|
|
16
|
+
}, {} as Record<string, string>);
|
|
17
|
+
return new URLSearchParams(records).toString();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
|
|
2
|
-
export interface ICognitoApi {
|
|
3
|
-
/**
|
|
4
|
-
* Healthcheck for the cognito-connector
|
|
5
|
-
*/
|
|
6
|
-
healthcheck(): Promise<HealthcheckResponse>;
|
|
7
|
-
/**
|
|
8
|
-
* Create a new user in Cognito
|
|
9
|
-
*/
|
|
10
|
-
signUp(request: SignUpRequest): Promise<SignUpResponse>;
|
|
11
|
-
/**
|
|
12
|
-
* Confirm sign-up for a user in Cognito
|
|
13
|
-
*/
|
|
14
|
-
signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Sign in a user
|
|
17
|
-
*/
|
|
18
|
-
signIn(request: SignInRequest): Promise<SignInResponse>;
|
|
19
|
-
/**
|
|
20
|
-
* Sign out a user
|
|
21
|
-
*/
|
|
22
|
-
signOut(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Change a user's password
|
|
25
|
-
*/
|
|
26
|
-
changePassword(request: ChangePasswordRequest): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieve user details
|
|
29
|
-
*/
|
|
30
|
-
getUser(request: GetUserRequest): Promise<GetUserResponse>;
|
|
31
|
-
/**
|
|
32
|
-
* Refresh a user's tokens
|
|
33
|
-
*/
|
|
34
|
-
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Respond to an auth challenge
|
|
37
|
-
*/
|
|
38
|
-
respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
|
|
39
|
-
/**
|
|
40
|
-
* Reset a user's password
|
|
41
|
-
*/
|
|
42
|
-
resetPassword(request: SetPasswordRequest): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
export interface HealthcheckResponse {
|
|
45
|
-
status: string;
|
|
46
|
-
}
|