chore: Update modules providers configuration with 'identifier' and 'PROVIDER' (#9636)
* chore: Update modules providers configuration with 'identifier' and 'PROVIDER' * update check * fix tests * type * normalize auth provider * emailpass * providers --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
902ac12f73
commit
876d8072e7
@@ -19,3 +19,4 @@ export * from "./module-provider"
|
||||
export * from "./query-context"
|
||||
export * from "./types/links-config"
|
||||
export * from "./types/medusa-service"
|
||||
export * from "./module-provider-registration-key"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
export const moduleProviderRegistrationKeyPrefix = "__providers__"
|
||||
|
||||
/**
|
||||
* Return the key used to register a module provider in the container
|
||||
* @param {string} moduleKey
|
||||
* @return {string}
|
||||
*/
|
||||
export function getProviderRegistrationKey({
|
||||
providerId,
|
||||
providerIdentifier,
|
||||
}: {
|
||||
providerId?: string
|
||||
providerIdentifier?: string
|
||||
}): string {
|
||||
const registrationIdentifier = `${
|
||||
providerIdentifier ? providerIdentifier : ""
|
||||
}${providerId ? `${providerIdentifier ? "_" : ""}${providerId}` : ""}`
|
||||
return moduleProviderRegistrationKeyPrefix + registrationIdentifier
|
||||
}
|
||||
Reference in New Issue
Block a user