@fiado/api-invoker 1.5.0 → 1.5.2

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.
@@ -63,6 +63,7 @@ const directorySetting_1 = require("./directorySetting");
63
63
  const firebase_connector_1 = require("./firebase-connector");
64
64
  const OnboardingApi_1 = __importDefault(require("./onboarding/api/OnboardingApi"));
65
65
  const OnboardingBusinessApi_1 = __importDefault(require("./onboarding-business/api/OnboardingBusinessApi"));
66
+ const payroll_business_1 = require("./payroll-business");
66
67
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
67
68
  // UTILS bindings
68
69
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -124,4 +125,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
124
125
  bind("IFirebaseConnectorApi").to(firebase_connector_1.FirebaseConnectorApi);
125
126
  bind("IOnboardingApi").to(OnboardingApi_1.default);
126
127
  bind("IOnboardingBusinessApi").to(OnboardingBusinessApi_1.default);
128
+ bind("IPayrollApi").to(payroll_business_1.PayrollApi);
127
129
  });
package/bin/index.d.ts CHANGED
@@ -50,3 +50,4 @@ export * from "./directorySetting";
50
50
  export * from "./firebase-connector";
51
51
  export * from "./onboarding";
52
52
  export * from "./onboarding-business";
53
+ export * from "./payroll-business";
package/bin/index.js CHANGED
@@ -66,3 +66,4 @@ __exportStar(require("./directorySetting"), exports);
66
66
  __exportStar(require("./firebase-connector"), exports);
67
67
  __exportStar(require("./onboarding"), exports);
68
68
  __exportStar(require("./onboarding-business"), exports);
69
+ __exportStar(require("./payroll-business"), exports);
@@ -0,0 +1,8 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IPayrollApi } from "./interfaces/IPayrollApi";
3
+ export declare class PayrollApi implements IPayrollApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ getByDirectoryId(directoryId: string): Promise<any>;
8
+ }
@@ -0,0 +1,37 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PayrollApi = void 0;
19
+ const inversify_1 = require("inversify");
20
+ const dotenv_1 = __importDefault(require("dotenv"));
21
+ dotenv_1.default.config();
22
+ let PayrollApi = class PayrollApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
26
+ }
27
+ async getByDirectoryId(directoryId) {
28
+ const url = `${this.baseUrl}private/payroll-boss/directory/${directoryId}`;
29
+ return await this.httpRequest.get(`${url}`);
30
+ }
31
+ };
32
+ exports.PayrollApi = PayrollApi;
33
+ exports.PayrollApi = PayrollApi = __decorate([
34
+ (0, inversify_1.injectable)(),
35
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
+ __metadata("design:paramtypes", [Object])
37
+ ], PayrollApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPayrollApi';
2
+ export * from './PayrollApi';
@@ -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/IPayrollApi"), exports);
18
+ __exportStar(require("./PayrollApi"), exports);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
3
+ */
4
+ export interface IPayrollApi {
5
+ /**
6
+ * Obtiene registros de payroll por directorio.
7
+ * @param directoryId ID del directorio.
8
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
9
+ */
10
+ getByDirectoryId(directoryId: string): Promise<any>;
11
+ }
@@ -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": "1.5.0",
3
+ "version": "1.5.2",
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",
@@ -81,6 +81,7 @@ import { IOnboardingApi } from "./onboarding";
81
81
  import OnboardingApi from "./onboarding/api/OnboardingApi";
82
82
  import OnboardingBusinessApi from "./onboarding-business/api/OnboardingBusinessApi";
83
83
  import { IOnboardingBusinessApi } from "./onboarding-business";
84
+ import { IPayrollApi, PayrollApi } from "./payroll-business";
84
85
 
85
86
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
86
87
  // UTILS bindings
@@ -144,4 +145,5 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
144
145
  bind<IFirebaseConnectorApi>("IFirebaseConnectorApi").to(FirebaseConnectorApi);
145
146
  bind<IOnboardingApi>("IOnboardingApi").to(OnboardingApi);
146
147
  bind<IOnboardingBusinessApi>("IOnboardingBusinessApi").to(OnboardingBusinessApi);
148
+ bind<IPayrollApi>("IPayrollApi").to(PayrollApi);
147
149
  });
package/src/index.ts CHANGED
@@ -50,6 +50,7 @@ export * from "./directorySetting";
50
50
  export * from "./firebase-connector";
51
51
  export * from "./onboarding";
52
52
  export * from "./onboarding-business";
53
+ export * from "./payroll-business";
53
54
 
54
55
 
55
56
 
@@ -0,0 +1,19 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { IPayrollApi } from "./interfaces/IPayrollApi";
5
+
6
+ dotenv.config();
7
+
8
+ @injectable()
9
+ export class PayrollApi implements IPayrollApi {
10
+
11
+ private readonly baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
12
+
13
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
+ async getByDirectoryId(directoryId: string): Promise<any> {
15
+ const url = `${this.baseUrl}private/payroll-boss/directory/${directoryId}`;
16
+ return await this.httpRequest.get(`${url}`);
17
+ }
18
+
19
+ }
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPayrollApi';
2
+ export * from './PayrollApi';
@@ -0,0 +1,13 @@
1
+
2
+ /**
3
+ * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
4
+ */
5
+ export interface IPayrollApi {
6
+
7
+ /**
8
+ * Obtiene registros de payroll por directorio.
9
+ * @param directoryId ID del directorio.
10
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
11
+ */
12
+ getByDirectoryId(directoryId: string): Promise<any>;
13
+ }