diff --git a/.changeset/shy-wolves-mix.md b/.changeset/shy-wolves-mix.md new file mode 100644 index 0000000000000..7a2a8eec036f9 --- /dev/null +++ b/.changeset/shy-wolves-mix.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +fix(medusa): fix constructor container type for abstract services diff --git a/packages/medusa/src/interfaces/file-service.ts b/packages/medusa/src/interfaces/file-service.ts index 1fa77971a0c08..fa4543a7c5d6b 100644 --- a/packages/medusa/src/interfaces/file-service.ts +++ b/packages/medusa/src/interfaces/file-service.ts @@ -299,7 +299,7 @@ export abstract class AbstractFileService * Additionally, if you’re 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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config) diff --git a/packages/medusa/src/interfaces/fulfillment-service.ts b/packages/medusa/src/interfaces/fulfillment-service.ts index 26f946d1b78a4..a8879b2bf3792 100644 --- a/packages/medusa/src/interfaces/fulfillment-service.ts +++ b/packages/medusa/src/interfaces/fulfillment-service.ts @@ -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 provider’s APIs, you can initialize it in the constructor and use it in other methods in the service. * Additionally, if you’re 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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config) diff --git a/packages/medusa/src/interfaces/notification-service.ts b/packages/medusa/src/interfaces/notification-service.ts index 40ef37995f84a..edf62ef60d167 100644 --- a/packages/medusa/src/interfaces/notification-service.ts +++ b/packages/medusa/src/interfaces/notification-service.ts @@ -234,7 +234,7 @@ export abstract class AbstractNotificationService * Additionally, if you’re 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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config) diff --git a/packages/medusa/src/interfaces/payment-processor.ts b/packages/medusa/src/interfaces/payment-processor.ts index fd6cb9ecc7886..58d08e53c9798 100644 --- a/packages/medusa/src/interfaces/payment-processor.ts +++ b/packages/medusa/src/interfaces/payment-processor.ts @@ -652,7 +652,7 @@ export abstract class AbstractPaymentProcessor implements PaymentProcessor { * Additionally, if you’re 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} 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} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) {} diff --git a/packages/medusa/src/interfaces/price-selection-strategy.ts b/packages/medusa/src/interfaces/price-selection-strategy.ts index f621334ff8730..4070c6371e9d9 100644 --- a/packages/medusa/src/interfaces/price-selection-strategy.ts +++ b/packages/medusa/src/interfaces/price-selection-strategy.ts @@ -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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config) diff --git a/packages/medusa/src/interfaces/tax-calculation-strategy.ts b/packages/medusa/src/interfaces/tax-calculation-strategy.ts index 95c2cb8dcb0a9..9ab102f5e4b5b 100644 --- a/packages/medusa/src/interfaces/tax-calculation-strategy.ts +++ b/packages/medusa/src/interfaces/tax-calculation-strategy.ts @@ -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 provider’s APIs, you can initialize it in the constructor and use it in other methods in the service. * Additionally, if you’re 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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config) diff --git a/packages/medusa/src/interfaces/tax-service.ts b/packages/medusa/src/interfaces/tax-service.ts index c8c38e070c087..c4dff54c69916 100644 --- a/packages/medusa/src/interfaces/tax-service.ts +++ b/packages/medusa/src/interfaces/tax-service.ts @@ -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 provider’s APIs, you can initialize it in the constructor and use it in other methods in the service. * Additionally, if you’re 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} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend. * @param {Record} 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, protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function ) { super(container, config)