docs: [10/n] generate core-flows reference (#8791)

This commit is contained in:
Shahed Nasser
2024-08-27 12:22:59 +03:00
committed by GitHub
parent 842c26cb46
commit c4dd82e814
52 changed files with 1888 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
---
slug: /references/medusa-workflows/batchLinkProductsToCategoryWorkflow
sidebar_label: batchLinkProductsToCategoryWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchLinkProductsToCategoryWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `batchLinkProductsToCategoryWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates links between product and category records.
## Input
<TypeList types={[{"name":"BatchUpdateProductsOnCategoryWorkflowInput","type":"[BatchUpdateProductsOnCategoryWorkflowInput](../../../../../types/WorkflowTypes/ProductCategoryWorkflow/interfaces/types.WorkflowTypes.ProductCategoryWorkflow.BatchUpdateProductsOnCategoryWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCategoryWorkflow"/>

View File

@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/batchLinkProductsToCollectionWorkflow
sidebar_label: batchLinkProductsToCollectionWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchLinkProductsToCollectionWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `batchLinkProductsToCollectionWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates links between product and collection records.
## Steps
<WorkflowDiagram workflow={{"name":"batchLinkProductsToCollectionWorkflow","steps":[{"type":"step","name":"batchLinkProductsToCollectionStep","description":"This step creates links between product and collection records.","link":"../../../../core_flows.Steps_Product/page.mdx#batchlinkproductstocollectionstep","depth":1}]}} />
## Input
<TypeList types={[{"name":"LinkWorkflowInput","type":"[LinkWorkflowInput](../../../../../types/CommonTypes/types/types.CommonTypes.LinkWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"add","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remove","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchLinkProductsToCollectionWorkflow"/>

View File

@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/createProductTypesWorkflow
sidebar_label: createProductTypesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductTypesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `createProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates one or more product types.
## Steps
<WorkflowDiagram workflow={{"name":"createProductTypesWorkflow","steps":[{"type":"step","name":"createProductTypesStep","description":"This step creates one or more product types.","link":"../../../../core_flows.Steps_Product/page.mdx#createproducttypesstep","depth":1},{"type":"hook","name":"productTypesCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesCreated","depth":2}]}} />
## Input
<TypeList types={[{"name":"CreateProductTypesWorkflowInput","type":"[CreateProductTypesWorkflowInput](../../../../types/core_flows.CreateProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_types","type":"[CreateProductTypeDTO](../../../../../product/interfaces/product.CreateProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
## Output
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createProductTypesWorkflow"/>
## Hooks
### productTypesCreated
#### Example
```ts
import { createProductTypesWorkflow } from "@medusajs/core-flows"
createProductTypesWorkflow.hooks.productTypesCreated(
async (({ product_types, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesCreated"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteCollectionsWorkflow
sidebar_label: deleteCollectionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCollectionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteCollectionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more collection.
## Steps
<WorkflowDiagram workflow={{"name":"deleteCollectionsWorkflow","steps":[{"type":"step","name":"deleteCollectionsStep","description":"This step deletes one or more collections.","link":"../../../../core_flows.Steps_Product/page.mdx#deletecollectionsstep","depth":1},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":2},{"type":"hook","name":"collectionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#collectionsDeleted","depth":3}]}} />
## Input
<TypeList types={[{"name":"DeleteCollectionsWorkflowInput","type":"[DeleteCollectionsWorkflowInput](../../../../types/core_flows.DeleteCollectionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteCollectionsWorkflow"/>
## Hooks
### collectionsDeleted
#### Example
```ts
import { deleteCollectionsWorkflow } from "@medusajs/core-flows"
deleteCollectionsWorkflow.hooks.collectionsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="collectionsDeleted"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteProductOptionsWorkflow
sidebar_label: deleteProductOptionsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductOptionsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteProductOptionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more product options.
## Steps
<WorkflowDiagram workflow={{"name":"deleteProductOptionsWorkflow","steps":[{"type":"step","name":"deleteProductOptionsStep","description":"This step deletes one or more product options.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductoptionsstep","depth":1},{"type":"hook","name":"productOptionsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productOptionsDeleted","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeleteProductOptionsWorkflowInput","type":"[DeleteProductOptionsWorkflowInput](../../../../types/core_flows.DeleteProductOptionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductOptionsWorkflow"/>
## Hooks
### productOptionsDeleted
#### Example
```ts
import { deleteProductOptionsWorkflow } from "@medusajs/core-flows"
deleteProductOptionsWorkflow.hooks.productOptionsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productOptionsDeleted"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteProductTagsWorkflow
sidebar_label: deleteProductTagsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductTagsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteProductTagsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more product tags.
## Steps
<WorkflowDiagram workflow={{"name":"deleteProductTagsWorkflow","steps":[{"type":"step","name":"deleteProductTagsStep","description":"This step deletes one or more product tags.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproducttagsstep","depth":1},{"type":"hook","name":"productTagsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTagsDeleted","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeleteProductTagsWorkflowInput","type":"[DeleteProductTagsWorkflowInput](../../../../types/core_flows.DeleteProductTagsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTagsWorkflow"/>
## Hooks
### productTagsDeleted
#### Example
```ts
import { deleteProductTagsWorkflow } from "@medusajs/core-flows"
deleteProductTagsWorkflow.hooks.productTagsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTagsDeleted"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteProductTypesWorkflow
sidebar_label: deleteProductTypesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductTypesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more product types.
## Steps
<WorkflowDiagram workflow={{"name":"deleteProductTypesWorkflow","steps":[{"type":"step","name":"deleteProductTypesStep","description":"This step deletes one or more product types.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproducttypesstep","depth":1},{"type":"hook","name":"productTypesDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesDeleted","depth":2}]}} />
## Input
<TypeList types={[{"name":"DeleteProductTypesWorkflowInput","type":"[DeleteProductTypesWorkflowInput](../../../../types/core_flows.DeleteProductTypesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductTypesWorkflow"/>
## Hooks
### productTypesDeleted
#### Example
```ts
import { deleteProductTypesWorkflow } from "@medusajs/core-flows"
deleteProductTypesWorkflow.hooks.productTypesDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesDeleted"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteProductVariantsWorkflow
sidebar_label: deleteProductVariantsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductVariantsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteProductVariantsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more product variants.
## Steps
<WorkflowDiagram workflow={{"name":"deleteProductVariantsWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"deleteProductVariantsStep","description":"This step deletes one or more product variants.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductvariantsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productVariantsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productVariantsDeleted","depth":4}]}} />
## Input
<TypeList types={[{"name":"DeleteProductVariantsWorkflowInput","type":"[DeleteProductVariantsWorkflowInput](../../../../types/core_flows.DeleteProductVariantsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductVariantsWorkflow"/>
## Hooks
### productVariantsDeleted
#### Example
```ts
import { deleteProductVariantsWorkflow } from "@medusajs/core-flows"
deleteProductVariantsWorkflow.hooks.productVariantsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productVariantsDeleted"/>

View File

@@ -0,0 +1,42 @@
---
slug: /references/medusa-workflows/deleteProductsWorkflow
sidebar_label: deleteProductsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `deleteProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow deletes one or more products.
## Steps
<WorkflowDiagram workflow={{"name":"deleteProductsWorkflow","steps":[{"type":"step","name":"getProductsStep","description":"This step retrieves products.","link":"../../../../core_flows.Steps_Product/page.mdx#getproductsstep","depth":1},{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":2},{"type":"step","name":"deleteProductsStep","description":"This step deletes one or more products.","link":"../../../../core_flows.Steps_Product/page.mdx#deleteproductsstep","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":3},{"type":"hook","name":"productsDeleted","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productsDeleted","depth":4}]}} />
## Input
<TypeList types={[{"name":"DeleteProductsWorkflowInput","type":"[DeleteProductsWorkflowInput](../../../../types/core_flows.DeleteProductsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteProductsWorkflow"/>
## Hooks
### productsDeleted
#### Example
```ts
import { deleteProductsWorkflow } from "@medusajs/core-flows"
deleteProductsWorkflow.hooks.productsDeleted(
async (({ ids }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productsDeleted"/>

View File

@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/exportProductsWorkflow
sidebar_label: exportProductsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# exportProductsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `exportProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow exports products matching the specified filters.
## Steps
<WorkflowDiagram workflow={{"name":"exportProductsWorkflow","steps":[{"type":"step","name":"getAllProductsStep","description":"This step retrieves all products.","link":"../../../../core_flows.Steps_Product/page.mdx#getallproductsstep","depth":1},{"type":"step","name":"generateProductCsvStep","description":"This step generates a CSV file to be exported.","link":"../../../../core_flows.Steps_Product/page.mdx#generateproductcsvstep","depth":2},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3}]}} />
## Input
<TypeList types={[{"name":"ExportProductsDTO","type":"`ExportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="exportProductsWorkflow"/>

View File

@@ -0,0 +1,24 @@
---
slug: /references/medusa-workflows/importProductsWorkflow
sidebar_label: importProductsWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# importProductsWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `importProductsWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow imports products from a CSV file.
## Steps
<WorkflowDiagram workflow={{"name":"importProductsWorkflow","steps":[{"type":"step","name":"parseProductCsvStep","description":"This step parses a CSV file holding products to import.","link":"../../../../core_flows.Steps_Product/page.mdx#parseproductcsvstep","depth":1},{"type":"step","name":"groupProductsForBatchStep","description":"This step groups products to be created and updated.","link":"../../../../core_flows.Steps_Product/page.mdx#groupproductsforbatchstep","depth":2},{"type":"step","name":"waitConfirmationProductImportStep","description":"This step waits until a product import is confirmed.","link":"../../../../core_flows.Steps_Product/page.mdx#waitconfirmationproductimportstep","depth":3}]}} />
## Input
<TypeList types={[{"name":"ImportProductsDTO","type":"`ImportProductsDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>
## Output
<TypeList types={[{"name":"ImportProductsSummary","type":"`ImportProductsSummary`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="importProductsWorkflow"/>

View File

@@ -0,0 +1,46 @@
---
slug: /references/medusa-workflows/updateProductTypesWorkflow
sidebar_label: updateProductTypesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductTypesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `updateProductTypesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow updates product types matching the specified filters.
## Steps
<WorkflowDiagram workflow={{"name":"updateProductTypesWorkflow","steps":[{"type":"step","name":"updateProductTypesStep","description":"This step updates product types matching the specified filters.","link":"../../../../core_flows.Steps_Product/page.mdx#updateproducttypesstep","depth":1},{"type":"hook","name":"productTypesUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#productTypesUpdated","depth":2}]}} />
## Input
<TypeList types={[{"name":"UpdateProductTypesWorkflowInput","type":"`UpdateProductTypesWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
## Output
<TypeList types={[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)","optional":false,"defaultValue":"","description":"A product type's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateProductTypesWorkflow"/>
## Hooks
### productTypesUpdated
#### Example
```ts
import { updateProductTypesWorkflow } from "@medusajs/core-flows"
updateProductTypesWorkflow.hooks.productTypesUpdated(
async (({ product_types, additional_data }, { container }) => {
//TODO
})
)
```
#### Input
Handlers consuming this hook accept the following input.
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"product_types","type":"[ProductTypeDTO](../../../../../product/interfaces/product.ProductTypeDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../../../product/types/product.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="productTypesUpdated"/>

View File

@@ -0,0 +1,20 @@
---
slug: /references/medusa-workflows/upsertVariantPricesWorkflow
sidebar_label: upsertVariantPricesWorkflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# upsertVariantPricesWorkflow - Medusa Workflows API Reference
This documentation provides a reference to the `upsertVariantPricesWorkflow`. It belongs to the `@medusajs/core-flows` package.
This workflow creates or updates variants' prices.
## Steps
<WorkflowDiagram workflow={{"name":"upsertVariantPricesWorkflow","steps":[{"type":"step","name":"removeRemoteLinkStep","description":"This step deletes linked records of a record.\n\nLearn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#cascade-delete-linked-records)\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#removeremotelinkstep","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":2},{"type":"step","name":"updatePriceSetsStep","description":"This step updates price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#updatepricesetsstep","depth":3},{"type":"step","name":"createPriceSetsStep","description":"This step creates one or more price sets.","link":"../../../../core_flows.Steps_Pricing/page.mdx#createpricesetsstep","depth":4},{"type":"step","name":"createVariantPricingLinkStep","description":"This step creates links between variant and price set records.","link":"../../../../core_flows.Steps_Product/page.mdx#createvariantpricinglinkstep","depth":5}]}} />
## Input
<TypeList types={[{"name":"UpsertVariantPricesWorkflowInput","type":"[UpsertVariantPricesWorkflowInput](../../../../types/core_flows.UpsertVariantPricesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variantPrices","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([CreatePricesDTO](../../../../../pricing/interfaces/pricing.CreatePricesDTO/page.mdx) \\| `UpdatePricesDTO`)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"[BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The amount of this money amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the money amount.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The minimum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| [BigNumberInput](../../../../../pricing/types/pricing.BigNumberInput/page.mdx)","description":"The maximum quantity required to be purchased for this money amount to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[CreatePriceSetPriceRules](../../../../../pricing/interfaces/pricing.CreatePriceSetPriceRules/page.mdx)","description":"The rules to add to the price. The object's keys are the attribute, and values are the value of that rule associated with this price.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"previousVariantIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="upsertVariantPricesWorkflow"/>

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchLinkProductsToCategoryWorkflowId
`Const` **batchLinkProductsToCategoryWorkflowId**: `"batch-link-products-to-category"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchLinkProductsToCollectionWorkflowId
`Const` **batchLinkProductsToCollectionWorkflowId**: `"batch-link-products-to-collection"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchProductVariantsWorkflowId
`Const` **batchProductVariantsWorkflowId**: `"batch-product-variants"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# batchProductsWorkflowId
`Const` **batchProductsWorkflowId**: `"batch-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createCollectionsWorkflowId
`Const` **createCollectionsWorkflowId**: `"create-collections"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductOptionsWorkflowId
`Const` **createProductOptionsWorkflowId**: `"create-product-options"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductTagsWorkflowId
`Const` **createProductTagsWorkflowId**: `"create-product-tags"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductTypesWorkflowId
`Const` **createProductTypesWorkflowId**: `"create-product-types"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductVariantsWorkflowId
`Const` **createProductVariantsWorkflowId**: `"create-product-variants"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# createProductsWorkflowId
`Const` **createProductsWorkflowId**: `"create-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteCollectionsWorkflowId
`Const` **deleteCollectionsWorkflowId**: `"delete-collections"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductOptionsWorkflowId
`Const` **deleteProductOptionsWorkflowId**: `"delete-product-options"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductTagsWorkflowId
`Const` **deleteProductTagsWorkflowId**: `"delete-product-tags"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductTypesWorkflowId
`Const` **deleteProductTypesWorkflowId**: `"delete-product-types"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductVariantsWorkflowId
`Const` **deleteProductVariantsWorkflowId**: `"delete-product-variants"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# deleteProductsWorkflowId
`Const` **deleteProductsWorkflowId**: `"delete-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# exportProductsWorkflowId
`Const` **exportProductsWorkflowId**: `"export-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# importProductsWorkflowId
`Const` **importProductsWorkflowId**: `"import-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateCollectionsWorkflowId
`Const` **updateCollectionsWorkflowId**: `"update-collections"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductOptionsWorkflowId
`Const` **updateProductOptionsWorkflowId**: `"update-product-options"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductTagsWorkflowId
`Const` **updateProductTagsWorkflowId**: `"update-product-tags"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductTypesWorkflowId
`Const` **updateProductTypesWorkflowId**: `"update-product-types"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductVariantsWorkflowId
`Const` **updateProductVariantsWorkflowId**: `"update-product-variants"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateProductsWorkflowId
`Const` **updateProductsWorkflowId**: `"update-products"`

View File

@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# upsertVariantPricesWorkflowId
`Const` **upsertVariantPricesWorkflowId**: `"upsert-variant-prices"`

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# Product
## Namespaces
- [Steps\_Product](../core_flows.Steps_Product/page.mdx)
- [Workflows\_Product](../core_flows.Workflows_Product/page.mdx)