docs: update imports and package names across docs (#9375)

* docs: update imports and package names across docs
+ reference configs

* generate files

* fix import

* change preview to rc
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-10-01 11:03:42 +02:00
1 parent c726ed54f5
commit 2e16949979
196 files changed
+1379 -1491

No files matched your search

@@ -18,10 +18,10 @@ Start by creating a new directory for your module. For example, `src/modules/my-
## 2. Create the Auth Provider Service
Create the file `src/modules/my-auth/service.ts` that holds the module's main service. It must extend the `AbstractAuthModuleProvider` class imported from `@medusajs/utils`:
Create the file `src/modules/my-auth/service.ts` that holds the module's main service. It must extend the `AbstractAuthModuleProvider` class imported from `@medusajs/framework/utils`:
```ts title="src/modules/my-auth/service.ts"
import { AbstractAuthModuleProvider } from "@medusajs/utils"
import { AbstractAuthModuleProvider } from "@medusajs/framework/utils"
class MyAuthProviderService extends AbstractAuthModuleProvider {
// TODO implement methods
@@ -47,8 +47,8 @@ In the constructor, you must pass to the parent constructor two parameters:
#### Example
```ts
import { AbstractAuthModuleProvider } from "@medusajs/utils"
import { Logger } from "@medusajs/types"
import { AbstractAuthModuleProvider } from "@medusajs/framework/utils"
import { Logger } from "@medusajs/framework/types"
type InjectedDependencies = {
logger: Logger
@@ -119,7 +119,7 @@ import {
AuthIdentityProviderService,
AuthenticationInput,
AuthenticationResponse
} from "@medusajs/types"
} from "@medusajs/framework/types"
// ...
class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -162,7 +162,7 @@ import {
AuthIdentityProviderService,
AuthenticationInput,
AuthenticationResponse
} from "@medusajs/types"
} from "@medusajs/framework/types"
// ...
class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -220,8 +220,8 @@ import {
AuthIdentityProviderService,
AuthenticationInput,
AuthenticationResponse
} from "@medusajs/types"
import { MedusaError } from "@medusajs/utils"
} from "@medusajs/framework/types"
import { MedusaError } from "@medusajs/framework/utils"
// ...
class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -282,8 +282,8 @@ import {
AuthIdentityProviderService,
AuthenticationInput,
AuthenticationResponse
} from "@medusajs/types"
import { MedusaError } from "@medusajs/utils"
} from "@medusajs/framework/types"
import { MedusaError } from "@medusajs/framework/utils"
// ...
class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -344,7 +344,7 @@ import {
AuthIdentityProviderService,
AuthenticationInput,
AuthenticationResponse
} from "@medusajs/types"
} from "@medusajs/framework/types"
// ...
class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -428,7 +428,7 @@ This exports the module's definition, indicating that the `MyAuthProviderService
To use your Auth Module Provider, add it to the `providers` array of the Auth Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -16,9 +16,9 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
## Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { createRemoteLinkStep } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { Modules } from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow("hello-world", () => {
createRemoteLinkStep([
@@ -18,13 +18,13 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
dismissRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -16,7 +16,7 @@ Emit an event.
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
emitEventStep
} from "@medusajs/core-flows"
@@ -18,13 +18,13 @@ Learn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advan
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
removeRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -20,7 +20,7 @@ To retrieve a list of records of a data model:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -44,7 +44,7 @@ To retrieve a single item instead of a an array:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -74,7 +74,7 @@ To throw an error if a record isn't found matching the specified ID:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -11,9 +11,9 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
### Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { createRemoteLinkStep } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { Modules } from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow("hello-world", () => {
createRemoteLinkStep([
@@ -50,13 +50,13 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
dismissRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -92,7 +92,7 @@ Emit an event.
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
emitEventStep
} from "@medusajs/core-flows"
@@ -127,13 +127,13 @@ Learn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advan
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
removeRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -182,7 +182,7 @@ To retrieve a list of records of a data model:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -206,7 +206,7 @@ To retrieve a single item instead of a an array:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -236,7 +236,7 @@ To throw an error if a record isn't found matching the specified ID:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -51,9 +51,9 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
### Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { createRemoteLinkStep } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { Modules } from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow("hello-world", () => {
createRemoteLinkStep([
@@ -90,13 +90,13 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
dismissRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -132,7 +132,7 @@ Emit an event.
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
emitEventStep
} from "@medusajs/core-flows"
@@ -167,13 +167,13 @@ Learn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advan
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
removeRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -222,7 +222,7 @@ To retrieve a list of records of a data model:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -246,7 +246,7 @@ To retrieve a single item instead of a an array:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -276,7 +276,7 @@ To throw an error if a record isn't found matching the specified ID:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -15,7 +15,7 @@ For example, if a store is deleted, its product should also be deleted.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const Store = model.define("store", {
id: model.id(),
@@ -15,7 +15,7 @@ and have conditions.
An example of a simple index:
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
id: model.id(),
@@ -33,7 +33,7 @@ export default MyCustom
To add a condition on the index, use the `where` option:
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
id: model.id(),
@@ -54,7 +54,7 @@ export default MyCustom
The condition can also be a negation. For example:
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
id: model.id(),
@@ -12,7 +12,7 @@ This method defines the default value of a property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
color: model
@@ -12,7 +12,7 @@ This method defines an index on a property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
id: model.id(),
@@ -12,7 +12,7 @@ This method indicates that a property's value can be `null`.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
price: model.bigNumber().nullable(),
@@ -13,7 +13,7 @@ A unique index is created on the property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const User = model.define("user", {
email: model.text().unique(),
@@ -12,7 +12,7 @@ This method defines an array of strings property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
names: model.array(),
@@ -12,7 +12,7 @@ This method defines a number property that expects large numbers, such as prices
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
price: model.bigNumber(),
@@ -12,7 +12,7 @@ This method defines a boolean property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
hasAccount: model.boolean(),
@@ -12,7 +12,7 @@ This method defines a timestamp property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
date_of_birth: model.dateTime(),
@@ -12,7 +12,7 @@ This method defines a property whose value can only be one of the specified valu
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
color: model.enum(["black", "white"]),
@@ -15,7 +15,7 @@ primary key.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const User = model.define("User", {
id: model.id().primaryKey(),
@@ -12,7 +12,7 @@ This method defines a property whose value is a stringified JSON object.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
metadata: model.json(),
@@ -12,7 +12,7 @@ This method defines a number property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
age: model.number(),
@@ -12,7 +12,7 @@ This method defines a string property.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
name: model.text(),
@@ -16,7 +16,7 @@ For example, a store "hasMany" products.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const Store = model.define("store", {
id: model.id(),
@@ -19,7 +19,7 @@ the other data model.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const User = model.define("user", {
id: model.id(),
@@ -16,7 +16,7 @@ is associated with many orders.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const Order = model.define("order", {
id: model.id(),
@@ -11,7 +11,7 @@ This method defines a data model.
## Example
```ts
import { model } from "@medusajs/utils"
import { model } from "@medusajs/framework/utils"
const MyCustom = model.define("my_custom", {
id: model.id(),
@@ -18,10 +18,10 @@ Start by creating a new directory for your module. For example, `src/modules/my-
## 2. Create the File Provider Service
Create the file `src/modules/my-file/service.ts` that holds the implementation of the module's main service. It must extend the `AbstractFileProviderService` class imported from `@medusajs/utils`:
Create the file `src/modules/my-file/service.ts` that holds the implementation of the module's main service. It must extend the `AbstractFileProviderService` class imported from `@medusajs/framework/utils`:
```ts title="src/modules/my-file/service.ts"
import { AbstractFileProviderService } from "@medusajs/utils"
import { AbstractFileProviderService } from "@medusajs/framework/utils"
class MyFileProviderService extends AbstractFileProviderService {
// TODO implement methods
@@ -40,8 +40,8 @@ If you're creating a client or establishing a connection with a third-party serv
#### Example
```ts
import { Logger } from "@medusajs/types"
import { AbstractFileProviderService } from "@medusajs/utils"
import { Logger } from "@medusajs/framework/types"
import { AbstractFileProviderService } from "@medusajs/framework/utils"
type InjectedDependencies = {
logger: Logger
@@ -206,7 +206,7 @@ The File Module accepts one provider only.
</Note>
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -18,10 +18,10 @@ Start by creating a new directory for your module. For example, `src/modules/my-
## 2. Create the Fulfillment Provider Service
Create the file `src/modules/my-fulfillment/service.ts` that holds the module's main service. It must extend the `AbstractFulfillmentProviderService` class imported from `@medusajs/utils`:
Create the file `src/modules/my-fulfillment/service.ts` that holds the module's main service. It must extend the `AbstractFulfillmentProviderService` class imported from `@medusajs/framework/utils`:
```ts title="src/modules/my-fulfillment/service.ts"
import { AbstractFulfillmentProviderService } from "@medusajs/utils"
import { AbstractFulfillmentProviderService } from "@medusajs/framework/utils"
class MyFulfillmentProviderService extends AbstractFulfillmentProviderService {
// TODO implement methods
@@ -77,7 +77,7 @@ This exports the module's definition, indicating that the `MyFulfillmentProvider
To use your Fulfillment Module Provider, add it to the `providers` array of the Fulfillment Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -12,9 +12,9 @@ This documentation provides a reference to the `createRemoteLinkStep` step. It b
## Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { createRemoteLinkStep } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { Modules } from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow("hello-world", () => {
createRemoteLinkStep([
@@ -14,13 +14,13 @@ This documentation provides a reference to the `dismissRemoteLinkStep` step. It
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
dismissRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -14,7 +14,7 @@ This documentation provides a reference to the `emitEventStep` step. It belongs
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
emitEventStep
} from "@medusajs/core-flows"
@@ -14,13 +14,13 @@ This documentation provides a reference to the `removeRemoteLinkStep` step. It b
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
removeRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -16,7 +16,7 @@ To retrieve a list of records of a data model:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -40,7 +40,7 @@ To retrieve a single item instead of a an array:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -70,7 +70,7 @@ To throw an error if a record isn't found matching the specified ID:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -10,7 +10,7 @@ In this document, you’ll learn how to create a file service in the Medusa back
The configurations for your Medusa application are in `medusa-config.js` located in the root of your Medusa project. The configurations include configurations for database, modules, and more.
`medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/utils`.
`medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/framework/utils`.
`defineConfig` accepts as a parameter an object with the following properties:
@@ -3938,9 +3938,9 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
#### Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { createRemoteLinkStep } from "@medusajs/core-flows"
import { Modules } from "@medusajs/utils"
import { Modules } from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow("hello-world", () => {
createRemoteLinkStep([
@@ -3975,13 +3975,13 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/adva
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
dismissRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -4015,7 +4015,7 @@ Emit an event.
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
emitEventStep
} from "@medusajs/core-flows"
@@ -4048,13 +4048,13 @@ Learn more in the [Remote Link documentation](https://docs.medusajs.com/v2/advan
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
removeRemoteLinkStep
} from "@medusajs/core-flows"
import {
Modules
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
const helloWorldWorkflow = createWorkflow(
"hello-world",
@@ -4099,7 +4099,7 @@ To retrieve a list of records of a data model:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -4123,7 +4123,7 @@ To retrieve a single item instead of a an array:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -4153,7 +4153,7 @@ To throw an error if a record isn't found matching the specified ID:
```ts
import {
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
useRemoteQueryStep
} from "@medusajs/core-flows"
@@ -6,7 +6,7 @@ import { TypeList } from "docs-ui"
# Workflows API Reference
This section of the documentation provides a reference to the utility functions of the `@medusajs/workflows-sdk` package.
This section of the documentation provides a reference to the utility functions of the `@medusajs/framework/workflows-sdk` package.
## Functions
@@ -20,12 +20,12 @@ Start by creating a new directory for your module. For example, `src/modules/my-
Create the file `src/modules/my-notification/service.ts` that holds the implementation of the notification service.
The Notification Provider Module's main service must extend the `AbstractNotificationProviderService` class imported from `@medusajs/utils`:
The Notification Provider Module's main service must extend the `AbstractNotificationProviderService` class imported from `@medusajs/framework/utils`:
```ts title="src/modules/my-notification/service.ts"
import {
AbstractNotificationProviderService
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
class MyNotificationProviderService extends AbstractNotificationProviderService {
// TODO add methods
@@ -44,8 +44,8 @@ If you're creating a client or establishing a connection with a third-party serv
#### Example
```ts
import { AbstractNotificationProviderService } from "@medusajs/utils"
import { Logger } from "@medusajs/types"
import { AbstractNotificationProviderService } from "@medusajs/framework/utils"
import { Logger } from "@medusajs/framework/types"
type InjectedDependencies = {
logger: Logger
@@ -103,7 +103,7 @@ This method is used to send a notification using the third-party provider or you
import {
ProviderSendNotificationDTO,
ProviderSendNotificationResultsDTO
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyNotificationProviderService extends AbstractNotificationProviderService {
// ...
@@ -159,7 +159,7 @@ The Notification Module accepts one provider per channel.
</Note>
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -18,10 +18,10 @@ Start by creating a new directory for your module. For example, `src/modules/my-
## 2. Create the Payment Provider Service
Create the file `src/modules/my-payment/service.ts` that holds the module's main service. It must extend the `AbstractPaymentProvider` class imported from `@medusajs/utils`:
Create the file `src/modules/my-payment/service.ts` that holds the module's main service. It must extend the `AbstractPaymentProvider` class imported from `@medusajs/framework/utils`:
```ts title="src/modules/my-payment/service.ts"
import { AbstractPaymentProvider } from "@medusajs/utils"
import { AbstractPaymentProvider } from "@medusajs/framework/utils"
type Options = {
apiKey: string
@@ -54,8 +54,8 @@ The provider can also access the module's options as a second parameter.
```ts
import {
AbstractPaymentProvider
} from "@medusajs/utils"
import { Logger } from "@medusajs/types"
} from "@medusajs/framework/utils"
import { Logger } from "@medusajs/framework/types"
type InjectedDependencies = {
logger: Logger
@@ -127,7 +127,7 @@ In this method, use the third-party provider to capture the payment.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -183,7 +183,7 @@ import {
PaymentProviderError,
PaymentProviderSessionResponse,
PaymentSessionStatus
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -241,7 +241,7 @@ This method cancels a payment.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -286,7 +286,7 @@ in the third-party session, before authorizing or capturing the payment later.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -345,7 +345,7 @@ Use this to delete or cancel the payment in the third-party service.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -390,7 +390,7 @@ This method gets the status of a payment session based on the status in the thir
// other imports...
import {
PaymentSessionStatus
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -441,7 +441,7 @@ This method refunds an amount of a payment previously captured.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -496,7 +496,7 @@ Retrieves the payment's data from the third-party service.
import {
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -543,7 +543,7 @@ import {
UpdatePaymentProviderSession,
PaymentProviderError,
PaymentProviderSessionResponse,
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -609,11 +609,11 @@ Learn more in [this documentation](https://docs.medusajs.com/v2/resources/commer
// other imports...
import {
BigNumber
} from "@medusajs/utils"
} from "@medusajs/framework/utils"
import {
ProviderWebhookPayload,
WebhookActionResult
} from "@medusajs/types"
} from "@medusajs/framework/types"
class MyPaymentProviderService extends AbstractPaymentProvider<
Options
@@ -696,7 +696,7 @@ This exports the module's definition, indicating that the `MyPaymentProviderServ
To use your Payment Module Provider, add it to the `providers` array of the Payment Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -10,11 +10,11 @@ In this document, you’ll learn how to create a search service in the Medusa ba
## Prerequisites
A search service must extend the `AbstractSearchService` class imported from the `@medusajs/utils` package. If you don’t already have the package
A search service must extend the `AbstractSearchService` class imported from the `@medusajs/framework/utils` package. If you don’t already have the package
installed, run the following command to install it within your project:
```bash npm2yarn
npm install @medusajs/utils
npm install @medusajs/framework/utils
```
---
@@ -22,7 +22,7 @@ npm install @medusajs/utils
## Overview
A search service class is in a TypeScript or JavaScript file created in the `src/services` directory. The class must extend the `AbstractSearchService` class imported
from the `@medusajs/utils` package.
from the `@medusajs/framework/utils` package.
Based on services’ naming conventions, the file’s name should be the slug version of the search service’s name without `service`, and the class’s name should be the
pascal case of the search service’s name following by `Service`.
@@ -30,7 +30,7 @@ pascal case of the search service’s name following by `Service`.
For example, create the `MySearchService` class in the file `src/services/my-search.ts`:
```ts title="src/services/my-search.ts"
import { AbstractSearchService } from "@medusajs/utils"
import { AbstractSearchService } from "@medusajs/framework/utils"
class MySearchService extends AbstractSearchService {
isDefault = false
@@ -18,7 +18,7 @@ either in a plugin, in a provider module, or directly in your Medusa application
## How to Create a Tax Provider
A tax provider class is defined in a TypeScript or JavaScript file. The class must implement the
`ITaxProvider` interface imported from `@medusajs/types`.
`ITaxProvider` interface imported from `@medusajs/framework/types`.
The file can be defined in a plugin, a provider module, or under the `src/services` directory of your Medusa application. You can later pass the package's name or the
path to the file in the `providers` option of the Tax Module.
@@ -26,7 +26,7 @@ path to the file in the `providers` option of the Tax Module.
For example:
```ts title="src/services/my-tax.ts"
import { ITaxProvider } from "@medusajs/types"
import { ITaxProvider } from "@medusajs/framework/types"
export default class MyTaxProvider implements ITaxProvider {
// ...
@@ -4,7 +4,7 @@ import { TypeList } from "docs-ui"
The configurations for your Medusa application are in `medusa-config.js` located in the root of your Medusa project. The configurations include configurations for database, modules, and more.
`medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/utils`.
`medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/framework/utils`.
`defineConfig` accepts as a parameter an object with the following properties:
@@ -12,7 +12,7 @@ type AdminProduct.
## Example
```tsx
import type { DetailWidgetProps, AdminProduct } from "@medusajs/types"
import type { DetailWidgetProps, AdminProduct } from "@medusajs/framework/types"
import { defineWidgetConfig } from "@medusajs/admin-sdk"
const ProductWidget = ({ data }: DetailWidgetProps<AdminProduct>) => {
@@ -12,7 +12,7 @@ import {
createStep,
StepResponse,
createWorkflow
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
interface CreateProductInput {
title: string
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# createHook - Workflows API Reference
This documentation provides a reference to the `createHook` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `createHook` . It belongs to the `@medusajs/framework/workflows-sdk` package.
Expose a hook in your workflow where you can inject custom functionality as a step function.
@@ -23,7 +23,7 @@ import {
createHook,
createWorkflow,
WorkflowResponse,
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import { createProductStep } from "./steps/create-product"
export const myWorkflow = createWorkflow(
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# createStep - Workflows API Reference
This documentation provides a reference to the `createStep` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `createStep` . It belongs to the `@medusajs/framework/workflows-sdk` package.
This function creates a [StepFunction](../../types/workflows.StepFunction/page.mdx) that can be used as a step in a workflow constructed by the [createWorkflow](../workflows.createWorkflow/page.mdx) function.
@@ -19,7 +19,7 @@ import {
StepResponse,
StepExecutionContext,
WorkflowData
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
interface CreateProductInput {
title: string
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# createWorkflow - Workflows API Reference
This documentation provides a reference to the `createWorkflow` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `createWorkflow` . It belongs to the `@medusajs/framework/workflows-sdk` package.
This function creates a workflow with the provided name and a constructor function.
The constructor function builds the workflow from steps created by the [createStep](../workflows.createStep/page.mdx) function.
@@ -17,7 +17,7 @@ invoke the exported workflow, then run its `run` method.
## Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { MedusaRequest, MedusaResponse, Product } from "@medusajs/medusa"
import {
createProductStep,
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# parallelize - Workflows API Reference
This documentation provides a reference to the `parallelize` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `parallelize` . It belongs to the `@medusajs/framework/workflows-sdk` package.
This function is used to run multiple steps in parallel. The result of each step will be returned as part of the result array.
@@ -17,7 +17,7 @@ This function is used to run multiple steps in parallel. The result of each step
import {
createWorkflow,
parallelize
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import {
createProductStep,
getProductStep,
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# transform - Workflows API Reference
This documentation provides a reference to the `transform` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `transform` . It belongs to the `@medusajs/framework/workflows-sdk` package.
This function transforms the output of other utility functions.
@@ -24,7 +24,7 @@ If you're also retrieving the output of a hook and want to check if its value is
import {
createWorkflow,
transform
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import { step1, step2 } from "./steps"
type WorkflowInput = {
@@ -7,7 +7,7 @@ import { TypeList } from "docs-ui"
# when - Workflows API Reference
This documentation provides a reference to the `when` . It belongs to the `@medusajs/workflows-sdk` package.
This documentation provides a reference to the `when` . It belongs to the `@medusajs/framework/workflows-sdk` package.
## Type Parameters