@fiado/api-invoker 5.111.0 → 5.112.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/retailCatalog/api/RetailCatalogBusinessApi.d.ts +6 -1
- package/bin/retailCatalog/api/RetailCatalogBusinessApi.js +8 -0
- package/bin/retailCatalog/api/interfaces/IRetailCatalogBusinessApi.d.ts +7 -1
- package/package.json +1 -1
- package/src/retailCatalog/api/RetailCatalogBusinessApi.ts +13 -0
- package/src/retailCatalog/api/interfaces/IRetailCatalogBusinessApi.ts +9 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import type { GetStoreStockCatalogResponse, HoldStockRequest, HoldStockResponse, InventoryLensQuery, InventoryLensResponse, ReleaseStockRequest, ReleaseStockResponse, RenewReservationsRequest, RenewReservationsResponse, ReserveStockRequest, ReserveStockResponse, ReturnStockRequest, ReturnStockResponse, SellStockRequest, SellStockResponse, SuggestPiecesQuery, SuggestPiecesResponse, SyncInventoryRequest, SyncInventoryResponse, ValidateProductResponse } from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
3
|
+
import type { GetStoreStockCatalogResponse, HoldStockRequest, HoldStockResponse, InventoryLensQuery, InventoryLensResponse, ReleaseStockRequest, ReleaseStockResponse, RenewReservationsRequest, RenewReservationsResponse, ReserveStockRequest, ReserveStockResponse, ReturnStockRequest, ReturnStockResponse, SellStockRequest, SellStockResponse, SuggestPiecesQuery, SuggestPiecesResponse, SyncInventoryRequest, SyncInventoryResponse, ValidateProductResponse, StoreCatalogItem as StockCatalogItem } from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
4
|
+
import type { PaginatedResult } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
4
5
|
import type { ApplyInventoryEventRequest, ApplyInventoryEventResponse, ApplyProductEventRequest, ApplyProductEventResponse } from "@fiado/type-kit/bin/retailIntegration/index.js";
|
|
5
6
|
import { IRetailCatalogBusinessApi, ProductsByRetailersResponse, ReleaseReservationBody, ReserveInventoryBody, ReserveInventoryResult, SellInventoryBody, StoreCatalogItem } from "./interfaces/IRetailCatalogBusinessApi.js";
|
|
6
7
|
/**
|
|
@@ -39,6 +40,10 @@ export default class RetailCatalogBusinessApi implements IRetailCatalogBusinessA
|
|
|
39
40
|
returnStock(storeId: string, body: ReturnStockRequest, tenantId: string): Promise<StandardResponse<ReturnStockResponse>>;
|
|
40
41
|
syncInventory(retailerId: string, body: SyncInventoryRequest, tenantId: string): Promise<StandardResponse<SyncInventoryResponse>>;
|
|
41
42
|
getStoreStockCatalog(storeId: string, tenantId: string): Promise<StandardResponse<GetStoreStockCatalogResponse>>;
|
|
43
|
+
listStoreStockCatalogPage(storeId: string, tenantId: string, page?: {
|
|
44
|
+
limit?: number;
|
|
45
|
+
nextToken?: string;
|
|
46
|
+
}): Promise<StandardResponse<PaginatedResult<StockCatalogItem>>>;
|
|
42
47
|
getInventoryLens(tenantId: string, retailerId: string, query: InventoryLensQuery): Promise<StandardResponse<InventoryLensResponse>>;
|
|
43
48
|
privateApplyProductEvent(request: ApplyProductEventRequest): Promise<StandardResponse<ApplyProductEventResponse>>;
|
|
44
49
|
privateApplyInventoryEvent(request: ApplyInventoryEventRequest): Promise<StandardResponse<ApplyInventoryEventResponse>>;
|
|
@@ -107,6 +107,14 @@ let RetailCatalogBusinessApi = class RetailCatalogBusinessApi {
|
|
|
107
107
|
async getStoreStockCatalog(storeId, tenantId) {
|
|
108
108
|
return await this.httpRequest.get(this.storeUrl(storeId, "stock-catalog", tenantId));
|
|
109
109
|
}
|
|
110
|
+
async listStoreStockCatalogPage(storeId, tenantId, page = {}) {
|
|
111
|
+
const extra = {};
|
|
112
|
+
if (page.limit !== undefined)
|
|
113
|
+
extra.limit = String(page.limit);
|
|
114
|
+
if (page.nextToken)
|
|
115
|
+
extra.nextToken = page.nextToken;
|
|
116
|
+
return await this.httpRequest.get(this.storeUrl(storeId, "stock-catalog/page", tenantId, extra));
|
|
117
|
+
}
|
|
110
118
|
async getInventoryLens(tenantId, retailerId, query) {
|
|
111
119
|
const params = new URLSearchParams({ tenantId, retailerId, filter: query.filter });
|
|
112
120
|
if (query.period)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import type { GetStoreStockCatalogResponse, HoldStockRequest, HoldStockResponse, InventoryLensQuery, InventoryLensResponse, MdmLockModeEnum, MdmProviderEnum, ReleaseStockRequest, ReleaseStockResponse, RenewReservationsRequest, RenewReservationsResponse, ReserveStockRequest, ReserveStockResponse, ReturnStockRequest, ReturnStockResponse, SellStockRequest, SellStockResponse, SuggestPiecesQuery, SuggestPiecesResponse, SyncInventoryRequest, SyncInventoryResponse, ValidateProductResponse } from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
2
|
+
import type { GetStoreStockCatalogResponse, HoldStockRequest, HoldStockResponse, InventoryLensQuery, InventoryLensResponse, MdmLockModeEnum, MdmProviderEnum, ReleaseStockRequest, ReleaseStockResponse, RenewReservationsRequest, RenewReservationsResponse, ReserveStockRequest, ReserveStockResponse, ReturnStockRequest, ReturnStockResponse, SellStockRequest, SellStockResponse, SuggestPiecesQuery, SuggestPiecesResponse, SyncInventoryRequest, StoreCatalogItem as StockCatalogItem, SyncInventoryResponse, ValidateProductResponse } from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
3
|
+
import type { PaginatedResult } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
3
4
|
import type { ApplyInventoryEventRequest, ApplyInventoryEventResponse, ApplyProductEventRequest, ApplyProductEventResponse } from "@fiado/type-kit/bin/retailIntegration/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* Contrato del publisher HTTP del lambda `retail-catalog-business` (SureKeep Fase 1, pista Retail)
|
|
@@ -174,6 +175,11 @@ export interface IRetailCatalogBusinessApi {
|
|
|
174
175
|
syncInventory(retailerId: string, body: SyncInventoryRequest, tenantId: string): Promise<StandardResponse<SyncInventoryResponse>>;
|
|
175
176
|
/** GET `/private/stores/{storeId}/stock-catalog` — catálogo vendible de la tienda, una fila por SKU. */
|
|
176
177
|
getStoreStockCatalog(storeId: string, tenantId: string): Promise<StandardResponse<GetStoreStockCatalogResponse>>;
|
|
178
|
+
/** GET `/private/stores/{storeId}/stock-catalog/page` — el mismo catálogo paginado con cursor opaco (`nextToken`). */
|
|
179
|
+
listStoreStockCatalogPage(storeId: string, tenantId: string, page?: {
|
|
180
|
+
limit?: number;
|
|
181
|
+
nextToken?: string;
|
|
182
|
+
}): Promise<StandardResponse<PaginatedResult<StockCatalogItem>>>;
|
|
177
183
|
/** GET `/private/inventory/lens` — lente de inventario del retailer; `period` y `storeId` solo aplican a `filter=list`. */
|
|
178
184
|
getInventoryLens(tenantId: string, retailerId: string, query: InventoryLensQuery): Promise<StandardResponse<InventoryLensResponse>>;
|
|
179
185
|
/** `POST /private/integration/product-events?tenantId=` — aplica un evento de producto del retailer. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.112.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",
|
|
@@ -22,7 +22,9 @@ import type {
|
|
|
22
22
|
SyncInventoryRequest,
|
|
23
23
|
SyncInventoryResponse,
|
|
24
24
|
ValidateProductResponse,
|
|
25
|
+
StoreCatalogItem as StockCatalogItem,
|
|
25
26
|
} from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
27
|
+
import type { PaginatedResult } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
26
28
|
import type {
|
|
27
29
|
ApplyInventoryEventRequest,
|
|
28
30
|
ApplyInventoryEventResponse,
|
|
@@ -208,6 +210,17 @@ export default class RetailCatalogBusinessApi implements IRetailCatalogBusinessA
|
|
|
208
210
|
return await this.httpRequest.get(this.storeUrl(storeId, "stock-catalog", tenantId));
|
|
209
211
|
}
|
|
210
212
|
|
|
213
|
+
async listStoreStockCatalogPage(
|
|
214
|
+
storeId: string,
|
|
215
|
+
tenantId: string,
|
|
216
|
+
page: { limit?: number; nextToken?: string } = {},
|
|
217
|
+
): Promise<StandardResponse<PaginatedResult<StockCatalogItem>>> {
|
|
218
|
+
const extra: Record<string, string> = {};
|
|
219
|
+
if (page.limit !== undefined) extra.limit = String(page.limit);
|
|
220
|
+
if (page.nextToken) extra.nextToken = page.nextToken;
|
|
221
|
+
return await this.httpRequest.get(this.storeUrl(storeId, "stock-catalog/page", tenantId, extra));
|
|
222
|
+
}
|
|
223
|
+
|
|
211
224
|
async getInventoryLens(
|
|
212
225
|
tenantId: string,
|
|
213
226
|
retailerId: string,
|
|
@@ -20,9 +20,11 @@ import type {
|
|
|
20
20
|
SuggestPiecesQuery,
|
|
21
21
|
SuggestPiecesResponse,
|
|
22
22
|
SyncInventoryRequest,
|
|
23
|
+
StoreCatalogItem as StockCatalogItem,
|
|
23
24
|
SyncInventoryResponse,
|
|
24
25
|
ValidateProductResponse,
|
|
25
26
|
} from "@fiado/type-kit/bin/retailCatalog/index.js";
|
|
27
|
+
import type { PaginatedResult } from "@fiado/type-kit/bin/retailOrg/index.js";
|
|
26
28
|
import type {
|
|
27
29
|
ApplyInventoryEventRequest,
|
|
28
30
|
ApplyInventoryEventResponse,
|
|
@@ -268,6 +270,13 @@ export interface IRetailCatalogBusinessApi {
|
|
|
268
270
|
/** GET `/private/stores/{storeId}/stock-catalog` — catálogo vendible de la tienda, una fila por SKU. */
|
|
269
271
|
getStoreStockCatalog(storeId: string, tenantId: string): Promise<StandardResponse<GetStoreStockCatalogResponse>>;
|
|
270
272
|
|
|
273
|
+
/** GET `/private/stores/{storeId}/stock-catalog/page` — el mismo catálogo paginado con cursor opaco (`nextToken`). */
|
|
274
|
+
listStoreStockCatalogPage(
|
|
275
|
+
storeId: string,
|
|
276
|
+
tenantId: string,
|
|
277
|
+
page?: { limit?: number; nextToken?: string },
|
|
278
|
+
): Promise<StandardResponse<PaginatedResult<StockCatalogItem>>>;
|
|
279
|
+
|
|
271
280
|
/** GET `/private/inventory/lens` — lente de inventario del retailer; `period` y `storeId` solo aplican a `filter=list`. */
|
|
272
281
|
getInventoryLens(
|
|
273
282
|
tenantId: string,
|