diff --git a/.changeset/proud-spies-march.md b/.changeset/proud-spies-march.md new file mode 100644 index 0000000000..afd6e2729e --- /dev/null +++ b/.changeset/proud-spies-march.md @@ -0,0 +1,5 @@ +--- +"@medusajs/types": patch +--- + +fix(types): add missing retrieveProductOptionValue to module interface diff --git a/packages/core/types/src/product/service.ts b/packages/core/types/src/product/service.ts index d784cdd0db..5993cc142b 100644 --- a/packages/core/types/src/product/service.ts +++ b/packages/core/types/src/product/service.ts @@ -1433,6 +1433,48 @@ export interface IProductModuleService extends IModuleService { sharedContext?: Context ): Promise | 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} 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} 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, + sharedContext?: Context + ): Promise + /** * This method is used to retrieve a paginated list of product option values based on optional filters and configuration. *