chore: update TSDocs for new release changes (#13317)

* chore: update TSDocs for new release changes

* remove .medusa directory
This commit is contained in:
Shahed Nasser
2025-08-28 11:51:24 +03:00
committed by GitHub
parent 6b04fbcc50
commit 1956456cd4
27 changed files with 252 additions and 25 deletions

1
.gitignore vendored
View File

@@ -32,3 +32,4 @@ dist/**
/packages/**/.cache
.cursorignore
**/.medusa

View File

@@ -26,9 +26,21 @@ export interface GetVariantPriceSetsStepInput {
context?: Record<string, unknown>
}
/**
* The details of the variants to get price sets for.
*/
export interface GetVariantPriceSetsStepBulkInput {
/**
* The variants to get price sets for.
*/
data: {
/**
* The ID of the variant to get the price set for.
*/
variantId: string
/**
* The context to use when calculating the price set.
*/
context?: Record<string, unknown>
}[]
}

View File

@@ -16,7 +16,7 @@ export const listShippingOptionsForOrderWorkflowId =
"list-shipping-options-for-order"
/**
* This workflow lists the shipping options of an order. It's executed by the
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store#shipping-options_getshippingoptions).
* [List Shipping Options Store API Route](https://docs.medusajs.com/api/store#orders_getidshippingoptions).
*
* :::note
*
@@ -27,6 +27,8 @@ export const listShippingOptionsForOrderWorkflowId =
*
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around to retrieve the shipping options of an order
* in your custom flows.
*
* @since 2.10.0
*
* @example
* const { result } = await listShippingOptionsForOrderWorkflow(container)
@@ -39,8 +41,7 @@ export const listShippingOptionsForOrderWorkflowId =
* @summary
*
* List a order's shipping options.
*
* :::
*
*/
export const listShippingOptionsForOrderWorkflow = createWorkflow(
listShippingOptionsForOrderWorkflowId,

View File

@@ -26,15 +26,72 @@ export interface RefreshOrderEditAdjustmentsWorkflowInput {
* The order edit to refresh the adjustments for.
*/
order: {
/**
* The ID of the order.
*/
id: string
/**
* The status of the order.
*/
status: OrderStatus
/**
* The 2 character ISO code for the currency.
*
* @example
* "usd"
*/
currency_code: string
/**
* The date the order was canceled at.
*/
canceled_at?: string | Date
/**
* The items in the order.
*/
items: ComputeActionItemLine[]
/**
* The promotions applied to the order.
*/
promotions: PromotionDTO[]
}
}
/**
* This workflow refreshes the adjustments for an order edit. It's used by other workflows, such as
* {@link beginOrderEditOrderWorkflow}.
*
* You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around refreshing adjustments for order edits
* in your custom flows.
*
* @since 2.10.0
*
* @example
* const { result } = await refreshOrderEditAdjustmentsWorkflow(container)
* .run({
* input: {
* order: {
* id: "order_123",
* // Imported from @medusajs/framework/types
* status: OrderStatus.PENDING,
* currency_code: "usd",
* items: [
* {
* id: "item_1",
* quantity: 1,
* subtotal: 10,
* original_total: 10,
* is_discountable: true
* }
* ],
* promotions: [],
* },
* },
* })
*
* @summary
*
* Refreshes adjustments for an order edit.
*/
export const refreshOrderEditAdjustmentsWorkflow = createWorkflow(
refreshOrderEditAdjustmentsWorkflowId,
function (input: WorkflowData<RefreshOrderEditAdjustmentsWorkflowInput>) {

View File

@@ -8,6 +8,13 @@ export type CreateViewConfigurationStepInput = CreateViewConfigurationDTO
export const createViewConfigurationStepId = "create-view-configuration"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const createViewConfigurationStep = createStep(
createViewConfigurationStepId,
async (data: CreateViewConfigurationStepInput, { container }) => {

View File

@@ -9,6 +9,13 @@ export type SetActiveViewConfigurationStepInput = {
export const setActiveViewConfigurationStepId = "set-active-view-configuration"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const setActiveViewConfigurationStep = createStep(
setActiveViewConfigurationStepId,
async (input: SetActiveViewConfigurationStepInput, { container }) => {

View File

@@ -12,6 +12,13 @@ export type UpdateViewConfigurationStepInput = {
export const updateViewConfigurationStepId = "update-view-configuration"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const updateViewConfigurationStep = createStep(
updateViewConfigurationStepId,
async (input: UpdateViewConfigurationStepInput, { container }) => {

View File

@@ -20,6 +20,13 @@ export type CreateViewConfigurationWorkflowInput =
export const createViewConfigurationWorkflowId = "create-view-configuration"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const createViewConfigurationWorkflow = createWorkflow(
createViewConfigurationWorkflowId,
(

View File

@@ -21,6 +21,13 @@ export type UpdateViewConfigurationWorkflowInput = {
export const updateViewConfigurationWorkflowId = "update-view-configuration"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const updateViewConfigurationWorkflow = createWorkflow(
updateViewConfigurationWorkflowId,
(

View File

@@ -2,13 +2,29 @@ import { FulfillmentTypes, IFulfillmentModuleService, } from "@medusajs/framewor
import { Modules } from "@medusajs/framework/utils"
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
/**
* The shipping option types to create.
*/
export type CreateShippingOptionTypesStepInput = FulfillmentTypes.CreateShippingOptionTypeDTO[]
export const createShippingOptionTypesStepId = "create-shipping-option-types"
/**
* This step creates one or more shipping option types.
*
* @since 2.10.0
*
* @example
* const shippingOptionTypes = createShippingOptionTypesStep([
* {
* label: "Standard",
* code: "standard",
* description: "Ship in 2-3 days."
* }
* ])
*/
export const createShippingOptionTypesStep = createStep(
createShippingOptionTypesStepId,
async (data: FulfillmentTypes.CreateShippingOptionTypeDTO[], { container }) => {
async (data: CreateShippingOptionTypesStepInput, { container }) => {
const service = container.resolve<IFulfillmentModuleService>(Modules.FULFILLMENT)
const created = await service.createShippingOptionTypes(data)

View File

@@ -10,6 +10,8 @@ export type DeleteShippingOptionTypesStepInput = string[]
export const deleteShippingOptionTypesStepId = "delete-shipping-option-types"
/**
* This step deletes one or more shipping option types.
*
* @since 2.10.0
*/
export const deleteShippingOptionTypesStep = createStep(
deleteShippingOptionTypesStepId,

View File

@@ -19,6 +19,18 @@ export type UpdateShippingOptionTypesStepInput = {
export const updateShippingOptionTypesStepId = "update-shipping-option-types"
/**
* This step updates shipping option types matching the specified filters.
*
* @since 2.10.0
*
* @example
* const shippingOptionTypes = updateShippingOptionTypesStep({
* selector: {
* id: "sotype_123"
* },
* update: {
* label: "Standard"
* }
* })
*/
export const updateShippingOptionTypesStep = createStep(
updateShippingOptionTypesStepId,

View File

@@ -23,20 +23,22 @@ export type CreateShippingOptionTypesWorkflowInput = {
export const createShippingOptionTypesWorkflowId = "create-shipping-option-types"
/**
* This workflow creates one or more shipping option types. It's used by the
* [Create Shipping Option Type Admin API Route](TODO HERE).
* [Create Shipping Option Type Admin API Route](https://docs.medusajs.com/api/admin#shipping-option-types_postshippingoptiontypes).
*
* This workflow has a hook that allows you to perform custom actions on the created shipping option types. For example, you can pass under `additional_data` custom data that
* allows you to create custom data models linked to the shipping option types.
*
* You can also use this workflow within your own custom workflows, allowing you to wrap custom logic around shipping option type creation.
*
* @since 2.10.0
*
* @example
* const { result } = await createShippingOptionTypesWorkflow(container)
* .run({
* input: {
* shipping_option_types: [
* {
* label: "Standard ",
* label: "Standard",
* code: "standard",
* description: "Ship in 2-3 days."
* }

View File

@@ -45,12 +45,14 @@ export const deleteShippingOptionTypesWorkflowId =
"delete-shipping-option-types"
/**
* This workflow deletes one or more shipping-option types. It's used by the
* [Delete Shipping Option Types Admin API Route](TODO HERE).
* [Delete Shipping Option Types Admin API Route](https://docs.medusajs.com/api/admin#shipping-option-types_deleteshippingoptiontypesid).
*
* This workflow has a hook that allows you to perform custom actions after the shipping-option types are deleted. For example,
* you can delete custom records linked to the shipping-option types.
*
* You can also use this workflow within your own custom workflows, allowing you to wrap custom logic around shipping option type deletion.
*
* @since 2.10.0
*
* @example
* const { result } = await deleteShippingOptionTypesWorkflow(container)
@@ -62,7 +64,7 @@ export const deleteShippingOptionTypesWorkflowId =
*
* @summary
*
* Delete one or more shippingOption types.
* Delete one or more shipping option types.
*
* @property hooks.shippingOptionTypesDeleted - This hook is executed after the types are deleted. You can consume this hook to perform custom actions on the deleted types.
*/

View File

@@ -13,7 +13,7 @@ import { updateShippingOptionTypesStep } from "../steps"
/**
* The data to update one or more shipping option types, along with custom data that's passed to the workflow's hooks.
*/
type UpdateShippingOptionTypesWorkflowInput = {
export type UpdateShippingOptionTypesWorkflowInput = {
/**
* The filters to select the shipping option types to update.
*/
@@ -27,22 +27,24 @@ type UpdateShippingOptionTypesWorkflowInput = {
export const updateShippingOptionTypesWorkflowId = "update-shipping-option-types"
/**
* This workflow updates one or more shipping option types. It's used by the
* [Update Shipping Option Type Admin API Route](TODO HERE).
* [Update Shipping Option Type Admin API Route](https://docs.medusajs.com/api/admin#shipping-option-types_postshippingoptiontypesid).
*
* This workflow has a hook that allows you to perform custom actions on the updated shipping option types. For example, you can pass under `additional_data` custom data that
* allows you to update custom data models linked to the shipping option types.
*
* You can also use this workflow within your own custom workflows, allowing you to wrap custom logic around shipping option type updates.
*
* @since 2.10.0
*
* @example
* const { result } = await updateShippingOptionTypesWorkflow(container)
* .run({
* input: {
* selector: {
* id: "ptyp_123"
* id: "sotype_123"
* },
* update: {
* value: "clothing"
* label: "Standard"
* },
* additional_data: {
* erp_id: "123"

View File

@@ -399,7 +399,7 @@ export class Promotion {
*
* @param ruleType - The type of rules to retrieve the attributes for. Can be `rules`, `buy-rules`, or `target-rules`.
* @param promotionType - The type of promotion to retrieve the attributes for. It can be `standard` or `buyget`.
* @param applicationMethodTargetType - The type of application method to retrieve the attributes for. It can be `order`, `items` or `shipping_methods`.
* @param applicationMethodTargetType - The type of application method to retrieve the attributes for. It can be `order`, `items` (default) or `shipping_methods`.
* @param headers - Headers to pass in the request.
* @returns The list of rule attributes.
*

View File

@@ -16,7 +16,7 @@ export class ShippingOptionType {
/**
* This method creates a shipping option type. It sends a request to the
* [Create Shipping Option Type](TODO HERE)
* [Create Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types_postshippingoptiontypes)
* API route.
*
* @param body - The shipping option type's details.
@@ -52,7 +52,7 @@ export class ShippingOptionType {
/**
* This method updates a shipping option type. It sends a request to the
* [Update Shipping Option Type](TODO HERE)
* [Update Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types_postshippingoptiontypesid)
* API route.
*
* @param id - The shipping option type's ID.
@@ -88,7 +88,7 @@ export class ShippingOptionType {
/**
* This method retrieves a paginated list of shipping option types. It sends a request to the
* [List Shipping Option Types](TODO HERE) API route.
* [List Shipping Option Types](https://docs.medusajs.com/api/admin#shipping-option-types_getshippingoptiontypes) API route.
*
* @param query - Filters and pagination configurations.
* @param headers - Headers to pass in the request.
@@ -147,7 +147,7 @@ export class ShippingOptionType {
/**
* This method retrieves a shipping option type by its ID. It sends a request to the
* [Get Shipping Option Type](TODO HERE)
* [Get Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types_getshippingoptiontypesid)
* API route.
*
* @param id - The shipping option type's ID.
@@ -194,7 +194,7 @@ export class ShippingOptionType {
/**
* This method deletes a shipping option type. It sends a request to the
* [Delete Shipping Option Type](TODO HERE)
* [Delete Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types_deleteshippingoptiontypesid)
* API route.
*
* @param id - The shipping option type's ID.

View File

@@ -50,11 +50,4 @@ export interface AdminOrderItemsFilters extends FindParams {
export interface AdminOrderChangesFilters extends BaseOrderChangesFilters {}
export interface AdminOrderItemsFilters extends FindParams {
id?: string[] | string
item_id?: string[] | string
order_id?: string[] | string
version?: number[] | number
}
export interface AdminGetOrderShippingOptionList {}

View File

@@ -63,13 +63,28 @@ export interface AdminGetPromotionsParams
}
export interface AdminGetPromotionRuleParams {
/**
* The type of promotion to retrieve the attributes for.
*/
promotion_type?: PromotionTypeValues
/**
* The type of application method to retrieve the attributes for.
*/
application_method_type?: ApplicationMethodTypeValues
/**
* The type of application method to retrieve the attributes for.
*/
application_method_target_type?: ApplicationMethodTargetTypeValues
}
export interface AdminGetPromotionRuleTypeParams extends SelectParams {
/**
* The type of promotion to retrieve the attributes for.
*/
promotion_type?: PromotionTypeValues
/**
* The type of application method to retrieve the attributes for.
*/
application_method_type?: ApplicationMethodTypeValues
}

View File

@@ -3,6 +3,9 @@ import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
export const AUTHENTICATE = false
/**
* @since 2.10.0
*/
export const GET = async (
req: MedusaRequest,
res: MedusaResponse<{ feature_flags: Record<string, boolean> }>

View File

@@ -2,6 +2,9 @@ import { listShippingOptionsForOrderWorkflow } from "@medusajs/core-flows"
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
import { AdminShippingOption, HttpTypes } from "@medusajs/framework/types"
/**
* @since 2.10.0
*/
export const GET = async (
req: MedusaRequest<{}, HttpTypes.AdminGetOrderShippingOptionList>,
res: MedusaResponse<{ shipping_options: AdminShippingOption[] }>

View File

@@ -15,6 +15,9 @@ import {
import { HttpTypes } from "@medusajs/framework/types"
import { MedusaError } from "@medusajs/framework/utils"
/**
* @since 2.10.0
*/
export const GET = async (
req: AuthenticatedMedusaRequest<AdminGetShippingOptionTypeParamsType>,
res: MedusaResponse<HttpTypes.AdminShippingOptionTypeResponse>
@@ -28,6 +31,9 @@ export const GET = async (
res.status(200).json({ shipping_option_type: shippingOptionType })
}
/**
* @since 2.10.0
*/
export const POST = async (
req: AuthenticatedMedusaRequest<AdminUpdateShippingOptionTypeType>,
res: MedusaResponse<HttpTypes.AdminShippingOptionTypeResponse>
@@ -61,6 +67,9 @@ export const POST = async (
res.status(200).json({ shipping_option_type: shippingOptionType })
}
/**
* @since 2.10.0
*/
export const DELETE = async (
req: AuthenticatedMedusaRequest,
res: MedusaResponse<HttpTypes.AdminShippingOptionTypeDeleteResponse>

View File

@@ -8,6 +8,9 @@ import { createShippingOptionTypesWorkflow } from "@medusajs/core-flows"
import { refetchShippingOptionType } from "./helpers"
import { HttpTypes } from "@medusajs/framework/types"
/**
* @since 2.10.0
*/
export const GET = async (
req: AuthenticatedMedusaRequest<HttpTypes.AdminShippingOptionTypeListParams>,
res: MedusaResponse<HttpTypes.AdminShippingOptionTypeListResponse>
@@ -29,6 +32,9 @@ export const GET = async (
})
}
/**
* @since 2.10.0
*/
export const POST = async (
req: AuthenticatedMedusaRequest<HttpTypes.AdminCreateShippingOptionType>,
res: MedusaResponse<HttpTypes.AdminShippingOptionTypeResponse>

View File

@@ -9,6 +9,13 @@ import {
import { generateEntityColumns } from "./helpers"
import { ENTITY_MAPPINGS } from "./entity-mappings"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const GET = async (
req: AuthenticatedMedusaRequest,
res: MedusaResponse<HttpTypes.AdminViewsEntityColumnsResponse>

View File

@@ -7,6 +7,13 @@ import { HttpTypes } from "@medusajs/framework/types"
import { MedusaError, Modules } from "@medusajs/framework/utils"
import { updateViewConfigurationWorkflow } from "@medusajs/core-flows"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const GET = async (
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetViewConfigurationParams>,
res: MedusaResponse<HttpTypes.AdminViewConfigurationResponse>
@@ -32,6 +39,13 @@ export const GET = async (
res.json({ view_configuration: viewConfiguration })
}
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const POST = async (
req: AuthenticatedMedusaRequest<AdminUpdateViewConfigurationType>,
res: MedusaResponse<HttpTypes.AdminViewConfigurationResponse>
@@ -63,6 +77,13 @@ export const POST = async (
res.json({ view_configuration: result })
}
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const DELETE = async (
req: AuthenticatedMedusaRequest,
res: MedusaResponse<HttpTypes.AdminViewConfigurationDeleteResponse>

View File

@@ -9,6 +9,13 @@ import {
import { HttpTypes } from "@medusajs/framework/types"
import { Modules } from "@medusajs/framework/utils"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const GET = async (
req: AuthenticatedMedusaRequest<AdminGetActiveViewConfigurationParamsType>,
res: MedusaResponse<
@@ -54,6 +61,13 @@ export const GET = async (
}
}
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const POST = async (
req: AuthenticatedMedusaRequest<AdminSetActiveViewConfigurationType>,
res: MedusaResponse<{ success: boolean }>

View File

@@ -7,6 +7,13 @@ import { HttpTypes } from "@medusajs/framework/types"
import { MedusaError, Modules } from "@medusajs/framework/utils"
import { createViewConfigurationWorkflow } from "@medusajs/core-flows"
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const GET = async (
req: AuthenticatedMedusaRequest<HttpTypes.AdminGetViewConfigurationsParams>,
res: MedusaResponse<HttpTypes.AdminViewConfigurationListResponse>
@@ -33,6 +40,13 @@ export const GET = async (
})
}
/**
* @ignore
*
* @privateRemarks
* Remove the `ignore` tag once the feature is ready. Otherwise,
* it will be generated in the documentation.
*/
export const POST = async (
req: AuthenticatedMedusaRequest<AdminCreateViewConfigurationType>,
res: MedusaResponse<HttpTypes.AdminViewConfigurationResponse>