docs: generate references manually for 2.12.3 (#14340)
This commit is contained in:
1 parent
52e965f411
commit
1c4c4b8e9a
1080 files changed
+394731
-361464
No files matched your search
+26
-2
@@ -20,9 +20,18 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method creates a locale.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const locale = await translationModuleService.createLocales({
|
||||
code: "en-US",
|
||||
name: "English (United States)",
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateLocaleDTO](../../../interfaces/translation.CreateLocaleDTO/page.mdx)","description":"The locale to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale (e.g., \"English (United States)\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createLocales"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateLocaleDTO](../../../interfaces/translation.CreateLocaleDTO/page.mdx)","description":"The locale to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createLocales"/>
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -32,9 +41,24 @@ This method creates a locale.
|
||||
|
||||
This method creates locales.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.createLocales([
|
||||
{
|
||||
code: "en-US",
|
||||
name: "English (United States)",
|
||||
},
|
||||
{
|
||||
code: "fr-FR",
|
||||
name: "French (France)",
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateLocaleDTO](../../../interfaces/translation.CreateLocaleDTO/page.mdx)[]","description":"The locales to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale (e.g., \"English (United States)\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createLocales"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateLocaleDTO](../../../interfaces/translation.CreateLocaleDTO/page.mdx)[]","description":"The locales to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createLocales"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+41
-2
@@ -20,9 +20,23 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method creates a translation.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const translation = await translationModuleService.createTranslations({
|
||||
reference_id: "prod_123",
|
||||
reference: "product",
|
||||
locale_code: "fr-FR",
|
||||
translations: {
|
||||
title: "Titre du produit",
|
||||
description: "Description du produit en français",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateTranslationDTO](../../../interfaces/translation.CreateTranslationDTO/page.mdx)","description":"The translation to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated (e.g., \"product\", \"product\\_variant\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createTranslations"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateTranslationDTO](../../../interfaces/translation.CreateTranslationDTO/page.mdx)","description":"The translation to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createTranslations"/>
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -32,9 +46,34 @@ This method creates a translation.
|
||||
|
||||
This method creates translations.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const translations = await translationModuleService.createTranslations([
|
||||
{
|
||||
reference_id: "prod_123",
|
||||
reference: "product",
|
||||
locale_code: "fr-FR",
|
||||
translations: {
|
||||
title: "Titre du produit",
|
||||
description: "Description du produit en français",
|
||||
},
|
||||
},
|
||||
{
|
||||
reference_id: "prod_123",
|
||||
reference: "product",
|
||||
locale_code: "de-DE",
|
||||
translations: {
|
||||
title: "Produkt Titel",
|
||||
description: "Produktbeschreibung auf Deutsch",
|
||||
},
|
||||
}
|
||||
])
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[CreateTranslationDTO](../../../interfaces/translation.CreateTranslationDTO/page.mdx)[]","description":"The translations to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated (e.g., \"product\", \"product\\_variant\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createTranslations"/>
|
||||
<TypeList types={[{"name":"data","type":"[CreateTranslationDTO](../../../interfaces/translation.CreateTranslationDTO/page.mdx)[]","description":"The translations to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createTranslations"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+7
-1
@@ -18,9 +18,15 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method deletes locales by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.deleteLocales(["loc_123", "loc_321"])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the locales to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteLocales"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects with IDs identifying the locales to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteLocales"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+7
-1
@@ -18,9 +18,15 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method deletes translations by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.deleteTranslations("tra_123")
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the translations to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteTranslations"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects with IDs identifying the translations to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteTranslations"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
slug: /references/translation/getStatistics
|
||||
sidebar_label: getStatistics
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# getStatistics - Translation Module Reference
|
||||
|
||||
This documentation provides a reference to the `getStatistics` method. This belongs to the Translation Module.
|
||||
|
||||
<Note>
|
||||
|
||||
You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference).
|
||||
|
||||
</Note>
|
||||
|
||||
This method retrieves translation statistics for the specified entities and locales.
|
||||
It's useful to understand the translation coverage of different entities across various locales.
|
||||
|
||||
You can use this method to get insights into how many fields are translated, missing translations,
|
||||
and the expected number of translations based on the entities and locales provided.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const [,count] = await productModuleService.listAndCountProducts()
|
||||
const [,variantCount] = await productVariantModuleService.listAndCountProductVariants()
|
||||
const stats = await translationModuleService.getStatistics({
|
||||
locales: ["en-US", "fr-FR"],
|
||||
entities: {
|
||||
product: { count }, // for example, 2 products
|
||||
product_variant: { count: variantCount },
|
||||
}
|
||||
})
|
||||
// Returns:
|
||||
// {
|
||||
// product: {
|
||||
// expected: 20, // 2 products × 5 fields × 2 locales
|
||||
// translated: 15,
|
||||
// missing: 5,
|
||||
// by_locale: {
|
||||
// "en-US": { expected: 10, translated: 8, missing: 2 },
|
||||
// "fr-FR": { expected: 10, translated: 7, missing: 3 }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[TranslationStatisticsInput](../../../interfaces/translation.TranslationStatisticsInput/page.mdx)","description":"The entities and locales to check.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"locales","type":"`string`[]","description":"Locales to check translations for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entities","type":"`Record<string, object>`","description":"Key-value pairs of entity types and their configurations.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"count","type":"`number`","description":"Total number of records for the entity type.\nFor example, total number of products.\n\nThis is necessary to compute expected translation counts.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getStatistics"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[TranslationStatisticsOutput](../../../types/translation.TranslationStatisticsOutput/page.mdx)>","optional":false,"defaultValue":"","description":"Statistics by entity.","expandable":false,"children":[{"name":"expected","type":"`number`","description":"Expected total number of translated fields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translated","type":"`number`","description":"Actual number of translated fields. This doesn't count\ntranslations that are null or empty.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"missing","type":"`number`","description":"Number of missing translations for expected translatable\nfields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"by_locale","type":"`Record<string, [LocaleStatistics](../../../interfaces/translation.LocaleStatistics/page.mdx)>`","description":"Breakdown of statistics by locale.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"expected","type":"`number`","description":"Expected total number of translated fields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translated","type":"`number`","description":"Actual number of translated fields. This doesn't count\ntranslations that are null or empty.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"missing","type":"`number`","description":"Number of missing translations for expected translatable\nfields.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getStatistics"/>
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
slug: /references/translation/getTranslatableFields
|
||||
sidebar_label: getTranslatableFields
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# getTranslatableFields - Translation Module Reference
|
||||
|
||||
This documentation provides a reference to the `getTranslatableFields` method. This belongs to the Translation Module.
|
||||
|
||||
<Note>
|
||||
|
||||
You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference).
|
||||
|
||||
</Note>
|
||||
|
||||
This method retrieves the translatable fields of a resource. For example,
|
||||
product entities have translatable fields such as `title` and `description`.
|
||||
|
||||
## Example
|
||||
|
||||
To get translatable fields for all resources:
|
||||
|
||||
```ts
|
||||
const allFields = translationModuleService.getTranslatableFields()
|
||||
// Returns: { product: ["title", "description", ...], product_variant: ["title", ...] }
|
||||
```
|
||||
|
||||
To get translatable fields for a specific resource:
|
||||
|
||||
```ts
|
||||
const productFields = translationModuleService.getTranslatableFields("product")
|
||||
// Returns: { product: ["title", "description", "subtitle", "status"] }
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"entityType","type":"`string`","description":"Name of the resource's table to get translatable fields for.\nIf not provided, returns all translatable fields for all entity types. For example, `product` or `product_variant`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTranslatableFields"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Record","type":"`Record<string, string[]>`","optional":false,"defaultValue":"","description":"A mapping of resource names to their translatable fields.","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTranslatableFields"/>
|
||||
+46
-1
@@ -18,9 +18,54 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a paginated list of locales along with the total count.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of locales using their IDs:
|
||||
|
||||
```ts
|
||||
const [locales, count] = await translationModuleService.listAndCountLocales({
|
||||
id: ["loc_123", "loc_321"],
|
||||
})
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the locales:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const [locales, count] = await translationModuleService.listAndCountLocales(
|
||||
{
|
||||
id: ["loc_123", "loc_321"],
|
||||
},
|
||||
{
|
||||
relations: ["translations"],
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
const [locales, count] = await translationModuleService.listAndCountLocales(
|
||||
{
|
||||
id: ["loc_123", "loc_321"],
|
||||
},
|
||||
{
|
||||
relations: ["translations"],
|
||||
take: 20,
|
||||
skip: 2,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx)","description":"The filters to apply on the retrieved locales.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/translation.Query/page.mdx)<T>[]","description":"","optLine truncated
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx)","description":"The filters to apply on the retrieved locales.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/translation.Query/page.mdx)<T>[]","description":"","optLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+46
-1
@@ -18,9 +18,54 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a paginated list of translations along with the total count.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of translations using their IDs:
|
||||
|
||||
```ts
|
||||
const [translations, count] = await translationModuleService.listAndCountTranslations({
|
||||
id: ["tra_123", "tra_321"],
|
||||
})
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the translations:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const [translations, count] = await translationModuleService.listAndCountTranslations(
|
||||
{
|
||||
id: ["tra_123", "tra_321"],
|
||||
},
|
||||
{
|
||||
relations: ["locale"],
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
const [translations, count] = await translationModuleService.listAndCountTranslations(
|
||||
{
|
||||
id: ["tra_123", "tra_321"],
|
||||
},
|
||||
{
|
||||
relations: ["locale"],
|
||||
take: 20,
|
||||
skip: 2,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx)","description":"The filters to apply on the retrieved translations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by locale code.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optionaLine truncated
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx)","description":"The filters to apply on the retrieved translations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by locale code.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optionaLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+46
-1
@@ -18,9 +18,54 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a paginated list of locales based on optional filters and configuration.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of locales using their IDs:
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.listLocales({
|
||||
id: ["loc_123", "loc_321"],
|
||||
})
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the locales:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.listLocales(
|
||||
{
|
||||
id: ["loc_123", "loc_321"],
|
||||
},
|
||||
{
|
||||
relations: ["translations"],
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.listLocales(
|
||||
{
|
||||
id: ["loc_123", "loc_321"],
|
||||
},
|
||||
{
|
||||
relations: ["translations"],
|
||||
take: 20,
|
||||
skip: 2,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx)","description":"The filters to apply on the retrieved locales.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/translation.Query/page.mdx)<T>[]","description":"","optLine truncated
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx)","description":"The filters to apply on the retrieved locales.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"$and","type":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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":"([FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableLocaleProps](../../../interfaces/translation.FilterableLocaleProps/page.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`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter locales by their name.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the locales by.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/translation.Query/page.mdx)<T>[]","description":"","optLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+46
-1
@@ -18,9 +18,54 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a paginated list of translations based on optional filters and configuration.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of translations using their IDs:
|
||||
|
||||
```ts
|
||||
const translations = await translationModuleService.listTranslations({
|
||||
id: ["tra_123", "tra_321"],
|
||||
})
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the translations:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const translations = await translationModuleService.listTranslations(
|
||||
{
|
||||
id: ["tra_123", "tra_321"],
|
||||
},
|
||||
{
|
||||
relations: ["locale"],
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
const translations = await translationModuleService.listTranslations(
|
||||
{
|
||||
id: ["tra_123", "tra_321"],
|
||||
},
|
||||
{
|
||||
relations: ["locale"],
|
||||
take: 20,
|
||||
skip: 2,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx)","description":"The filters to apply on the retrieved translations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by locale code.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optionaLine truncated
|
||||
<TypeList types={[{"name":"filters","type":"[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx)","description":"The filters to apply on the retrieved translations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by entity type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string>","description":"Filter translations by locale code.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"$and","type":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"([FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.mdx) \\| [BaseFilterable](../../../interfaces/translation.BaseFilterable/page.mdx)<[FilterableTranslationProps](../../../interfaces/translation.FilterableTranslationProps/page.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":"q","type":"`string`","description":"Search through translated content using this search term.\nThis searches within the JSONB translations field values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/translation.OperatorMap/page.mdx)<string \\| string[]>","description":"The IDs to filter the translations by.","optionaLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+8
-2
@@ -18,10 +18,16 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method restores soft deleted locales by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.restoreLocales(["loc_123", "loc_321"])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the locales to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/translation.RestoreReturn/page.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreLocales"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the locales to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/translation.RestoreReturn/page.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the locale. You can pass to its `returnLinkableKeys`\nproperty any of the locale'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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreLocales"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object with IDs of related records that were restored.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreLocales"/>
|
||||
<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.\n\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreLocales"/>
|
||||
+8
-2
@@ -18,10 +18,16 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method restores soft deleted translations by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.restoreTranslations(["tra_123", "tra_321"])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the translations to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/translation.RestoreReturn/page.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreTranslations"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects with IDs identifying the translations to restore.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/translation.RestoreReturn/page.mdx)<TReturnableLinkableKeys>","description":"Configurations determining which relations to restore along with each of the translation. You can pass to its `returnLinkableKeys`\nproperty any of the translation'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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreTranslations"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object with IDs of related records that were restored.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreTranslations"/>
|
||||
<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.\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="restoreTranslations"/>
|
||||
+24
-1
@@ -18,9 +18,32 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a locale by its ID.
|
||||
|
||||
## Example
|
||||
|
||||
A simple example that retrieves a locale by its ID:
|
||||
|
||||
```ts
|
||||
const locale = await translationModuleService.retrieveLocale("loc_123")
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const locale = await translationModuleService.retrieveLocale("loc_123", {
|
||||
relations: ["translations"],
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/translation.FindConfig/page.mdx)<[LocaleDTO](../../../interfaces/translation.LocaleDTO/page.mdx)>","description":"The configurations determining how the locale is retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` & `object` \\| 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.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](../../../types/translation.FindConfigOrder/page.mdx)","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":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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","typeLine truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/translation.FindConfig/page.mdx)<[LocaleDTO](../../../interfaces/translation.LocaleDTO/page.mdx)>","description":"The configurations determining how the locale is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a locale.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` & `object` \\| 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.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](../../../types/translation.FindConfigOrder/page.mdx)","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":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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 curreLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+23
@@ -18,6 +18,29 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method retrieves a translation by its ID.
|
||||
|
||||
## Example
|
||||
|
||||
A simple example that retrieves a translation by its ID:
|
||||
|
||||
```ts
|
||||
const translation = await translationModuleService.retrieveTranslation("tra_123")
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved:
|
||||
|
||||
:::note
|
||||
|
||||
You can only retrieve data models defined in the same module. To retrieve linked data models
|
||||
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
|
||||
|
||||
:::
|
||||
|
||||
```ts
|
||||
const translation = await translationModuleService.retrieveTranslation("tra_123", {
|
||||
relations: ["locale"],
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the translation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/translation.FindConfig/page.mdx)<[TranslationDTO](../../../interfaces/translation.TranslationDTO/page.mdx)>","description":"The configurations determining how the translation is retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` & `object` \\| 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.\n\nYou can only retrieve data models defined in the same module. To retrieve linked data models\nfrom other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"[FindConfigOrder](../../../types/translation.FindConfigOrder/page.mdx)","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":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":"iLine truncated
|
||||
|
||||
+8
-2
@@ -18,10 +18,16 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method soft deletes locales by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.softDeleteLocales(["loc_123", "loc_321"])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the locales to soft delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/translation.SoftDeleteReturn/page.mdx)<TReturnableLinkableKeys>","description":"An object for related entities that should be soft-deleted.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteLocales"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the locales to soft delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/translation.SoftDeleteReturn/page.mdx)<TReturnableLinkableKeys>","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteLocales"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object with IDs of related records that were also soft deleted.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteLocales"/>
|
||||
<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.\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteLocales"/>
|
||||
+8
-2
@@ -18,10 +18,16 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method soft deletes translations by their IDs or objects.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
await translationModuleService.softDeleteTranslations(["tra_123", "tra_321"])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects identifying the translations to soft delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/translation.SoftDeleteReturn/page.mdx)<TReturnableLinkableKeys>","description":"An object for related entities that should be soft-deleted.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteTranslations"/>
|
||||
<TypeList types={[{"name":"primaryKeyValues","type":"`string` \\| `object` \\| `string`[] \\| `object`[]","description":"The IDs or objects with IDs identifying the translations to soft delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/translation.SoftDeleteReturn/page.mdx)<TReturnableLinkableKeys>","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","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/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteTranslations"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void \\| Record<string, string[]>>","optional":false,"defaultValue":"","description":"An object with IDs of related records that were also soft deleted.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteTranslations"/>
|
||||
<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.\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record<string, string[]>","type":"`void` \\| `Record<string, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="softDeleteTranslations"/>
|
||||
+41
-2
@@ -20,6 +20,15 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method updates an existing locale. The ID should be included in the data object.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const locale = await translationModuleService.updateLocales({
|
||||
id: "loc_123",
|
||||
name: "English (United States)",
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateLocaleDTO](../../../interfaces/translation.UpdateLocaleDTO/page.mdx)","description":"The attributes to update in the locale (including id).","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the locale to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateLocales"/>
|
||||
@@ -30,11 +39,41 @@ This method updates an existing locale. The ID should be included in the data ob
|
||||
|
||||
## updateLocales(dataOrOptions, sharedContext?): Promise<[LocaleDTO](../../../interfaces/translation.LocaleDTO/page.mdx)[]>
|
||||
|
||||
This method updates existing locales using an array or selector-based approach.
|
||||
This method updates existing locales either by ID or by a selector.
|
||||
|
||||
### Example
|
||||
|
||||
To update locales by their IDs:
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.updateLocales([
|
||||
{
|
||||
id: "loc_123",
|
||||
name: "English (United States)",
|
||||
},
|
||||
{
|
||||
id: "loc_321",
|
||||
name: "French (France)",
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
To update locales by a selector:
|
||||
|
||||
```ts
|
||||
const locales = await translationModuleService.updateLocales({
|
||||
selector: {
|
||||
code: "en-US",
|
||||
},
|
||||
data: {
|
||||
name: "English (United States)",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"dataOrOptions","type":"[UpdateLocaleDTO](../../../interfaces/translation.UpdateLocaleDTO/page.mdx)[] \\| `object`","description":"The data or options for bulk update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the locale to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"selector","type":"`Record<string, any>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateLocaleDTO](../../../interfaces/translation.UpdateLocaleDTO/page.mdx) \\| [UpdateLocaleDTO](../../../interfaces/translation.UpdateLocaleDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the locale to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultVaLine truncated
|
||||
<TypeList types={[{"name":"dataOrOptions","type":"`object` \\| [UpdateLocaleDTO](../../../interfaces/translation.UpdateLocaleDTO/page.mdx)[]","description":"The data or options for bulk update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"selector","type":"`Record<string, any>`","description":"The selector to update the locales by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateLocaleDataDTO](../../../interfaces/translation.UpdateLocaleDataDTO/page.mdx) \\| [UpdateLocaleDataDTO](../../../interfaces/translation.UpdateLocaleDataDTO/page.mdx)[]","description":"The data to update the locales with.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the locale to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="hLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+28
-2
@@ -20,9 +20,21 @@ You should only use this methods when implementing complex customizations. For c
|
||||
|
||||
This method updates an existing translation. The ID should be included in the data object.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const translation = await translationModuleService.updateTranslations({
|
||||
id: "tra_123",
|
||||
translations: {
|
||||
title: "Titre du produit",
|
||||
description: "Description du produit en français",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"data","type":"[UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx)","description":"The attributes to update in the translation (including id).","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateTranslations"/>
|
||||
<TypeList types={[{"name":"data","type":"[UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx)","description":"The attributes to update in the translation (including id).","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"preventReleaseEvents","type":"`boolean`","description":"preventReleaseEvents","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isCancelling","type":"`boolean`","description":"A boolean value indicating whether the current workflow execution is being cancelled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cancelingFromParentStep","type":"`boolean`","description":"Weither or not a sub workflow cancellation is being triggered from a parent step.\nIf true, the parent step will not be triggered by the sub workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateTranslations"/>
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -32,9 +44,23 @@ This method updates an existing translation. The ID should be included in the da
|
||||
|
||||
This method updates existing translations using an array or selector-based approach.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const translations = await translationModuleService.updateTranslations([
|
||||
{
|
||||
id: "tra_123",
|
||||
translations: {
|
||||
title: "Titre du produit",
|
||||
description: "Description du produit en français",
|
||||
},
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"dataOrOptions","type":"[UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx)[] \\| `object`","description":"The data or options for bulk update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"selector","type":"`Record<string, any>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx) \\| [UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`",Line truncated
|
||||
<TypeList types={[{"name":"dataOrOptions","type":"`object` \\| [UpdateTranslationDTO](../../../interfaces/translation.UpdateTranslationDTO/page.mdx)[]","description":"The data or options for bulk update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"selector","type":"`Record<string, any>`","description":"The selector to update the translations by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateTranslationDataDTO](../../../interfaces/translation.UpdateTranslationDataDTO/page.mdx) \\| [UpdateTranslationDataDTO](../../../interfaces/translation.UpdateTranslationDataDTO/page.mdx)[]","description":"The data to update the translations with.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/translation.Context/page.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":"runId","type":"`string`","description":"A string indicating the ID of the current run.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/translation.IMessageAggregator/page.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":[]},{"name":"parentStepIdempotencyKey","type":"`string`","descriptLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
The locale to be created.
|
||||
|
||||
<TypeList types={[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale (e.g., \"English (United States)\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateLocaleDTO"/>
|
||||
<TypeList types={[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the locale to create.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateLocaleDTO"/>
|
||||
+1
-1
@@ -8,4 +8,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
The translation to be created.
|
||||
|
||||
<TypeList types={[{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated (e.g., \"product\", \"product\\_variant\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation (e.g., \"en-US\", \"fr-FR\").","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateTranslationDTO"/>
|
||||
<TypeList types={[{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CreateTranslationDTO"/>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# EntityTypeStatistics
|
||||
|
||||
Statistics for an entity type.
|
||||
|
||||
<TypeList types={[{"name":"expected","type":"`number`","description":"Expected total number of translated fields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translated","type":"`number`","description":"Actual number of translated fields. This doesn't count\ntranslations that are null or empty.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"missing","type":"`number`","description":"Number of missing translations for expected translatable\nfields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"by_locale","type":"`Record<string, [LocaleStatistics](../translation.LocaleStatistics/page.mdx)>`","description":"Breakdown of statistics by locale.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"expected","type":"`number`","description":"Expected total number of translated fields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translated","type":"`number`","description":"Actual number of translated fields. This doesn't count\ntranslations that are null or empty.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"missing","type":"`number`","description":"Number of missing translations for expected translatable\nfields.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="EntityTypeStatistics"/>
|
||||
+2
-1
@@ -16,7 +16,6 @@ You should only use the methods in this reference when implementing complex cust
|
||||
</Note>
|
||||
|
||||
The main service interface for the Translation Module.
|
||||
Method signatures match what MedusaService generates.
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -24,6 +23,8 @@ Method signatures match what MedusaService generates.
|
||||
- [createTranslations](../../ITranslationModuleService/methods/translation.ITranslationModuleService.createTranslations/page.mdx)
|
||||
- [deleteLocales](../../ITranslationModuleService/methods/translation.ITranslationModuleService.deleteLocales/page.mdx)
|
||||
- [deleteTranslations](../../ITranslationModuleService/methods/translation.ITranslationModuleService.deleteTranslations/page.mdx)
|
||||
- [getStatistics](../../ITranslationModuleService/methods/translation.ITranslationModuleService.getStatistics/page.mdx)
|
||||
- [getTranslatableFields](../../ITranslationModuleService/methods/translation.ITranslationModuleService.getTranslatableFields/page.mdx)
|
||||
- [listAndCountLocales](../../ITranslationModuleService/methods/translation.ITranslationModuleService.listAndCountLocales/page.mdx)
|
||||
- [listAndCountTranslations](../../ITranslationModuleService/methods/translation.ITranslationModuleService.listAndCountTranslations/page.mdx)
|
||||
- [listLocales](../../ITranslationModuleService/methods/translation.ITranslationModuleService.listLocales/page.mdx)
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# LocaleStatistics
|
||||
|
||||
Statistics for a specific locale.
|
||||
|
||||
<TypeList types={[{"name":"expected","type":"`number`","description":"Expected total number of translated fields.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"translated","type":"`number`","description":"Actual number of translated fields. This doesn't count\ntranslations that are null or empty.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"missing","type":"`number`","description":"Number of missing translations for expected translatable\nfields.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="LocaleStatistics"/>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# TranslationStatisticsInput
|
||||
|
||||
Input for getStatistics method.
|
||||
|
||||
<TypeList types={[{"name":"locales","type":"`string`[]","description":"Locales to check translations for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entities","type":"`Record<string, object>`","description":"Key-value pairs of entity types and their configurations.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"count","type":"`number`","description":"Total number of records for the entity type.\nFor example, total number of products.\n\nThis is necessary to compute expected translation counts.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="TranslationStatisticsInput"/>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# UpdateLocaleDataDTO
|
||||
|
||||
The data to update in the locale.
|
||||
|
||||
<TypeList types={[{"name":"code","type":"`string`","description":"The BCP 47 language tag code of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The human-readable name of the locale.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateLocaleDataDTO"/>
|
||||
+1
-1
@@ -8,4 +8,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
The attributes to update in the translation.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The type of entity being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateTranslationDTO"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the translation to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateTranslationDTO"/>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# UpdateTranslationDataDTO
|
||||
|
||||
The attributes to update in translations matching a selector.
|
||||
|
||||
<TypeList types={[{"name":"reference_id","type":"`string`","description":"The ID of the data model being translated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reference","type":"`string`","description":"The name of the table that the translation belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"locale_code","type":"`string`","description":"The BCP 47 language tag code for this translation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"translations","type":"`Record<string, unknown>`","description":"The translated fields as key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateTranslationDataDTO"/>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
---
|
||||
displayed_sidebar: translationReference
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# TranslationStatisticsOutput
|
||||
|
||||
**TranslationStatisticsOutput**: `Record<string, [EntityTypeStatistics](../../interfaces/translation.EntityTypeStatistics/page.mdx)>`
|
||||
|
||||
Output of getStatistics method.
|
||||
Maps entity types to their translation statistics.
|
||||
Reference in new issue
Block a user