@fiado/api-invoker 3.3.5 → 3.4.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.
@@ -0,0 +1,9 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { ReportarCuentaRequest, ReportarCuentaResponse } from "@fiado/type-kit/bin/circuloCredito";
3
+ import { ICirculoCreditoApi } from "./interfaces/ICirculoCreditoApi";
4
+ export declare class CirculoCreditoApi implements ICirculoCreditoApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ reportarCuenta(request: ReportarCuentaRequest): Promise<ReportarCuentaResponse>;
9
+ }
@@ -0,0 +1,32 @@
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.CirculoCreditoApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let CirculoCreditoApi = class CirculoCreditoApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ this.baseUrl = process.env.CIRCULO_CREDITO_CONNECTOR_URL || "";
21
+ }
22
+ async reportarCuenta(request) {
23
+ const url = `${this.baseUrl}/private/reportar/cuenta`;
24
+ return await this.httpRequest.post(url, request);
25
+ }
26
+ };
27
+ exports.CirculoCreditoApi = CirculoCreditoApi;
28
+ exports.CirculoCreditoApi = CirculoCreditoApi = __decorate([
29
+ (0, inversify_1.injectable)(),
30
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
31
+ __metadata("design:paramtypes", [Object])
32
+ ], CirculoCreditoApi);
@@ -0,0 +1,4 @@
1
+ import { ReportarCuentaRequest, ReportarCuentaResponse } from "@fiado/type-kit/bin/circuloCredito";
2
+ export interface ICirculoCreditoApi {
3
+ reportarCuenta(request: ReportarCuentaRequest): Promise<ReportarCuentaResponse>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/CirculoCreditoApi';
2
+ export * from './api/interfaces/ICirculoCreditoApi';
@@ -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("./api/CirculoCreditoApi"), exports);
18
+ __exportStar(require("./api/interfaces/ICirculoCreditoApi"), exports);
@@ -0,0 +1,46 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -75,6 +75,7 @@ const STPBusinessApi_1 = __importDefault(require("./stp-business/api/STPBusiness
75
75
  const MulticommServicePaymentApi_1 = __importDefault(require("./multicommServicePayment/api/MulticommServicePaymentApi"));
76
76
  const ProductPaymentApi_1 = __importDefault(require("./product-payment/api/ProductPaymentApi"));
77
77
  const commission_business_1 = require("./commission-business");
78
+ const circuloCredito_1 = require("./circuloCredito");
78
79
  // Credit module - API clients
79
80
  const credit_engine_1 = require("./credit-engine");
80
81
  const credit_payment_1 = require("./credit-payment");
@@ -169,6 +170,7 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
169
170
  bind("ISTPBusinessApi").to(STPBusinessApi_1.default);
170
171
  bind("IProductPaymentApi").to(ProductPaymentApi_1.default);
171
172
  bind("ICommissionBusinessApi").to(commission_business_1.CommissionBusinessApi);
173
+ bind("ICirculoCreditoApi").to(circuloCredito_1.CirculoCreditoApi);
172
174
  // Credit module - API clients
173
175
  bind("ICreditEngineApi").to(credit_engine_1.CreditEngineApi);
174
176
  bind("ICreditPaymentApi").to(credit_payment_1.CreditPaymentApi);
File without changes
File without changes
package/bin/index.d.ts CHANGED
@@ -36,6 +36,7 @@ export * from "./disputes";
36
36
  export * from "./directories";
37
37
  export * from "./cognitoConnector";
38
38
  export * from "./centralPayments";
39
+ export * from "./circuloCredito";
39
40
  export * from "./zendesk";
40
41
  export * from "./blacklist";
41
42
  export * from "./legalDocument";
package/bin/index.js CHANGED
@@ -52,6 +52,7 @@ __exportStar(require("./disputes"), exports);
52
52
  __exportStar(require("./directories"), exports);
53
53
  __exportStar(require("./cognitoConnector"), exports);
54
54
  __exportStar(require("./centralPayments"), exports);
55
+ __exportStar(require("./circuloCredito"), exports);
55
56
  __exportStar(require("./zendesk"), exports);
56
57
  __exportStar(require("./blacklist"), exports);
57
58
  __exportStar(require("./legalDocument"), exports);
@@ -0,0 +1,3 @@
1
+ export interface IReportProcessorBusiness {
2
+ processReports(key: string): Promise<void>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.3.5",
3
+ "version": "3.4.0",
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",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.50",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.6.2",
19
+ "@fiado/type-kit": "^3.7.0",
20
20
  "dotenv": "^16.4.7",
21
21
  "i": "^0.3.7",
22
22
  "inversify": "^6.2.2",
@@ -0,0 +1,18 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { ReportarCuentaRequest, ReportarCuentaResponse } from "@fiado/type-kit/bin/circuloCredito";
4
+ import { ICirculoCreditoApi } from "./interfaces/ICirculoCreditoApi";
5
+
6
+ @injectable()
7
+ export class CirculoCreditoApi implements ICirculoCreditoApi {
8
+ private readonly baseUrl = process.env.CIRCULO_CREDITO_CONNECTOR_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
11
+
12
+ async reportarCuenta(
13
+ request: ReportarCuentaRequest,
14
+ ): Promise<ReportarCuentaResponse> {
15
+ const url = `${this.baseUrl}/private/reportar/cuenta`;
16
+ return await this.httpRequest.post(url, request);
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ import { ReportarCuentaRequest, ReportarCuentaResponse } from "@fiado/type-kit/bin/circuloCredito";
2
+
3
+ export interface ICirculoCreditoApi {
4
+ reportarCuenta(
5
+ request: ReportarCuentaRequest,
6
+ ): Promise<ReportarCuentaResponse>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/CirculoCreditoApi';
2
+ export * from './api/interfaces/ICirculoCreditoApi';
@@ -101,6 +101,7 @@ import MulticommServicePaymentApi from "./multicommServicePayment/api/MulticommS
101
101
  import { IProductPaymentApi } from "./product-payment";
102
102
  import ProductPaymentApi from "./product-payment/api/ProductPaymentApi";
103
103
  import { CommissionBusinessApi, ICommissionBusinessApi } from "./commission-business";
104
+ import { CirculoCreditoApi, ICirculoCreditoApi } from "./circuloCredito";
104
105
  // Credit module - API clients
105
106
  import { CreditEngineApi, ICreditEngineApi } from "./credit-engine";
106
107
  import { CreditPaymentApi, ICreditPaymentApi } from "./credit-payment";
@@ -216,6 +217,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
216
217
  bind<ISTPBusinessApi>("ISTPBusinessApi").to(STPBusinessApi);
217
218
  bind<IProductPaymentApi>("IProductPaymentApi").to(ProductPaymentApi);
218
219
  bind<ICommissionBusinessApi>("ICommissionBusinessApi").to(CommissionBusinessApi);
220
+ bind<ICirculoCreditoApi>("ICirculoCreditoApi").to(CirculoCreditoApi);
219
221
 
220
222
  // Credit module - API clients
221
223
  bind<ICreditEngineApi>("ICreditEngineApi").to(CreditEngineApi);
package/src/index.ts CHANGED
@@ -36,6 +36,7 @@ export * from "./disputes";
36
36
  export * from "./directories";
37
37
  export * from "./cognitoConnector";
38
38
  export * from "./centralPayments";
39
+ export * from "./circuloCredito";
39
40
  export * from "./zendesk";
40
41
  export * from "./blacklist";
41
42
  export * from "./legalDocument";