From 6634765cedc68f605f005766845350d611db142c Mon Sep 17 00:00:00 2001 From: SteelRazor47 Date: Tue, 9 Sep 2025 19:43:53 +0200 Subject: [PATCH] fix(types): add missing retrieveProductOptionValue to module interface (#12313) * fix(types): add missing retrieveProductOptionValue to module interface * changeset * Update tsdoc --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> --- .changeset/proud-spies-march.md | 5 +++ packages/core/types/src/product/service.ts | 42 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .changeset/proud-spies-march.md 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. *