@fiado/api-invoker 5.126.0 → 5.127.0
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/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/usmarketgrowth-business/UsMarketGrowthBusinessApi.d.ts +11 -0
- package/bin/usmarketgrowth-business/UsMarketGrowthBusinessApi.js +33 -0
- package/bin/usmarketgrowth-business/index.d.ts +2 -0
- package/bin/usmarketgrowth-business/index.js +2 -0
- package/bin/usmarketgrowth-business/interfaces/IUsMarketGrowthBusinessApi.d.ts +17 -0
- package/bin/usmarketgrowth-business/interfaces/IUsMarketGrowthBusinessApi.js +1 -0
- package/package.json +1 -1
- package/src/container.config.ts +2 -0
- package/src/index.ts +1 -0
- package/src/usmarketgrowth-business/UsMarketGrowthBusinessApi.ts +22 -0
- package/src/usmarketgrowth-business/index.ts +2 -0
- package/src/usmarketgrowth-business/interfaces/IUsMarketGrowthBusinessApi.ts +17 -0
package/bin/container.config.js
CHANGED
|
@@ -72,6 +72,7 @@ import OnboardingBusinessApi from "./onboarding-business/api/OnboardingBusinessA
|
|
|
72
72
|
import { ExpedienteUpdatedPublisher } from "./onboarding-business/index.js";
|
|
73
73
|
import { PayrollApi } from "./payroll-business/index.js";
|
|
74
74
|
import { ReferralBusinessApi } from "./referral-business/index.js";
|
|
75
|
+
import { UsMarketGrowthBusinessApi } from "./usmarketgrowth-business/index.js";
|
|
75
76
|
import { EventHistoryApi } from "./event-history-business/index.js";
|
|
76
77
|
import ReportProcessorBusinessApi from "./report-processor-business/api/ReportProcessorBusinessApi.js";
|
|
77
78
|
import NotificationWSMessagePublisher from "./notificationWebsockets/queue/NotificationWSMessagePublisher.js";
|
|
@@ -227,6 +228,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
227
228
|
bind("IOnboardingBusinessApi").to(OnboardingBusinessApi);
|
|
228
229
|
bind("IPayrollApi").to(PayrollApi);
|
|
229
230
|
bind("IReferralBusinessApi").to(ReferralBusinessApi);
|
|
231
|
+
bind("IUsMarketGrowthBusinessApi").to(UsMarketGrowthBusinessApi);
|
|
230
232
|
bind("IEventHistoryApi").to(EventHistoryApi);
|
|
231
233
|
bind("IReportProcessorBusinessApi").to(ReportProcessorBusinessApi);
|
|
232
234
|
bind("IPeopleBusinessApi").to(PeopleBusinessApi);
|
package/bin/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./onboarding/index.js";
|
|
|
62
62
|
export * from "./onboarding-business/index.js";
|
|
63
63
|
export * from "./payroll-business/index.js";
|
|
64
64
|
export * from "./referral-business/index.js";
|
|
65
|
+
export * from "./usmarketgrowth-business/index.js";
|
|
65
66
|
export * from "./event-history-business/index.js";
|
|
66
67
|
export * from "./report-processor-business/index.js";
|
|
67
68
|
export * from "./notificationWebsockets/index.js";
|
package/bin/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./onboarding/index.js";
|
|
|
62
62
|
export * from "./onboarding-business/index.js";
|
|
63
63
|
export * from "./payroll-business/index.js";
|
|
64
64
|
export * from "./referral-business/index.js";
|
|
65
|
+
export * from "./usmarketgrowth-business/index.js";
|
|
65
66
|
export * from "./event-history-business/index.js";
|
|
66
67
|
export * from "./report-processor-business/index.js";
|
|
67
68
|
export * from "./notificationWebsockets/index.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { PromoterByDirectoryIdResponse } from "@fiado/type-kit/bin/usmarketgrowth-business/index.js";
|
|
3
|
+
import { IUsMarketGrowthBusinessApi } from "./interfaces/IUsMarketGrowthBusinessApi.js";
|
|
4
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
|
+
export declare class UsMarketGrowthBusinessApi implements IUsMarketGrowthBusinessApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
getPromoterByDirectoryId(directoryId: string): Promise<FiadoApiResponse<PromoterByDirectoryIdResponse>>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from "inversify";
|
|
14
|
+
import dotenv from 'dotenv';
|
|
15
|
+
import { joinUrl } from "../utils/joinUrl.js";
|
|
16
|
+
dotenv.config();
|
|
17
|
+
let UsMarketGrowthBusinessApi = class UsMarketGrowthBusinessApi {
|
|
18
|
+
httpRequest;
|
|
19
|
+
baseUrl = process.env.USMARKETGROWTH_BUSINESS_LAMBDA_URL || "";
|
|
20
|
+
constructor(httpRequest) {
|
|
21
|
+
this.httpRequest = httpRequest;
|
|
22
|
+
}
|
|
23
|
+
async getPromoterByDirectoryId(directoryId) {
|
|
24
|
+
const url = joinUrl(this.baseUrl, `private/promoters/directoryId/${encodeURIComponent(directoryId)}`);
|
|
25
|
+
return await this.httpRequest.get(url);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
UsMarketGrowthBusinessApi = __decorate([
|
|
29
|
+
injectable(),
|
|
30
|
+
__param(0, inject("IHttpRequest")),
|
|
31
|
+
__metadata("design:paramtypes", [Object])
|
|
32
|
+
], UsMarketGrowthBusinessApi);
|
|
33
|
+
export { UsMarketGrowthBusinessApi };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
+
import type { PromoterByDirectoryIdResponse } from "@fiado/type-kit/bin/usmarketgrowth-business/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cliente de `usmarketgrowth-business` (promotores de US Market Growth).
|
|
5
|
+
*
|
|
6
|
+
* Env var requerida en el consumer: `USMARKETGROWTH_BUSINESS_LAMBDA_URL`, resuelta con
|
|
7
|
+
* `{{resolve:ssm:usmarketgrowth-business}}`.
|
|
8
|
+
*/
|
|
9
|
+
export interface IUsMarketGrowthBusinessApi {
|
|
10
|
+
/**
|
|
11
|
+
* Promotor ligado a un directorio (un directorio por llamada).
|
|
12
|
+
* Si el directorio no es de un promotor, el lambda responde 404 `PROMOTER_NOT_FOUND`.
|
|
13
|
+
* @param directoryId ID del directorio.
|
|
14
|
+
*/
|
|
15
|
+
getPromoterByDirectoryId(directoryId: string): Promise<FiadoApiResponse<PromoterByDirectoryIdResponse>>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.127.0",
|
|
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
|
"type": "module",
|
|
6
6
|
"main": "bin/index.js",
|
package/src/container.config.ts
CHANGED
|
@@ -103,6 +103,7 @@ import OnboardingBusinessApi from "./onboarding-business/api/OnboardingBusinessA
|
|
|
103
103
|
import { IOnboardingBusinessApi, IExpedienteUpdatedPublisher, ExpedienteUpdatedPublisher } from "./onboarding-business/index.js";
|
|
104
104
|
import { IPayrollApi, PayrollApi } from "./payroll-business/index.js";
|
|
105
105
|
import { IReferralBusinessApi, ReferralBusinessApi } from "./referral-business/index.js";
|
|
106
|
+
import { IUsMarketGrowthBusinessApi, UsMarketGrowthBusinessApi } from "./usmarketgrowth-business/index.js";
|
|
106
107
|
import { EventHistoryApi, IEventHistoryApi } from "./event-history-business/index.js";
|
|
107
108
|
import ReportProcessorBusinessApi from "./report-processor-business/api/ReportProcessorBusinessApi.js";
|
|
108
109
|
import { IReportProcessorBusinessApi } from "./report-processor-business/index.js";
|
|
@@ -300,6 +301,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
300
301
|
bind<IOnboardingBusinessApi>("IOnboardingBusinessApi").to(OnboardingBusinessApi);
|
|
301
302
|
bind<IPayrollApi>("IPayrollApi").to(PayrollApi);
|
|
302
303
|
bind<IReferralBusinessApi>("IReferralBusinessApi").to(ReferralBusinessApi);
|
|
304
|
+
bind<IUsMarketGrowthBusinessApi>("IUsMarketGrowthBusinessApi").to(UsMarketGrowthBusinessApi);
|
|
303
305
|
bind<IEventHistoryApi>("IEventHistoryApi").to(EventHistoryApi);
|
|
304
306
|
bind<IReportProcessorBusinessApi>("IReportProcessorBusinessApi").to(ReportProcessorBusinessApi);
|
|
305
307
|
bind<IPeopleBusinessApi>("IPeopleBusinessApi").to(PeopleBusinessApi);
|
package/src/index.ts
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./onboarding/index.js";
|
|
|
62
62
|
export * from "./onboarding-business/index.js";
|
|
63
63
|
export * from "./payroll-business/index.js";
|
|
64
64
|
export * from "./referral-business/index.js";
|
|
65
|
+
export * from "./usmarketgrowth-business/index.js";
|
|
65
66
|
export * from "./event-history-business/index.js";
|
|
66
67
|
export * from "./report-processor-business/index.js";
|
|
67
68
|
export * from "./notificationWebsockets/index.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import type { PromoterByDirectoryIdResponse } from "@fiado/type-kit/bin/usmarketgrowth-business/index.js";
|
|
5
|
+
import { IUsMarketGrowthBusinessApi } from "./interfaces/IUsMarketGrowthBusinessApi.js";
|
|
6
|
+
import { joinUrl } from "../utils/joinUrl.js";
|
|
7
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
8
|
+
|
|
9
|
+
dotenv.config();
|
|
10
|
+
|
|
11
|
+
@injectable()
|
|
12
|
+
export class UsMarketGrowthBusinessApi implements IUsMarketGrowthBusinessApi {
|
|
13
|
+
|
|
14
|
+
private readonly baseUrl = process.env.USMARKETGROWTH_BUSINESS_LAMBDA_URL || "";
|
|
15
|
+
|
|
16
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
17
|
+
|
|
18
|
+
async getPromoterByDirectoryId(directoryId: string): Promise<FiadoApiResponse<PromoterByDirectoryIdResponse>> {
|
|
19
|
+
const url = joinUrl(this.baseUrl, `private/promoters/directoryId/${encodeURIComponent(directoryId)}`);
|
|
20
|
+
return await this.httpRequest.get(url);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
2
|
+
import type { PromoterByDirectoryIdResponse } from "@fiado/type-kit/bin/usmarketgrowth-business/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cliente de `usmarketgrowth-business` (promotores de US Market Growth).
|
|
6
|
+
*
|
|
7
|
+
* Env var requerida en el consumer: `USMARKETGROWTH_BUSINESS_LAMBDA_URL`, resuelta con
|
|
8
|
+
* `{{resolve:ssm:usmarketgrowth-business}}`.
|
|
9
|
+
*/
|
|
10
|
+
export interface IUsMarketGrowthBusinessApi {
|
|
11
|
+
/**
|
|
12
|
+
* Promotor ligado a un directorio (un directorio por llamada).
|
|
13
|
+
* Si el directorio no es de un promotor, el lambda responde 404 `PROMOTER_NOT_FOUND`.
|
|
14
|
+
* @param directoryId ID del directorio.
|
|
15
|
+
*/
|
|
16
|
+
getPromoterByDirectoryId(directoryId: string): Promise<FiadoApiResponse<PromoterByDirectoryIdResponse>>;
|
|
17
|
+
}
|