feat(modules-sdk): Remote Query (#4463)

* feat: Remote Query
This commit is contained in:
Carlos R. L. Rodrigues
2023-07-19 15:35:36 -03:00
committed by GitHub
parent 95c538c675
commit 5a8a889c6d
57 changed files with 1286 additions and 423 deletions
@@ -11,6 +11,7 @@ import {
IInventoryService,
InventoryItemDTO,
InventoryLevelDTO,
JoinerServiceConfig,
MODULE_RESOURCE_TYPE,
ReservationItemDTO,
SharedContext,
@@ -23,6 +24,7 @@ import {
MedusaError,
} from "@medusajs/utils"
import { EntityManager } from "typeorm"
import { joinerConfig } from "../joiner-config"
import InventoryItemService from "./inventory-item"
import InventoryLevelService from "./inventory-level"
import ReservationItemService from "./reservation-item"
@@ -57,6 +59,10 @@ export default class InventoryService implements IInventoryService {
this.reservationItemService_ = reservationItemService
}
__joinerConfig(): JoinerServiceConfig {
return joinerConfig
}
/**
* Lists inventory items that match the given selector
* @param selector - the selector to filter inventory items by
@@ -75,6 +81,13 @@ export default class InventoryService implements IInventoryService {
context
)
}
async list(
selector: FilterableInventoryItemProps,
config: FindConfig<InventoryItemDTO> = { relations: [], skip: 0, take: 10 },
context: SharedContext = {}
): Promise<InventoryItemDTO[]> {
return await this.inventoryItemService_.list(selector, config, context)
}
/**
* Lists inventory levels that match the given selector