fix(medusa): fix constructor container type for abstract services (#6259)

This commit is contained in:
Shahed Nasser
2024-02-08 11:36:45 +02:00
committed by GitHub
parent 5c6ba674fb
commit 3ded2314a5
8 changed files with 19 additions and 14 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): fix constructor container type for abstract services

View File

@@ -299,7 +299,7 @@ export abstract class AbstractFileService
* Additionally, if youre creating your file service as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin,
* you can access them in the constructor.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this file service is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -334,7 +334,7 @@ export abstract class AbstractFileService
* }
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)

View File

@@ -415,7 +415,7 @@ export abstract class AbstractFulfillmentService
* You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party providers APIs, you can initialize it in the constructor and use it in other methods in the service.
* Additionally, if youre creating your fulfillment provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this fulfillment provider is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -433,7 +433,7 @@ export abstract class AbstractFulfillmentService
* }
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)

View File

@@ -234,7 +234,7 @@ export abstract class AbstractNotificationService
* Additionally, if youre creating your notification provider as an external plugin to be installed on any Medusa backend and you want to access the options
* added for the plugin, you can access it in the constructor.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this notification provider is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -264,7 +264,7 @@ export abstract class AbstractNotificationService
* export default EmailSenderService
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)

View File

@@ -652,7 +652,7 @@ export abstract class AbstractPaymentProcessor implements PaymentProcessor {
* Additionally, if youre creating your Payment Processor as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin,
* you can access it in the constructor. The options are passed as a second parameter.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend through [dependency injection](https://docs.medusajs.com/development/fundamentals/dependency-injection)
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend through [dependency injection](https://docs.medusajs.com/development/fundamentals/dependency-injection)
* @param {Record<string, unknown>} config - If this fulfillment provider is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -672,7 +672,7 @@ export abstract class AbstractPaymentProcessor implements PaymentProcessor {
* ```
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {}

View File

@@ -225,7 +225,7 @@ export abstract class AbstractPriceSelectionStrategy
/**
* You can use the `constructor` of your price-selection strategy to access the different services in Medusa through dependency injection.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this price-selection strategy is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -254,7 +254,7 @@ export abstract class AbstractPriceSelectionStrategy
* export default MyStrategy
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)

View File

@@ -128,7 +128,7 @@ export abstract class AbstractTaxCalculationStrategy
* You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party providers APIs, you can initialize it in the constructor and use it in other methods in the service.
* Additionally, if youre creating your tax calculation strategy as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this tax calculation strategy is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -156,7 +156,7 @@ export abstract class AbstractTaxCalculationStrategy
* export default TaxCalculationStrategy
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)

View File

@@ -206,7 +206,7 @@ export abstract class AbstractTaxService
* You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party providers APIs, you can initialize it in the constructor and use it in other methods in the service.
* Additionally, if youre creating your tax provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor.
*
* @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
* @param {Record<string, unknown>} config - If this tax provider is created in a plugin, the plugin's options are passed in this parameter.
*
* @example
@@ -235,7 +235,7 @@ export abstract class AbstractTaxService
* export default MyTaxService
*/
protected constructor(
protected readonly container: MedusaContainer,
protected readonly container: Record<string, unknown>,
protected readonly config?: Record<string, unknown> // eslint-disable-next-line @typescript-eslint/no-empty-function
) {
super(container, config)