@fiado/api-invoker 1.4.1 → 1.4.3
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/CognitoConnectorApi.d.ts +1 -1
- package/bin/cognitoConnector/CognitoConnectorApi.js +2 -2
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApi.d.ts +1 -1
- package/bin/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/onboarding/api/OnboardingApi.d.ts +8 -0
- package/bin/onboarding/api/OnboardingApi.js +31 -0
- package/bin/onboarding/api/interfaces/IOnboardingApi.d.ts +3 -0
- package/bin/onboarding/api/interfaces/IOnboardingApi.js +2 -0
- package/bin/onboarding/index.d.ts +2 -0
- package/bin/onboarding/index.js +18 -0
- package/package.json +1 -1
- package/src/cognitoConnector/CognitoConnectorApi.ts +2 -2
- package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +1 -1
- package/src/container.config.ts +3 -0
- package/src/index.ts +1 -0
- package/src/onboarding/api/OnboardingApi.ts +18 -0
- package/src/onboarding/api/interfaces/IOnboardingApi.ts +3 -0
- package/src/onboarding/index.ts +2 -0
|
@@ -5,7 +5,7 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
|
|
|
5
5
|
private httpRequest;
|
|
6
6
|
private readonly baseUrl;
|
|
7
7
|
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
|
|
8
|
+
deleteCognitoUser(identityId: string): Promise<void>;
|
|
9
9
|
signUp(input: SignUpRequest): Promise<SignUpResponse>;
|
|
10
10
|
signIn(input: SignInRequest): Promise<SignInResponse>;
|
|
11
11
|
getUser(input: GetUserRequest): Promise<GetUserResponse>;
|
|
@@ -18,8 +18,8 @@ let CognitoConnectorApi = class CognitoConnectorApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.INDETITY_SERVER_BASE_URL || "";
|
|
20
20
|
}
|
|
21
|
-
async
|
|
22
|
-
const url = `${this.baseUrl}cognito/deleteUser/${
|
|
21
|
+
async deleteCognitoUser(identityId) {
|
|
22
|
+
const url = `${this.baseUrl}cognito/deleteUser/${identityId}`;
|
|
23
23
|
return await this.httpRequest.delete(url);
|
|
24
24
|
}
|
|
25
25
|
async signUp(input) {
|
|
@@ -9,5 +9,5 @@ export interface ICognitoConnectorApi {
|
|
|
9
9
|
changePassword(input: SetPasswordRequest): Promise<void>;
|
|
10
10
|
respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
|
|
11
11
|
resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
|
|
12
|
-
|
|
12
|
+
deleteCognitoUser(identityId: string): Promise<void>;
|
|
13
13
|
}
|
package/bin/container.config.js
CHANGED
|
@@ -61,6 +61,7 @@ const EstafetaApi_1 = __importDefault(require("./estafeta/api/EstafetaApi"));
|
|
|
61
61
|
const appselectondata_1 = require("./appselectondata");
|
|
62
62
|
const directorySetting_1 = require("./directorySetting");
|
|
63
63
|
const firebase_connector_1 = require("./firebase-connector");
|
|
64
|
+
const OnboardingApi_1 = __importDefault(require("./onboarding/api/OnboardingApi"));
|
|
64
65
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
65
66
|
// UTILS bindings
|
|
66
67
|
bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
|
|
@@ -120,4 +121,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
120
121
|
bind("IAppSelectionDataApi").to(appselectondata_1.AppSelectionDataApi);
|
|
121
122
|
bind("IDirectorySettingApi").to(directorySetting_1.DirectorySettingApi);
|
|
122
123
|
bind("IFirebaseConnectorApi").to(firebase_connector_1.FirebaseConnectorApi);
|
|
124
|
+
bind("IOnboardingApi").to(OnboardingApi_1.default);
|
|
123
125
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IOnboardingApi } from "./interfaces/IOnboardingApi";
|
|
3
|
+
export default class OnboardingApi implements IOnboardingApi {
|
|
4
|
+
private httpRequest;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(httpRequest: IHttpRequest);
|
|
7
|
+
delete(id: string): Promise<any>;
|
|
8
|
+
}
|
|
@@ -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 OnboardingApi = class OnboardingApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.ONBOARDING_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async delete(id) {
|
|
22
|
+
const url = `${this.baseUrl}onboarding/${id}`;
|
|
23
|
+
return await this.httpRequest.delete(`${url}`);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
OnboardingApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], OnboardingApi);
|
|
31
|
+
exports.default = OnboardingApi;
|
|
@@ -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/OnboardingApi"), exports);
|
|
18
|
+
__exportStar(require("./api/interfaces/IOnboardingApi"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
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",
|
|
@@ -9,8 +9,8 @@ export default class CognitoConnectorApi implements ICognitoConnectorApi {
|
|
|
9
9
|
private readonly baseUrl = process.env.INDETITY_SERVER_BASE_URL || "";
|
|
10
10
|
|
|
11
11
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
12
|
-
async
|
|
13
|
-
const url = `${this.baseUrl}cognito/deleteUser/${
|
|
12
|
+
async deleteCognitoUser(identityId: string): Promise<void> {
|
|
13
|
+
const url = `${this.baseUrl}cognito/deleteUser/${identityId}`;
|
|
14
14
|
return await this.httpRequest.delete(url);
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -13,5 +13,5 @@ export interface ICognitoConnectorApi {
|
|
|
13
13
|
changePassword(input: SetPasswordRequest): Promise<void>;
|
|
14
14
|
respondToNewPasswordChallenge(input: RespondToAuthChallengeRequest): Promise<SignInResponse>;
|
|
15
15
|
resetPassword(username: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<void>;
|
|
16
|
-
|
|
16
|
+
deleteCognitoUser(identityId: string): Promise<void>;
|
|
17
17
|
}
|
package/src/container.config.ts
CHANGED
|
@@ -77,6 +77,8 @@ import EstafetaApi from "./estafeta/api/EstafetaApi";
|
|
|
77
77
|
import { AppSelectionDataApi, IAppSelectionDataApi } from "./appselectondata";
|
|
78
78
|
import { DirectorySettingApi, IDirectorySettingApi } from "./directorySetting";
|
|
79
79
|
import { FirebaseConnectorApi, IFirebaseConnectorApi } from "./firebase-connector";
|
|
80
|
+
import { IOnboardingApi } from "./onboarding";
|
|
81
|
+
import OnboardingApi from "./onboarding/api/OnboardingApi";
|
|
80
82
|
|
|
81
83
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
82
84
|
// UTILS bindings
|
|
@@ -138,4 +140,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
138
140
|
bind<IAppSelectionDataApi>("IAppSelectionDataApi").to(AppSelectionDataApi);
|
|
139
141
|
bind<IDirectorySettingApi>("IDirectorySettingApi").to(DirectorySettingApi);
|
|
140
142
|
bind<IFirebaseConnectorApi>("IFirebaseConnectorApi").to(FirebaseConnectorApi);
|
|
143
|
+
bind<IOnboardingApi>("IOnboardingApi").to(OnboardingApi);
|
|
141
144
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { IOnboardingApi } from "./interfaces/IOnboardingApi";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class OnboardingApi implements IOnboardingApi {
|
|
8
|
+
|
|
9
|
+
private readonly baseUrl = process.env.ONBOARDING_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async delete(id: string): Promise<any> {
|
|
15
|
+
const url = `${this.baseUrl}onboarding/${id}`;
|
|
16
|
+
return await this.httpRequest.delete(`${url}`);
|
|
17
|
+
}
|
|
18
|
+
}
|