Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/proud-spies-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/types": patch
---

fix(types): add missing retrieveProductOptionValue to module interface
42 changes: 42 additions & 0 deletions packages/core/types/src/product/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,48 @@ export interface IProductModuleService extends IModuleService {
sharedContext?: Context
): Promise<Record<string, string[]> | void>

/**
* This method is used to retrieve a product option value by its ID.
*
* @param {string} optionValueId - The ID of the product option value to retrieve.
* @param {FindConfig<ProductOptionValueDTO>} config -
* The configurations determining how the product option value is retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a product option value.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<ProductOptionValueDTO>} The retrieved product option value.
*
* @example
* A simple example that retrieves a product option value by its ID:
*
* ```ts
* const optionValue =
* await productModuleService.retrieveProductOptionValue("optval_123")
* ```
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const optionValue = await productModuleService.retrieveProductOptionValue(
* "optval_123",
* {
* relations: ["option"],
* }
* )
* ```
*/
retrieveProductOptionValue(
optionValueId: string,
config?: FindConfig<ProductOptionValueDTO>,
sharedContext?: Context
): Promise<ProductOptionValueDTO>

/**
* This method is used to retrieve a paginated list of product option values based on optional filters and configuration.
*
Expand Down
Loading