Skip to content

Commit

Permalink
chore(docs): Generated References (#5516)
Browse files Browse the repository at this point in the history
Generated the following references:
- `js-client`
- `pricing`
- `services`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 2, 2023
1 parent 80fe362 commit aa2bb7a
Show file tree
Hide file tree
Showing 271 changed files with 38,173 additions and 9,836 deletions.
8 changes: 8 additions & 0 deletions packages/types/src/pricing/common/price-set-money-amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ export interface CreatePriceSetMoneyAmountDTO {
money_amount?: MoneyAmountDTO | string
}

/**
* @interface
*
* Filters to apply on price set money amounts.
*
* @prop id - The IDs to filter the price set money amounts by.
* @prop price_set_id - The IDs to filter the price set money amount's associated price set.
*/
export interface FilterablePriceSetMoneyAmountProps
extends BaseFilterable<FilterablePriceSetMoneyAmountProps> {
id?: string[]
Expand Down
204 changes: 203 additions & 1 deletion packages/types/src/pricing/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2200,13 +2200,215 @@ export interface IPricingModuleService {
sharedContext?: Context
): Promise<[PriceSetMoneyAmountRulesDTO[], number]>


/**
* This method is used to retrieve a paginated list of price set money amounts based on optional filters and configuration.
*
* @param {FilterablePriceSetMoneyAmountProps} filters - The filters to apply on the retrieved price set money amounts.
* @param {FindConfig<PriceSetMoneyAmountDTO>} config -
* The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set money amount.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<PriceSetMoneyAmountDTO[]>} The list of price set money amounts.
*
* @example
*
* To retrieve a list of price set money amounts using their IDs:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string) {
* const pricingService = await initializePricingModule()
*
* const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({
* id: [id]
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* To specify relations that should be retrieved within the price set money amounts:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string) {
* const pricingService = await initializePricingModule()
*
* const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({
* id: [id]
* }, {
* relations: ["price_rules"]
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) {
* const pricingService = await initializePricingModule()
*
* const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({
* id: [id]
* }, {
* relations: ["price_rules"],
* skip,
* take
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) {
* const pricingService = await initializePricingModule()
*
* const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({
* $and: [
* {
* id: ids
* },
* {
* title: titles
* }
* ]
* }, {
* relations: ["price_rules"],
* skip,
* take
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*/
listPriceSetMoneyAmounts(
filters?: FilterablePriceSetMoneyAmountProps,
config?: FindConfig<PriceSetMoneyAmountDTO>,
sharedContext?: Context
): Promise<PriceSetMoneyAmountDTO[]>

/**
* This method is used to retrieve a paginated list of price set money amounts along with the total count of
* available price set money amounts satisfying the provided filters.
*
* @param {FilterablePriceSetMoneyAmountProps} filters - The filters to apply on the retrieved price set money amounts.
* @param {FindConfig<PriceSetMoneyAmountDTO>} config -
* The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the
* attributes or relations associated with a price set money amount.
* @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
* @returns {Promise<[PriceSetMoneyAmountDTO[], number]>} The list of price set money amounts and their total count.
*
* @example
*
* To retrieve a list of price set money amounts using their IDs:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string) {
* const pricingService = await initializePricingModule()
*
* const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({
* id: [id]
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* To specify relations that should be retrieved within the price set money amounts:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string) {
* const pricingService = await initializePricingModule()
*
* const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({
* id: [id]
* }, {
* relations: ["price_rules"],
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) {
* const pricingService = await initializePricingModule()
*
* const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({
* id: [id]
* }, {
* relations: ["price_rules"],
* skip,
* take
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*
* You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example:
*
* ```ts
* import {
* initialize as initializePricingModule,
* } from "@medusajs/pricing"
*
* async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) {
* const pricingService = await initializePricingModule()
*
* const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({
* $and: [
* {
* id: ids
* },
* {
* title: titles
* }
* ]
* }, {
* relations: ["price_rules"],
* skip,
* take
* })
*
* // do something with the price set money amounts or return them
* }
* ```
*/
listAndCountPriceSetMoneyAmounts(
filters?: FilterablePriceSetMoneyAmountProps,
config?: FindConfig<PriceSetMoneyAmountDTO>,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
displayed_sidebar: jsClientSidebar
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# CreateCartWorkflowInputDTO

[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx).CreateCartWorkflowInputDTO

## Properties

<ParameterTypes parameters={[
{
"name": "billing_address",
"type": "[`AddressDTO`](../../internal/modules/admin_discounts.internal.internal-1.mdx#addressdto)",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "billing_address_id",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "context",
"type": "`object`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "country_code",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "customer_id",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "email",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "items",
"type": "[`CreateLineItemInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx)[]",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "region_id",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "sales_channel_id",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "shipping_address",
"type": "[`AddressDTO`](../../internal/modules/admin_discounts.internal.internal-1.mdx#addressdto)",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
},
{
"name": "shipping_address_id",
"type": "`string`",
"description": "",
"optional": true,
"defaultValue": "",
"children": []
}
]} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
displayed_sidebar: jsClientSidebar
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# CreateLineItemInputDTO

[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx).CreateLineItemInputDTO

## Properties

<ParameterTypes parameters={[
{
"name": "quantity",
"type": "`number`",
"description": "",
"optional": false,
"defaultValue": "",
"children": []
},
{
"name": "variant_id",
"type": "`string`",
"description": "",
"optional": false,
"defaultValue": "",
"children": []
}
]} />
Loading

3 comments on commit aa2bb7a

@vercel
Copy link

@vercel vercel bot commented on aa2bb7a Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-ui – ./www/apps/ui

docs-ui.vercel.app
docs-ui-medusajs.vercel.app
docs-ui-git-develop-medusajs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on aa2bb7a Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api-reference – ./www/apps/api-reference

api-reference-medusajs.vercel.app
api-reference-git-develop-medusajs.vercel.app
api-reference-delta.vercel.app
docs.medusajs.com

@vercel
Copy link

@vercel vercel bot commented on aa2bb7a Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

medusa-docs – ./www/apps/docs

medusa-docs-git-develop-medusajs.vercel.app
medusa-docs-medusajs.vercel.app
medusa-docs.vercel.app

Please sign in to comment.