@fiado/api-invoker 1.0.48 → 1.0.50

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,8 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
3
+ import { IAuthenticationApi } from "./interfaces/IAuthenticationApi";
4
+ export declare class AuthenticationApi implements IAuthenticationApi {
5
+ private httpRequest;
6
+ constructor(httpRequest: IHttpRequest);
7
+ signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
8
+ }
@@ -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.AuthenticationApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let AuthenticationApi = class AuthenticationApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ }
21
+ async signUpAdditionalCard(createAdditionalCard) {
22
+ const url = `${process.env.AUTH_LAMBDA_URL}`;
23
+ const operation = "postSignUpAdditionalCard";
24
+ return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
25
+ }
26
+ };
27
+ exports.AuthenticationApi = AuthenticationApi;
28
+ exports.AuthenticationApi = AuthenticationApi = __decorate([
29
+ (0, inversify_1.injectable)(),
30
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
31
+ __metadata("design:paramtypes", [Object])
32
+ ], AuthenticationApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IAuthenticationApi';
2
+ export * from './AuthenticationApi';
@@ -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/IAuthenticationApi"), exports);
18
+ __exportStar(require("./AuthenticationApi"), exports);
@@ -0,0 +1,4 @@
1
+ import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
2
+ export interface IAuthenticationApi {
3
+ signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,4 +9,5 @@ export declare class DirectoryApi implements IDirectoryApi {
9
9
  updateExternalUserId(directoryId: string, provider: Provider, externalUserId: string): Promise<void>;
10
10
  updateScope(directoryId: string, scope: string[]): Promise<void>;
11
11
  getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>;
12
+ getByPhoneNumber(phoneNumber: string): Promise<any>;
12
13
  }
@@ -58,6 +58,11 @@ let DirectoryApi = class DirectoryApi {
58
58
  const operationName = "getByOwnerDirectoryId";
59
59
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
60
60
  }
61
+ async getByPhoneNumber(phoneNumber) {
62
+ const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
63
+ const operationName = "getUserInfoByParams";
64
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
65
+ }
61
66
  };
62
67
  exports.DirectoryApi = DirectoryApi;
63
68
  exports.DirectoryApi = DirectoryApi = __decorate([
@@ -36,4 +36,12 @@ export interface IDirectoryApi {
36
36
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
37
37
  */
38
38
  getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>;
39
+ /**
40
+ * Obtiene un directorio por su número de teléfono.
41
+ * @param phoneNumber Número de teléfono a buscar.
42
+ * @returns Una promesa que resuelve a un objeto de directorio.
43
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
44
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
45
+ */
46
+ getByPhoneNumber(phoneNumber: string): Promise<any>;
39
47
  }
package/bin/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from "./account-fiadoinc";
11
11
  export * from "./account-fiadosa";
12
12
  export * from "./account-pagoconfiado";
13
13
  export * from "./exchangeRates";
14
+ export * from "./authentication";
package/bin/index.js CHANGED
@@ -27,3 +27,4 @@ __exportStar(require("./account-fiadoinc"), exports);
27
27
  __exportStar(require("./account-fiadosa"), exports);
28
28
  __exportStar(require("./account-pagoconfiado"), exports);
29
29
  __exportStar(require("./exchangeRates"), exports);
30
+ __exportStar(require("./authentication"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,17 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
3
+ import { inject, injectable } from "inversify";
4
+ import { IAuthenticationApi } from "./interfaces/IAuthenticationApi";
5
+
6
+ @injectable()
7
+ export class AuthenticationApi implements IAuthenticationApi {
8
+
9
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
10
+
11
+ async signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any> {
12
+ const url = `${process.env.AUTH_LAMBDA_URL}`;
13
+ const operation = "postSignUpAdditionalCard";
14
+
15
+ return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+
2
+
3
+
4
+ export * from './interfaces/IAuthenticationApi';
5
+ export * from './AuthenticationApi';
@@ -0,0 +1,6 @@
1
+ import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
2
+
3
+ export interface IAuthenticationApi {
4
+
5
+ signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
6
+ }
@@ -61,6 +61,14 @@ export class DirectoryApi implements IDirectoryApi {
61
61
  const operationName = "getByOwnerDirectoryId";
62
62
 
63
63
 
64
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
65
+ }
66
+
67
+ public async getByPhoneNumber(phoneNumber: string): Promise<any> {
68
+
69
+ const url = `${this.baseUrl}?phoneNumber=${phoneNumber}`;
70
+ const operationName = "getUserInfoByParams";
71
+
64
72
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
65
73
  }
66
74
  }
@@ -41,4 +41,13 @@ export interface IDirectoryApi {
41
41
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
42
42
  */
43
43
  getByOwnerDirectoryId(ownerDirectoryId: string): Promise<any>
44
+
45
+ /**
46
+ * Obtiene un directorio por su número de teléfono.
47
+ * @param phoneNumber Número de teléfono a buscar.
48
+ * @returns Una promesa que resuelve a un objeto de directorio.
49
+ * Puede devolver un objeto vacío si no se encuentra coincidencia.
50
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
51
+ */
52
+ getByPhoneNumber(phoneNumber: string): Promise<any>
44
53
  }
package/src/index.ts CHANGED
@@ -11,6 +11,4 @@ export * from "./account-fiadoinc";
11
11
  export * from "./account-fiadosa";
12
12
  export * from "./account-pagoconfiado";
13
13
  export * from "./exchangeRates";
14
-
15
-
16
-
14
+ export * from "./authentication";