@fiado/api-invoker 1.5.19 → 1.5.21
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/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
- package/bin/estafeta/EstafetaApi.d.ts +0 -0
- package/bin/estafeta/EstafetaApi.js +0 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/report-processor-business/api/IReportProcessorBusiness.d.ts +3 -0
- package/bin/report-processor-business/api/IReportProcessorBusiness.js +2 -0
- package/bin/report-processor-business/api/IReportProcessorBusinessApi.d.ts +6 -0
- package/bin/report-processor-business/api/IReportProcessorBusinessApi.js +2 -0
- package/bin/report-processor-business/api/ReportProcessorBusinessApi.d.ts +11 -0
- package/bin/report-processor-business/api/ReportProcessorBusinessApi.js +31 -0
- package/bin/report-processor-business/index.d.ts +2 -0
- package/bin/report-processor-business/index.js +18 -0
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/report-processor-business/api/IReportProcessorBusinessApi.ts +5 -0
- package/src/report-processor-business/api/ReportProcessorBusinessApi.ts +18 -0
- package/src/report-processor-business/index.ts +5 -0
|
@@ -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
|
+
}
|
|
File without changes
|
|
File without changes
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -69,3 +69,4 @@ __exportStar(require("./onboarding-business"), exports);
|
|
|
69
69
|
__exportStar(require("./payroll-business"), exports);
|
|
70
70
|
__exportStar(require("./referral-business"), exports);
|
|
71
71
|
__exportStar(require("./event-history-business"), exports);
|
|
72
|
+
__exportStar(require("./report-processor-business"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IReportProcessorBusinessApi } from "./IReportProcessorBusinessApi";
|
|
3
|
+
export default class ReportProcessorBusinessApi implements IReportProcessorBusinessApi {
|
|
4
|
+
private httpRequest;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
processReports(key: string): Promise<{
|
|
8
|
+
url: string;
|
|
9
|
+
expiresInSeconds: number;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let ReportProcessorBusinessApi = class ReportProcessorBusinessApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.REPORT_PROCESSOR_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async processReports(key) {
|
|
22
|
+
const url = `${this.baseUrl}/report-link?key=${key}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
ReportProcessorBusinessApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], ReportProcessorBusinessApi);
|
|
31
|
+
exports.default = ReportProcessorBusinessApi;
|
|
@@ -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/ReportProcessorBusinessApi"), exports);
|
|
18
|
+
__exportStar(require("./api/IReportProcessorBusinessApi"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.21",
|
|
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",
|
package/src/index.ts
CHANGED
|
@@ -52,4 +52,5 @@ export * from "./onboarding";
|
|
|
52
52
|
export * from "./onboarding-business";
|
|
53
53
|
export * from "./payroll-business";
|
|
54
54
|
export * from "./referral-business";
|
|
55
|
-
export * from "./event-history-business";
|
|
55
|
+
export * from "./event-history-business";
|
|
56
|
+
export * from "./report-processor-business";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IReportProcessorBusinessApi } from "./IReportProcessorBusinessApi";
|
|
4
|
+
|
|
5
|
+
@injectable()
|
|
6
|
+
export default class ReportProcessorBusinessApi implements IReportProcessorBusinessApi {
|
|
7
|
+
|
|
8
|
+
private readonly baseUrl = process.env.REPORT_PROCESSOR_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
async processReports(key: string): Promise<{ url: string, expiresInSeconds: number }> {
|
|
13
|
+
|
|
14
|
+
const url = `${this.baseUrl}/report-link?key=${key}`;
|
|
15
|
+
|
|
16
|
+
return await this.httpRequest.get<{ url: string, expiresInSeconds: number }>(url);
|
|
17
|
+
}
|
|
18
|
+
}
|