docs: prep for v2 documentation (#6710)
This PR includes documentation that preps for v2 docs (but doesn't introduce new docs). _Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._ ## Changes - Change Medusa version in base OAS used for v2. - Fix to docblock generator related to not catching all path parameters. - Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules. - Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used. - Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment. - Upgraded docusaurus to v3.0.1 - Added new Vale rules to ensure correct spelling of Medusa Admin and module names. - Added new components to the `docs-ui` package that will be used in future documentation changes.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
displayed_sidebar: servicesSidebar
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
import TypeList from "@site/src/components/TypeList"
|
||||
|
||||
# NotificationService
|
||||
|
||||
@@ -10,13 +10,13 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"container","type":"`InjectedDependencies`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new NotificationService"/>
|
||||
<TypeList types={[{"name":"container","type":"`InjectedDependencies`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new NotificationService"/>
|
||||
|
||||
___
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[{"name":"manager_","type":"`EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionManager_","type":"`undefined` \\| `EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__container__","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subscribers_","type":"`object`","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[]},{"name":"attachmentGenerator_","type":"`unknown`","description":"","optional":false,"defaultValue":"null","expandable":false,"children":[]},{"name":"container_","type":"`InjectedDependencies` & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"logger_","type":"[Logger](../../medusa/types/medusa.Logger.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notificationRepository_","type":"Repository<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notificationProviderRepository_","type":"Repository<[NotificationProvider](../../entities/classes/entities.NotificationProvider.mdx)>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__configModule__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="NotificationService"/>
|
||||
<TypeList types={[{"name":"manager_","type":"`EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionManager_","type":"`undefined` \\| `EntityManager`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__container__","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subscribers_","type":"`object`","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[]},{"name":"attachmentGenerator_","type":"`unknown`","description":"","optional":false,"defaultValue":"null","expandable":false,"children":[]},{"name":"container_","type":"`InjectedDependencies` & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"logger_","type":"[Logger](../../medusa/types/medusa.Logger.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notificationRepository_","type":"Repository<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notificationProviderRepository_","type":"Repository<[NotificationProvider](../../entities/classes/entities.NotificationProvider.mdx)>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__configModule__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="NotificationService"/>
|
||||
|
||||
___
|
||||
|
||||
@@ -26,7 +26,7 @@ ___
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"EntityManager","type":"`EntityManager`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="activeManager_"/>
|
||||
<TypeList types={[{"name":"EntityManager","type":"`EntityManager`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="activeManager_"/>
|
||||
|
||||
___
|
||||
|
||||
@@ -36,21 +36,21 @@ ___
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"transactionManager","type":"`EntityManager`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="withTransaction"/>
|
||||
<TypeList types={[{"name":"transactionManager","type":"`EntityManager`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="withTransaction"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"this","type":"`this`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="withTransaction"/>
|
||||
<TypeList types={[{"name":"this","type":"`this`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="withTransaction"/>
|
||||
|
||||
### shouldRetryTransaction\_
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"err","type":"`Record<string, unknown>` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/>
|
||||
<TypeList types={[{"name":"err","type":"`Record<string, unknown>` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/>
|
||||
<TypeList types={[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/>
|
||||
|
||||
### atomicPhase\_
|
||||
|
||||
@@ -60,15 +60,15 @@ transaction manager is created.
|
||||
|
||||
#### Type Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TError","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TError","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"work","type":"(`transactionManager`: `EntityManager`) => Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
<TypeList types={[{"name":"work","type":"(`transactionManager`: `EntityManager`) => Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<TResult>","optional":false,"defaultValue":"","description":"the result of the transactional work","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<TResult>","optional":false,"defaultValue":"","description":"the result of the transactional work","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
|
||||
|
||||
### registerAttachmentGenerator
|
||||
|
||||
@@ -77,11 +77,11 @@ used to generate on demand invoices or other documents.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"service","type":"`unknown`","description":"the service to assign to the attachmentGenerator","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="registerAttachmentGenerator"/>
|
||||
<TypeList types={[{"name":"service","type":"`unknown`","description":"the service to assign to the attachmentGenerator","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="registerAttachmentGenerator"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"Registers an attachment generator to the service. The generator can be\nused to generate on demand invoices or other documents.","expandable":false,"children":[]}]} sectionTitle="registerAttachmentGenerator"/>
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"Registers an attachment generator to the service. The generator can be\nused to generate on demand invoices or other documents.","expandable":false,"children":[]}]} sectionTitle="registerAttachmentGenerator"/>
|
||||
|
||||
### registerInstalledProviders
|
||||
|
||||
@@ -89,11 +89,11 @@ Takes a list of notification provider ids and persists them in the database.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"providerIds","type":"`string`[]","description":"a list of provider ids","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="registerInstalledProviders"/>
|
||||
<TypeList types={[{"name":"providerIds","type":"`string`[]","description":"a list of provider ids","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="registerInstalledProviders"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Takes a list of notification provider ids and persists them in the database.","expandable":false,"children":[]}]} sectionTitle="registerInstalledProviders"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"Takes a list of notification provider ids and persists them in the database.","expandable":false,"children":[]}]} sectionTitle="registerInstalledProviders"/>
|
||||
|
||||
### list
|
||||
|
||||
@@ -101,11 +101,11 @@ Retrieves a list of notifications.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"selector","type":"[Selector](../../medusa/types/medusa.Selector.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the params to select the notifications by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"selector","type":"[Selector](../../medusa/types/medusa.Selector.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the params to select the notifications by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="list"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)[]>","optional":false,"defaultValue":"","description":"the notifications that satisfy the query.","expandable":false,"children":[]}]} sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)[]>","optional":false,"defaultValue":"","description":"the notifications that satisfy the query.","expandable":false,"children":[]}]} sectionTitle="list"/>
|
||||
|
||||
### listAndCount
|
||||
|
||||
@@ -113,11 +113,11 @@ Retrieves a list of notifications and total count.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"selector","type":"[Selector](../../medusa/types/medusa.Selector.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the params to select the notifications by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="listAndCount"/>
|
||||
<TypeList types={[{"name":"selector","type":"[Selector](../../medusa/types/medusa.Selector.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the params to select the notifications by.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="listAndCount"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<[[Notification](../../entities/classes/entities.Notification.mdx)[], number]>","optional":false,"defaultValue":"","description":"the notifications that satisfy the query as well as the count.","expandable":false,"children":[]}]} sectionTitle="listAndCount"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[[Notification](../../entities/classes/entities.Notification.mdx)[], number]>","optional":false,"defaultValue":"","description":"the notifications that satisfy the query as well as the count.","expandable":false,"children":[]}]} sectionTitle="listAndCount"/>
|
||||
|
||||
### retrieve
|
||||
|
||||
@@ -125,11 +125,11 @@ Retrieves a notification with a given id
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"id","type":"`string`","description":"the id of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"{}","expandable":false,"children":[]}]} sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"the id of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"the configuration to apply to the query","optional":false,"defaultValue":"{}","expandable":false,"children":[]}]} sectionTitle="retrieve"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the notification","expandable":false,"children":[]}]} sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the notification","expandable":false,"children":[]}]} sectionTitle="retrieve"/>
|
||||
|
||||
### subscribe
|
||||
|
||||
@@ -137,11 +137,11 @@ Subscribes a given provider to an event.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"eventName","type":"`string`","description":"the event to subscribe to","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providerId","type":"`string`","description":"the provider that the event will be sent to","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="subscribe"/>
|
||||
<TypeList types={[{"name":"eventName","type":"`string`","description":"the event to subscribe to","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providerId","type":"`string`","description":"the provider that the event will be sent to","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="subscribe"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"Subscribes a given provider to an event.","expandable":false,"children":[]}]} sectionTitle="subscribe"/>
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"Subscribes a given provider to an event.","expandable":false,"children":[]}]} sectionTitle="subscribe"/>
|
||||
|
||||
### retrieveProvider\_
|
||||
|
||||
@@ -150,11 +150,11 @@ resolution fails.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"id","type":"`string`","description":"the id of the provider","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrieveProvider_"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"the id of the provider","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrieveProvider_"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"AbstractNotificationService","type":"`object`","description":"## Overview\n\n:::note[Prerequisites]\n\nBefore creating a Notification Provider, [install an event bus module](https://docs.medusajs.com/development/events/modules/redis).\n\n:::\n\nA Notification Provider is a provider that handles sending and resending of notifications.\n\nTo create a Notification Provider, create a TypeScript or JavaScript file in `src/services`. The name of the file is the name of the provider\n(for example, `sendgrid.ts`). The file must export a class that extends the `AbstractNotificationService` class imported from `@medusajs/medusa`.\n\nFor example, create the file `src/services/email-sender.ts` with the following content:\n\n```ts title=\"src/services/email-sender.ts\"\nimport { AbstractNotificationService } from \"@medusajs/medusa\"\nimport { EntityManager } from \"typeorm\"\n\nclass EmailSenderService extends AbstractNotificationService {\n protected manager_: EntityManager\n protected transactionManager_: EntityManager\n\n sendNotification(\n event: string,\n data: unknown,\n attachmentGenerator: unknown\n ): Promise<{\n to: string;\n status: string;\n data: Record<string, unknown>;\n }> {\n throw new Error(\"Method not implemented.\")\n }\n resendNotification(\n notification: unknown,\n config: unknown,\n attachmentGenerator: unknown\n ): Promise<{\n to: string;\n status: string;\n data: Record<string, unknown>;\n }> {\n throw new Error(\"Method not implemented.\")\n }\n\n}\n\nexport default EmailSenderService\n```\n\n---\n\n## Identifier Property\n\nThe `NotificationProvider` entity has 2 properties: `identifier` and `is_installed`. The value of the `identifier` property in the notification provider\nclass is used when the Notification Provider is created in the database.\n\nThe value of this property is also used later when you want to subscribe the Notification Provider to events in a [Loader](https://docs.medusajs.com/development/loaders/overview).\n\nFor example:\n\n```ts\nclass EmailSenderService extends AbstractNotificationService {\n static identifier = \"email-sender\"\n // ...\n}\n```\n\n---","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrieveProvider_"/>
|
||||
<TypeList types={[{"name":"AbstractNotificationService","type":"`object`","description":"## Overview\n\n:::note[Prerequisites]\n\nBefore creating a Notification Provider, [install an event bus module](https://docs.medusajs.com/development/events/modules/redis).\n\n:::\n\nA Notification Provider is a provider that handles sending and resending of notifications.\n\nTo create a Notification Provider, create a TypeScript or JavaScript file in `src/services`. The name of the file is the name of the provider\n(for example, `sendgrid.ts`). The file must export a class that extends the `AbstractNotificationService` class imported from `@medusajs/medusa`.\n\nFor example, create the file `src/services/email-sender.ts` with the following content:\n\n```ts title=\"src/services/email-sender.ts\"\nimport { AbstractNotificationService } from \"@medusajs/medusa\"\nimport { EntityManager } from \"typeorm\"\n\nclass EmailSenderService extends AbstractNotificationService {\n protected manager_: EntityManager\n protected transactionManager_: EntityManager\n\n sendNotification(\n event: string,\n data: unknown,\n attachmentGenerator: unknown\n ): Promise<{\n to: string;\n status: string;\n data: Record<string, unknown>;\n }> {\n throw new Error(\"Method not implemented.\")\n }\n resendNotification(\n notification: unknown,\n config: unknown,\n attachmentGenerator: unknown\n ): Promise<{\n to: string;\n status: string;\n data: Record<string, unknown>;\n }> {\n throw new Error(\"Method not implemented.\")\n }\n\n}\n\nexport default EmailSenderService\n```\n\n---\n\n## Identifier Property\n\nThe `NotificationProvider` entity has 2 properties: `identifier` and `is_installed`. The value of the `identifier` property in the notification provider\nclass is used when the Notification Provider is created in the database.\n\nThe value of this property is also used later when you want to subscribe the Notification Provider to events in a [Loader](https://docs.medusajs.com/development/loaders/overview).\n\nFor example:\n\n```ts\nclass EmailSenderService extends AbstractNotificationService {\n static identifier = \"email-sender\"\n // ...\n}\n```\n\n---","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrieveProvider_"/>
|
||||
|
||||
### handleEvent
|
||||
|
||||
@@ -164,11 +164,11 @@ order to allow for resends. Will log any errors that are encountered.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"eventName","type":"`string`","description":"the event to handle","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"the data the event was sent with","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="handleEvent"/>
|
||||
<TypeList types={[{"name":"eventName","type":"`string`","description":"the event to handle","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"the data the event was sent with","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="handleEvent"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<undefined \\| void \\| [Notification](../../entities/classes/entities.Notification.mdx)[]>","optional":false,"defaultValue":"","description":"the result of notification subscribed","expandable":false,"children":[]}]} sectionTitle="handleEvent"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<undefined \\| void \\| [Notification](../../entities/classes/entities.Notification.mdx)[]>","optional":false,"defaultValue":"","description":"the result of notification subscribed","expandable":false,"children":[]}]} sectionTitle="handleEvent"/>
|
||||
|
||||
### send
|
||||
|
||||
@@ -177,11 +177,11 @@ method. Persists the Notification in the database.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"event","type":"`string`","description":"the name of the event","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventData","type":"`Record<string, unknown>`","description":"the data the event was sent with","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providerId","type":"`string`","description":"the provider that should handle the event.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="send"/>
|
||||
<TypeList types={[{"name":"event","type":"`string`","description":"the name of the event","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventData","type":"`Record<string, unknown>`","description":"the data the event was sent with","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providerId","type":"`string`","description":"the provider that should handle the event.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="send"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<undefined \\| [Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the created notification","expandable":false,"children":[]}]} sectionTitle="send"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<undefined \\| [Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the created notification","expandable":false,"children":[]}]} sectionTitle="send"/>
|
||||
|
||||
### resend
|
||||
|
||||
@@ -190,8 +190,8 @@ underlying provider's resendNotification method.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[{"name":"id","type":"`string`","description":"the id of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"any configuration that might override the previous\n send","optional":false,"defaultValue":"{}","expandable":false,"children":[]}]} sectionTitle="resend"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"the id of the notification","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../medusa/interfaces/medusa.FindConfig.mdx)<[Notification](../../entities/classes/entities.Notification.mdx)>","description":"any configuration that might override the previous\n send","optional":false,"defaultValue":"{}","expandable":false,"children":[]}]} sectionTitle="resend"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<ParameterTypes parameters={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the newly created notification","expandable":false,"children":[]}]} sectionTitle="resend"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[Notification](../../entities/classes/entities.Notification.mdx)>","optional":false,"defaultValue":"","description":"the newly created notification","expandable":false,"children":[]}]} sectionTitle="resend"/>
|
||||
|
||||
Reference in New Issue
Block a user