From 0fd9f27ca5ae1297bfeab057339d7a4784223734 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Fri, 31 Oct 2025 16:17:19 +0200 Subject: [PATCH] chore: add missing since and featureFlag tags (#13926) --- packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml | 3 +++ .../core-flows/src/product/steps/add-image-to-variants.ts | 2 ++ .../core-flows/src/product/steps/add-images-to-variant.ts | 2 ++ .../src/product/steps/remove-image-from-variants.ts | 2 ++ .../src/product/steps/remove-images-from-variant.ts | 2 ++ .../src/product/workflows/batch-image-variants.ts | 2 ++ .../src/product/workflows/batch-variant-images.ts | 2 ++ packages/core/js-sdk/src/admin/product.ts | 4 ++++ packages/medusa/src/api/admin/index/details/route.ts | 5 +++-- packages/medusa/src/api/admin/index/sync/route.ts | 4 ++++ .../products/[id]/images/[image_id]/variants/batch/route.ts | 3 +++ .../[id]/variants/[variant_id]/images/batch/route.ts | 3 +++ .../medusa/src/api/store/product-variants/[id]/route.ts | 3 +++ packages/medusa/src/api/store/product-variants/route.ts | 3 +++ packages/modules/product/src/models/product-image.ts | 3 +++ .../product/src/models/product-variant-product-image.ts | 3 +++ packages/modules/product/src/models/product-variant.ts | 6 ++++++ 17 files changed, 50 insertions(+), 2 deletions(-) diff --git a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml index 52b4a059dd..6bb1a88e3a 100644 --- a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml +++ b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml @@ -149,6 +149,9 @@ decorators: - StoreGiftCardInvitation StoreTransactionGroup: - StoreStoreCreditAccount + AdminProductImage: + - AdminProduct + - AdminProductVariant theme: openapi: theme: diff --git a/packages/core/core-flows/src/product/steps/add-image-to-variants.ts b/packages/core/core-flows/src/product/steps/add-image-to-variants.ts index b7d9f403e9..9da9388bdd 100644 --- a/packages/core/core-flows/src/product/steps/add-image-to-variants.ts +++ b/packages/core/core-flows/src/product/steps/add-image-to-variants.ts @@ -6,6 +6,8 @@ export const addImageToVariantsStepId = "add-image-to-variants" /** * This step adds an image to one or more product variants. + * + * @since 2.11.2 * * @example * const data = addImageToVariantsStep({ diff --git a/packages/core/core-flows/src/product/steps/add-images-to-variant.ts b/packages/core/core-flows/src/product/steps/add-images-to-variant.ts index d57e92213b..37b7f362e7 100644 --- a/packages/core/core-flows/src/product/steps/add-images-to-variant.ts +++ b/packages/core/core-flows/src/product/steps/add-images-to-variant.ts @@ -6,6 +6,8 @@ export const addImagesToVariantStepId = "add-images-to-variant" /** * This step adds one or more images to a product variant. + * + * @since 2.11.2 * * @example * const data = addImagesToVariantStep({ diff --git a/packages/core/core-flows/src/product/steps/remove-image-from-variants.ts b/packages/core/core-flows/src/product/steps/remove-image-from-variants.ts index ba027ab468..7e738a5ee1 100644 --- a/packages/core/core-flows/src/product/steps/remove-image-from-variants.ts +++ b/packages/core/core-flows/src/product/steps/remove-image-from-variants.ts @@ -7,6 +7,8 @@ export const removeImageFromVariantsStepId = "remove-image-from-variants" /** * This step removes an image from one or more product variants. * + * @since 2.11.2 + * * @example * const data = removeImageFromVariantsStep({ * image_id: "img_123", diff --git a/packages/core/core-flows/src/product/steps/remove-images-from-variant.ts b/packages/core/core-flows/src/product/steps/remove-images-from-variant.ts index 66a027b890..a0ba5dfbef 100644 --- a/packages/core/core-flows/src/product/steps/remove-images-from-variant.ts +++ b/packages/core/core-flows/src/product/steps/remove-images-from-variant.ts @@ -7,6 +7,8 @@ export const removeImagesFromVariantStepId = "remove-images-from-variant" /** * This step removes one or more images from a product variant. * + * @since 2.11.2 + * * @example * const data = removeImagesFromVariantStep({ * variant_id: "variant_123", diff --git a/packages/core/core-flows/src/product/workflows/batch-image-variants.ts b/packages/core/core-flows/src/product/workflows/batch-image-variants.ts index 408de3c931..c9d4f4a94b 100644 --- a/packages/core/core-flows/src/product/workflows/batch-image-variants.ts +++ b/packages/core/core-flows/src/product/workflows/batch-image-variants.ts @@ -55,6 +55,8 @@ export const batchImageVariantsWorkflowId = "batch-image-variants" * You can use this workflow within your own customizations or custom workflows to manage image-variant associations in bulk. * This is also useful when writing a [seed script](https://docs.medusajs.com/learn/fundamentals/custom-cli-scripts/seed-data) or a custom import script. * + * @since 2.11.2 + * * @example * const { result } = await batchImageVariantsWorkflow(container) * .run({ diff --git a/packages/core/core-flows/src/product/workflows/batch-variant-images.ts b/packages/core/core-flows/src/product/workflows/batch-variant-images.ts index 0432fe1338..250d47f345 100644 --- a/packages/core/core-flows/src/product/workflows/batch-variant-images.ts +++ b/packages/core/core-flows/src/product/workflows/batch-variant-images.ts @@ -55,6 +55,8 @@ export const batchVariantImagesWorkflowId = "batch-variant-images" * You can use this workflow within your own customizations or custom workflows to manage variant-image associations in bulk. * This is also useful when writing a [seed script](https://docs.medusajs.com/learn/fundamentals/custom-cli-scripts/seed-data) or a custom import script. * + * @since 2.11.2 + * * @example * const { result } = await batchVariantImagesWorkflow(container) * .run({ diff --git a/packages/core/js-sdk/src/admin/product.ts b/packages/core/js-sdk/src/admin/product.ts index e71913af92..c9b9792e09 100644 --- a/packages/core/js-sdk/src/admin/product.ts +++ b/packages/core/js-sdk/src/admin/product.ts @@ -1080,6 +1080,8 @@ export class Product { * This method manages image-variant associations for a specific image. It sends a request to the * [Batch Image Variants](https://docs.medusajs.com/api/admin#products_postproductsidimagesimage_idvariantsbatch) * API route. + * + * @since 2.11.2 * * @param productId - The product's ID. * @param imageId - The image's ID. @@ -1116,6 +1118,8 @@ export class Product { * This method manages variant-image associations for a specific variant. It sends a request to the * [Batch Variant Images](https://docs.medusajs.com/api/admin#products_postproductsidvariantsvariant_idimagesbatch) * API route. + * + * @since 2.11.2 * * @param productId - The product's ID. * @param variantId - The variant's ID. diff --git a/packages/medusa/src/api/admin/index/details/route.ts b/packages/medusa/src/api/admin/index/details/route.ts index fed374308c..d154ad11db 100644 --- a/packages/medusa/src/api/admin/index/details/route.ts +++ b/packages/medusa/src/api/admin/index/details/route.ts @@ -4,8 +4,9 @@ import { Modules } from "@medusajs/framework/utils" /** * Get the index information for all entities that are indexed and their sync state - * @param req - * @param res + * + * @since 2.11.2 + * @featureFlag index */ export const GET = async ( req: AuthenticatedMedusaRequest, diff --git a/packages/medusa/src/api/admin/index/sync/route.ts b/packages/medusa/src/api/admin/index/sync/route.ts index 823a476cd5..e52b667036 100644 --- a/packages/medusa/src/api/admin/index/sync/route.ts +++ b/packages/medusa/src/api/admin/index/sync/route.ts @@ -2,6 +2,10 @@ import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework" import { HttpTypes } from "@medusajs/framework/types" import { Modules } from "@medusajs/framework/utils" +/** + * @since 2.11.2 + * @featureFlag index + */ export const POST = async ( req: AuthenticatedMedusaRequest, res: MedusaResponse diff --git a/packages/medusa/src/api/admin/products/[id]/images/[image_id]/variants/batch/route.ts b/packages/medusa/src/api/admin/products/[id]/images/[image_id]/variants/batch/route.ts index 6a2942369b..700350f086 100644 --- a/packages/medusa/src/api/admin/products/[id]/images/[image_id]/variants/batch/route.ts +++ b/packages/medusa/src/api/admin/products/[id]/images/[image_id]/variants/batch/route.ts @@ -5,6 +5,9 @@ import { } from "@medusajs/framework/http" import { HttpTypes } from "@medusajs/framework/types" +/** + * @since 2.11.2 + */ export const POST = async ( req: AuthenticatedMedusaRequest, res: MedusaResponse diff --git a/packages/medusa/src/api/admin/products/[id]/variants/[variant_id]/images/batch/route.ts b/packages/medusa/src/api/admin/products/[id]/variants/[variant_id]/images/batch/route.ts index 7697f4b06b..434322cc26 100644 --- a/packages/medusa/src/api/admin/products/[id]/variants/[variant_id]/images/batch/route.ts +++ b/packages/medusa/src/api/admin/products/[id]/variants/[variant_id]/images/batch/route.ts @@ -5,6 +5,9 @@ import { } from "@medusajs/framework/http" import { HttpTypes } from "@medusajs/framework/types" +/** + * @since 2.11.2 + */ export const POST = async ( req: AuthenticatedMedusaRequest, res: MedusaResponse diff --git a/packages/medusa/src/api/store/product-variants/[id]/route.ts b/packages/medusa/src/api/store/product-variants/[id]/route.ts index 21188801d6..95d0238588 100644 --- a/packages/medusa/src/api/store/product-variants/[id]/route.ts +++ b/packages/medusa/src/api/store/product-variants/[id]/route.ts @@ -17,6 +17,9 @@ type StoreVariantRetrieveRequest = StoreRequestWithContext & AuthenticatedMedusaRequest +/** + * @since 2.11.2 + */ export const GET = async ( req: StoreVariantRetrieveRequest, res: MedusaResponse diff --git a/packages/medusa/src/api/store/product-variants/route.ts b/packages/medusa/src/api/store/product-variants/route.ts index f63a520131..60510fc5a4 100644 --- a/packages/medusa/src/api/store/product-variants/route.ts +++ b/packages/medusa/src/api/store/product-variants/route.ts @@ -15,6 +15,9 @@ type StoreVariantListRequest = StoreRequestWithContext & AuthenticatedMedusaRequest +/** + * @since 2.11.2 + */ export const GET = async ( req: StoreVariantListRequest, res: MedusaResponse diff --git a/packages/modules/product/src/models/product-image.ts b/packages/modules/product/src/models/product-image.ts index 6ff74f30ed..733cac15a0 100644 --- a/packages/modules/product/src/models/product-image.ts +++ b/packages/modules/product/src/models/product-image.ts @@ -14,6 +14,9 @@ const ProductImage = model product: model.belongsTo(() => Product, { mappedBy: "images", }), + /** + * @since 2.11.2 + */ variants: model.manyToMany(() => ProductVariant, { mappedBy: "images", pivotEntity: () => ProductVariantProductImage, diff --git a/packages/modules/product/src/models/product-variant-product-image.ts b/packages/modules/product/src/models/product-variant-product-image.ts index ffbc1117e1..5135f7fb89 100644 --- a/packages/modules/product/src/models/product-variant-product-image.ts +++ b/packages/modules/product/src/models/product-variant-product-image.ts @@ -2,6 +2,9 @@ import { model } from "@medusajs/framework/utils" import ProductVariant from "./product-variant" import ProductImage from "./product-image" +/** + * @since 2.11.2 + */ const ProductVariantProductImage = model.define("ProductVariantProductImage", { id: model.id({ prefix: "pvpi" }).primaryKey(), variant: model.belongsTo(() => ProductVariant, { diff --git a/packages/modules/product/src/models/product-variant.ts b/packages/modules/product/src/models/product-variant.ts index 1dacbf7039..75bbb89361 100644 --- a/packages/modules/product/src/models/product-variant.ts +++ b/packages/modules/product/src/models/product-variant.ts @@ -22,6 +22,9 @@ const ProductVariant = model width: model.number().nullable(), metadata: model.json().nullable(), variant_rank: model.number().default(0).nullable(), + /** + * @since 2.11.2 + */ thumbnail: model.text().nullable(), product: model .belongsTo(() => Product, { @@ -29,6 +32,9 @@ const ProductVariant = model }) .searchable() .nullable(), + /** + * @since 2.11.2 + */ images: model.manyToMany(() => ProductImage, { mappedBy: "variants", pivotEntity: () => ProductVariantProductImage,