@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.
@@ -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
- deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
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 deleteCognitoUserByDirectoryId(directoryId) {
22
- const url = `${this.baseUrl}cognito/deleteUser/${directoryId}`;
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
- deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
12
+ deleteCognitoUser(identityId: string): Promise<void>;
13
13
  }
@@ -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
@@ -48,3 +48,4 @@ export * from "./estafeta";
48
48
  export * from "./appselectondata";
49
49
  export * from "./directorySetting";
50
50
  export * from "./firebase-connector";
51
+ export * from "./onboarding";
package/bin/index.js CHANGED
@@ -64,3 +64,4 @@ __exportStar(require("./estafeta"), exports);
64
64
  __exportStar(require("./appselectondata"), exports);
65
65
  __exportStar(require("./directorySetting"), exports);
66
66
  __exportStar(require("./firebase-connector"), exports);
67
+ __exportStar(require("./onboarding"), exports);
@@ -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,3 @@
1
+ export interface IOnboardingApi {
2
+ delete(id: string): Promise<any>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/OnboardingApi';
2
+ export * from './api/interfaces/IOnboardingApi';
@@ -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.1",
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 deleteCognitoUserByDirectoryId(directoryId: string): Promise<void> {
13
- const url = `${this.baseUrl}cognito/deleteUser/${directoryId}`;
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
- deleteCognitoUserByDirectoryId(directoryId: string): Promise<void>;
16
+ deleteCognitoUser(identityId: string): Promise<void>;
17
17
  }
@@ -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
@@ -48,5 +48,6 @@ export * from "./estafeta";
48
48
  export * from "./appselectondata";
49
49
  export * from "./directorySetting";
50
50
  export * from "./firebase-connector";
51
+ export * from "./onboarding";
51
52
 
52
53
 
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ export interface IOnboardingApi {
2
+ delete(id: string): Promise<any>
3
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/OnboardingApi';
2
+ export * from './api/interfaces/IOnboardingApi';