docs: show the source code link in order models reference (#13398)
This commit is contained in:
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderChange data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderChange**: `any` = `_OrderChange`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/order-change.ts#L85" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderChangeAction data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderChangeAction**: `any` = `_OrderChangeAction`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/order-change-action.ts#L72" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderClaim data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderClaim**: `any` = `_OrderClaim`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/claim.ts#L84" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderClaimItem data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderClaimItem**: `any` = `_OrderClaimItem`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/claim-item.ts#L51" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderClaimItemImage data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderClaimItemImage**: `any` = `_OrderClaimItemImage`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/claim-item-image.ts#L31" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderExchange data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderExchange**: `any` = `_OrderExchange`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/exchange.ts#L78" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderExchangeItem data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderExchangeItem**: `any` = `_OrderExchangeItem`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/exchange-item.ts#L39" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderLineItem data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderLineItem**: `any` = `_OrderLineItem`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/line-item.ts#L75" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderLineItemAdjustment data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderLineItemAdjustment**: `any` = `_OrderLineItemAdjustment`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/line-item-adjustment.ts#L25" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderLineItemTaxLine data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderLineItemTaxLine**: `any` = `_OrderLineItemTaxLine`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/line-item-tax-line.ts#L24" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderShipping data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderShipping**: `any` = `_OrderShipping`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/order-shipping-method.ts#L83" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderShippingMethod data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderShippingMethod**: `any` = `_OrderShippingMethod`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/shipping-method.ts#L40" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderShippingMethodAdjustment data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderShippingMethodAdjustment**: `any` = `_OrderShippingMethodAdjustment`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/shipping-method-adjustment.ts#L33" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderShippingMethodTaxLine data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderShippingMethodTaxLine**: `any` = `_OrderShippingMethodTaxLine`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/shipping-method-tax-line.ts#L33" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the OrderTransaction data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **OrderTransaction**: `any`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/transaction.ts#L89" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the Return data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **Return**: `any` = `_Return`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/return.ts#L90" />
|
||||
|
||||
@@ -10,4 +10,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ReturnItem data model. It belongs to the Order Module.
|
||||
|
||||
`Const` **ReturnItem**: `any` = `_ReturnItem`
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/9069e9279ee230384cf09c553f60ab6caa0e7012/packages/modules/order/src/models/return-item.ts#L59" />
|
||||
|
||||
@@ -192,6 +192,7 @@ You should only use the methods in this reference when implementing complex cust
|
||||
Functions: false,
|
||||
Methods: false,
|
||||
},
|
||||
internalType: "model-ref",
|
||||
},
|
||||
[`^modules/${snakeCaseModuleName}_models`]: {
|
||||
reflectionDescription: `This documentation provides a reference to the data models in the ${titleModuleName} Module`,
|
||||
@@ -207,6 +208,7 @@ You should only use the methods in this reference when implementing complex cust
|
||||
Variables: "Data Models",
|
||||
}
|
||||
: {},
|
||||
internalType: "model-ref",
|
||||
},
|
||||
} as FormattingOptionsType)
|
||||
}, {} as FormattingOptionsType),
|
||||
|
||||
@@ -180,7 +180,7 @@ export function registerHelpers(theme: MarkdownTheme) {
|
||||
shouldExpandPropertiesHelper(theme)
|
||||
shouldExpandDeclarationChildrenHelper(theme)
|
||||
startSectionsHelper(theme)
|
||||
ifDmlEntityHelper()
|
||||
ifDmlEntityHelper(theme)
|
||||
dmlPropertiesHelper()
|
||||
ifWorkflowStepHelper()
|
||||
stepInputHelper(theme)
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import Handlebars from "handlebars"
|
||||
import { DeclarationReflection } from "typedoc"
|
||||
import { isDmlEntity } from "utils"
|
||||
import { MarkdownTheme } from "../../theme.js"
|
||||
|
||||
export default function () {
|
||||
export default function (theme: MarkdownTheme) {
|
||||
Handlebars.registerHelper(
|
||||
"ifDmlEntity",
|
||||
function (this: DeclarationReflection, options: Handlebars.HelperOptions) {
|
||||
return isDmlEntity(this) ? options.fn(this) : options.inverse(this)
|
||||
const { internalType } = theme.getFormattingOptionsForLocation()
|
||||
return isDmlEntity(this) || internalType === "model-ref"
|
||||
? options.fn(this)
|
||||
: options.inverse(this)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -115,10 +115,7 @@ export default function (theme: MarkdownTheme) {
|
||||
str += `Handlers consuming this hook accept the following input.\n\n`
|
||||
|
||||
str += Handlebars.helpers.parameterComponent.call(
|
||||
cleanUpHookInput(
|
||||
signatures[0].parameters,
|
||||
this.name === "addToCartWorkflow" && hook.name === "validate"
|
||||
),
|
||||
cleanUpHookInput(signatures[0].parameters),
|
||||
{
|
||||
hash: {
|
||||
sectionTitle: hook.name,
|
||||
|
||||
1
www/utils/packages/types/lib/index.d.ts
vendored
1
www/utils/packages/types/lib/index.d.ts
vendored
@@ -103,6 +103,7 @@ export type FormattingOptionType = {
|
||||
workflowDiagramComponent?: string
|
||||
isEventsReference?: boolean
|
||||
sortMembers?: boolean
|
||||
internalType?: string
|
||||
}
|
||||
|
||||
export type AllowedProjectDocumentsOption = {
|
||||
|
||||
@@ -41,15 +41,11 @@ export function getHookChildren(
|
||||
}
|
||||
|
||||
export function cleanUpHookInput(
|
||||
parameters: ParameterReflection[],
|
||||
debug = false
|
||||
parameters: ParameterReflection[]
|
||||
): (ParameterReflection | DeclarationReflection)[] {
|
||||
const hasInvokeParameter = parameters.some(
|
||||
(parameter) => parameter.name === "invoke"
|
||||
)
|
||||
if (debug) {
|
||||
console.log(parameters, hasInvokeParameter)
|
||||
}
|
||||
if (hasInvokeParameter) {
|
||||
return getHookInputFromInvoke(parameters)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user