@fiado/api-invoker 5.118.0 → 5.119.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.
@@ -1,6 +1,6 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
2
  import { StandardResponse } from "@fiado/gateway-adapter";
3
- import type { PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
3
+ import type { ActiveSalePromotionsBySkusRequest, ActiveSalePromotionsBySkusResponse, PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
4
4
  import { IRetailPromotionsBusinessApi } from "./interfaces/IRetailPromotionsBusinessApi.js";
5
5
  /** Publisher HTTP de los privados de `retail-promotions-business`. Contrato -> `IRetailPromotionsBusinessApi`. */
6
6
  export default class RetailPromotionsBusinessApi implements IRetailPromotionsBusinessApi {
@@ -8,4 +8,5 @@ export default class RetailPromotionsBusinessApi implements IRetailPromotionsBus
8
8
  private readonly baseUrl;
9
9
  constructor(httpRequest: IHttpRequest);
10
10
  releaseSalePromotion(tenantId: string, sessionId: string): Promise<StandardResponse<PrivateReleaseSalePromotionResponse>>;
11
+ listActiveSalePromotionsBySkus(input: ActiveSalePromotionsBySkusRequest): Promise<StandardResponse<ActiveSalePromotionsBySkusResponse>>;
11
12
  }
@@ -24,6 +24,9 @@ let RetailPromotionsBusinessApi = class RetailPromotionsBusinessApi {
24
24
  const url = `${this.baseUrl}/private/sessions/${encodeURIComponent(sessionId)}/sale-promotion?${query.toString()}`;
25
25
  return await this.httpRequest.delete(url);
26
26
  }
27
+ async listActiveSalePromotionsBySkus(input) {
28
+ return await this.httpRequest.post(`${this.baseUrl}/private/sale-promotions/active-by-skus`, input);
29
+ }
27
30
  };
28
31
  RetailPromotionsBusinessApi = __decorate([
29
32
  injectable(),
@@ -1,9 +1,14 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import type { PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
2
+ import type { ActiveSalePromotionsBySkusRequest, ActiveSalePromotionsBySkusResponse, PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
3
3
  export interface IRetailPromotionsBusinessApi {
4
4
  /**
5
5
  * `DELETE /private/sessions/{sessionId}/sale-promotion`: suelta el apartado de la promo de venta.
6
6
  * Lo llama el wizard al cancelar. Es idempotente: `released: false` si no había apartado.
7
7
  */
8
8
  releaseSalePromotion(tenantId: string, sessionId: string): Promise<StandardResponse<PrivateReleaseSalePromotionResponse>>;
9
+ /**
10
+ * `POST /private/sale-promotions/active-by-skus`: promos de venta vigentes por SKU, hasta 100 por llamada.
11
+ * Una entrada por SKU en el orden pedido; `UNAVAILABLE` por entrada si no se pudieron leer.
12
+ */
13
+ listActiveSalePromotionsBySkus(input: ActiveSalePromotionsBySkusRequest): Promise<StandardResponse<ActiveSalePromotionsBySkusResponse>>;
9
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.118.0",
3
+ "version": "5.119.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",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.14.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.512.0",
37
+ "@fiado/type-kit": "^3.513.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,7 +1,11 @@
1
1
  import { inject, injectable } from "inversify";
2
2
  import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { StandardResponse } from "@fiado/gateway-adapter";
4
- import type { PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
4
+ import type {
5
+ ActiveSalePromotionsBySkusRequest,
6
+ ActiveSalePromotionsBySkusResponse,
7
+ PrivateReleaseSalePromotionResponse,
8
+ } from "@fiado/type-kit/bin/retailPromotions/index.js";
5
9
  import { IRetailPromotionsBusinessApi } from "./interfaces/IRetailPromotionsBusinessApi.js";
6
10
 
7
11
  /** Publisher HTTP de los privados de `retail-promotions-business`. Contrato -> `IRetailPromotionsBusinessApi`. */
@@ -20,4 +24,10 @@ export default class RetailPromotionsBusinessApi implements IRetailPromotionsBus
20
24
  const url = `${this.baseUrl}/private/sessions/${encodeURIComponent(sessionId)}/sale-promotion?${query.toString()}`;
21
25
  return await this.httpRequest.delete(url);
22
26
  }
27
+
28
+ async listActiveSalePromotionsBySkus(
29
+ input: ActiveSalePromotionsBySkusRequest,
30
+ ): Promise<StandardResponse<ActiveSalePromotionsBySkusResponse>> {
31
+ return await this.httpRequest.post(`${this.baseUrl}/private/sale-promotions/active-by-skus`, input);
32
+ }
23
33
  }
@@ -1,7 +1,11 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import type { PrivateReleaseSalePromotionResponse } from "@fiado/type-kit/bin/retailPromotions/index.js";
2
+ import type {
3
+ ActiveSalePromotionsBySkusRequest,
4
+ ActiveSalePromotionsBySkusResponse,
5
+ PrivateReleaseSalePromotionResponse,
6
+ } from "@fiado/type-kit/bin/retailPromotions/index.js";
3
7
 
4
- // Contrato de los privados de `retail-promotions-business`; el caller manda `tenantId` por query.
8
+ // Contrato de los privados de `retail-promotions-business`; el caller manda `tenantId` por query o en el body.
5
9
  // El consumer necesita `RETAIL_PROMOTIONS_BUSINESS_URL` = `{{resolve:ssm:retail-promotions-business}}`.
6
10
  export interface IRetailPromotionsBusinessApi {
7
11
  /**
@@ -12,4 +16,12 @@ export interface IRetailPromotionsBusinessApi {
12
16
  tenantId: string,
13
17
  sessionId: string,
14
18
  ): Promise<StandardResponse<PrivateReleaseSalePromotionResponse>>;
19
+
20
+ /**
21
+ * `POST /private/sale-promotions/active-by-skus`: promos de venta vigentes por SKU, hasta 100 por llamada.
22
+ * Una entrada por SKU en el orden pedido; `UNAVAILABLE` por entrada si no se pudieron leer.
23
+ */
24
+ listActiveSalePromotionsBySkus(
25
+ input: ActiveSalePromotionsBySkusRequest,
26
+ ): Promise<StandardResponse<ActiveSalePromotionsBySkusResponse>>;
15
27
  }