chore(utils): update tsdocs for provider identifiers (#9656)

This commit is contained in:
Shahed Nasser
2024-10-18 17:32:15 +03:00
committed by GitHub
parent 1e0f6188ec
commit 30659b077a
4 changed files with 106 additions and 26 deletions
@@ -49,8 +49,24 @@ export class AbstractNotificationProviderService
implements INotificationProvider
{
/**
* Override this static method in order for the loader to validate the options provided to the module provider.
* @param options
* This method validates the options of the provider set in `medusa-config.ts`.
* Implementing this method is optional. It's useful if your provider requires custom validation.
*
* If the options aren't valid, throw an error.
*
* @param options - The provider's options.
*
* @example
* class MyNotificationProviderService extends AbstractNotificationProviderService {
* static validateOptions(options: Record<any, any>) {
* if (!options.apiKey) {
* throw new MedusaError(
* MedusaError.Types.INVALID_DATA,
* "API key is required in the provider's options."
* )
* }
* }
* }
*/
static validateOptions(options: Record<any, any>): void | never {}