chore(docs): Generated References (#6896)
Generated the following references: - `inventory` - `js_client` - `medusa` - `medusa_config` - `medusa_react` - `modules` - `payment` - `pricing` - `product` - `services` - `stock_location` - `tax_calculation` - `types` - `workflows` Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
co-authored by
Shahed Nasser
parent
9fdced2c27
commit
68aa0971a2
+15
@@ -0,0 +1,15 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# saveRawMessageData
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"messageData","type":"[MessageFormat](../../types/product.MessageFormat.mdx)<T> \\| [MessageFormat](../../types/product.MessageFormat.mdx)<T>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="saveRawMessageData"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="saveRawMessageData"/>
|
||||
+39
-5
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+39
-5
File diff suppressed because one or more lines are too long
+41
-8
@@ -13,22 +13,23 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This documentation provides a reference to the createOptions method. This belongs to the Product Module.
|
||||
|
||||
## createOptions(data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>
|
||||
|
||||
This method is used to create product options.
|
||||
|
||||
## Example
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function createProductOption (title: string, productId: string) {
|
||||
async function createOptions (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const productOptions = await productModule.createOptions([
|
||||
const options = await productModule.createOptions([
|
||||
{
|
||||
title,
|
||||
product_id: productId
|
||||
title
|
||||
}
|
||||
])
|
||||
|
||||
@@ -36,10 +37,42 @@ async function createProductOption (title: string, productId: string) {
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductOptionDTO](../../interfaces/product.CreateProductOptionDTO.mdx)[]","description":"The product options to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createOptions"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductOptionDTO](../../interfaces/product.CreateProductOptionDTO.mdx)[]","description":"The product options to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createOptions"/>
|
||||
|
||||
## Returns
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of created product options.","expandable":false,"children":[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"`object`","description":"A product option's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createOptions"/>
|
||||
|
||||
## createOptions(data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>
|
||||
|
||||
This method is used to create a product option.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function createOption (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const option = await productModule.createOptions(
|
||||
{
|
||||
title
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the product option or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductOptionDTO](../../interfaces/product.CreateProductOptionDTO.mdx)","description":"The product option to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createOptions"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>","optional":false,"defaultValue":"","description":"The created product option.","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../interfaces/product.ProductOptionValueDTO.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../interfaces/product.ProductDTO.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createOptions"/>
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ async function createProductTags (values: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductTagDTO](../../interfaces/product.CreateProductTagDTO.mdx)[]","description":"The product tags to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createTags"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductTagDTO](../../interfaces/product.CreateProductTagDTO.mdx)[]","description":"The product tags to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createTags"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+38
-4
@@ -13,9 +13,11 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This documentation provides a reference to the createTypes method. This belongs to the Product Module.
|
||||
|
||||
## createTypes(data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>
|
||||
|
||||
This method is used to create a product type.
|
||||
|
||||
## Example
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
@@ -35,10 +37,42 @@ async function createProductType (value: string) {
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductTypeDTO](../../interfaces/product.CreateProductTypeDTO.mdx)[]","description":"The product types to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product type's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createTypes"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductTypeDTO](../../interfaces/product.CreateProductTypeDTO.mdx)[]","description":"The product types to be created.","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":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createTypes"/>
|
||||
|
||||
## Returns
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of created product types.","expandable":false,"children":[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"`object`","description":"A product type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createTypes"/>
|
||||
|
||||
## createTypes(data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>
|
||||
|
||||
This method is used to create a product type.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function createType (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const type = await productModule.createTypes(
|
||||
{
|
||||
value
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the product type or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateProductTypeDTO](../../interfaces/product.CreateProductTypeDTO.mdx)","description":"The product type to be created.","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":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createTypes"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The created product type.","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.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":"`null` \\| `Record<string, unknown>`","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":[]}]}]}]} sectionTitle="createTypes"/>
|
||||
|
||||
+46
-11
File diff suppressed because one or more lines are too long
+1
-1
@@ -31,7 +31,7 @@ async function deleteProducts (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ async function deleteCategory (id: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"categoryId","type":"`string`","description":"The ID of the product category to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCategory"/>
|
||||
<TypeList types={[{"name":"categoryId","type":"`string`","description":"The ID of the product category to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCategory"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ async function deleteCollection (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productCollectionIds","type":"`string`[]","description":"The IDs of the product collections to be updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCollections"/>
|
||||
<TypeList types={[{"name":"productCollectionIds","type":"`string`[]","description":"The IDs of the product collections to be updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCollections"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ async function deleteProductOptions (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productOptionIds","type":"`string`[]","description":"The IDs of the product options to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteOptions"/>
|
||||
<TypeList types={[{"name":"productOptionIds","type":"`string`[]","description":"The IDs of the product options to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteOptions"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ async function deleteProductTags (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productTagIds","type":"`string`[]","description":"The IDs of the product tags to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteTags"/>
|
||||
<TypeList types={[{"name":"productTagIds","type":"`string`[]","description":"The IDs of the product tags to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteTags"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ async function deleteProductTypes (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productTypeIds","type":"`string`[]","description":"The IDs of the product types to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteTypes"/>
|
||||
<TypeList types={[{"name":"productTypeIds","type":"`string`[]","description":"The IDs of the product types to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ async function deleteProducts (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productVariantIds","type":"`string`[]","description":"The IDs of the ProductVariant to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteVariants"/>
|
||||
<TypeList types={[{"name":"productVariantIds","type":"`string`[]","description":"The IDs of the ProductVariant to be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteVariants"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -35,7 +35,7 @@ async function restoreProducts (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the products. You can pass to its `returnLinkableKeys`\nproperty any of the product's relation attribute names, such as `variant_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restore"/>
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the products. You can pass to its `returnLinkableKeys`\nproperty any of the product's relation attribute names, such as `variant_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restore"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/restoreCollections
|
||||
sidebar_label: restoreCollections
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restoreCollections - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the restoreCollections method. This belongs to the Product Module.
|
||||
|
||||
This method is used to restore collections which were deleted using the [softDelete](product.IProductModuleService.softDelete.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function restoreCollections (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.restoreCollections(ids, {
|
||||
returnLinkableKeys: []
|
||||
})
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"collectionIds","type":"`string`[]","description":"The IDs of the collections to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the collections. You can pass to its `returnLinkableKeys`\nproperty any of the collection's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreCollections"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the product entity's relations.\n\nIf there are no related records that were restored, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreCollections"/>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/restoreOptions
|
||||
sidebar_label: restoreOptions
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restoreOptions - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the restoreOptions method. This belongs to the Product Module.
|
||||
|
||||
This method is used to restore options which were deleted using the [softDelete](product.IProductModuleService.softDelete.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function restoreOptions (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.restoreOptions(ids, {
|
||||
returnLinkableKeys: ["option_value_id"]
|
||||
})
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"optionIds","type":"`string`[]","description":"The IDs of the options to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the options. You can pass to its `returnLinkableKeys`\nproperty any of the option's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreOptions"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the option entity's relations, and its value is an array of strings, each being the ID of the record associated with the option through this relation.\n\nIf there are no related records that were restored, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreOptions"/>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/restoreTypes
|
||||
sidebar_label: restoreTypes
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# restoreTypes - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the restoreTypes method. This belongs to the Product Module.
|
||||
|
||||
This method is used to restore types which were deleted using the [softDelete](product.IProductModuleService.softDelete.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function restoreTypes (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.restoreTypes(ids, {
|
||||
returnLinkableKeys: []
|
||||
})
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"typeIds","type":"`string`[]","description":"The IDs of the types to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the types. You can pass to its `returnLinkableKeys`\nproperty any of the type's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the type entity's relations, and its value is an array of strings, each being the ID of the record associated with the type through this relation.\n\nIf there are no related records that were restored, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreTypes"/>
|
||||
+9
-6
@@ -13,8 +13,7 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This documentation provides a reference to the restoreVariants method. This belongs to the Product Module.
|
||||
|
||||
This method is used to restore product varaints that were soft deleted. Product variants are soft deleted when they're not
|
||||
provided in a product's details passed to the [update](product.IProductModuleService.update.mdx) method.
|
||||
This method is used to restore variants which were deleted using the [softDelete](product.IProductModuleService.softDelete.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
@@ -23,17 +22,21 @@ import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function restoreProductVariants (ids: string[]) {
|
||||
async function restoreVariants (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
await productModule.restoreVariants(ids)
|
||||
const cascadedEntities = await productModule.restoreVariants(ids, {
|
||||
returnLinkableKeys: ["option_value_id"]
|
||||
})
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"variantIds","type":"`string`[]","description":"The IDs of the variants to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the product variants. You can pass to its `returnLinkableKeys`\nproperty any of the product variant's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreVariants"/>
|
||||
<TypeList types={[{"name":"variantIds","type":"`string`[]","description":"The IDs of the variants to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../interfaces/product.RestoreReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the variants. You can pass to its `returnLinkableKeys`\nproperty any of the variant's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreVariants"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the product variant entity's relations\nand its value is an array of strings, each being the ID of the record associated with the product variant through this relation.\n\nIf there are no related records that were restored, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreVariants"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored. The object's keys are the ID attribute names of the variant entity's relations, and its value is an array of strings, each being the ID of the record associated with the variant through this relation.\n\nIf there are no related records that were restored, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreVariants"/>
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
@@ -53,8 +53,8 @@ async function retrieveProductType (id: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"typeId","type":"`string`","description":"The ID of the product type to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/product.FindConfig.mdx)<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","description":"The configurations determining how the product type is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a product type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveType"/>
|
||||
<TypeList types={[{"name":"typeId","type":"`string`","description":"The ID of the product type to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../interfaces/product.FindConfig.mdx)<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","description":"The configurations determining how the product type is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a product type.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveType"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved product type.","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.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":"metadata","type":"`null` \\| `Record<string, unknown>`","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":[]}]}]}]} sectionTitle="retrieveType"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The retrieved product type.","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.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":"`null` \\| `Record<string, unknown>`","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":[]}]}]}]} sectionTitle="retrieveType"/>
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -35,7 +35,7 @@ async function deleteProducts (ids: string[]) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the products. You can pass to its `returnLinkableKeys`\nproperty any of the product's relation attribute names, such as `variant_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDelete"/>
|
||||
<TypeList types={[{"name":"productIds","type":"`string`[]","description":"The IDs of the products to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the products. You can pass to its `returnLinkableKeys`\nproperty any of the product's relation attribute names, such as `variant_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDelete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/softDeleteCollections
|
||||
sidebar_label: softDeleteCollections
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeleteCollections - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the softDeleteCollections method. This belongs to the Product Module.
|
||||
|
||||
This method is used to delete product collections. Unlike the [deleteCollections](product.IProductModuleService.deleteCollections.mdx) method, this method won't completely remove the collection. It can still be accessed or retrieved using methods like retrieveCollections if you pass the `withDeleted` property to the `config` object parameter.
|
||||
|
||||
The soft-deleted collections can be restored using the [restoreCollections](product.IProductModuleService.restoreCollections.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function deleteCollections (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.softDeleteCollections(ids)
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"collectionIds","type":"`string`[]","description":"The IDs of the collections to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the collections. You can pass to its `returnLinkableKeys`\nproperty any of the collection's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteCollections"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted. The object's keys are the ID attribute names of the collection entity's relations.\n\nIf there are no related records, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteCollections"/>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/softDeleteOptions
|
||||
sidebar_label: softDeleteOptions
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeleteOptions - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the softDeleteOptions method. This belongs to the Product Module.
|
||||
|
||||
This method is used to delete options. Unlike the [delete](product.IProductModuleService.delete.mdx) method, this method won't completely remove the option. It can still be accessed or retrieved using methods like [retrieve](product.IProductModuleService.retrieve.mdx) if you pass the `withDeleted` property to the `config` object parameter.
|
||||
|
||||
The soft-deleted options can be restored using the [restore](product.IProductModuleService.restore.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function deleteOptions (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.softDeleteOptions(ids)
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"optionIds","type":"`string`[]","description":"The IDs of the options to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the options. You can pass to its `returnLinkableKeys`\nproperty any of the option's relation attribute names, such as `option_value_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteOptions"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted. The object's keys are the ID attribute names of the option entity's relations, and its value is an array of strings, each being the ID of a record associated with the option through this relation.\n\nIf there are no related records, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteOptions"/>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/softDeleteTypes
|
||||
sidebar_label: softDeleteTypes
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeleteTypes - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the softDeleteTypes method. This belongs to the Product Module.
|
||||
|
||||
This method is used to delete types. Unlike the [delete](product.IProductModuleService.delete.mdx) method, this method won't completely remove the type. It can still be accessed or retrieved using methods like [retrieve](product.IProductModuleService.retrieve.mdx) if you pass the `withDeleted` property to the `config` object parameter.
|
||||
|
||||
The soft-deleted types can be restored using the [restore](product.IProductModuleService.restore.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function deleteTypes (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.softDeleteTypes(ids)
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"typeIds","type":"`string`[]","description":"The IDs of the types to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the types. You can pass to its `returnLinkableKeys`\nproperty any of the type's relation attribute names.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteTypes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted. The object's keys are the ID attribute names of the type entity's relations, and its value is an array of strings, each being the ID of a record associated with the type through this relation.\n\nIf there are no related records, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteTypes"/>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/softDeleteVariants
|
||||
sidebar_label: softDeleteVariants
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# softDeleteVariants - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the softDeleteVariants method. This belongs to the Product Module.
|
||||
|
||||
This method is used to delete variants. Unlike the [delete](product.IProductModuleService.delete.mdx) method, this method won't completely remove the variant. It can still be accessed or retrieved using methods like [retrieve](product.IProductModuleService.retrieve.mdx) if you pass the `withDeleted` property to the `config` object parameter.
|
||||
|
||||
The soft-deleted variants can be restored using the [restore](product.IProductModuleService.restore.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function deleteProductVariants (ids: string[]) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const cascadedEntities = await productModule.softDeleteVariants(ids)
|
||||
|
||||
// do something with the returned cascaded entity IDs or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"variantIds","type":"`string`[]","description":"The IDs of the variants to soft-delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../interfaces/product.SoftDeleteReturn.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to soft delete along with the each of the variants. You can pass to its `returnLinkableKeys`\nproperty any of the variant's relation attribute names, such as `option_value_id`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteVariants"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted. The object's keys are the ID attribute names of the variant entity's relations, and its value is an array of strings, each being the ID of a record associated with the variant through this relation.\n\nIf there are no related records, the promise resolved to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteVariants"/>
|
||||
+40
-9
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+42
-11
File diff suppressed because one or more lines are too long
+43
-12
@@ -13,33 +13,64 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This documentation provides a reference to the updateOptions method. This belongs to the Product Module.
|
||||
|
||||
This method is used to update existing product options.
|
||||
## updateOptions(id, data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>
|
||||
|
||||
## Example
|
||||
This method is used to update a option.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function updateProductOption (id: string, title: string) {
|
||||
async function updateOption (id: string, title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const productOptions = await productModule.updateOptions([
|
||||
{
|
||||
id,
|
||||
const option = await productModule.updateOptions(id, {
|
||||
title
|
||||
}
|
||||
])
|
||||
)
|
||||
|
||||
// do something with the product options or return them
|
||||
// do something with the option or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateProductOptionDTO](../../interfaces/product.UpdateProductOptionDTO.mdx)[]","description":"The product options to be updated, each holding the attributes that should be updated in the product option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateOptions"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the option to be updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateProductOptionDTO](../../interfaces/product.UpdateProductOptionDTO.mdx)","description":"The attributes of the option to be updated","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateOptions"/>
|
||||
|
||||
## Returns
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of updated product options.","expandable":false,"children":[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"`object`","description":"A product option's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateOptions"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>","optional":false,"defaultValue":"","description":"The updated option.","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../interfaces/product.ProductOptionValueDTO.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../interfaces/product.ProductDTO.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateOptions"/>
|
||||
|
||||
## updateOptions(selector, data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>
|
||||
|
||||
This method is used to update a list of options determined by the selector filters.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function updateOptions(ids: string[], title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const options = await productModule.updateOptions({id: ids}, {
|
||||
title
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the options or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"selector","type":"[FilterableProductOptionProps](../../interfaces/product.FilterableProductOptionProps.mdx)","description":"The filters that will determine which options will be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductOptionProps](../../interfaces/product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](../../interfaces/product.BaseFilterable.mdx)<[FilterableProductOptionProps](../../interfaces/product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](../../interfaces/product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](../../interfaces/product.BaseFilterable.mdx)<[FilterableProductOptionProps](../../interfaces/product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product options by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"[UpdateProductOptionDTO](../../interfaces/product.UpdateProductOptionDTO.mdx)","description":"The attributes to be updated on the selected options","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateOptions"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The updated options.","expandable":false,"children":[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"`object`","description":"A product option's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateOptions"/>
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ async function updateProductTag (id: string, value: string) {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateProductTagDTO](../../interfaces/product.UpdateProductTagDTO.mdx)[]","description":"The product tags to be updated, each having the attributes that should be updated in a product tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product tag to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateTags"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdateProductTagDTO](../../interfaces/product.UpdateProductTagDTO.mdx)[]","description":"The product tags to be updated, each having the attributes that should be updated in a product tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateTags"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+43
-12
@@ -13,33 +13,64 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This documentation provides a reference to the updateTypes method. This belongs to the Product Module.
|
||||
|
||||
This method is used to update a product type
|
||||
## updateTypes(id, data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>
|
||||
|
||||
## Example
|
||||
This method is used to update a type.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function updateProductType (id: string, value: string) {
|
||||
async function updateType (id: string, title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const productTypes = await productModule.updateTypes([
|
||||
{
|
||||
id,
|
||||
const type = await productModule.updateTypes(id, {
|
||||
value
|
||||
}
|
||||
])
|
||||
)
|
||||
|
||||
// do something with the product types or return them
|
||||
// do something with the type or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateProductTypeDTO](../../interfaces/product.UpdateProductTypeDTO.mdx)[]","description":"The product types to be updated, each having the attributes that should be updated in the product type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product type to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateTypes"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the type to be updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateProductTypeDTO](../../interfaces/product.UpdateProductTypeDTO.mdx)","description":"The attributes of the type to be updated","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateTypes"/>
|
||||
|
||||
## Returns
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The list of updated product types.","expandable":false,"children":[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"`object`","description":"A product type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateTypes"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The updated type.","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.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":"`null` \\| `Record<string, unknown>`","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":[]}]}]}]} sectionTitle="updateTypes"/>
|
||||
|
||||
## updateTypes(selector, data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>
|
||||
|
||||
This method is used to update a list of types determined by the selector filters.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function updateTypes(ids: string[], title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const types = await productModule.updateTypes({id: ids}, {
|
||||
value
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the types or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"selector","type":"[FilterableProductTypeProps](../../interfaces/product.FilterableProductTypeProps.mdx)","description":"The filters that will determine which types will be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableProductTypeProps](../../interfaces/product.FilterableProductTypeProps.mdx) \\| [BaseFilterable](../../interfaces/product.BaseFilterable.mdx)<[FilterableProductTypeProps](../../interfaces/product.FilterableProductTypeProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductTypeProps](../../interfaces/product.FilterableProductTypeProps.mdx) \\| [BaseFilterable](../../interfaces/product.BaseFilterable.mdx)<[FilterableProductTypeProps](../../interfaces/product.FilterableProductTypeProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value to filter product types by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"[UpdateProductTypeDTO](../../interfaces/product.UpdateProductTypeDTO.mdx)","description":"The attributes to be updated on the selected types","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateTypes"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The updated types.","expandable":false,"children":[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"`object`","description":"A product type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateTypes"/>
|
||||
|
||||
+45
-12
File diff suppressed because one or more lines are too long
+78
File diff suppressed because one or more lines are too long
+78
File diff suppressed because one or more lines are too long
+78
@@ -0,0 +1,78 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/upsertOptions
|
||||
sidebar_label: upsertOptions
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# upsertOptions - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the upsertOptions method. This belongs to the Product Module.
|
||||
|
||||
## upsertOptions(data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>
|
||||
|
||||
This method updates existing options, or creates new ones if they don't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function upsertOptions (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const createdOptions = await productModule.upsertOptions([
|
||||
{
|
||||
title
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the options or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertProductOptionDTO](../../interfaces/product.UpsertProductOptionDTO.mdx)[]","description":"The attributes to update or create for each option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertOptions"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The updated and created options.","expandable":false,"children":[{"name":"ProductOptionDTO[]","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductOptionDTO","type":"`object`","description":"A product option's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertOptions"/>
|
||||
|
||||
## upsertOptions(data, sharedContext?): Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>
|
||||
|
||||
This method updates an existing option, or creates a new one if it doesn't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function upsertOption (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const createdOption = await productModule.upsertOptions(
|
||||
{
|
||||
title
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the option or return it
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertProductOptionDTO](../../interfaces/product.UpsertProductOptionDTO.mdx)","description":"The attributes to update or create for the option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertOptions"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)>","optional":false,"defaultValue":"","description":"The updated or created option.","expandable":false,"children":[{"name":"ProductOptionDTO","type":"[ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","optional":false,"defaultValue":"","description":"A product option's data.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../interfaces/product.ProductOptionValueDTO.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../interfaces/product.ProductOptionDTO.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`null` \\| `string`","description":"The associated product option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option value was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [ProductDTO](../../interfaces/product.ProductDTO.mdx)","description":"The associated product.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The associated product id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertOptions"/>
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
badge:
|
||||
variant: orange
|
||||
text: Beta
|
||||
slug: /references/product/upsertTypes
|
||||
sidebar_label: upsertTypes
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# upsertTypes - Product Module Reference
|
||||
|
||||
This documentation provides a reference to the upsertTypes method. This belongs to the Product Module.
|
||||
|
||||
## upsertTypes(data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>
|
||||
|
||||
This method updates existing types, or creates new ones if they don't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function upsertTypes (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const createdTypes = await productModule.upsertTypes([
|
||||
{
|
||||
value
|
||||
}
|
||||
])
|
||||
|
||||
// do something with the types or return them
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertProductTypeDTO](../../interfaces/product.UpsertProductTypeDTO.mdx)[]","description":"The attributes to update or create for each type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertTypes"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]>","optional":false,"defaultValue":"","description":"The updated and created types.","expandable":false,"children":[{"name":"ProductTypeDTO[]","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ProductTypeDTO","type":"`object`","description":"A product type's data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="upsertTypes"/>
|
||||
|
||||
## upsertTypes(data, sharedContext?): Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>
|
||||
|
||||
This method updates an existing type, or creates a new one if it doesn't exist.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeProductModule,
|
||||
} from "@medusajs/product"
|
||||
|
||||
async function upsertType (title: string) {
|
||||
const productModule = await initializeProductModule()
|
||||
|
||||
const createdType = await productModule.upsertTypes(
|
||||
{
|
||||
value
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the type or return it
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpsertProductTypeDTO](../../interfaces/product.UpsertProductTypeDTO.mdx)","description":"The attributes to update or create for the type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../interfaces/product.Context.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../interfaces/product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="upsertTypes"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.mdx)>","optional":false,"defaultValue":"","description":"The updated or created type.","expandable":false,"children":[{"name":"ProductTypeDTO","type":"[ProductTypeDTO](../../interfaces/product.ProductTypeDTO.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":"`null` \\| `Record<string, unknown>`","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":[]}]}]}]} sectionTitle="upsertTypes"/>
|
||||
+78
File diff suppressed because one or more lines are too long
@@ -12,4 +12,4 @@ A context used to share resources, such as transaction manager, between the appl
|
||||
|
||||
<TypeList types={[{"name":"TManager","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Context"/>
|
||||
|
||||
<TypeList types={[{"name":"__type","type":"`\"MedusaContext\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Context"/>
|
||||
<TypeList types={[{"name":"__type","type":"`\"MedusaContext\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](product.IMessageAggregator.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Context"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
A product option to create.
|
||||
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductOptionDTO"/>
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The product option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductOptionDTO"/>
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
A product type to create.
|
||||
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product type's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductTypeDTO"/>
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductTypeDTO"/>
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
A product variant to create.
|
||||
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The inventory quantiy of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[CreateProductVariantOptionDTO](product.CreateProductVariantOptionDTO.mdx)[]","description":"The product variant options to create and associate with the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of a product variant option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductVariantDTO"/>
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The id of the product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The inventory quantiy of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The product variant options to associate with the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductVariantDTO"/>
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# CreateProductVariantOptionDTO
|
||||
|
||||
A product variant option to create.
|
||||
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The value of a product variant option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateProductVariantOptionDTO"/>
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The filters to apply on retrieved product collections.
|
||||
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductCollectionProps"/>
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductCollectionProps](product.FilterableProductCollectionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"The handles to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The title to filter product collections by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductCollectionProps"/>
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The filters to apply on retrieved product options.
|
||||
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductOptionProps](product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductOptionProps](product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductOptionProps](product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The titles to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product options by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductOptionProps"/>
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductOptionProps](product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductOptionProps](product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductOptionProps](product.FilterableProductOptionProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductOptionProps](product.FilterableProductOptionProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"The titles to filter product options by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product options by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductOptionProps"/>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The filters to apply on retrieved product variants.
|
||||
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductVariantProps](product.FilterableProductVariantProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductVariantProps](product.FilterableProductVariantProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductVariantProps](product.FilterableProductVariantProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductVariantProps](product.FilterableProductVariantProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string` \\| `string`[]","description":"The SKUs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product variants by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"Filter product variants by their associated options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`[]","description":"IDs to filter options by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options.id","type":"`string`[]","description":"IDs to filter options by.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductVariantProps"/>
|
||||
<TypeList types={[{"name":"$and","type":"([FilterableProductVariantProps](product.FilterableProductVariantProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductVariantProps](product.FilterableProductVariantProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableProductVariantProps](product.FilterableProductVariantProps.mdx) \\| [BaseFilterable](product.BaseFilterable.mdx)<[FilterableProductVariantProps](product.FilterableProductVariantProps.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string` \\| `string`[]","description":"The SKUs to filter product variants by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"Filter the product variants by their associated products' IDs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"Filter product variants by their associated options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FilterableProductVariantProps"/>
|
||||
|
||||
@@ -13,4 +13,4 @@ which provides correct typing of field names in its properties.
|
||||
|
||||
<TypeList types={[{"name":"Entity","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/>
|
||||
|
||||
<TypeList types={[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/>
|
||||
<TypeList types={[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/>
|
||||
|
||||
@@ -11,3 +11,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
- [save](../IMessageAggregator/methods/product.IMessageAggregator.save.mdx)
|
||||
- [getMessages](../IMessageAggregator/methods/product.IMessageAggregator.getMessages.mdx)
|
||||
- [clearMessages](../IMessageAggregator/methods/product.IMessageAggregator.clearMessages.mdx)
|
||||
- [saveRawMessageData](../IMessageAggregator/methods/product.IMessageAggregator.saveRawMessageData.mdx)
|
||||
|
||||
+23
-9
@@ -12,11 +12,19 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
This section of the documentation provides a reference to the `IProductModuleService` interface’s methods. This is the interface developers use to use the functionalities provided by the Product Module.
|
||||
|
||||
The main service interface for the product module.
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../IProductModuleService/methods/product.IProductModuleService.retrieve.mdx)
|
||||
- [list](../IProductModuleService/methods/product.IProductModuleService.list.mdx)
|
||||
- [listAndCount](../IProductModuleService/methods/product.IProductModuleService.listAndCount.mdx)
|
||||
- [create](../IProductModuleService/methods/product.IProductModuleService.create.mdx)
|
||||
- [upsert](../IProductModuleService/methods/product.IProductModuleService.upsert.mdx)
|
||||
- [update](../IProductModuleService/methods/product.IProductModuleService.update.mdx)
|
||||
- [delete](../IProductModuleService/methods/product.IProductModuleService.delete.mdx)
|
||||
- [softDelete](../IProductModuleService/methods/product.IProductModuleService.softDelete.mdx)
|
||||
- [restore](../IProductModuleService/methods/product.IProductModuleService.restore.mdx)
|
||||
- [retrieveTag](../IProductModuleService/methods/product.IProductModuleService.retrieveTag.mdx)
|
||||
- [listTags](../IProductModuleService/methods/product.IProductModuleService.listTags.mdx)
|
||||
- [listAndCountTags](../IProductModuleService/methods/product.IProductModuleService.listAndCountTags.mdx)
|
||||
@@ -27,35 +35,41 @@ This section of the documentation provides a reference to the `IProductModuleSer
|
||||
- [listTypes](../IProductModuleService/methods/product.IProductModuleService.listTypes.mdx)
|
||||
- [listAndCountTypes](../IProductModuleService/methods/product.IProductModuleService.listAndCountTypes.mdx)
|
||||
- [createTypes](../IProductModuleService/methods/product.IProductModuleService.createTypes.mdx)
|
||||
- [upsertTypes](../IProductModuleService/methods/product.IProductModuleService.upsertTypes.mdx)
|
||||
- [updateTypes](../IProductModuleService/methods/product.IProductModuleService.updateTypes.mdx)
|
||||
- [deleteTypes](../IProductModuleService/methods/product.IProductModuleService.deleteTypes.mdx)
|
||||
- [softDeleteTypes](../IProductModuleService/methods/product.IProductModuleService.softDeleteTypes.mdx)
|
||||
- [restoreTypes](../IProductModuleService/methods/product.IProductModuleService.restoreTypes.mdx)
|
||||
- [retrieveOption](../IProductModuleService/methods/product.IProductModuleService.retrieveOption.mdx)
|
||||
- [listOptions](../IProductModuleService/methods/product.IProductModuleService.listOptions.mdx)
|
||||
- [listAndCountOptions](../IProductModuleService/methods/product.IProductModuleService.listAndCountOptions.mdx)
|
||||
- [createOptions](../IProductModuleService/methods/product.IProductModuleService.createOptions.mdx)
|
||||
- [upsertOptions](../IProductModuleService/methods/product.IProductModuleService.upsertOptions.mdx)
|
||||
- [updateOptions](../IProductModuleService/methods/product.IProductModuleService.updateOptions.mdx)
|
||||
- [deleteOptions](../IProductModuleService/methods/product.IProductModuleService.deleteOptions.mdx)
|
||||
- [softDeleteOptions](../IProductModuleService/methods/product.IProductModuleService.softDeleteOptions.mdx)
|
||||
- [restoreOptions](../IProductModuleService/methods/product.IProductModuleService.restoreOptions.mdx)
|
||||
- [retrieveVariant](../IProductModuleService/methods/product.IProductModuleService.retrieveVariant.mdx)
|
||||
- [listVariants](../IProductModuleService/methods/product.IProductModuleService.listVariants.mdx)
|
||||
- [updateVariants](../IProductModuleService/methods/product.IProductModuleService.updateVariants.mdx)
|
||||
- [createVariants](../IProductModuleService/methods/product.IProductModuleService.createVariants.mdx)
|
||||
- [deleteVariants](../IProductModuleService/methods/product.IProductModuleService.deleteVariants.mdx)
|
||||
- [listAndCountVariants](../IProductModuleService/methods/product.IProductModuleService.listAndCountVariants.mdx)
|
||||
- [createVariants](../IProductModuleService/methods/product.IProductModuleService.createVariants.mdx)
|
||||
- [upsertVariants](../IProductModuleService/methods/product.IProductModuleService.upsertVariants.mdx)
|
||||
- [updateVariants](../IProductModuleService/methods/product.IProductModuleService.updateVariants.mdx)
|
||||
- [deleteVariants](../IProductModuleService/methods/product.IProductModuleService.deleteVariants.mdx)
|
||||
- [softDeleteVariants](../IProductModuleService/methods/product.IProductModuleService.softDeleteVariants.mdx)
|
||||
- [restoreVariants](../IProductModuleService/methods/product.IProductModuleService.restoreVariants.mdx)
|
||||
- [retrieveCollection](../IProductModuleService/methods/product.IProductModuleService.retrieveCollection.mdx)
|
||||
- [listCollections](../IProductModuleService/methods/product.IProductModuleService.listCollections.mdx)
|
||||
- [listAndCountCollections](../IProductModuleService/methods/product.IProductModuleService.listAndCountCollections.mdx)
|
||||
- [createCollections](../IProductModuleService/methods/product.IProductModuleService.createCollections.mdx)
|
||||
- [upsertCollections](../IProductModuleService/methods/product.IProductModuleService.upsertCollections.mdx)
|
||||
- [updateCollections](../IProductModuleService/methods/product.IProductModuleService.updateCollections.mdx)
|
||||
- [deleteCollections](../IProductModuleService/methods/product.IProductModuleService.deleteCollections.mdx)
|
||||
- [softDeleteCollections](../IProductModuleService/methods/product.IProductModuleService.softDeleteCollections.mdx)
|
||||
- [restoreCollections](../IProductModuleService/methods/product.IProductModuleService.restoreCollections.mdx)
|
||||
- [retrieveCategory](../IProductModuleService/methods/product.IProductModuleService.retrieveCategory.mdx)
|
||||
- [listCategories](../IProductModuleService/methods/product.IProductModuleService.listCategories.mdx)
|
||||
- [listAndCountCategories](../IProductModuleService/methods/product.IProductModuleService.listAndCountCategories.mdx)
|
||||
- [createCategory](../IProductModuleService/methods/product.IProductModuleService.createCategory.mdx)
|
||||
- [updateCategory](../IProductModuleService/methods/product.IProductModuleService.updateCategory.mdx)
|
||||
- [deleteCategory](../IProductModuleService/methods/product.IProductModuleService.deleteCategory.mdx)
|
||||
- [create](../IProductModuleService/methods/product.IProductModuleService.create.mdx)
|
||||
- [update](../IProductModuleService/methods/product.IProductModuleService.update.mdx)
|
||||
- [delete](../IProductModuleService/methods/product.IProductModuleService.delete.mdx)
|
||||
- [softDelete](../IProductModuleService/methods/product.IProductModuleService.softDelete.mdx)
|
||||
- [restore](../IProductModuleService/methods/product.IProductModuleService.restore.mdx)
|
||||
- [restoreVariants](../IProductModuleService/methods/product.IProductModuleService.restoreVariants.mdx)
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The product image's data.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product image.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"url","type":"`string`","description":"The URL of the product image.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product image was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ProductImageDTO"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product image.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"url","type":"`string`","description":"The URL of the product image.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product image was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product image was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"When the product image was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ProductImageDTO"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
A product type's data.
|
||||
|
||||
<TypeList types={[{"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":"metadata","type":"`null` \\| `Record<string, unknown>`","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":[]}]} sectionTitle="ProductTypeDTO"/>
|
||||
<TypeList types={[{"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":"`null` \\| `Record<string, unknown>`","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":[]}]} sectionTitle="ProductTypeDTO"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# ProductVariantOptionDTO
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product variant option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_value","type":"`null` \\| [ProductOptionValueDTO](product.ProductOptionValueDTO.mdx)","description":"The value of the product variant option.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"option_value_id","type":"`null` \\| `string`","description":"The value of the product variant option id.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant","type":"`null` \\| [ProductVariantDTO](product.ProductVariantDTO.mdx)","description":"The associated product variant.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"variant_id","type":"`null` \\| `string`","description":"The associated product variant id.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ProductVariantOptionDTO"/>
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The data to update in a product collection. The `id` is used to identify which product collection to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product collection to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_ids","type":"`string`[]","description":"The IDs of the products to associate with the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductCollectionDTO"/>
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The value of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_ids","type":"`string`[]","description":"The IDs of the products to associate with the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductCollectionDTO"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpdateProductImageDTO
|
||||
|
||||
The data to update in a product image. The `id` is used to identify which product image to update.
|
||||
|
||||
<TypeList types={[{"name":"url","type":"`string`","description":"The new URL of the product image.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductImageDTO"/>
|
||||
+1
-1
@@ -6,4 +6,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpdateProductOptionDTO
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductOptionDTO"/>
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductOptionDTO"/>
|
||||
|
||||
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The data to update in a product tag. The `id` is used to identify which product tag to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product tag to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductTagDTO"/>
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The value of the product tag.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductTagDTO"/>
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The data to update in a product type. The `id` is used to identify which product type to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product type to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductTypeDTO"/>
|
||||
<TypeList types={[{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductTypeDTO"/>
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
The data to update in a product variant. The `id` is used to identify which product variant to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product variant to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The inventory quantiy of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[CreateProductVariantOptionDTO](product.CreateProductVariantOptionDTO.mdx)[]","description":"The product variant options to create and associate with the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The value of a product variant option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductVariantDTO"/>
|
||||
<TypeList types={[{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The inventory quantiy of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The product variant options to associate with the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateProductVariantDTO"/>
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductCollectionDTO
|
||||
|
||||
The data to update in a product collection. The `id` is used to identify which product collection to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product collection to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The handle of the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_ids","type":"`string`[]","description":"The IDs of the products to associate with the product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductCollectionDTO"/>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductImageDTO
|
||||
|
||||
The data to update in a product image. The `id` is used to identify which product image to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product image's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"url","type":"`string`","description":"The new URL of the product image.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductImageDTO"/>
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductOptionDTO
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product option to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The product option values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductOptionDTO"/>
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductTagDTO
|
||||
|
||||
The data to update in a product tag. The `id` is used to identify which product tag to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product tag to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product tag.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductTagDTO"/>
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductTypeDTO
|
||||
|
||||
The data to update in a product type. The `id` is used to identify which product type to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product type's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The new value of the product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductTypeDTO"/>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# UpsertProductVariantDTO
|
||||
|
||||
The data to update in a product variant. The `id` is used to identify which product variant to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the product variant to update.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The EAN of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The UPC of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The inventory quantiy of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The HS Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The origin country of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The MID Code of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The material of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The weight of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The length of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The height of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The width of the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The product variant options to associate with the product variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpsertProductVariantDTO"/>
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
displayed_sidebar: productReference
|
||||
---
|
||||
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# MessageFormat
|
||||
|
||||
**MessageFormat**: `Object`
|
||||
|
||||
## Properties
|
||||
|
||||
<TypeList types={[{"name":"eventName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"T \\| T[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="MessageFormat"/>
|
||||
Reference in New Issue
Block a user