diff --git a/www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx b/www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx index 16621ac39f..42ff1038c3 100644 --- a/www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx +++ b/www/apps/book/app/advanced-development/api-routes/protected-routes/page.mdx @@ -69,18 +69,18 @@ export const GET = async ( req: AuthenticatedMedusaRequest, res: MedusaResponse ) => { - const customerService: ICustomerModuleService = + const customerModuleService: ICustomerModuleService = req.scope.resolve(ModuleRegistrationName.CUSTOMER) - const customer = await customerService.retrieve( - req.auth.actor_id + const customer = await customerModuleService.retrieve( + req.auth_context.actor_id ) // ... } ``` -In the route handler, you resolve the `CustomerService`, then use it to retrieve the logged-in customer, if available. +In the route handler, you resolve the Customer Module's main service, then use it to retrieve the logged-in customer, if available. --- @@ -106,13 +106,15 @@ export const GET = async ( ModuleRegistrationName.USER ) - const user = await userService.retrieve(req.auth.actor_id) + const user = await userService.retrieve( + req.auth_context.actor_id + ) // ... } ``` -In the route handler, you resolve the `UserService`, and then use it to retrieve the logged-in admin user. +In the route handler, you resolve the User Module's main service, and then use it to retrieve the logged-in admin user. --- diff --git a/www/apps/resources/app/commerce-modules/api-key/concepts/page.mdx b/www/apps/resources/app/commerce-modules/api-key/concepts/page.mdx new file mode 100644 index 0000000000..baaec0acc0 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/api-key/concepts/page.mdx @@ -0,0 +1,29 @@ +export const metadata = { + title: `API Key Concepts`, +} + +# {metadata.title} + +In this document, you’ll learn how about the different types of API keys, and their expiration and verification. +## API Key Types + +There are two types of API keys: + +- `publishable`: A public key used in client applications, such as a storefront. +- `secret`: A secret key used for authentication and verification purposes, such as an admin user’s authentication token or a password reset token. + +The API key’s type is stored in the `type` field of the [ApiKey data model](/references/api-key/models/ApiKey). + +--- + +## API Key Expiration + +An API key expires when it’s revoked using the [revoke method of the module’s main service](/references/api-key/revoke). + +The associated token is no longer usable or verifiable. + +--- + +## Token Verification + +To verify a token received as an input or in a request, use the [authenticate method of the module’s main service](/references/api-key/authenticate) which validates the token against all non-expired tokens. diff --git a/www/apps/resources/app/commerce-modules/api-key/events/page.mdx b/www/apps/resources/app/commerce-modules/api-key/events/page.mdx index a4f503cdb4..60714dd62d 100644 --- a/www/apps/resources/app/commerce-modules/api-key/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/api-key/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the API Key Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/api-key/examples/page.mdx b/www/apps/resources/app/commerce-modules/api-key/examples/page.mdx index 4d293b65e6..4b8ffe359f 100644 --- a/www/apps/resources/app/commerce-modules/api-key/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/api-key/examples/page.mdx @@ -120,19 +120,27 @@ In this guide, you’ll find common examples of how you can use the API Key Modu ```ts - import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" + import { + AuthenticatedMedusaRequest, + MedusaResponse + } from "@medusajs/medusa" import { IApiKeyModuleService } from "@medusajs/types" - import { ModuleRegistrationName } from "@medusajs/modules-sdk" + import { + ModuleRegistrationName + } from "@medusajs/modules-sdk" export async function POST( - request: MedusaRequest, + request: AuthenticatedMedusaRequest, res: MedusaResponse ) { const apiKeyModuleService: IApiKeyModuleService = request.scope.resolve(ModuleRegistrationName.API_KEY) const revokedKey = await apiKeyModuleService.revoke( - request.params.id + request.params.id, + { + revoked_by: request.auth_context.actor_id + } ) res.json({ @@ -154,6 +162,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu type ContextType = { params: { id: string + user_id: string } } @@ -163,7 +172,12 @@ In this guide, you’ll find common examples of how you can use the API Key Modu ) { const apiKeyModuleService = await initializeApiKeyModule() - const revokedKey = await apiKeyModuleService.revoke(params.id) + const revokedKey = await apiKeyModuleService.revoke( + params.id, + { + revoked_by: params.user_id + } + ) return NextResponse.json({ api_key: revokedKey, @@ -176,7 +190,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu --- -## Verify Token +## Verify or Authenticate Token @@ -194,7 +208,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu request.scope.resolve(ModuleRegistrationName.API_KEY) const authenticatedToken = - await apiKeyModuleService.authenticate(request.params.id) + await apiKeyModuleService.authenticate(request.params.token) res.json({ is_authenticated: !!authenticatedToken, @@ -214,7 +228,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu type ContextType = { params: { - id: string + token: string } } @@ -225,7 +239,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu const apiKeyModuleService = await initializeApiKeyModule() const authenticatedToken = - await apiKeyModuleService.authenticate(request.params.id) + await apiKeyModuleService.authenticate(request.params.token) return NextResponse.json({ is_authenticated: !!authenticatedToken, @@ -244,19 +258,25 @@ In this guide, you’ll find common examples of how you can use the API Key Modu ```ts - import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" + import { + AuthenticatedMedusaRequest, + MedusaResponse + } from "@medusajs/medusa" import { IApiKeyModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" export async function POST( - request: MedusaRequest, + request: AuthenticatedMedusaRequest, res: MedusaResponse ) { const apiKeyModuleService: IApiKeyModuleService = request.scope.resolve(ModuleRegistrationName.API_KEY) const revokedKey = await apiKeyModuleService.revoke( - request.params.id + request.params.id, + { + revoked_by: request.auth_context.actor_id + } ) const newKey = await apiKeyModuleService.create({ @@ -284,6 +304,7 @@ In this guide, you’ll find common examples of how you can use the API Key Modu type ContextType = { params: { id: string + user_id: string } } @@ -293,7 +314,9 @@ In this guide, you’ll find common examples of how you can use the API Key Modu ) { const apiKeyModuleService = await initializeApiKeyModule() - const revokedKey = await apiKeyModuleService.revoke(params.id) + const revokedKey = await apiKeyModuleService.revoke(params.id, { + revoked_by: params.user_id + }) const newKey = await apiKeyModuleService.create({ title: revokedKey.title, @@ -314,4 +337,4 @@ In this guide, you’ll find common examples of how you can use the API Key Modu ## More Examples -The [module interface reference](/references/api-key) provides a reference to all the methods available for use with examples for each. +The [API Key Module's main service reference](/references/api-key) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/api-key/page.mdx b/www/apps/resources/app/commerce-modules/api-key/page.mdx index 345b66f854..27c475c1cb 100644 --- a/www/apps/resources/app/commerce-modules/api-key/page.mdx +++ b/www/apps/resources/app/commerce-modules/api-key/page.mdx @@ -8,8 +8,6 @@ export const metadata = { The API Key Module is the `@medusajs/api-key` NPM package that provides API-key-related features in your Medusa and Node.js applications. ---- - ## Features ### API Key Types and Management @@ -54,7 +52,9 @@ if (!authenticatedToken) { Revoke keys to disable their use permenantly. ```ts -const revokedKey = await apiKeyModuleService.revoke("apk_1") +const revokedKey = await apiKeyModuleService.revoke("apk_1", { + revoked_by: "user_123" +}) ``` ### Roll API Keys @@ -62,7 +62,9 @@ const revokedKey = await apiKeyModuleService.revoke("apk_1") Roll API keys by revoking a key then re-creating it. ```ts -const revokedKey = await apiKeyModuleService.revoke("apk_1") +const revokedKey = await apiKeyModuleService.revoke("apk_1", { + revoked_by: "user_123" +}) const newKey = await apiKeyModuleService.create({ title: revokedKey.title, @@ -75,14 +77,16 @@ const newKey = await apiKeyModuleService.create({ ## Configure API Key Module -After installing the `@medusajs/api-key` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the API Key Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - apiKey: { - resolve: "@medusajs/api-key", - }, + [Modules.API_KEY]: true, } ``` @@ -141,12 +145,15 @@ For example: import { IApiKeyModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { - const apiKeyModuleService: IApiKeyModuleService = - context.container.resolve( - ModuleRegistrationName.API_KEY - ) - const apiKeys = await apiKeyModuleService.list() + const step1 = createStep( + "step-1", + async (_, { container }) => { + const apiKeyModuleService: IApiKeyModuleService = + container.resolve( + ModuleRegistrationName.API_KEY + ) + + const apiKeys = await apiKeyModuleService.list() }) ``` diff --git a/www/apps/resources/app/commerce-modules/api-key/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/api-key/relations-to-other-modules/page.mdx index 944eea7f21..60abb27d57 100644 --- a/www/apps/resources/app/commerce-modules/api-key/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/api-key/relations-to-other-modules/page.mdx @@ -4,15 +4,13 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the API Key Module and other Commerce Modules. +This document showcases the link modules defined between the API Key Module and other commerce modules. ## Sales Channel Module -You can create a publishable API key and associate it with a sales channel. The Medusa application forms a relation between the `ApiKey` and the `SalesChannel` data models. +You can create a publishable API key and associate it with a sales channel. Medusa defines a link module that builds a relation between the `ApiKey` and the `SalesChannel` data models. -![A diagram showcasing an example of how resources from the API Key and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1710170465/Medusa%20Resources/api-key-sales-channel_ylpl6t.jpg) +![A diagram showcasing an example of how data models from the API Key and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709812064/Medusa%20Resources/sales-channel-api-key_zmqi2l.jpg) This is useful to avoid passing the sales channel's ID as a parameter of every request, and instead pass the publishable API key in the header of any request to the Store API route. diff --git a/www/apps/resources/app/commerce-modules/api-key/tokens/page.mdx b/www/apps/resources/app/commerce-modules/api-key/tokens/page.mdx deleted file mode 100644 index ff95077758..0000000000 --- a/www/apps/resources/app/commerce-modules/api-key/tokens/page.mdx +++ /dev/null @@ -1,50 +0,0 @@ -export const metadata = { - title: `API Key Tokens`, -} - -# {metadata.title} - -In this document, you’ll learn how the API Key module generates, revokes, and verifies tokens. - -## API Key Types - -There are two types of API keys: - -- `publishable`: A public key used in client applications, such as a storefront. -- `secret`: A secret key used for authentication and verification purposes, such as an admin user’s authentication token or a password reset token. - -The API key’s type is stored in the `type` field of the `ApiKey` data model. - ---- - -## Publishable Token Generation - -When you create a publishable API key, its token is generated using [the `randomBytes` method of Node.js’s crypto package](https://nodejs.org/docs/latest-v18.x/api/crypto.html#cryptorandombytessize-callback). The token is `32` characters long and is hex-encoded. It’s stored in the `token` field of the `ApiKey` data model. - ---- - -## Secret Token Generation - -When you create a secret API key, three tokens are generated: - -- A token that’s `32` characters long and hex-encoded. It’s generated using the `randomBytes` method of Node.js’s crypto package. -- A salt token that’s `15` characters long and hex-encoded. It’s also generated using the `randomBytes` method. -- A hashed token is generated from the token and salt token using [the `scrypt` method of Node.js’s crypto package](https://nodejs.org/docs/latest-v18.x/api/crypto.html#x509tostring). It’s `64` characters long and hex-encoded. - -The salt and hashed tokens are stored in the `ApiKey` data model’s `salt` and `token` fields, respectively. - ---- - -## API Key Expiration - -An API key expires when it’s revoked using the `revoke` method of the module’s main service. The method sets the API key’s `revoked_at` and `revoked_by` fields accordingly. - -The associated token is no longer usable or verifiable. - ---- - -## Token Verification - -To verify a token received as an input or in a request, the `authenticate` method of the module’s main service goes through all non-expired API keys. It recalculates the hash token using the supplied token and the API key’s `salt` field. - -If the calculated hashed token matches the one in the database, the token is considered verified. diff --git a/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx index 7aeedf2710..935ff58f4e 100644 --- a/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx @@ -12,7 +12,7 @@ In this document, you'll learn about how the Auth Provider is used in an authent ## How to Authenticate a User -To authenticate a user, you use the `authenticate` method of the Auth Module's main service (`IAuthModuleService`). For example: +To authenticate a user, you use the [authenticate method of the Auth Module's main service](/references/auth/authenticate) (`IAuthModuleService`). For example: ```ts const data = await authModuleService.authenticate( @@ -24,13 +24,7 @@ const data = await authModuleService.authenticate( ) ``` -This method calls the `authenticate` method of the specified provider and returns its data. - - - -Learn about the parameters and return type of the `IAuthModuleService`'s `authenticate` method in [this reference](/references/auth/authenticate). - - +This method calls the `authenticate` method of the provider specified in the first parameter and returns its data. --- @@ -51,7 +45,7 @@ Then, the user is authenticated successfully, and their authentication details a -Learn more about the `authIdentity` in [this guide](../persisting-auth-user/page.mdx#what-is-an-authuser). +Check out the [AuthIdentity](/references/auth/models/AuthIdentity) reference for the expected fields in `authIdentity`. @@ -65,8 +59,8 @@ If the `authenticate` method returns the following object: ```ts data = { - success: true, - location: "https://....", + success: true, + location: "https://....", } ``` @@ -78,7 +72,7 @@ It means the authentication process requires the user to perform an action with Providers handling this authentication flow must implement the `validateCallback` method. It implements the logic to validate the authentication with the third-party service. -So, once the user performs the required action, the third-party service must redirect to an API route that uses the `validateCallback` method of the `IAuthModuleService`. The method calls the specified provider’s `validateCallback` method passing it the authentication details it received in the second parameter: +So, once the user performs the required action, the third-party service must redirect to an API route that uses the [validateCallback method of the Auth Module's main service](/references/auth/validateCallback). The method calls the specified provider’s `validateCallback` method passing it the authentication details it received in the second parameter: ```ts const data = await authModuleService.validateCallback( @@ -90,13 +84,7 @@ const data = await authModuleService.validateCallback( ) ``` - - -Learn more about the parameters and return type of the `IAuthModuleService`'s `validateCallback` method in [this reference](/references/auth/validateCallback). - - - -If the authentication is successful, the auth provider’s `validateCallback` method returns the same data as the basic authentication: +If the authentication is successful, the `validateCallback` method returns the same data as the basic authentication: ```ts data = { diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx index 5563a177cf..3eb66e61a5 100644 --- a/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx @@ -6,34 +6,43 @@ export const metadata = { In this document, you’ll learn how the Auth Module handles authentication using providers. -## What's an Auth Provider? +## What's an Auth Provider Module? -An auth provider is a TypeScript or JavaScript class used to authenticate customers and users. Each provider implements the authentication logic based on its purpose. +An auth provider module handles authenticating customers and users, either using custom logic or by integrating a third-party service. -For example, the `emailpass` provider authenticates a user using their email and password, whereas the `google` provider authenticates users using their Google account. +For example, the EmailPass Auth Provider Module authenticates a user using their email and password, whereas the Google Auth Provider Module authenticates users using their Google account. + + + +Support for the Google Auth Provider Module is coming soon. + + --- -## The Auth Provider Class +## Configure Auth Provider Modules -An auth provider implements the `AbstractAuthModuleProvider` class imported from the `@medusajs/utils` package. The provider must implement the `authenticate` method that authenticates a user. +By default, admin users and customers can login with all installed auth provider moduless. -When you call the `authenticate` method of the Auth Module's main service (`IAuthModuleService`), the method resolves the specified provider and calls its `authenticate` method passing it the second parameter it received: +To limit the auth providers that used for admin users and customers, use the [authMethodsPerActor option](/references/medusa-config#http-authMethodsPerActor-1-3) in Medusa's configurations: -```ts -const data = await authModuleService.authenticate( - "emailpass", - // passed to auth provider - { +```js title="medusa-config.js" +module.exports = { + projectConfig: { + http: { + authMethodsPerActor: { + user: ["google"], + customer: ["emailpass"] + }, // ... - } - ) + }, + // ... + } +} ``` -It also returns the same data returned by the auth provider. +--- - +## How to Create an Auth Provider Module -Learn about the parameters and return type of the `IAuthModuleService`'s `authenticate` method in [this reference](/references/auth/authenticate). - - +Refer to [this guide](/references/auth/provider) to learn how to create an auth provider module. diff --git a/www/apps/resources/app/commerce-modules/auth/events/page.mdx b/www/apps/resources/app/commerce-modules/auth/events/page.mdx index d3eab00127..9f60b25b88 100644 --- a/www/apps/resources/app/commerce-modules/auth/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Auth Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/auth/examples/page.mdx b/www/apps/resources/app/commerce-modules/auth/examples/page.mdx index d9d3bb794f..d030701f84 100644 --- a/www/apps/resources/app/commerce-modules/auth/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/examples/page.mdx @@ -218,7 +218,7 @@ This example uses the [jsonwebtoken NPM package](https://www.npmjs.com/package/j --- -## Create Auth User +## Create Auth Identity @@ -275,7 +275,7 @@ This example uses the [jsonwebtoken NPM package](https://www.npmjs.com/package/j --- -## List Auth Users +## List Auth Identities @@ -322,7 +322,7 @@ This example uses the [jsonwebtoken NPM package](https://www.npmjs.com/package/j --- -## Update an Auth User +## Update an Auth Identity @@ -392,7 +392,7 @@ This example uses the [jsonwebtoken NPM package](https://www.npmjs.com/package/j --- -## Delete an Auth User +## Delete an Auth Identity @@ -448,4 +448,4 @@ This example uses the [jsonwebtoken NPM package](https://www.npmjs.com/package/j ## More Examples -The [module interface reference](/references/auth) provides a reference to all the methods available for use with examples for each. +The [Auth Module's main service reference](/references/auth) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/auth/page.mdx b/www/apps/resources/app/commerce-modules/auth/page.mdx index ceb1dc3030..fb1f964be0 100644 --- a/www/apps/resources/app/commerce-modules/auth/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/page.mdx @@ -8,13 +8,11 @@ export const metadata = { The Auth Module is the `@medusajs/auth` NPM package that provides authentication-related features in your Medusa and Node.js applications. ---- - ## Features -### Authenticate Users +### Basic User Authentication -With the Auth Module, authenticate users using their credentials. +With the Auth Module, authenticate users using their email and password credentials. ```ts const { success, authIdentity, error } = @@ -71,25 +69,22 @@ const { success, authIdentity } = ## Configure Auth Module -After installing the `@medusajs/auth` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Auth Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - auth: { - resolve: "@medusajs/auth", - options: { - providers: [ - // ... - ], - }, - }, + [Modules.AUTH]: true, } ``` -### Module Options +{/* ### Module Options -Refer to [this documentation](./module-options/page.mdx) for details on the module's options. +Refer to [this documentation](./module-options/page.mdx) for details on the module's options. */} --- @@ -103,9 +98,14 @@ For example: ```ts title="src/api/store/custom/route.ts" - import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" + import { + MedusaRequest, + MedusaResponse + } from "@medusajs/medusa" import { IAuthModuleService } from "@medusajs/types" - import { ModuleRegistrationName } from "@medusajs/modules-sdk" + import { + ModuleRegistrationName + } from "@medusajs/modules-sdk" export async function GET( req: MedusaRequest, @@ -126,7 +126,9 @@ For example: ```ts title="src/subscribers/custom-handler.ts" import { SubscriberArgs } from "@medusajs/medusa" import { IAuthModuleService } from "@medusajs/types" - import { ModuleRegistrationName } from "@medusajs/modules-sdk" + import { + ModuleRegistrationName + } from "@medusajs/modules-sdk" export default async function subscriberHandler({ container, @@ -144,11 +146,15 @@ For example: ```ts title="src/workflows/hello-world/step1.ts" import { createStep } from "@medusajs/workflows-sdk" import { IAuthModuleService } from "@medusajs/types" - import { ModuleRegistrationName } from "@medusajs/modules-sdk" + import { + ModuleRegistrationName + } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const authModuleService: IAuthModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.AUTH ) const authIdentitys = await authModuleService.list() diff --git a/www/apps/resources/app/commerce-modules/auth/persisting-auth-user/page.mdx b/www/apps/resources/app/commerce-modules/auth/persisting-auth-user/page.mdx deleted file mode 100644 index 9ff3d33550..0000000000 --- a/www/apps/resources/app/commerce-modules/auth/persisting-auth-user/page.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -sidebar_label: "Persisting Auth User" ---- - -export const metadata = { - title: `Persisting Auth User Authentication`, -} - -# {metadata.title} - -In this document, you’ll learn what the `AuthIdentity` is and how to persist its authentication. - -## What is an AuthIdentity? - -As explained in the [Auth Provider](../auth-providers/page.mdx) guide, when a user or customer is authenticated, you receive an `authIdentity` object: - -```ts -const { success, authIdentity } = - await authModuleService.authenticate("emailpass", { - // ... - }) -``` - -The `authIdentity` object is a record of the `AuthIdentity` data model. It has details about the authenticated user or customer, such as their ID, email, and other details. - - - -Learn more about the `AuthIdentity`'s fields in [this reference](/references/auth/models/AuthIdentity). - - - ---- - -## Persisting Authentication - -While the Auth Module provides the authentication functionality, it doesn’t provide the functionality to persist the authentication, as that depends on your application’s requirements. - -For example, the Medusa application’s authentication route signs the `authIdentity` object into a JSON Web Token (JWT): - -```ts -const { - success, - authIdentity, -} = await service.authenticate(auth_provider, authData) - -// ... -const { - jwtSecret, -} = req.scope.resolve("configModule").projectConfig.http - -const token = jwt.sign(authIdentity, jwtSecret) -``` - -Then, the token is passed in the header of subsequent requests in the Authorization Bearer header. - -An authentication middleware verifies the token and attaches the associated `authIdentity`'s details to the `auth` property of the request object passed to the subsequent middlewares and route. - -If the authentication middleware can’t verify the token, the user isn’t authenticated and they’re asked to login again. diff --git a/www/apps/resources/app/commerce-modules/auth/user-creation/page.mdx b/www/apps/resources/app/commerce-modules/auth/user-creation/page.mdx index 01dd24b75d..e3c89125bd 100644 --- a/www/apps/resources/app/commerce-modules/auth/user-creation/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/user-creation/page.mdx @@ -3,32 +3,14 @@ sidebar_label: "User Creation" --- export const metadata = { - title: `User Creation with Auth Module`, + title: `User Creation`, } # {metadata.title} -In this document, you’ll learn about the user-creation flow and how to use it with the User Module. +In this document, you’ll learn about creating a user with the User Module after authentication. -## Auth User Creation in Authentication Flow - -In the [Auth Provider](../auth-providers/page.mdx) documentation, you learned about the authentication flows supported by the Auth Module. These flows are used when an `AuthIdentity` is already available for the specified authentication data, such as email/password credentials. - -However, the `emailpass` and `google` providers support creating an `AuthIdentity` if none exists. If an email is provided that doesn’t have an `AuthIdentity` associated with it (checked via its `entity_id` field) for the specified provider (checked via its `provider` field), a new `AuthIdentity` is created for that email and provider. - -![Diagram showcasing the AuthIdentity creation part of the authentication flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1711441638/Medusa%20Resources/auth-user-creation_gmahvl.jpg) - -So, by default, your authentication flow supports both sign-in and sign-up flows. - - - -This step actually occurs at different points of the authentication flow for each of the providers. For the `emailpass` provider, it occurs before checking that the password is correct. For the `google` provider, you must go through the full authentication flow to retrieve the user details, such as email, from Google. - - - ---- - -## Creating a User in the User Module +## Creating a User using the User Module The User Module provides user and invite management functionalities. However, it doesn’t provide authentication functionalities or store any related data. diff --git a/www/apps/resources/app/commerce-modules/cart/concepts/page.mdx b/www/apps/resources/app/commerce-modules/cart/concepts/page.mdx index 1244b57386..82e9f9b7eb 100644 --- a/www/apps/resources/app/commerce-modules/cart/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/concepts/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll get an overview of the main concepts of a cart. ## Shipping and Billing Addresses -A cart has a shipping and billing address. Both of these addresses are represented by the `Address` data model. +A cart has a shipping and billing address. Both of these addresses are represented by the [Address data model](/references/cart/models/Address). ![A diagram showcasing the relation between the Cart and Address data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1711532392/Medusa%20Resources/cart-addresses_ls6qmv.jpg) @@ -16,13 +16,13 @@ A cart has a shipping and billing address. Both of these addresses are represent ## Line Items -A line item, represented by the `LineItem` data model, is a product added to the cart. A cart has multiple line items. +A line item, represented by the `LineItem` data model, is a product variant added to the cart. A cart has multiple line items. -A line item stores some of the product’s fields, such as the `product_title` and `product_description`. It also stores data related to the item’s quantity and price. +A line item stores some of the product variant’s fields, such as the `product_title` and `product_description`. It also stores data related to the item’s quantity and price. -A product can be from the [Product Module](../../product/page.mdx) but can also be a custom item used only in this cart. +A product variant can be from the [Product Module](../../product/page.mdx) but can also be a custom item used only in this cart. @@ -30,16 +30,14 @@ A product can be from the [Product Module](../../product/page.mdx) but can also ## Shipping Methods -A shipping method, represented by the `ShippingMethod` data model, is the method used to fulfill the items in the cart after the order is placed. A cart can have more than one shipping method. +A shipping method, represented by the [ShippingMethod data model](/references/cart/models/ShippingMethod), is used to fulfill the items in the cart after the order is placed. A cart can have more than one shipping method. -If the shipping method is created from a shipping option, typically available through the Fulfillment Module, its ID is stored in the `shipping_option_id`. +If the shipping method is created from a shipping option, available through the [Fulfillment Module](../../fulfillment/page.mdx), its ID is stored in the `shipping_option_id`. A shipping method can also be a custom method associated with this cart only. ### data Field -When fulfilling the order after its placed, you may use a third-party fulfillment provider that requires additional custom data to be passed along from the checkout process. +After an order is placed, you may use a third-party fulfillment provider to fulfill its shipments. If the fulfillment provider requires additional custom data to be passed along from the checkout process, you can add this data in the `ShippingMethod`'s `data` field. -The `ShippingMethod` data model has a `data` field. It's an object used to store custom data relevant later for fulfillment. - -In the Medusa application, it's the `data` is passed to the Fulfillment Module when fulfilling items. \ No newline at end of file +The `data` field is an object used to store custom data relevant later for fulfillment. diff --git a/www/apps/resources/app/commerce-modules/cart/events/page.mdx b/www/apps/resources/app/commerce-modules/cart/events/page.mdx index 060ecb2a7a..5f7eb3c611 100644 --- a/www/apps/resources/app/commerce-modules/cart/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Cart Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/cart/examples/page.mdx b/www/apps/resources/app/commerce-modules/cart/examples/page.mdx index f110a7b063..b79af7187d 100644 --- a/www/apps/resources/app/commerce-modules/cart/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/examples/page.mdx @@ -448,7 +448,7 @@ In this guide, you’ll find common examples of how you can use the Cart Module const cartModuleService: ICartModuleService = req.scope.resolve(ModuleRegistrationName.CART) - await cartModuleService.deleteLineItems(["cali_123"]) + await cartModuleService.deleteShippingMethods(["casm_123"]) res.status(200) } @@ -482,4 +482,4 @@ In this guide, you’ll find common examples of how you can use the Cart Module ## More Examples -The [module interface reference](/references/cart) provides a reference to all the methods available for use with examples for each. +The [Cart Module's main service reference](/references/cart) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/cart/page.mdx b/www/apps/resources/app/commerce-modules/cart/page.mdx index 3e292e051c..8cca98325c 100644 --- a/www/apps/resources/app/commerce-modules/cart/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/page.mdx @@ -8,8 +8,6 @@ export const metadata = { The Cart Module is the `@medusajs/cart` NPM package that provides cart-related features in your Medusa and Node.js applications. ---- - ## Features ### Cart Management @@ -67,14 +65,16 @@ When used with their respective modules and other commerce modules, you benefit ## Configure Cart Module -After installing the `@medusajs/cart` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Cart Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - cart: { - resolve: "@medusajs/cart", - }, + [Modules.CART]: true, } ``` @@ -134,11 +134,14 @@ For example: import { ICartModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const cartModuleService: ICartModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.CART ) + const carts = await cartModuleService.list() }) ``` diff --git a/www/apps/resources/app/commerce-modules/cart/promotions/page.mdx b/www/apps/resources/app/commerce-modules/cart/promotions/page.mdx index 828846b5f0..c76a963908 100644 --- a/www/apps/resources/app/commerce-modules/cart/promotions/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/promotions/page.mdx @@ -14,17 +14,26 @@ In this document, you’ll learn how a promotion is applied to a cart’s line i An adjustment line indicates a change to an item or a shipping method’s amount. It’s used to apply promotions or discounts on a cart. -The `LineItemAdjustment` data model represents adjustment lines for a line item, and the `ShippingMethodAdjustment` data model represents adjustment lines for a shipping method. +The `LineItemAdjustment` data model represents changes on a line item, and the `ShippingMethodAdjustment` data model represents changes on a shipping method. ![A diagram showcasing the relations between other data models and adjustment line models](https://res.cloudinary.com/dza7lstvk/image/upload/v1711534248/Medusa%20Resources/cart-adjustments_k4sttb.jpg) -The `amount` field of the adjustment line indicates the amount to be discounted from the original amount. Also, the ID of the applied promotion can be stored in the `promotion_id` field of the adjustment line. +The `amount` field of the adjustment line indicates the amount to be discounted from the original amount. Also, the ID of the applied promotion is stored in the `promotion_id` field of the adjustment line. + +--- + +## Discountable Option + +The `LineItem` data model has an `is_discountable` field that indicates whether promotions can be applied to the line item. It’s enabled by default. + +When disabled, a promotion can’t be applied to a line item. In the context of the Promotion Module, the promotion isn’t applied to the line item even if it matches its rules. + --- ## Promotion Actions -When using the Cart and Promotion modules together, such as in the Medusa application, use the `computeActions` method of the Promotion Module’s main service. It retrieves the actions of line items and shipping methods. +When using the Cart and Promotion modules together, use the [computeActions method of the Promotion Module’s main service](/references/promotion/computeActions). It retrieves the actions of line items and shipping methods. @@ -90,12 +99,6 @@ const actions = await promotionModuleService.computeActions( The `computeActions` method accepts the existing adjustments of line items and shipping methods to compute the actions accurately. - - -Learn more about the `computeActions` method in [this reference](/references/promotion/computeActions). - - - Then, use the returned `addItemAdjustment` and `addShippingMethodAdjustment` actions to set the cart’s line item and the shipping method’s adjustments. ```ts @@ -121,12 +124,4 @@ await cartModuleService.setShippingMethodAdjustments( action.action === "addShippingMethodAdjustment" ) as AddShippingMethodAdjustment[] ) -``` - ---- - -## Discountable Option - -The `LineItem` data model has an `is_discountable` field that indicates whether promotions can be applied to the line item. It’s enabled by default. - -When disabled, a promotion can’t be applied to a line item. In the context of the Promotion Module, the promotion isn’t applied to the line item even if it matches its rules. +``` \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/cart/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/cart/relations-to-other-modules/page.mdx index 99c061a2cc..b6ba6bf4a0 100644 --- a/www/apps/resources/app/commerce-modules/cart/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/relations-to-other-modules/page.mdx @@ -4,36 +4,50 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Cart Module and other Commerce Modules. +This document showcases the link modules defined between the Cart Module and other commerce modules. ## Customer Module -A cart is scoped to the customer using it. The Medusa application forms a relation between the `Cart` and `Customer` data models. +A cart is scoped to the customer using it. Medusa defines a link module that builds a relationship between the `Cart` and `Customer` data models. -![A diagram showcasing an example of how resources from the Cart and Customer modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537276/Medusa%20Resources/cart-customer_pnjvuw.jpg) +![A diagram showcasing an example of how data models from the Cart and Customer modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537276/Medusa%20Resources/cart-customer_pnjvuw.jpg) --- ## Payment Module -The Payment Module allows you to associate payments with a cart. The Medusa application forms a relation between the `Cart` and `PaymentCollection` data models. +The Payment Module allows you to associate payments with a cart. Medusa defines a link module that builds a relationship between the `Cart` and `PaymentCollection` data models. -![A diagram showcasing an example of how resources from the Cart and Payment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537849/Medusa%20Resources/cart-payment_ixziqm.jpg) +![A diagram showcasing an example of how data models from the Cart and Payment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537849/Medusa%20Resources/cart-payment_ixziqm.jpg) + +--- + +## Product Module + +A cart's line item is associated with a product and its variant. Medusa defines a link module that builds a relationship between the `Cart`, `Product`, and `ProductVariant` data models. + +![A diagram showcasing an example of how data models from the Cart and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716546229/Medusa%20Resources/cart-product_x82x9j.jpg) --- ## Promotion Module -A promotion can be applied on line items and shipping methods of a cart. The Medusa application forms a relation between the `Cart` and `Promotion` data models. +A promotion can be applied on line items and shipping methods of a cart. Medusa defines a link module that builds a relationship between the `Cart`, `LineItemAdjustment`, and `Promotion` data models. -![A diagram showcasing an example of how resources from the Cart and Promotion modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538015/Medusa%20Resources/cart-promotion_kuh9vm.jpg) +![A diagram showcasing an example of how data models from the Cart and Promotion modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538015/Medusa%20Resources/cart-promotion_kuh9vm.jpg) + +--- + +## Region Module + +A cart is scoped to a region. Medusa defines a link module that builds a relationship between the `Cart` and `Region` data models. + +![A diagram showcasing an example of how data models from the Cart and Region modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716543714/Medusa%20Resources/customer-region_rtmymb.jpg) --- ## Sales Channel Module -A cart is scoped to a sales channel. The Medusa application forms a relation between the `Cart` and `SalesChannel` data models. +A cart is scoped to a sales channel. Medusa defines a link module that builds a relationship between the `Cart` and `SalesChannel` data models. -![A diagram showcasing an example of how resources from the Cart and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538159/Medusa%20Resources/cart-sales-channel_n2oi0v.jpg) +![A diagram showcasing an example of how data models from the Cart and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538159/Medusa%20Resources/cart-sales-channel_n2oi0v.jpg) diff --git a/www/apps/resources/app/commerce-modules/cart/tax-lines/page.mdx b/www/apps/resources/app/commerce-modules/cart/tax-lines/page.mdx index 680fc98b1c..6f2466e5a4 100644 --- a/www/apps/resources/app/commerce-modules/cart/tax-lines/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/tax-lines/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn about tax lines in a cart and how to retrieve t ## What are Tax Lines? -A tax line indicates the tax rate of a line item or a shipping method. The `LineItemTaxLine` data model represents a line item’s tax line, and the `ShippingMethodTaxLine` data model represents a shipping method’s tax line. +A tax line indicates the tax rate of a line item or a shipping method. The [LineItemTaxLine data model](/references/cart/models/LineItemTaxLine) represents a line item’s tax line, and the [ShippingMethodTaxLine data model](/references/cart/models/ShippingMethodTaxLine) represents a shipping method’s tax line. ![A diagram showcasing the relation between other data models and the tax line models](https://res.cloudinary.com/dza7lstvk/image/upload/v1711534431/Medusa%20Resources/cart-tax-lines_oheaq6.jpg) @@ -34,7 +34,7 @@ The following diagram is a simplified showcase of how a subtotal is calculated f ## Retrieving Tax Lines -When using the Cart and Tax modules together, such as in the Medusa application, you can use the `getTaxLines` method of the Tax Module’s main service. It retrieves the tax lines for a cart’s line items and shipping methods. +When using the Cart and Tax modules together, you can use the `getTaxLines` method of the Tax Module’s main service. It retrieves the tax lines for a cart’s line items and shipping methods. ```ts // retrieve the cart diff --git a/www/apps/resources/app/commerce-modules/currency/events/page.mdx b/www/apps/resources/app/commerce-modules/currency/events/page.mdx index 3e42f4ed63..5f322681ff 100644 --- a/www/apps/resources/app/commerce-modules/currency/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/currency/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Currency Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/currency/examples/page.mdx b/www/apps/resources/app/commerce-modules/currency/examples/page.mdx index a2b27c8238..36a1667f0a 100644 --- a/www/apps/resources/app/commerce-modules/currency/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/currency/examples/page.mdx @@ -55,7 +55,7 @@ In this guide, you’ll find common examples of how you can use the Currency Mod --- -## Retrieve a Currency by its ID +## Retrieve a Currency by its Code @@ -108,4 +108,4 @@ In this guide, you’ll find common examples of how you can use the Currency Mod ## More Examples -The [Currency Module interface reference](/references/currency) provides a reference to all the methods available for use with examples for each. +The [Currency Module's main service reference](/references/currency) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/currency/page.mdx b/www/apps/resources/app/commerce-modules/currency/page.mdx index e1dac4e02d..7c104dde5e 100644 --- a/www/apps/resources/app/commerce-modules/currency/page.mdx +++ b/www/apps/resources/app/commerce-modules/currency/page.mdx @@ -8,23 +8,19 @@ export const metadata = { The Currency Module is the `@medusajs/currency` NPM package that provides currency-related features in your Medusa and Node.js applications. ---- - ## Features ### Currency Retrieval List and retrieve currencies stored in your application. -By default, the module, on application start, adds currencies defined in [this file](https://github.com/medusajs/medusa/blob/develop/packages/utils/src/defaults/currencies.ts) to the database. - ```ts const currency = await currencyModuleService.retrieve("usd") ``` ### Support Currencies in Modules -Other commerce modules use currency codes in their models or operations. You can use the Currency Module to retrieve a currency code and its details. +Other commerce modules use currency codes in their data models or operations. You can use the Currency Module to retrieve a currency code and its details. An example with the Region Module: @@ -39,14 +35,16 @@ const currency = await currencyModuleService.retrieve( ## Configure Currency Module -After installing the `@medusajs/currency` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Currency Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - currency: { - resolve: "@medusajs/currency", - }, + [Modules.CURRENCY]: true, } ``` @@ -105,9 +103,11 @@ For example: import { ICurrencyModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const currencyModuleService: ICurrencyModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.CURRENCY ) diff --git a/www/apps/resources/app/commerce-modules/currency/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/currency/relations-to-other-modules/page.mdx new file mode 100644 index 0000000000..1d45624c6b --- /dev/null +++ b/www/apps/resources/app/commerce-modules/currency/relations-to-other-modules/page.mdx @@ -0,0 +1,13 @@ +export const metadata = { + title: `Relations between Currency Module and Other Modules`, +} + +# {metadata.title} + +This document showcases the link modules defined between the Currency Module and other commerce modules. + +## Store Module + +A store has a default currency. Medusa defines a link module that builds a relationship between the `Store` and `Currency` data models. + +![A diagram showcasing an example of how resources from the Stock Location and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1716798146/Medusa%20Resources/store-currency_wzftwh.jpg) diff --git a/www/apps/resources/app/commerce-modules/customer/customer-accounts/page.mdx b/www/apps/resources/app/commerce-modules/customer/customer-accounts/page.mdx index 39cd8814d2..b5b38fb4c8 100644 --- a/www/apps/resources/app/commerce-modules/customer/customer-accounts/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/customer-accounts/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn how registered and unregistered accounts are di ## `has_account` field -The `Customer` data model has a `has_account` field, which is a boolean that indicates whether a customer is registerd. +The [Customer data model](/references/customer/models/Customer) has a `has_account` field, which is a boolean that indicates whether a customer is registerd. When a guest customer places an order, a new `Customer` record is created with `has_account` set to `false`. @@ -20,4 +20,4 @@ When this or another guest customer registers an account with the same email, a The above behavior means that two `Customer` records may exist of the same email. However, the main difference is the `has_account` field’s value. -So, there can only be one guest customer (having `has_account=false`) and one registered customer (having `has_account=true`) with the same email. If another customer tries to create an account with the same email, they’ll get an error that an account with this email already exists. +So, there can only be one guest customer (having `has_account=false`) and one registered customer (having `has_account=true`) with the same email. diff --git a/www/apps/resources/app/commerce-modules/customer/events/page.mdx b/www/apps/resources/app/commerce-modules/customer/events/page.mdx index 9956db6dc0..999fb227fb 100644 --- a/www/apps/resources/app/commerce-modules/customer/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Customer Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/customer/examples/page.mdx b/www/apps/resources/app/commerce-modules/customer/examples/page.mdx index 723cc13da6..0df8eeb2a8 100644 --- a/www/apps/resources/app/commerce-modules/customer/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/examples/page.mdx @@ -233,4 +233,4 @@ In this guide, you’ll find common examples of how you can use the Customer Mod ## More Examples -The [module interface reference](/references/customer) provides a reference to all the methods available for use with examples for each. +The [Customer Module's main service reference](/references/customer) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/customer/page.mdx b/www/apps/resources/app/commerce-modules/customer/page.mdx index 63afc8f7b8..e5ac249245 100644 --- a/www/apps/resources/app/commerce-modules/customer/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/page.mdx @@ -42,14 +42,16 @@ await customerModuleService.addCustomerToGroup({ ## Configure Customer Module -After installing the `@medusajs/customer` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Customer Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - customer: { - resolve: "@medusajs/customer", - }, + [Modules.CUSTOMER]: true, } ``` @@ -108,9 +110,11 @@ For example: import { ICustomerModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const customerModuleService: ICustomerModuleService = - context.container.resolve(ModuleRegistrationName.PRODUCT) + container.resolve(ModuleRegistrationName.CUSTOMER) const customers = await customerModuleService.list() }) diff --git a/www/apps/resources/app/commerce-modules/customer/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/customer/relations-to-other-modules/page.mdx index d968f1947e..e15c8529d1 100644 --- a/www/apps/resources/app/commerce-modules/customer/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/relations-to-other-modules/page.mdx @@ -4,13 +4,19 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Customer Module and other Commerce Modules. +This document showcases the link modules defined between the Customer Module and other commerce modules. ## Cart Module -A customer has a cart to purchase items from the store. The Medusa application forms a relation between the `Customer` and the `Cart` data models. +A customer has a cart to purchase items from the store. Medusa defines a link module that builds a relationship between the `Customer` and the `Cart` data models. -![A diagram showcasing an example of how resources from the Customer and Cart modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709915775/Medusa%20Resources/customer-cart_by5e7s.jpg) +![A diagram showcasing an example of how data models from the Customer and Cart modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537276/Medusa%20Resources/cart-customer_pnjvuw.jpg) + +--- + +## Order Module + +A customer is associated with the orders they place. Medusa defines a link module that builds a relationship between the `Customer` and the `Order` data models. + +![A diagram showcasing an example of how data models from the Customer and Order modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716545470/Medusa%20Resources/customer-order_pkla6f.jpg) diff --git a/www/apps/resources/app/commerce-modules/fulfillment/concepts/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/concepts/page.mdx index 674c7fd4c0..39ef9c1799 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/concepts/page.mdx @@ -10,7 +10,7 @@ In this document, you’ll learn about some basic fulfillment concepts. A fulfillment set is a general form or way of fulfillment. For example, shipping is a form of fulfillment, and pick-up is another form of fulfillment. Each of these can be created as fulfillment sets. -A fulfillment set is represented by the `FulfillmentSet` data model. All other configurations, options, and management features are related to a fulfillment set, in one way or another. So, the first step when using the Fulfillment Module is to create a fulfillment set. +A fulfillment set is represented by the [FulfillmentSet data model](/references/fulfillment/models/FulfillmentSet). All other configurations, options, and management features are related to a fulfillment set, in one way or another. ```ts const fulfillmentSets = await fulfillmentModuleService.create( @@ -33,13 +33,11 @@ const fulfillmentSets = await fulfillmentModuleService.create( A service zone is a collection of geographical zones or areas. It’s used to restrict available shipping options to a defined set of locations. -A service zone is represented by the `ServiceZone` data model. It’s associated with a fulfillment set, as each service zone is specific to a form of fulfillment. For example, if a customer chooses to pick up items, you can restrict the available shipping options based on their location. +A service zone is represented by the [ServiceZone data model](/references/fulfillment/models/ServiceZone). It’s associated with a fulfillment set, as each service zone is specific to a form of fulfillment. For example, if a customer chooses to pick up items, you can restrict the available shipping options based on their location. -A fulfillment set can have multiple service zones, each restricting different locations. +![A diagram showcasing the relation between fulfillment sets, service zones, and geo zones](https://res.cloudinary.com/dza7lstvk/image/upload/v1712329770/Medusa%20Resources/service-zone_awmvfs.jpg) -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712329770/Medusa%20Resources/service-zone_awmvfs.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712329770/Medusa%20Resources/service-zone_awmvfs.jpg) - -A service zone can have multiple geographical zones, each represented by the `GeoZone` data model. It holds location-related details to narrow down supported areas, such as country, city, or province code. +A service zone can have multiple geographical zones, each represented by the [GeoZone data model](/references/fulfillment/models/GeoZone). It holds location-related details to narrow down supported areas, such as country, city, or province code. --- @@ -47,4 +45,4 @@ A service zone can have multiple geographical zones, each represented by the `Ge A shipping profile defines a type of items that are shipped in a similar manner. For example, a `default` shipping profile is used for all item types, but the `digital` shipping profile is used for digital items that aren’t shipped and delivered conventionally. -A shipping profile is represented by the `ShippingProfile` data model. It only defines the profile’s details, but it’s associated with the shipping options available for the item type. +A shipping profile is represented by the [ShippingProfile data model](/references/fulfillment/models/ShippingProfile). It only defines the profile’s details, but it’s associated with the shipping options available for the item type. diff --git a/www/apps/resources/app/commerce-modules/fulfillment/events/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/events/page.mdx index 19fd440e58..6172a6335e 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Fulfillment Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/fulfillment/fulfillment-provider/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/fulfillment-provider/page.mdx index 01c2485cb3..53c1c2f3f5 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/fulfillment-provider/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/fulfillment-provider/page.mdx @@ -1,25 +1,27 @@ export const metadata = { - title: `Fulfillment Provider`, + title: `Fulfillment Provider Module`, } # {metadata.title} -In this document, you’ll learn what a fulfillment provider is. +In this document, you’ll learn what a fulfillment provider module is. -## What’s a Fulfillment Provider? +## What’s a Fulfillment Provider Module? -A fulfillment provider implements the functionality of fulfilling items, typically using a third-party integration. It’s represented by the `FulfillmentProvider` data model. +A fulfillment provider module handles fulfilling items, typically using a third-party integration. ---- - -## How to Create a Fulfillment Provider? - -A fulfillment provider is a TypeScript or JavaScript class that extends the `AbstractFulfillmentProviderService` class imported from `@medusajs/utils`. You can create it part of your Medusa application codebase, in a plugin, or in a provider module. +Fulfillment provider modules are stored and represented by the [FulfillmentProvider data model](/references/fulfillment/models/FulfillmentProvider). --- ## Configure Fulfillment Providers -The Fulfillment Module accepts a `providers` option that allows you to register providers in your application. When the Medusa application starts, it registers these modules and adds records of the `FulfillmentProvider` for them. +The Fulfillment Module accepts a `providers` option that allows you to register providers in your application. Learn more about the `providers` option in [this documentation](../module-options/page.mdx). + +--- + +## How to Create a Fulfillment Provider? + +Refer to [this guide](/references/fulfillment/provider) to learn how to create a fulfillment provider module. diff --git a/www/apps/resources/app/commerce-modules/fulfillment/item-fulfillment/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/item-fulfillment/page.mdx index ec284079d1..2202563a76 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/item-fulfillment/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/item-fulfillment/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn about the concepts of item fulfillment. ## Fulfillment Data Model -A fulfillment is the shipping and delivery of one or more items to the customer. It’s represented by the `Fulfillment` data model. +A fulfillment is the shipping and delivery of one or more items to the customer. It’s represented by the [Fulfillment data model](/references/fulfillment/models/Fulfillment). --- @@ -18,7 +18,7 @@ A fulfillment is associated with a fulfillment provider that handles all its pro The fulfillment is also associated with a shipping option of that provider, which determines how the item is shipped. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712331947/Medusa%20Resources/fulfillment-shipping-option_jk9ndp.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331947/Medusa%20Resources/fulfillment-shipping-option_jk9ndp.jpg) +![A diagram showcasing the relation between a fulfillment, fulfillment provider, and shipping option](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331947/Medusa%20Resources/fulfillment-shipping-option_jk9ndp.jpg) --- @@ -36,7 +36,7 @@ A fulfillment is used to fulfill one or more items. Each item is represented by The fulfillment item holds details relevant to fulfilling the item, such as barcode, SKU, and quantity to fulfill. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712332114/Medusa%20Resources/fulfillment-item_etzxb0.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712332114/Medusa%20Resources/fulfillment-item_etzxb0.jpg) +![A diagram showcasing the relation between fulfillment and fulfillment items.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712332114/Medusa%20Resources/fulfillment-item_etzxb0.jpg) --- diff --git a/www/apps/resources/app/commerce-modules/fulfillment/module-options/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/module-options/page.mdx index f2ce5d0339..77a1b9c252 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/module-options/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/module-options/page.mdx @@ -14,7 +14,7 @@ In this document, you'll learn about the options of the Fulfillment Module. ## providers -The `providers` option is an array of either fulfillment provider modules, fulfillment plugins, or path to a file that holds a fulfillment provider. +The `providers` option is an array of fulfillment provider modules. When the Medusa application starts, these providers are registered and can be used to process fulfillments. @@ -29,6 +29,13 @@ const modules = { providers: [ { resolve: `@medusajs/fulfillment-manual`, + options: { + config: { + manual: { + // provider options... + } + } + } }, ], }, @@ -38,5 +45,6 @@ const modules = { The `providers` option is an array of objects that accept the following properties: -- `resolve`: A string indicating the package name of the fulfillment provider module or the fulfillment plugin, or the path to the file defining the fulfillment provider. -- `options`: An optional object of options to pass to the fulfillment provider. +- `resolve`: A string indicating either the package name of the fulfillment provider module or the path to it. +- `options`: An optional object of the fulfillment provider module's options. The object must have the following property: + - `config`: An object whose key is the ID of the fulfillment provider, and its value is an object of options to pass to the provider module. \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/fulfillment/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/page.mdx index a100848a2c..8116323650 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/page.mdx @@ -8,13 +8,11 @@ export const metadata = { The Fulfillment Module is the `@medusajs/fulfillment` NPM package that provides fulfillment-related features in your Medusa and Node.js applications. ---- - ## Features ### Fulfillment Management -Create fulfillments and keep track of their statuses, items, and more. +Create fulfillments and keep track of their status, items, and more. ```ts const fulfillment = @@ -46,7 +44,6 @@ Use third-party fulfillment providers to provide customers with shipping options ```ts const shippingOption = await fulfillmentModuleService.createShippingOptions({ - name: "Express shipping", // ... provider_id: "webshipper", }) @@ -109,12 +106,14 @@ const fulfillmentSets = await fulfillmentModuleService.create( ## Configure Fulfillment Module -After installing the `@medusajs/fulfillment` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Fulfillment Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + const modules = { // ... - fulfillment: { + [Modules.FULFILLMENT]: { resolve: "@medusajs/fulfillment", providers: [ // ... @@ -184,11 +183,14 @@ For example: import { IFulfillmentModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const fulfillmentModuleService: IFulfillmentModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.FULFILLMENT ) + const fulfillments = await fulfillmentModuleService.listFulfillments() }) diff --git a/www/apps/resources/app/commerce-modules/fulfillment/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/relations-to-other-modules/page.mdx index 65373cf436..cce271f1da 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/relations-to-other-modules/page.mdx @@ -4,14 +4,26 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Fulfillment Module and other commerce modules. -This document showcases the relation between the Fulfillment Module and other Commerce Modules. +## Order Module + +A fulfillment is created for an orders' items. Medusa defines a link module that builds a relationship between the `Fulfillment` and `Order` data models. + +![A diagram showcasing an example of how data models from the Fulfillment and Order modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716549903/Medusa%20Resources/order-fulfillment_h0vlps.jpg) + +--- + +## Pricing Module + +A shipping option's price is stored as a price set. Medusa defines a link module that builds a relationship between the `PriceSet` and `ShippingOption` data models. + +![A diagram showcasing an example of how data models from the Pricing and Fulfillment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716561747/Medusa%20Resources/pricing-fulfillment_spywwa.jpg) + +--- ## Stock Location Module -When the Fulfillment and Stock Location modules are used together, a fulfillment set can be conditioned to a specific stock location. +A fulfillment set can be conditioned to a specific stock location. Medusa defines a link module that builds a relationship between the `FulfillmentSet` and `StockLocation` data models. -The Medusa application forms a relation between the `FulfillmentSet` and `StockLocation` data models. - -![A diagram showcasing an example of how resources from the Fulfillment and Stock Location modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1712567101/Medusa%20Resources/fulfillment-stock-location_nlkf7e.jpg) +![A diagram showcasing an example of how data models from the Fulfillment and Stock Location modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1712567101/Medusa%20Resources/fulfillment-stock-location_nlkf7e.jpg) diff --git a/www/apps/resources/app/commerce-modules/fulfillment/shipping-options/page.mdx b/www/apps/resources/app/commerce-modules/fulfillment/shipping-option/page.mdx similarity index 60% rename from www/apps/resources/app/commerce-modules/fulfillment/shipping-options/page.mdx rename to www/apps/resources/app/commerce-modules/fulfillment/shipping-option/page.mdx index e45a0d71c2..d4c52561a8 100644 --- a/www/apps/resources/app/commerce-modules/fulfillment/shipping-options/page.mdx +++ b/www/apps/resources/app/commerce-modules/fulfillment/shipping-option/page.mdx @@ -1,5 +1,5 @@ export const metadata = { - title: `Shipping Options`, + title: `Shipping Option`, } # {metadata.title} @@ -12,21 +12,21 @@ A shipping option is a way of shipping an item. Each fulfillment provider provid When the customer places their order, they choose a shipping option to be used to fulfill their items. -A shipping option is represented by the `ShippingOption` data model. +A shipping option is represented by the [ShippingOption data model](/references/fulfillment/models/ShippingOption). --- ## Service Zone Restrictions -A shipping option is restricted by a service zone, which specifies in what locations can a shipping option be used. +A shipping option is restricted by a service zone, limiting the locations a shipping option be used in. For example, a fulfillment provider may have a shipping option that can be used in the United States, and another in Canada. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712330831/Medusa%20Resources/shipping-option-service-zone_pobh6k.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712330831/Medusa%20Resources/shipping-option-service-zone_pobh6k.jpg) +![A diagram showcasing the relation between shipping options and service zones.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712330831/Medusa%20Resources/shipping-option-service-zone_pobh6k.jpg) Service zones can be more restrictive, such as restricting to certain cities or province codes. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712331186/Medusa%20Resources/shipping-option-service-zone-city_m5sxod.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331186/Medusa%20Resources/shipping-option-service-zone-city_m5sxod.jpg) +![A diagram showcasing the relation between shipping options, service zones, and geo zones](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331186/Medusa%20Resources/shipping-option-service-zone-city_m5sxod.jpg) --- @@ -34,26 +34,26 @@ Service zones can be more restrictive, such as restricting to certain cities or You can restrict shipping options by custom rules, such as the item’s weight or the customer’s group. -These rules are represented by the `ShippingOptionRule` data model. Its fields define the custom rule: +These rules are represented by the [ShippingOptionRule data model](/references/fulfillment/models/ShippingOptionRule). Its fields define the custom rule: -- `field`: The name of an field or table that the rule applies to. For example, `customer_group`. -- `value`: One or more values. +- `attribute`: The name of a field or table that the rule applies to. For example, `customer_group`. - `operator`: The operator used in the condition. For example: - To allow multiple values, use the operator `in`, which validates that the provided values are in the rule’s values. - To create a negation condition that considers `value` against the rule, use `nin`, which validates that the provided values aren’t in the rule’s values. - Check out more operators in [this reference](/references/fulfillment/types/fulfillment.RuleOperatorType). +- `value`: One or more values. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712331340/Medusa%20Resources/shipping-option-rule_oosopf.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331340/Medusa%20Resources/shipping-option-rule_oosopf.jpg) +![A diagram showcasing the relation between shipping option and shipping option rules.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331340/Medusa%20Resources/shipping-option-rule_oosopf.jpg) A shipping option can have multiple rules. For example, a shipping option is available if the customer belongs to the VIP group and the total weight is less than 2000g. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712331462/Medusa%20Resources/shipping-option-rule-2_ylaqdb.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331462/Medusa%20Resources/shipping-option-rule-2_ylaqdb.jpg) +![A diagram showcasing how a shipping option can have multiple rules.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331462/Medusa%20Resources/shipping-option-rule-2_ylaqdb.jpg) --- ## Shipping Profile and Types -A shipping option belongs to a type. For example, a shipping option’s type may be `express`, while another `standard`. The type is represented by the `ShippingOptionType` data model. +A shipping option belongs to a type. For example, a shipping option’s type may be `express`, while another `standard`. The type is represented by the [ShippingOptionType data model](/references/fulfillment/models/ShippingOptionType). A shipping option also belongs to a shipping profile, as each shipping profile defines the type of items to be shipped in a similar manner. diff --git a/www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx b/www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx index d0e0d9a5a1..f2da158810 100644 --- a/www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn about the main concepts in the Inventory Module ## InventoryItem -An inventory item, represented by the `InventoryItem` data model, is a stock-kept item, such as a product, whose inventory can be managed. +An inventory item, represented by the [InventoryItem data model](/references/inventory/models/InventoryItem), is a stock-kept item, such as a product, whose inventory can be managed. The `InventoryItem` data model mainly holds details related to the underlying stock item, but has relations to other data models that include its inventory details. @@ -18,7 +18,7 @@ The `InventoryItem` data model mainly holds details related to the underlying st ## InventoryLevel -An inventory level, represented by the `InventoryLevel` data model, holds the inventory and quantity details of an inventory item in a specific location. +An inventory level, represented by the [InventoryLevel data model](/references/inventory/models/InventoryLevel), holds the inventory and quantity details of an inventory item in a specific location. It has three quantity-related fields: @@ -28,9 +28,7 @@ It has three quantity-related fields: ### Associated Location -The inventory level's location is determined by the `location_id` field. The Medusa application links the `InventoryLevel` data model with the `StockLocation` data model from the Stock Location Module. - -Learn more about this relation in [this guide](../relations-to-other-modules/page.mdx#stock-location-module) +The inventory level's location is determined by the `location_id` field. Medusa links the `InventoryLevel` data model with the `StockLocation` data model from the Stock Location Module. --- diff --git a/www/apps/resources/app/commerce-modules/inventory/events/page.mdx b/www/apps/resources/app/commerce-modules/inventory/events/page.mdx index c37ba69f55..ecd247569c 100644 --- a/www/apps/resources/app/commerce-modules/inventory/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Inventory Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx b/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx index b212c93aea..f4dd1dab13 100644 --- a/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/examples/page.mdx @@ -318,7 +318,7 @@ In this document, you’ll find common examples of how you can use the Inventory res.json({ is_available: await inventoryModuleService.confirmInventory( request.body.inventory_item_id, - request.body.location_id, + [request.body.location_id], request.body.required_quantity ), }) @@ -343,7 +343,7 @@ In this document, you’ll find common examples of how you can use the Inventory return NextResponse.json({ is_available: await inventoryModuleService.confirmInventory( body.inventory_item_id, - body.location_id, + [body.location_id], body.required_quantity ), }) @@ -569,4 +569,4 @@ In this document, you’ll find common examples of how you can use the Inventory ## More Examples -The [module interface reference](/references/inventory-next) provides a reference to all the methods available for use with examples for each. +The [Inventory Module's main service reference](/references/inventory-next) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/inventory/inventory-in-flows/page.mdx b/www/apps/resources/app/commerce-modules/inventory/inventory-in-flows/page.mdx index f5659fe906..7fd560604c 100644 --- a/www/apps/resources/app/commerce-modules/inventory/inventory-in-flows/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/inventory-in-flows/page.mdx @@ -8,7 +8,7 @@ This document explains how the Inventory Module is used within the Medusa applic ## Product Variant Creation -When a product variant is created and its `manage_inventory` field's value is `true`, the Medusa application uses the Inventory Module to create an inventory item associated with that product variant. +When a product variant is created and its `manage_inventory` field's value is `true`, the Medusa application creates an inventory item associated with that product variant. ![A diagram showcasing how the Inventory Module is used in the product variant creation form](https://res.cloudinary.com/dza7lstvk/image/upload/v1709661511/Medusa%20Resources/inventory-product-create_khz2hk.jpg) @@ -16,7 +16,7 @@ When a product variant is created and its `manage_inventory` field's value is `t ## Add to Cart -When a product variant with `manage_inventory` set to `true` is added to cart, the Medusa application uses the Inventory Module to check whether there's sufficient stocked quantity. If not, an error is thrown and the product variant won't be added to the cart. +When a product variant with `manage_inventory` set to `true` is added to cart, the Medusa application checks whether there's sufficient stocked quantity. If not, an error is thrown and the product variant won't be added to the cart. ![A diagram showcasing how the Inventory Module is used in the add to cart flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709711645/Medusa%20Resources/inventory-cart-flow_achwq9.jpg) @@ -24,7 +24,7 @@ When a product variant with `manage_inventory` set to `true` is added to cart, t ## Order Placed -When an order is placed, the Medusa application uses the Inventory Module to create a reservation item for each product variant with `manage_inventory` set to `true`. It also sets the `reserved_quantity` of the inventory level associated with the inventory item to the ordered quantity of that item. +When an order is placed, the Medusa application creates a reservation item for each product variant with `manage_inventory` set to `true`. ![A diagram showcasing how the Inventory Module is used in the order placed flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712005/Medusa%20Resources/inventory-order-placed_qdxqdn.jpg) @@ -32,11 +32,11 @@ When an order is placed, the Medusa application uses the Inventory Module to cre ## Order Fulfillment -When an item in an order is fulfilled and the associated variant has its `manage_inventory` field set to `true`, the Medusa application uses the Inventory Module to: +When an item in an order is fulfilled and the associated variant has its `manage_inventory` field set to `true`, the Medusa application: -- Subtract the `reserved_quantity` from the `stocked_quantity` in the inventory level associated with the variant's inventory item. -- Reset the `reserved_quantity` to `0`. -- Delete the associated reservation item. +- Subtracts the `reserved_quantity` from the `stocked_quantity` in the inventory level associated with the variant's inventory item. +- Resets the `reserved_quantity` to `0`. +- Deletes the associated reservation item. ![A diagram showcasing how the Inventory Module is used in the order fulfillment flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712390/Medusa%20Resources/inventory-order-fulfillment_o9wdxh.jpg) @@ -44,6 +44,6 @@ When an item in an order is fulfilled and the associated variant has its `manage ## Order Return -When an item in an order is returned and the associated variant has its `manage_inventory` field set to `true`, the Medusa application uses the Inventor Module to increment the `stocked_quantity` of the inventory level associated with the inventory item with the returned quantity. +When an item in an order is returned and the associated variant has its `manage_inventory` field set to `true`, the Medusa application increments the `stocked_quantity` of the inventory item's level with the returned quantity. ![A diagram showcasing how the Inventory Module is used in the order return flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712457/Medusa%20Resources/inventory-order-return_ihftyk.jpg) diff --git a/www/apps/resources/app/commerce-modules/inventory/page.mdx b/www/apps/resources/app/commerce-modules/inventory/page.mdx index e63321c894..f4cd809183 100644 --- a/www/apps/resources/app/commerce-modules/inventory/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/page.mdx @@ -8,12 +8,6 @@ export const metadata = { The Inventory Module is the `@medusajs/inventory-next` NPM package that provides inventory-related features in your Medusa and Node.js applications. - - -This module is an updated version of the [Inventory Module part of the multi-warehouse feature](../../modules/multiwarehouse/inventory-module.md). In Medusa V2, the previous version of the module will no longer be in use. - - - ## Features ### Inventory Items Management @@ -59,7 +53,7 @@ const reservationItem = ### Check Inventory Availability -Check whether an inventory item has the necessary quantity for purchase. Any reserved quantity is considered unavailable, even if the inventory item's quantity hasn't been adjusted yet. +Check whether an inventory item has the necessary quantity for purchase. Any reserved quantity is considered unavailable. ```ts const isAvailable = @@ -74,14 +68,16 @@ const isAvailable = ## Configure Inventory Module -After installing the `@medusajs/inventory-next` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Inventory Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - inventoryService: { - resolve: "@medusajs/inventory-next", - }, + [Modules.INVENTORY]: true, } ``` @@ -142,9 +138,11 @@ For example: import { IInventoryService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const inventoryModuleService: IInventoryService = - context.container.resolve(ModuleRegistrationName.INVENTORY) + container.resolve(ModuleRegistrationName.INVENTORY) const inventoryItems = await inventoryModuleService.list({}) diff --git a/www/apps/resources/app/commerce-modules/inventory/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/inventory/relations-to-other-modules/page.mdx index d69765e664..dbfe32e780 100644 --- a/www/apps/resources/app/commerce-modules/inventory/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/inventory/relations-to-other-modules/page.mdx @@ -4,15 +4,13 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Inventory Module and other Commerce Modules. +This document showcases the link modules defined between the Inventory Module and other commerce modules. ## Product Module -Each product variant has different inventory details. The Medusa application forms a relation between the `ProductVariant` and `InventoryItem` data models. +Each product variant has different inventory details. Medusa defines a link module that builds a relationship between the `ProductVariant` and `InventoryItem` data models. -![A diagram showcasing an example of how resources from the Inventory and Product Module are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709658720/Medusa%20Resources/inventory-product_ejnray.jpg) +![A diagram showcasing an example of how data models from the Inventory and Product Module are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709658720/Medusa%20Resources/inventory-product_ejnray.jpg) A product variant, whose `manage_inventory` field is enabled, has an associated inventory item. Through that inventory's items relations in the Inventory Module, you can manage and check the variant's inventory quantity. @@ -22,6 +20,6 @@ A product variant, whose `manage_inventory` field is enabled, has an associated Reservation items and inventory items are associated with a location. The Medusa application forms a relation between the `ReservationItem` and `StockLocation` data models, and the `InventoryLevel` and `StockLocation` data models. -![A diagram showcasing an example of how resources from the Inventory and Stock Location modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709660383/Medusa%20Resources/inventory-stock-location_yp26k3.jpg) +![A diagram showcasing an example of how data models from the Inventory and Stock Location modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709660383/Medusa%20Resources/inventory-stock-location_yp26k3.jpg) The stock location provides address details of the location. diff --git a/www/apps/resources/app/commerce-modules/order/concepts/page.mdx b/www/apps/resources/app/commerce-modules/order/concepts/page.mdx index ae6f6bc338..63bf2c6e5d 100644 --- a/www/apps/resources/app/commerce-modules/order/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/concepts/page.mdx @@ -4,27 +4,23 @@ export const metadata = { # {metadata.title} -In this document, you’ll learn about orders and their general fields. - -## Order Data Model - -An order represents a customer purchase in your store. The `Order` data model holds the information about that purchase. - ---- +In this document, you’ll learn about orders and related concepts ## Order Items -The items purchased in the order are represented by the `OrderItem` data model. An order can have multiple items. +The items purchased in the order are represented by the [OrderItem data model](/references/order/models/OrderItem). An order can have multiple items. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712304722/Medusa%20Resources/order-order-items_uvckxd.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712304722/Medusa%20Resources/order-order-items_uvckxd.jpg) +![A diagram showcasing the relation between an order and its items.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712304722/Medusa%20Resources/order-order-items_uvckxd.jpg) -Learn more about order items in [this guide](../order-items/page.mdx). +### Item’s Product Details + +The details of the purchased products are represented by the [LineItem data model](/references/order/models/LineItem). Not only does a line item hold the details of the product, but also details related to its price, adjustments due to promotions, and taxes. --- ## Order’s Shipping Method -An order has one or more shipping methods used to handle item shipment. Each shipping method is represented by the `ShippingMethod` data model that holds its details. +An order has one or more shipping methods used to handle item shipment. Each shipping method is represented by the [ShippingMethod data model](/references/order/models/ShippingMethod) that holds its details. ### data Field @@ -32,19 +28,19 @@ When fulfilling the order, you may use a third-party fulfillment provider that r The `ShippingMethod` data model has a `data` field. It’s an object used to store custom data relevant later for fulfillment. -In the Medusa application, the `data` is passed to the Fulfillment Module when fulfilling items. +The Medusa application passes the `data` field to the Fulfillment Module when fulfilling items. --- ## Order Totals -The order’s total amounts (including tax total, total after an item is returned, etc…) are represented by the `OrderSummary` data model. An order can have multiple summaries. +The order’s total amounts (including tax total, total after an item is returned, etc…) are represented by the [OrderSummary data model](/references/order/models/OrderSummary). --- ## Order Payments -Payments made on an order, whether they’re capture or refund payments, are recorded as transactions represented by the `Transaction` data model. +Payments made on an order, whether they’re capture or refund payments, are recorded as transactions represented by the [Transaction data model](/references/order/models/Transaction). An order can have multiple transactions. The sum of these transactions must be equal to the order summary’s total. Otherwise, there’s an outstanding amount. diff --git a/www/apps/resources/app/commerce-modules/order/events/page.mdx b/www/apps/resources/app/commerce-modules/order/events/page.mdx index 3365fd59b6..abe5cfc665 100644 --- a/www/apps/resources/app/commerce-modules/order/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Order Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/order-change/page.mdx b/www/apps/resources/app/commerce-modules/order/order-change/page.mdx index d7f0e27f81..f6a4818077 100644 --- a/www/apps/resources/app/commerce-modules/order/order-change/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/order-change/page.mdx @@ -8,11 +8,17 @@ export const metadata = { In this document, you’ll learn how to make changes to an order, such as return or exchange an item. + + +Order Change is still in development. + + + ## What's an Order Change? -An order change is modifying the order’s items for business purposes. For example, when a customer requests to return an item, or when you suggest exchanging an item with another. +An order change is modifying the order’s items for business purposes. For example, when a customer requests to return an item, or when a merchant suggests exchanging an item with another. -Order changes are represented by the `OrderChange` data model. +Order changes are represented by the [OrderChange data model](/references/order/models/OrderChange). --- @@ -25,7 +31,7 @@ An order change can have multiple underlying actions. For example, to exchange a - Add the new item to be sent to the customer. - Fulfill the item and send it to the customer. -Each of these actions is represented by the `OrderChangeAction` data model. +Each of these actions is represented by the [OrderChangeAction data model](/references/order/models/OrderChangeAction). ### Action Name @@ -269,33 +275,12 @@ The `action` field of the `OrderChangeAction` holds the name of the action to pe - -### Action Chaining - -Actions are chained one after the other, similar to the example in the earlier section. This also allows you to cancel or undo some actions. - -For example, if you request an order return with `RETURN_ITEM` action, you can later cancel it with the `CANCEL_RETURN` action. - -The actions are ordered by the `ordering` field of the `OrderChangeAction` data model. - -### Action Amount - -The `OrderChangeAction` data model has an `amount` field that indicates a change in the order’s amount that this action incurs. - ---- - ## Order Change Confirmation The `OrderChange` data model has a `status` field that indicates its current status. By default, it’s pending. At this point, the order change’s actions aren’t applied to the order yet. -To apply these changes to the order, you must confirm the order change. When the order change is confirmed: +To apply these changes to the order, you confirm the order change. When the order change is confirmed: - The status of the order change is changed to `confirmed`. - The order’s items are changed based on the order change’s actions. For example, an item is added, or an existing item’s quantity is changed. - The order summary is modified to reflect new changes. - - - -If there are changes to the order’s total amount due to refunding or capturing payment, they must be added as transactions first. Otherwise, they won’t be accounted for when modifying the order summary - - diff --git a/www/apps/resources/app/commerce-modules/order/order-items/page.mdx b/www/apps/resources/app/commerce-modules/order/order-items/page.mdx deleted file mode 100644 index e07bb42a1e..0000000000 --- a/www/apps/resources/app/commerce-modules/order/order-items/page.mdx +++ /dev/null @@ -1,37 +0,0 @@ -export const metadata = { - title: `Order Item`, -} - -# {metadata.title} - -In this document, you’ll learn about the order item and the general details it holds. - -## OrderItem Data Model - -Each item in an order is represented by the `OrderItem` data model. It holds details related to the quantity of the item and the underlying product details. - ---- - -## Order Item Quantity - -The `OrderItem` data model has the following quantity fields: - -- `quantity`: The quantity ordered. -- `fulfilled_quantity`: The quantity that’s been fulfilled. -- `shipped_quantity`: The quantity that’s been shipped. -- `return_requested_quantity`: The quantity requested to be returned, but hasn’t been received yet. -- `return_received_quantity`: The quantity that’s been received from the customer due to a return request. -- `return_dismissed_quantity`: The quantity that’s been received from the customer due to a return request, but the items are damaged. -- `written_off_quantity`: The quantity removed from the originally ordered quantity. - ---- - -## Item’s Product Details - -The details of the purchased products are represented by the `LineItem` data model. Not only does a line item hold the details of the product, but also details related to its price, adjustments due to promotions, and taxes. - - - -The `LineItem` data model is similar to the Cart Module’s `LineItem` data model. So, when using both modules, the data can be copied between the modules as-is. - - \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/order-versioning/page.mdx b/www/apps/resources/app/commerce-modules/order/order-versioning/page.mdx index 8157fa0dd8..bb859a4c94 100644 --- a/www/apps/resources/app/commerce-modules/order/order-versioning/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/order-versioning/page.mdx @@ -28,6 +28,6 @@ So, if the order’s `version` is `1`, the order change’s version is `2`. Then, once the order change is confirmed and applied to the order, the versions of the order and order summary change to that of the order change. -Order items change depending on the version they were added or modified in, as explained in the earlier section. +![A diagram showcasing how the version of an order changes](https://res.cloudinary.com/dza7lstvk/image/upload/v1712304242/Medusa%20Resources/order-versioning_rsx2rn.jpg) -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712304242/Medusa%20Resources/order-versioning_rsx2rn.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712304242/Medusa%20Resources/order-versioning_rsx2rn.jpg) +Order items change depending on the version they were added or modified in, as explained in the earlier section. diff --git a/www/apps/resources/app/commerce-modules/order/page.mdx b/www/apps/resources/app/commerce-modules/order/page.mdx index 8c33fee0d0..0bf8243248 100644 --- a/www/apps/resources/app/commerce-modules/order/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/page.mdx @@ -8,13 +8,11 @@ export const metadata = { The Order Module is the `@medusajs/order` NPM package that provides order-related features in your Medusa and Node.js applications. ---- - ## Features ### Order Management -Store and manage your orders by retrieving, creating, canceling, and performing other operations. +Store and manage your orders to retriev, create, cancel, and perform other operations. ```ts const order = await orderModuleService.create({ @@ -47,9 +45,35 @@ const draftOrder = await orderModuleService.create({ }) ``` +### Apply Promotions + +Apply promotions or discounts to the order's items and shipping methods by adding adjustment lines that are factored into their subtotals. + +```ts +const lineAdjustments = + await orderModuleService.addLineItemAdjustments({ + item_id: "cali_123", + code: "50OFF", + amount: 500, + }) + +const shippingAdjustments = + await orderModuleService.addShippingMethodAdjustments({ + shipping_method_id: "casm_123", + code: "FREESHIPPING", + amount: 1000, + }) +``` + ### Returns, Exchanges, and Other Order Changes -Orders can be changed to return items from the customer, exchange an item with another, change the quantity of an item, or other changes. + + +Order Changes are still in development. + + + +Orders can be changed to return items from the customer, exchange an item with another, change the quantity of an item, or perform other changes. Changes are only applied after confirmation, and order history is preserved through versioning. @@ -74,38 +98,20 @@ await orderModuleService.addOrderAction({ await orderModuleService.confirmOrderChange("ord_123") ``` -### Apply Promotions - -Apply promotions or discounts to the order's items and shipping methods by adding adjustment lines that are factored into their subtotals. - -```ts -const lineAdjustments = - await orderModuleService.addLineItemAdjustments({ - item_id: "cali_123", - code: "50OFF", - amount: 500, - }) - -const shippingAdjustments = - await orderModuleService.addShippingMethodAdjustments({ - shipping_method_id: "casm_123", - code: "FREESHIPPING", - amount: 1000, - }) -``` - --- ## Configure Order Module -After installing the `@medusajs/order` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Order Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - order: { - resolve: "@medusajs/order", - }, + [Modules.ORDER]: true, } ``` @@ -150,7 +156,7 @@ For example: container, }: SubscriberArgs) { const orderModuleService: IOrderModuleService = - container.resolve(ModuleRegistrationName.API_KEY) + container.resolve(ModuleRegistrationName.ORDER) const orders = await orderModuleService.list() } @@ -164,10 +170,12 @@ For example: import { IOrderModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const orderModuleService: IOrderModuleService = - context.container.resolve( - ModuleRegistrationName.API_KEY + container.resolve( + ModuleRegistrationName.ORDER ) const orders = await orderModuleService.list() }) diff --git a/www/apps/resources/app/commerce-modules/order/promotion-adjustments/page.mdx b/www/apps/resources/app/commerce-modules/order/promotion-adjustments/page.mdx index 8eff9ceb21..c3902d3d04 100644 --- a/www/apps/resources/app/commerce-modules/order/promotion-adjustments/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/promotion-adjustments/page.mdx @@ -14,17 +14,26 @@ In this document, you’ll learn how a promotion is applied to an order’s item An adjustment line indicates a change to a line item or a shipping method’s amount. It’s used to apply promotions or discounts on an order. -The `LineItemAdjustment` data model represents adjustment lines for a line item, and the `ShippingMethodAdjustment` data model represents adjustment lines for a shipping method. +The [LineItemAdjustment data model](/references/order/models/LineItemAdjustment) represents changes on a line item, and the [ShippingMethodAdjustment data model](/references/order/models/ShippingMethodAdjustment) represents changes on a shipping method. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712306017/Medusa%20Resources/order-adjustments_myflir.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712306017/Medusa%20Resources/order-adjustments_myflir.jpg) +![A diagram showcasing the relation between an order, its items and shipping methods, and their adjustment lines](https://res.cloudinary.com/dza7lstvk/image/upload/v1712306017/Medusa%20Resources/order-adjustments_myflir.jpg) The `amount` field of the adjustment line indicates the amount to be discounted from the original amount. Also, the ID of the applied promotion can be stored in the `promotion_id` field of the adjustment line. +--- + +## Discountable Option + +The `LineItem` data model has an `is_discountable` field that indicates whether promotions can be applied to the line item. It’s enabled by default. + +When disabled, a promotion can’t be applied to a line item. In the context of the Promotion Module, the promotion isn’t applied to the line item even if it matches its rules. + + --- ## Promotion Actions -When using the Order and Promotion modules together, such as in the Medusa application, use the `computeActions` method of the Promotion Module’s main service. It retrieves the actions of line items and shipping methods. +When using the Order and Promotion modules together, use the [computeActions method of the Promotion Module’s main service](/references/promotion/computeActions). It retrieves the actions of line items and shipping methods. @@ -92,12 +101,6 @@ const actions = await promotionModuleService.computeActions( The `computeActions` method accepts the existing adjustments of line items and shipping methods to compute the actions accurately. - - -Learn more about the `computeActions` method in [this reference](/references/promotion/computeActions). - - - Then, use the returned `addItemAdjustment` and `addShippingMethodAdjustment` actions to set the order’s line items and the shipping method’s adjustments. ```ts @@ -123,12 +126,4 @@ await orderModuleService.setShippingMethodAdjustments( action.action === "addShippingMethodAdjustment" ) as AddShippingMethodAdjustment[] ) -``` - ---- - -## Discountable Option - -The `LineItem` data model has an `is_discountable` field that indicates whether promotions can be applied to the line item. It’s enabled by default. - -When disabled, a promotion can’t be applied to a line item. In the context of the Promotion Module, the promotion isn’t applied to the line item even if it matches its rules. +``` \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/order/relations-to-other-modules/page.mdx index 3b1653d23a..10e18afe25 100644 --- a/www/apps/resources/app/commerce-modules/order/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/relations-to-other-modules/page.mdx @@ -4,13 +4,59 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Order Module and other commerce modules. -This document showcases the relation between the Order Module and other Commerce Modules. +## Customer Module + +An order is associated with the customer that placed it. Medusa defines a link module that builds a relationship between the `Order` and `Customer` data models. + +![A diagram showcasing an example of how data models from the Order and Customer modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716545470/Medusa%20Resources/customer-order_pkla6f.jpg) + +--- + +## Fulfillment Module + +A fulfillment is created for an orders' items. Medusa defines a link module that builds a relationship between the `Fulfillment` and `Order` data models. + +![A diagram showcasing an example of how data models from the Fulfillment and Order modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716549903/Medusa%20Resources/order-fulfillment_h0vlps.jpg) + +--- + +## Payment Module + +An order's payment is stored in a payment collection. Medusa defines a link module that builds a relationship between the `Order` and `PaymentCollection` data models. + +![A diagram showcasing an example of how data models from the Order and Payment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716554726/Medusa%20Resources/order-payment_ubdwok.jpg) + +--- + +## Product Module + +An order's line item is associated with the purchased product and its variant. Medusa defines a link module that builds a relationship between the `LineItem`, `Product`, and `ProductVariant` data models. + +![A diagram showcasing an example of how data models from the Order and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716556100/Medusa%20Resources/order-product_l6ylte.jpg) + +--- + +## Promotion Module + +An order is associated with the promotion applied on it. Medusa defines a link module that builds a relationship between the `Order` and `Promotion` data models. + +![A diagram showcasing an example of how data models from the Order and Promotion modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716555015/Medusa%20Resources/order-promotion_dgjzzd.jpg) + +--- + +## Region Module + +An order is associated with the customer's region. Medusa defines a link module that builds a relationship between the `Order` and `Region` data models. + +![A diagram showcasing an example of how data models from the Order and Region modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716555119/Medusa%20Resources/order-region_ihkp2u.jpg) + +--- ## Sales Channel Module -Orders can be scoped to a sales channel. The Medusa application forms a relation between the `Order` and the `SalesChannel` data models. +Orders can be scoped to a sales channel. Medusa defines a link module that builds a relationship between the `Order` and the `SalesChannel` data models. ![A diagram showcasing an example of how resources from the Order and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1712315409/Medusa%20Resources/order-sales-channel_dy72gx.jpg) diff --git a/www/apps/resources/app/commerce-modules/order/tax-lines/page.mdx b/www/apps/resources/app/commerce-modules/order/tax-lines/page.mdx index b814ec783e..8435bced2b 100644 --- a/www/apps/resources/app/commerce-modules/order/tax-lines/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/tax-lines/page.mdx @@ -12,15 +12,15 @@ In this document, you’ll learn about tax lines in an order. ## What are Tax Lines? -A tax line indicates the tax rate of a line item or a shipping method. The `LineItemTaxLine` data model represents a line item’s tax line, and the `ShippingMethodTaxLine` data model represents a shipping method’s tax line. +A tax line indicates the tax rate of a line item or a shipping method. The [LineItemTaxLine data model](/references/order/models/LineItemTaxLine) represents a line item’s tax line, and the [ShippingMethodTaxLine data model](/references/order/models/ShippingMethodTaxLine) represents a shipping method’s tax line. -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712307225/Medusa%20Resources/order-tax-lines_sixujd.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712307225/Medusa%20Resources/order-tax-lines_sixujd.jpg) +![A diagram showcasing the relation between orders, items and shipping methods, and tax lines](https://res.cloudinary.com/dza7lstvk/image/upload/v1712307225/Medusa%20Resources/order-tax-lines_sixujd.jpg) --- ## Tax Inclusivity -By default, the tax amount is calculated by taking the tax rate from the line item or shipping method’s amount and then added to the item/method’s subtotal. +By default, the tax amount is calculated by taking the tax rate from the line item or shipping method’s amount and then adding it to the item/method’s subtotal. However, line items and shipping methods have an `is_tax_inclusive` field that, when enabled, indicates that the item or method’s price already includes taxes. @@ -32,4 +32,4 @@ The following diagram is a simplified showcase of how a subtotal is calculated f -![https://res.cloudinary.com/dza7lstvk/image/upload/v1712307395/Medusa%20Resources/order-tax-inclusive_oebdnm.jpg](https://res.cloudinary.com/dza7lstvk/image/upload/v1712307395/Medusa%20Resources/order-tax-inclusive_oebdnm.jpg) \ No newline at end of file +![A diagram showcasing how a subtotal is calculated from the tax perspective](https://res.cloudinary.com/dza7lstvk/image/upload/v1712307395/Medusa%20Resources/order-tax-inclusive_oebdnm.jpg) \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/order/transactions/page.mdx b/www/apps/resources/app/commerce-modules/order/transactions/page.mdx index bdce6bcc59..1973383c63 100644 --- a/www/apps/resources/app/commerce-modules/order/transactions/page.mdx +++ b/www/apps/resources/app/commerce-modules/order/transactions/page.mdx @@ -6,30 +6,19 @@ export const metadata = { # {metadata.title} -In this document, you’ll learn about an order’s transactions and usefulness. +In this document, you’ll learn about an order’s transactions and its use. ## What is a Transaction? -A transaction represents any order payment process, such as capturing or refunding an amount. It’s represented by the `Transaction` data model. +A transaction represents any order payment process, such as capturing or refunding an amount. It’s represented by the [Transaction data model](/references/order/models/Transaction). The transaction’s main purpose is to ensure a correct balance between paid and outstanding amounts. --- -## Transaction Reference - -The Order Module doesn’t provide payment processing functionalities, so it doesn’t store payments that can be processed. For that, use the Payment Module or custom logic. - -The `Transaction` data model has two fields that determine which data model and record holds the actual payment’s details: - -- `reference`: indicates the table’s name in the database. For example, `payment` if you’re using the Payment Module. -- `reference_id`: indicates the ID of the record in the table. For example, `pay_123`. - ---- - ## Checking Outstanding Amount -The order’s total is stored in the `OrderSummary`'s `total` field. To check the outstanding amount of the order, the transaction amounts of an order are summed. Then: +The order’s total is stored in the `OrderSummary`'s `total` field. To check the outstanding amount of the order, its transaction amounts are summed. Then, the following conditions are checked: @@ -77,3 +66,14 @@ The order’s total is stored in the `OrderSummary`'s `total` field. To check th
+ +--- + +## Transaction Reference + +The Order Module doesn’t provide payment processing functionalities, so it doesn’t store payments that can be processed. For that, use the Payment Module or custom logic. + +The `Transaction` data model has two fields that determine which data model and record holds the actual payment’s details: + +- `reference`: indicates the table’s name in the database. For example, `payment` if you’re using the Payment Module. +- `reference_id`: indicates the ID of the record in the table. For example, `pay_123`. \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/payment/events/page.mdx b/www/apps/resources/app/commerce-modules/payment/events/page.mdx index 305f780183..1dc0d4b8c6 100644 --- a/www/apps/resources/app/commerce-modules/payment/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Payment Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/payment/examples/page.mdx b/www/apps/resources/app/commerce-modules/payment/examples/page.mdx index 222260830d..290079f4b4 100644 --- a/www/apps/resources/app/commerce-modules/payment/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/examples/page.mdx @@ -374,4 +374,4 @@ In this guide, you’ll find common examples of how you can use the Payment Modu ## More Examples -The [module interface reference](/references/payment) provides a reference to all the methods available for use with examples for each. +The [Payment Module's main service reference](/references/payment) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/payment/page.mdx b/www/apps/resources/app/commerce-modules/payment/page.mdx index e187a2e8be..14be444c90 100644 --- a/www/apps/resources/app/commerce-modules/payment/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/page.mdx @@ -9,8 +9,6 @@ export const metadata = { The Payment Module is the `@medusajs/payment` NPM package that provides payment-related features in your Medusa and Node.js applications. ---- - ## Features ### Add Payment Functionalities to Any Resource @@ -40,7 +38,7 @@ await paymentModuleService.capturePayment({ ### Integrate Third-Party Payment Providers -Use payment providers like Stripe and PayPal to handle and process payments. +Use payment providers like Stripe to handle and process payments. ```ts const payment = @@ -74,12 +72,16 @@ await paymentModuleService.processEvent({ ## Configure Payment Module -After installing the `@medusajs/payment` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Payment Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - apiKey: { + [Modules.PAYMENT]: { resolve: "@medusajs/payment", options: { // ... @@ -134,7 +136,7 @@ For example: container, }: SubscriberArgs) { const paymentModuleService: IPaymentModuleService = - container.resolve(ModuleRegistrationName.API_KEY) + container.resolve(ModuleRegistrationName.PAYMENT) const payment_collections = await paymentModuleService.listPaymentCollections() @@ -149,10 +151,12 @@ For example: import { IPaymentModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const paymentModuleService: IPaymentModuleService = - context.container.resolve( - ModuleRegistrationName.API_KEY + container.resolve( + ModuleRegistrationName.PAYMENT ) const payment_collections = diff --git a/www/apps/resources/app/commerce-modules/payment/payment-collection/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment-collection/page.mdx index a452c7d30f..9683e75602 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment-collection/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment-collection/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn what a payment collection is and how to use it ## What's a Payment Collection? -A payment collection stores payment details related to a resource, such as a cart or an order. It’s represented by the `PaymentCollection` data model. +A payment collection stores payment details related to a resource, such as a cart or an order. It’s represented by the [PaymentCollection data model](/references/payment/models/PaymentCollection). Every purchase or request for payment starts with a payment collection. The collection holds details necessary to complete the payment, including: @@ -18,20 +18,20 @@ Every purchase or request for payment starts with a payment collection. The coll --- -## Usage with the Cart Module - -The Cart Module provides cart management features. However, it doesn’t provide any features related to accepting payment. - -With the Payment Module, you can create a payment collection for the cart and handle the payment functionalities. - -The Medusa application creates a link between the `PaymentCollection` and `Cart` data models. It also implements the payment flow during checkout as explained in [this documentation](../payment-flow/page.mdx). - -![Diagram showcasing the relation between the Payment and Cart modules](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537849/Medusa%20Resources/cart-payment_ixziqm.jpg) - ---- - ## Multiple Payments The payment collection supports multiple payment sessions and payments. You can use this to accept payments in increments or split payments across payment providers. ![Diagram showcasing how a payment collection can have multiple payment sessions and payments](https://res.cloudinary.com/dza7lstvk/image/upload/v1711554695/Medusa%20Resources/payment-collection-multiple-payments_oi3z3n.jpg) + +--- + +## Usage with the Cart Module + +The Cart Module provides cart management features. However, it doesn’t provide any features related to accepting payment. + +With the Payment Module, you can create a payment collection for the cart and process the payment. + +The Medusa application creates a link between the `PaymentCollection` and `Cart` data models. It also implements the payment flow during checkout as explained in [this documentation](../payment-flow/page.mdx). + +![Diagram showcasing the relation between the Payment and Cart modules](https://res.cloudinary.com/dza7lstvk/image/upload/v1711537849/Medusa%20Resources/cart-payment_ixziqm.jpg) diff --git a/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx index 93d13acd3a..993f2493b1 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx @@ -1,16 +1,10 @@ export const metadata = { - title: `Payment Flow`, + title: `Accept Payment Flow`, } # {metadata.title} -In this document, you’ll learn about the payment flow implemented by the Medusa application. This is the recommended flow to follow when accepting a payment for a resource using the Payment Module. - - - -The flow described is in the checkout context. However, you can apply it in any use case. - - +In this document, you’ll learn how to implement an accept-payment flow. ## Flow Overview diff --git a/www/apps/resources/app/commerce-modules/payment/payment-session/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment-session/page.mdx index 57d94a46c3..1f0b04dd28 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment-session/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment-session/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn what a payment session is. ## What's a Payment Session? -A payment session, represented by the `PaymentSession` data model, is a payment amount to be authorized. It’s associated with a payment provider that handles authorizing it. +A payment session, represented by the [PaymentSession data model](/references/payment/modules/PaymentSession), is a payment amount to be authorized. It’s associated with a payment provider that handles authorizing it. A payment collection can have multiple payment sessions. For example, during checkout, when a customer chooses between paying with Stripe or PayPal, each of these payment options is a payment session associated with a payment provider (Stripe or PayPal). @@ -18,9 +18,9 @@ A payment collection can have multiple payment sessions. For example, during che ## data field -Payment providers may need some additional data to process the payment later. The `PaymentSession` data model has a `data` field used to store that data. +Payment providers may need additional data to process the payment later. The `PaymentSession` data model has a `data` field used to store that data. -For example, for Stripe, you must pass Stripe’s customer ID when processing the payment. So, when you create a payment session, the Stripe payment provider creates the customer in Stripe and stores the ID in the `data` field. +For example, the customer's ID in Stripe is stored in the `data` field. --- diff --git a/www/apps/resources/app/commerce-modules/payment/payment/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment/page.mdx index d0588d5338..2cbeef6fc0 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn what a payment is and how it's created, capture ## What's a Payment? -When a payment session is authorized, a payment, represented by the `Payment` data model, is created. This payment is an authorized amount that’s later captured or refunded. +When a payment session is authorized, a payment, represented by the [Payment data model](/references/payment/models/Payment), is created. This payment can later be captured or refunded. A payment carries along many of the data and relations of a payment session: @@ -20,7 +20,7 @@ A payment carries along many of the data and relations of a payment session: ## Capture Payments -When a payment is captured, a capture, represented by the `Capture` data model, is created. It holds details related to the capture, such as the amount, the capture date, and more. +When a payment is captured, a capture, represented by the [Capture data model](/references/payment/models/Capture), is created. It holds details related to the capture, such as the amount, the capture date, and more. The payment can also be captured incrementally, each time a capture record is created for that amount. @@ -30,8 +30,8 @@ The payment can also be captured incrementally, each time a capture record is cr ## Refund Payments -An amount of a payment can be refunded if it’s already captured. Once it’s refunded, a refund, represented by the `Refund` data model, is created. It holds details related to the refund, such as the amount, refund date, and more. +When a payment is refunded, a refund, represented by the [Refund data model](/references/payment/models/Refund), is created. It holds details related to the refund, such as the amount, refund date, and more. -A payment can be refunded multiple times, and each time a refund record is created for that refund. +A payment can be refunded multiple times, and each time a refund record is created. ![A diagram showcasing how a payment's multiple refunds are stored](https://res.cloudinary.com/dza7lstvk/image/upload/v1711565555/Medusa%20Resources/payment-refund_lgfvyy.jpg) diff --git a/www/apps/resources/app/commerce-modules/payment/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/payment/relations-to-other-modules/page.mdx index 19b0fe4c36..65e1dd4a14 100644 --- a/www/apps/resources/app/commerce-modules/payment/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/relations-to-other-modules/page.mdx @@ -4,9 +4,7 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Payment Module and other Commerce Modules. +This document showcases the link modules defined between the Payment Module and other commerce modules. ## Cart Module @@ -16,6 +14,14 @@ Learn more about this relation in [this documentation](../payment-collection/pag --- +## Order Module + +An order's payment is stored in a payment collection. Medusa defines a link module that builds a relationship between the `Order` and `PaymentCollection` data models. + +![A diagram showcasing an example of how data models from the Order and Payment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716554726/Medusa%20Resources/order-payment_ubdwok.jpg) + +--- + ## Region Module You can specify for each region which payment providers are available. The Medusa application forms a relation between the `PaymentProvider` and the `Region` data models. diff --git a/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx b/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx index 784b10cdb7..cae59ad69a 100644 --- a/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/webhook-events/page.mdx @@ -14,31 +14,12 @@ A webhook event is sent from a third-party payment provider to your application. ## processEvent Method -The Payment Module’s main service (`IPaymentModuleService`) provides a `processEvent` method used to handle incoming webhook events from third-party providers. The method delegates the handling to the associated payment provider, which returns the event's details. +The Payment Module’s main service (`IPaymentModuleService`) provides a [processEvent method](/references/payment/processEvent) used to handle incoming webhook events from third-party payment services. The method delegates the handling to the associated payment provider, which returns the event's details. -If the event's details indicate that the payment should be authorized, then the `authorizePaymentSession` of the main service is executed on the specified payment session. - -If the event's details indicate that the payment should be captured, then the `capturePayment` of the main service is executed on the payment of the specified payment session. +Medusa implements a webhook listener at the `/hooks/payment/[provider]` API route, where `[provider]` is the ID of the provider (for example, `stripe`). You can use that webhook listener in your third-party payment provider's configurations. ![A diagram showcasing the steps of how the processEvent method words](https://res.cloudinary.com/dza7lstvk/image/upload/v1711567415/Medusa%20Resources/payment-webhook_seaocg.jpg) -You can use this method in your webhook listener API routes or endpoints. +If the event's details indicate that the payment should be authorized, then the [authorizePaymentSession method of the main service](/references/payment/authorizePaymentSession) is executed on the specified payment session. - - -Medusa V2 implements a webhook listener at the `/hooks/payment/[provider]` API route, where `[provider]` is the ID of the provider (for example, `stripe`). You can use that webhook listener in your third-party payment provider's configurations. - - - -For example: - -```ts -await paymentModuleService.processEvent({ - provider: "stripe", - payload: { - // webhook event data - }, -}) -``` - -Learn more about the method’s parameters and return types in [this reference](/references/payment/processEvent). +If the event's details indicate that the payment should be captured, then the [capturePayment method of the main service](/references/payment/capturePayment) is executed on the payment of the specified payment session. \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/pricing/concepts/page.mdx b/www/apps/resources/app/commerce-modules/pricing/concepts/page.mdx index 7c80e6b930..233c8d4bc4 100644 --- a/www/apps/resources/app/commerce-modules/pricing/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/concepts/page.mdx @@ -6,70 +6,46 @@ export const metadata = { In this document, you’ll learn about the main concepts in the Pricing Module, and how data is stored and related. -## Price - -The `Price` data model represents any price. - -Prices can be conditioned by the `min_quantity` and `max_quantity` fields, which are helpful when calculating the price for a specific quantity. - -If a price has its `min_quantity` or `max_quantity` fields set, they’re only considered for the price calculation if they have a lower `min_quantity` or a higher `max_quantity` than the quantity specified for calculation. - ---- - ## Price Set -A `PriceSet` represents a collection of prices that are linked to a resource (for example, a product or a shipping option). Each of these prices are represented by the `Price` data module. +A [PriceSet](/references/pricing/models/PriceSet) represents a collection of prices that are linked to a resource (for example, a product or a shipping option). Each of these prices are represented by the [Price data module](/references/pricing/models/Price). ![A diagram showcasing the relation between the price set and price](https://res.cloudinary.com/dza7lstvk/image/upload/v1709648650/Medusa%20Resources/price-set-money-amount_xeees0.jpg) --- -## Prices with Rules - -### Rule Type +## Rule Type Each price within a price set can be applied for different conditions. These conditions are represented as rule types. -A `RuleType` defines custom conditions. Each rule type has a unique `rule_field`, referenced in rule values, such as when setting a rule of a price. +A [RuleType](/references/pricing/models/RuleType) defines custom conditions. A rule type has a unique `rule_attribute` which indicates the field this rule applies on. For example, `region_id`. -### Price Rule +This is referenced when setting a rule of a price. For example: -Each rule of a price within a price set is represented by the `PriceRule` data model, which holds the value of a rule type. The `Price` data model has a `rules_count` field, which indicates how many rules, represented by `PriceRule`, are applied to the price. +export const ruleTypeHighlights = [ + ["8", "region_id", "Reference a rule type by its `rule_attribute`."], + ["8", `"PL"`, "The value of this rule."] +] -![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709648772/Medusa%20Resources/price-rule-1_vy8bn9.jpg) - -For example, you create a `zip_code` rule type. Then, a price within the price set can have the rule value `10557`, indicating that the price can only be applied within the `10557` zip code. - -Each price within the price set can have different values for the same rule type. - -For example: - -![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709648884/Medusa%20Resources/price-rule-2_b6fuyb.jpg) - -Each price can have multiple rules applied to it as well. - -For example, a price can have the rules `zip_code` and `region_id` applied to it. In this case, the value of each rule is represented by a `PriceRule`. - -![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType with multiple rules.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709649296/Medusa%20Resources/price-rule-3_pwpocz.jpg) - -### PriceSetRuleType - -The `PriceSetRuleType` data model indicates what rules the prices can have within a price set. It creates a relation between the `PriceSet` and `RuleType` entities. - -For example, to use the `zip_code` rule type on a price in a price set, the rule type must first be enabled on the price set through the `PriceSetRuleType`. - -![A diagram showcasing the relation between the PriceSet, PriceRule, Price, RuleType, and PriceSetRuleType](https://res.cloudinary.com/dza7lstvk/image/upload/v1709649375/Medusa%20Resources/price-set-rule-type_cqqt0u.jpg) +```ts highlights={ruleTypeHighlights} +const priceSet = await pricingModuleService.addPrices({ + priceSetId, + prices: [ + { + amount: 500, + currency_code: "EUR", + rules: { + region_id: "PL", + }, + }, + ], +}) +``` --- ## Price List -A `PriceList` is a group of prices only enabled if their rules are satisfied. A price list has optional `start_date` and `end_date` fields, which indicate the date range in which a price list can be applied. +A [PriceList](/references/pricing/models/PriceList) is a group of prices only enabled if their conditions and rules are satisfied. A price list has optional `start_date` and `end_date` fields, which indicate the date range in which a price list can be applied. -Its associated prices are represented by the `Price` data model. - -Each rule that can be applied to a price list is represented by the `PriceListRule` data model. The `rules_count` field of a `PriceList` indicates how many rules are applied to it. - -Each rule of a price list can have more than one value, representing its values by the `PriceListRuleValue` data model. - -![A diagram showcasing the relation between the PriceSet, PriceList, Price, RuleType, and PriceListRuleValue](https://res.cloudinary.com/dza7lstvk/image/upload/v1709641999/Medusa%20Resources/price-list_zd10yd.jpg) +Its associated prices are represented by the `Price` data model. \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/pricing/events/page.mdx b/www/apps/resources/app/commerce-modules/pricing/events/page.mdx index 8a161a5e80..e8063540f3 100644 --- a/www/apps/resources/app/commerce-modules/pricing/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Pricing Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/pricing/examples/page.mdx b/www/apps/resources/app/commerce-modules/pricing/examples/page.mdx index 1106d87675..0c664cedd5 100644 --- a/www/apps/resources/app/commerce-modules/pricing/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/examples/page.mdx @@ -11,7 +11,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Create a Price Set - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -47,7 +47,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -89,7 +89,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## List Price Sets - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -110,7 +110,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -136,7 +136,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Retrieve a Price Set by its ID - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -159,7 +159,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -196,7 +196,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Create a Rule Type - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -210,16 +210,17 @@ In this document, you’ll find common examples of how you can use the Pricing M const pricingModuleService: IPricingModuleService = request.scope.resolve(ModuleRegistrationName.PRICING) - const priceSet = await pricingModuleService.retrieve( - request.params.id - ) + const ruleType = await pricingModuleService.createRuleTypes([{ + name: "Customer Group", + rule_attribute: "customer_group_id", + }]) - res.json({ price_set: priceSet }) + res.json({ rule_type: ruleType }) } ``` - + ```ts import { NextResponse } from "next/server" @@ -228,23 +229,17 @@ In this document, you’ll find common examples of how you can use the Pricing M initialize as initializePricingModule, } from "@medusajs/pricing" - type ContextType = { - params: { - id: string - } - } - - export async function GET( - request: Request, - { params }: ContextType + export async function POST( + request: Request ) { const pricingModuleService = await initializePricingModule() - const priceSet = await pricingModuleService.retrieve( - params.id - ) + const ruleType = await pricingModuleService.createRuleTypes([{ + name: "Customer Group", + rule_attribute: "customer_group_id", + }]) - return NextResponse.json({ price_set: priceSet }) + return NextResponse.json({ rule_type: ruleType }) } ``` @@ -256,7 +251,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Add Prices with Rules - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -288,7 +283,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -326,7 +321,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Create Price List - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -369,7 +364,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -415,7 +410,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ## Calculate Prices For a Currency - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -445,7 +440,7 @@ In this document, you’ll find common examples of how you can use the Pricing M ``` - + ```ts import { NextResponse } from "next/server" @@ -486,4 +481,4 @@ In this document, you’ll find common examples of how you can use the Pricing M ## More Examples -The [module interface reference](/references/pricing) provides a reference to all the methods available for use with examples for each. +The [Pricing Module's main service reference](/references/pricing) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/pricing/page.mdx b/www/apps/resources/app/commerce-modules/pricing/page.mdx index 2c99bf4c66..2db768a646 100644 --- a/www/apps/resources/app/commerce-modules/pricing/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/page.mdx @@ -12,7 +12,7 @@ The Pricing Module is the `@medusajs/pricing` NPM package that provides pricing- ### Price Management -With the Pricing Module, store the prices of a resource and manage them through the main interface's methods. +With the Pricing Module, store the prices of a resource and manage them through the main service's methods. Prices are grouped in a price set, allowing you to add more than one price for a resource based on different conditions, such as currency code. @@ -23,7 +23,6 @@ const priceSet = await pricingModuleService.create({ { amount: 500, currency_code: "USD", - rules: {}, }, { amount: 400, @@ -87,9 +86,7 @@ const priceList = await pricingModuleService.createPriceLists({ ### Price Calculation Strategy -The module’s main service provides a `calculatePrices` method to retrieve the best price for a given context. - -You can use your custom rules here to find the best price for the specified rule values. +Retrieve the best price in a given context and for the specified rule values. ```ts const price = await pricingModuleService.calculatePrices( @@ -107,14 +104,16 @@ const price = await pricingModuleService.calculatePrices( ## Configure Pricing Module -After installing the `@medusajs/pricing` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Pricing Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - pricingService: { - resolve: "@medusajs/pricing", - }, + [Modules.PRICING]: true, } ``` @@ -173,9 +172,11 @@ For example: import { IPricingModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const pricingModuleService: IPricingModuleService = - context.container.resolve(ModuleRegistrationName.PRICING) + container.resolve(ModuleRegistrationName.PRICING) const priceSets = await pricingModuleService.list() }) diff --git a/www/apps/resources/app/commerce-modules/pricing/price-calculation/page.mdx b/www/apps/resources/app/commerce-modules/pricing/price-calculation/page.mdx index a14640e994..6341b5d080 100644 --- a/www/apps/resources/app/commerce-modules/pricing/price-calculation/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/price-calculation/page.mdx @@ -1,167 +1,164 @@ -import { Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper } from "docs-ui" +import { Tabs, TabsList, TabsTrigger, TabsContent, TabsContentWrapper, TypeList } from "docs-ui" export const metadata = { - title: `Prices Calculation`, + title: `Prices Calculation Strategy`, } # {metadata.title} -In this document, you'll learn how prices are calculated under the hood when you use the `calculatePrices` method of the Pricing Module interface. +In this document, you'll learn how prices are calculated when you use the `calculatePrices` method of the Pricing Module's main service. ## Overview -The `calculatePrices` method accepts the ID of one or more price sets and a context. For each price set, it selects two types of prices that best match the context; one belongs to a price list, and one doesn't. - -Then, it returns an array of price objects, each price for every supplied price set ID. +The [calculatePrices method](/references/pricing/calculatePrices) accepts the ID of one or more price sets and a context. It returns a price object with the best matching price for each price set. --- ## Calculation Context -The context is an object passed to the `calculatePrices` method. It must contain at least the `currency_code`. Only prices in the price sets with the same currency code are considered for the price selection. +The context is an object passed as a second parameter to the `calculatePrices` method. It must contain at least the `currency_code`. Only prices in the price sets with the same currency code are considered for the price selection. For example: ```ts -import { - initialize as initializePricingModule, -} from "@medusajs/pricing" - -async function calculatePrice( - priceSetId: string, - currencyCode: string -) { - const pricingModuleService = await initializePricingModule() - - const price = await pricingModuleService.calculatePrices( - { id: [priceSetId] }, - { - context: { - currency_code: currencyCode, - }, - } - ) -} +const price = await pricingModuleService.calculatePrices( + { id: [priceSetId] }, + { + context: { + currency_code: currencyCode, + }, + } +) ``` -The context object can also contain any custom rules, with the key being the `rule_field` of a rule type and its value being the rule's value. +The context object can also contain any custom rules, with the key being the `rule_attribute` of a rule type and its value being the rule's value. For example: ```ts -import { - initialize as initializePricingModule, -} from "@medusajs/pricing" - -async function calculatePrice( - priceSetId: string, - currencyCode: string -) { - const pricingModuleService = await initializePricingModule() - - const price = await pricingModuleService.calculatePrices( - { id: [priceSetId] }, - { - context: { - currency_code: currencyCode, - region_id: "US", - }, - } - ) -} +const price = await pricingModuleService.calculatePrices( + { id: [priceSetId] }, + { + context: { + currency_code: currencyCode, + region_id: "US", + }, + } +) ``` --- -## Prices Selection +## Returned Price Object For each price set, the method selects two prices: - The calculated price: a price that belongs to a price list. If there are no prices associated with a price list, it’ll be the same as the original price. -- The original price: a price that doesn't belong to a price list. +- The original price: If the calculated price's price list type is `override`, then the original price will be the same as the calculated price. Otheriwse, a price that doesn't belong to a price list. -### Calculated Price Selection Process +After the original and calculated prices are selected, the method will use them to create a price object for each price set. -![A diagram showcasing the calculated price selection process.](https://res.cloudinary.com/dza7lstvk/image/upload/v1700574799/Medusa%20Docs/Diagrams/calculated-price_vjnx3j.jpg) +The price object has the following properties: -- Find the price set’s associated valid price lists. A price list is considered valid if: - - The current date is between its start and end dates. - - The price list's rules satisfy the context's rules. -- If valid price lists are found, the prices within them are sorted by their amount in ascending order. The one having the lowest amount is selected as the calculated price. -- If no valid price list is found, the selected calculated price will be the same as the original price. - -### Original Price Selection Process - -![A diagram showcasing the original price selection process.](https://res.cloudinary.com/dza7lstvk/image/upload/v1700574800/Medusa%20Docs/Diagrams/original-price_i47fso.jpg) - -- If the price list associated with the calculated price is of type `override`, the selected original price is set to the calculated price. -- If no rules are provided in the context other than the `currency_code`, the default price is selected as the original price. The default price is a price having no rules applied to it. -- Otherwise, if a price exists in any price set with the same rules provided in the context, it's selected as the original price. -- If no price exists with the same rules as the context, all prices satisfying any combination of the provided rules are retrieved. - - The prices are sorted in descending order by the associated `Price`'s `rules_count`, the `default_priority` of the rule types, and the `priority` of the associated `PriceRule`. The `priority` field has a higher precedence than the `default_priority`. - - The highest price sorted is selected as the original price since it's considered the best price. - ---- - -## Returned Calculated Price - -After the original and calculated prices are selected, the method will use them to create the following price object for each pr - -```ts -const price = { - id: priceSetId, - is_calculated_price_price_list: - !!calculatedPrice?.price_list_id, - calculated_amount: parseInt( - calculatedPrice?.amount || "" - ) || null, - - is_original_price_price_list: - !!originalPrice?.price_list_id, - original_amount: parseInt( - originalPrice?.amount || "" - ) || null, - - currency_code: calculatedPrice?.currency_code || null, - - calculated_price: { - price_id: calculatedPrice?.id || null, - price_list_id: calculatedPrice?.price_list_id || null, - price_list_type: calculatedPrice?.price_list_type || null, - min_quantity: parseInt( - calculatedPrice?.min_quantity || "" - ) || null, - max_quantity: parseInt( - calculatedPrice?.max_quantity || "" - ) || null, - }, - - original_price: { - price_id: originalPrice?.id || null, - price_list_id: originalPrice?.price_list_id || null, - price_list_type: originalPrice?.price_list_type || null, - min_quantity: parseInt( - originalPrice?.min_quantity || "" - ) || null, - max_quantity: parseInt( - originalPrice?.max_quantity || "" - ) || null, - }, -} -``` - -Where: - -- `id`: The ID of the price set from which the price was selected. -- `is_calculated_price_price_list`: whether the calculated price belongs to a price list. As mentioned earlier, if no valid price list is found, the calculated price is set to the original price, which doesn't belong to a price list. -- `calculated_amount`: The amount of the calculated price, or `null` if there isn't a calculated price. -- `is_original_price_price_list`: whether the original price belongs to a price list. As mentioned earlier, if the price list of the calculated price is of type `override`, the original price will be the same as the calculated price. -- `original_amount`: The amount of the original price, or `null` if there isn't an original price. -- `currency_code`: The currency code of the calculated price, or `null` if there isn't a calculated price. -- `calculated_price`: An object containing the calculated price's price details and potentially its associated price list. -- `original_price`: An object containing the original price's price details and potentially its associated price list. - -The method returns an array of these price objects. + --- @@ -173,18 +170,18 @@ Consider the following rule types and price sets: const ruleTypes = await pricingModuleService.createRuleTypes([ { name: "Region", - rule_field: "region_id", + rule_attribute: "region_id", }, { name: "City", - rule_field: "city", + rule_attribute: "city", }, ]) const priceSet = await pricingModuleService.create({ rules: [ - { rule_field: "region_id" }, - { rule_field: "city" }, + { rule_attribute: "region_id" }, + { rule_attribute: "city" }, ], prices: [ //default diff --git a/www/apps/resources/app/commerce-modules/pricing/price-rules/page.mdx b/www/apps/resources/app/commerce-modules/pricing/price-rules/page.mdx new file mode 100644 index 0000000000..b73308b584 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/pricing/price-rules/page.mdx @@ -0,0 +1,47 @@ +export const metadata = { + title: `Price Rules`, +} + +# {metadata.title} + +In this document, you'll learn about price rules for price sets and price lists. + +## Price Rule + +Each rule of a price within a price set is represented by the [PriceRule data model](/references/pricing/models/PriceRule), which holds the value of a rule type. The `Price` data model has a `rules_count` field, which indicates how many rules, represented by `PriceRule`, are applied to the price. + +![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709648772/Medusa%20Resources/price-rule-1_vy8bn9.jpg) + +For example, you create a `zip_code` rule type. Then, a price within the price set can have the rule value `10557`, indicating that the price can only be applied within the `10557` zip code. + +Each price within the price set can have different values for the same rule type. + +For example: + +![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709648884/Medusa%20Resources/price-rule-2_b6fuyb.jpg) + +Each price can have multiple rules applied to it as well. + +For example, a price can have the rules `zip_code` and `region_id` applied to it. In this case, the value of each rule is represented by a `PriceRule`. + +![A diagram showcasing the relation between the PriceRule, PriceSet, Price, and RuleType with multiple rules.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709649296/Medusa%20Resources/price-rule-3_pwpocz.jpg) + +--- + +## Restrict Price Rules + +The [PriceSetRuleType data model](/references/pricing/models/PriceSetRuleType) indicates what rules the prices can have within a price set. It creates a relation between the `PriceSet` and `RuleType` data models. + +For example, to use the `zip_code` rule type on a price in a price set, the rule type must first be enabled on the price set through the `PriceSetRuleType`. + +![A diagram showcasing the relation between the PriceSet, PriceRule, Price, RuleType, and PriceSetRuleType](https://res.cloudinary.com/dza7lstvk/image/upload/v1709649375/Medusa%20Resources/price-set-rule-type_cqqt0u.jpg) + +--- + +## Price List Rules + +Rules that can be applied to a price list are represented by the [PriceListRule data model](/references/pricing/models/PriceListRule). The `rules_count` field of a `PriceList` indicates how many rules are applied to it. + +Each rule of a price list can have more than one value, representing its values by the [PriceListRuleValue data model](/references/pricing/models/PriceListRuleValue). + +![A diagram showcasing the relation between the PriceSet, PriceList, Price, RuleType, and PriceListRuleValue](https://res.cloudinary.com/dza7lstvk/image/upload/v1709641999/Medusa%20Resources/price-list_zd10yd.jpg) diff --git a/www/apps/resources/app/commerce-modules/pricing/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/pricing/relations-to-other-modules/page.mdx index 70ac92b7e9..6cb9f02da8 100644 --- a/www/apps/resources/app/commerce-modules/pricing/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/pricing/relations-to-other-modules/page.mdx @@ -4,14 +4,20 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Pricing Module and other commerce modules. -This document showcases the relation between the Pricing Module and other Commerce Modules. +## Fulfillment Module + +A shipping option's price is stored as a price set. Medusa defines a link module that builds a relationship between the `PriceSet` and `ShippingOption` data models. + +![A diagram showcasing an example of how data models from the Pricing and Fulfillment modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716561747/Medusa%20Resources/pricing-fulfillment_spywwa.jpg) + +--- ## Product Module -A product variant’s prices are stored as prices belonging to a price set. The Medusa application forms a relation between the `ProductVariant` and the `PriceSet`. +A product variant’s prices are stored as prices belonging to a price set. Medusa defines a link module that builds a relationship between the `ProductVariant` and the `PriceSet`. -![A diagram showcasing an example of how resources from the Pricing and Product Module are linked. The PriceSet is linked to the ProductVariant of the Product Module.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651039/Medusa%20Resources/pricing-product_m4xaut.jpg) +![A diagram showcasing an example of how data models from the Pricing and Product Module are linked. The PriceSet is linked to the ProductVariant of the Product Module.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651039/Medusa%20Resources/pricing-product_m4xaut.jpg) So, when you want to add prices for a product variant, you create a price set and add the prices to it. You can then benefit from adding rules to prices or using the `calculatePrices` method to retrieve the price of a product variant within a specified context. diff --git a/www/apps/resources/app/commerce-modules/product/events/page.mdx b/www/apps/resources/app/commerce-modules/product/events/page.mdx index e0d4e09186..7c685c65f1 100644 --- a/www/apps/resources/app/commerce-modules/product/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Product Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/product/examples/page.mdx b/www/apps/resources/app/commerce-modules/product/examples/page.mdx index 484e6d7a87..5393545d7a 100644 --- a/www/apps/resources/app/commerce-modules/product/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/examples/page.mdx @@ -11,7 +11,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## Create Product - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -51,7 +51,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ``` - + ```ts import { NextResponse } from "next/server" @@ -96,7 +96,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## List Products - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -110,14 +110,14 @@ In this guide, you’ll find common examples of how you can use the Product Modu const productModuleService: IProductModuleService = request.scope.resolve(ModuleRegistrationName.PRODUCT) - const data = await productModuleService.list() + const products = await productModuleService.list() - res.json({ products: data }) + res.json({ products }) } ``` - + ```ts import { NextResponse } from "next/server" @@ -129,19 +129,21 @@ In this guide, you’ll find common examples of how you can use the Product Modu export async function GET(request: Request) { const productModuleService = await initializeProductModule() - const data = await productModuleService.list() + const products = await productModuleService.list() - return NextResponse.json({ products: data }) + return NextResponse.json({ products }) } ``` +--- + ## Retrieve a Product by its ID - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -155,16 +157,16 @@ In this guide, you’ll find common examples of how you can use the Product Modu const productModuleService: IProductModuleService = request.scope.resolve(ModuleRegistrationName.PRODUCT) - const data = await productModuleService.list({ - id: request.params.id, - }) + const product = await productModuleService.retrieve( + request.params.id + ) - res.json({ product: data[0] }) + res.json({ product }) } ``` - + ```ts import { NextResponse } from "next/server" @@ -180,11 +182,11 @@ In this guide, you’ll find common examples of how you can use the Product Modu const { id } = params const productModuleService = await initializeProductModule() - const data = await productModuleService.list({ - id, - }) + const product = await productModuleService.retrieve( + id + ) - return NextResponse.json({ product: data[0] }) + return NextResponse.json({ product }) } ``` @@ -196,7 +198,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## Retrieve a Product by its Handle - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -210,14 +212,16 @@ In this guide, you’ll find common examples of how you can use the Product Modu const productModuleService: IProductModuleService = request.scope.resolve(ModuleRegistrationName.PRODUCT) - const data = await productModuleService.list() + const data = await productModuleService.list({ + handle: "shirt" + }) - res.json({ products: data }) + res.json({ product: data[0] }) } ``` - + ```ts import { NextResponse } from "next/server" @@ -229,59 +233,8 @@ In this guide, you’ll find common examples of how you can use the Product Modu export async function GET(request: Request) { const productModuleService = await initializeProductModule() - const data = await productModuleService.list() - - return NextResponse.json({ products: data }) - } - ``` - - - - -## Retrieve a Product by its ID - - - - - ```ts - import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" - import { IProductModuleService } from "@medusajs/types" - import { ModuleRegistrationName } from "@medusajs/modules-sdk" - - export async function GET( - request: MedusaRequest, - res: MedusaResponse - ) { - const productModuleService: IProductModuleService = - request.scope.resolve(ModuleRegistrationName.PRODUCT) - const data = await productModuleService.list({ - handle: request.params.handle, - }) - - res.json({ product: data[0] }) - } - ``` - - - - - ```ts - import { NextResponse } from "next/server" - - import { - initialize as initializeProductModule, - } from "@medusajs/product" - - export async function GET( - request: Request, - { params }: { params: Record }) { - - const { handle } = params - const productModuleService = await initializeProductModule() - - const data = await productModuleService.list({ - handle, + handle: "shirt" }) return NextResponse.json({ product: data[0] }) @@ -296,7 +249,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## Retrieve Categories - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -310,14 +263,14 @@ In this guide, you’ll find common examples of how you can use the Product Modu const productModuleService: IProductModuleService = request.scope.resolve(ModuleRegistrationName.PRODUCT) - const data = await productModuleService.listCategories() + const categories = await productModuleService.listCategories() - res.json({ categories: data }) + res.json({ categories }) } ``` - + ```ts import { NextResponse } from "next/server" @@ -329,9 +282,9 @@ In this guide, you’ll find common examples of how you can use the Product Modu export async function GET(request: Request) { const productModuleService = await initializeProductModule() - const data = await productModuleService.listCategories() + const categories = await productModuleService.listCategories() - return NextResponse.json({ categories: data }) + return NextResponse.json({ categories }) } ``` @@ -343,7 +296,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## Retrieve Category by Handle - + ```ts import { MedusaRequest, MedusaResponse } from "@medusajs/medusa" @@ -366,7 +319,7 @@ In this guide, you’ll find common examples of how you can use the Product Modu ``` - + ```ts import { NextResponse } from "next/server" @@ -397,4 +350,4 @@ In this guide, you’ll find common examples of how you can use the Product Modu ## More Examples -The [Product Module interface reference](/references/product) provides a reference to all the methods available for use with examples for each. +The [Product Module's main service reference](/references/product) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/product/page.mdx b/www/apps/resources/app/commerce-modules/product/page.mdx index 9092fbecda..7afc2d2f3b 100644 --- a/www/apps/resources/app/commerce-modules/product/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/page.mdx @@ -12,7 +12,7 @@ The Product Module is the `@medusajs/product` NPM package that provides product- ### Products Management -With the Product Module, store products and manage them through the main interface methods. Products have custom options, such as color or size, and each variant in the product sets the value for these options. +Store and manage products. Products have custom options, such as color or size, and each variant in the product sets the value for these options. ```ts const products = await productService.create([ @@ -62,14 +62,16 @@ const products = await productService.update([ ## Configure Product Module -After installing the `@medusajs/product` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Product Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - productService: { - resolve: "@medusajs/product", - }, + [Modules.PRODUCT]: true, } ``` @@ -126,9 +128,11 @@ For example: import { IProductModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const productModuleService: IProductModuleService = - context.container.resolve(ModuleRegistrationName.PRODUCT) + container.resolve(ModuleRegistrationName.PRODUCT) const products = await productModuleService.list() }) diff --git a/www/apps/resources/app/commerce-modules/product/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/product/relations-to-other-modules/page.mdx index 01168a234c..d9c559edec 100644 --- a/www/apps/resources/app/commerce-modules/product/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/relations-to-other-modules/page.mdx @@ -4,21 +4,29 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Product Module and other commerce modules. -This document showcases the relation between the Product Module and other Commerce Modules. +## Cart Module -{/* TODO add relation to: +A cart's line item is associated with a product and its variant. Medusa defines a link module that builds a relationship between the `Cart`, `Product`, and `ProductVariant` data models. -- shipping profile +![A diagram showcasing an example of how data models from the Cart and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716546229/Medusa%20Resources/cart-product_x82x9j.jpg) -*/} +--- + +## Order Module + +An order's line item is associated with the purchased product and its variant. Medusa defines a link module that builds a relationship between the `LineItem`, `Product`, and `ProductVariant` data models. + +![A diagram showcasing an example of how data models from the Order and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716556100/Medusa%20Resources/order-product_l6ylte.jpg) + +--- ## Pricing Module -A product variant’s prices are stored as money amounts belonging to a price set. The Medusa application forms a relation between the `ProductVariant` and the `PriceSet` data models. +A product variant’s prices are stored as money amounts belonging to a price set. Medusa defines a link module that builds a relationship between the `ProductVariant` and the `PriceSet` data models. -![A diagram showcasing an example of how resources from the Pricing and Product Module are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651464/Medusa%20Resources/product-pricing_vlxsiq.jpg) +![A diagram showcasing an example of how data models from the Pricing and Product Module are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651464/Medusa%20Resources/product-pricing_vlxsiq.jpg) So, to add prices for a product variant, create a price set and add the prices as money amounts to it. @@ -28,17 +36,17 @@ Learn more about the `PriceSet` data model in the [Pricing Concepts](../../prici ## Sales Channel Module -A product can have different availability in different sales channels. The Medusa application forms a relation between the `Product` and `SalesChannel` data models. +A product can have different availability in different sales channels. Medusa defines a link module that builds a relationship between the `Product` and `SalesChannel` data models. -![A diagram showcasing an example of how resources from the Product and Sales Channel modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651840/Medusa%20Resources/product-sales-channel_t848ik.jpg) +![A diagram showcasing an example of how data models from the Product and Sales Channel modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709651840/Medusa%20Resources/product-sales-channel_t848ik.jpg) --- ## Inventory Module -Each product variant has different inventory details. The Medusa application forms a relation between the `ProductVariant` and `InventoryItem` data models. +Each product variant has different inventory details. Medusa defines a link module that builds a relationship between the `ProductVariant` and `InventoryItem` data models. -![A diagram showcasing an example of how resources from the Product and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709652779/Medusa%20Resources/product-inventory_kmjnud.jpg) +![A diagram showcasing an example of how data models from the Product and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709652779/Medusa%20Resources/product-inventory_kmjnud.jpg) When the `manage_inventory` field of a product variant is enabled, you can manage the variant's inventory in different locations through this relation. diff --git a/www/apps/resources/app/commerce-modules/promotion/actions/page.mdx b/www/apps/resources/app/commerce-modules/promotion/actions/page.mdx index 4610d4ef73..1dec4e5c29 100644 --- a/www/apps/resources/app/commerce-modules/promotion/actions/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/actions/page.mdx @@ -8,13 +8,7 @@ In this document, you’ll learn about promotion actions and how they’re compu ## computeActions Method -The `IPromotionModuleService` has a `computeActions` method that returns an array of actions to perform on a cart when one or more promotions are applied. - - - -Refer to [the method’s reference](/references/promotion/computeActions) for full details on this method’s parameters and return type. - - +The Promotion Module's main service has a [computeActions method](/references/promotion/computeActions) that returns an array of actions to perform on a cart when one or more promotions are applied. Actions inform you what adjustment must be made to a cart item or shipping method. Each action is an object having the `action` field indicating the type of action. @@ -38,7 +32,7 @@ export interface AddItemAdjustmentAction { } ``` -When the Medusa application receives this action type, it creates a new record of the `LineItemAdjustment` data model in the Cart Module. +This action means that a new record should be created of the `LineItemAdjustment` data model in the Cart Module. @@ -50,7 +44,7 @@ Refer to [this reference](/references/promotion/interfaces/promotion.AddItemAdju The `removeItemAdjustment` action indicates that an adjustment must be removed from a line item. For example, remove the $5 discount. -When the Medusa application uses the `computeActions` method, it passes any previous item adjustments in the `items` property of the second parameter. +The `computeActions` method accepts any previous item adjustments in the `items` property of the second parameter. This action has the following format: @@ -63,7 +57,7 @@ export interface RemoveItemAdjustmentAction { } ``` -When the Medusa application receives this action type, it removes the `LineItemAdjustment` with the specified ID in the `adjustment_id` property. +This action means that a new record should be removed of the `LineItemAdjustment` with the specified ID in the `adjustment_id` property. @@ -87,7 +81,7 @@ export interface AddShippingMethodAdjustment { } ``` -When the Medusa application receives this action type, it creates a new record of the `ShippingMethodAdjustment` data model in the Cart Module. +This action means that a new record should be created of the `ShippingMethodAdjustment` data model in the Cart Module. @@ -99,7 +93,7 @@ Refer to [this reference](/references/promotion/interfaces/promotion.AddShipping The `removeShippingMethodAdjustment` action indicates that an adjustment must be removed from a shipping method. For example, remove the free shipping discount. -When the Medusa application uses the `computeActions` method, it passes any previous shipping method adjustments in the `shipping_methods` property of the second parameter. +The `computeActions` method accepts any previous shipping method adjustments in the `shipping_methods` property of the second parameter. This action has the following format: @@ -132,8 +126,6 @@ export interface CampaignBudgetExceededAction { } ``` -The Medusa Application considers this an error, so it doesn’t apply the promotions on the cart. - Refer to [this reference](/references/promotion/interfaces/promotion.CampaignBudgetExceededAction) for details on the object’s properties. diff --git a/www/apps/resources/app/commerce-modules/promotion/application-method/page.mdx b/www/apps/resources/app/commerce-modules/promotion/application-method/page.mdx new file mode 100644 index 0000000000..5b2124869f --- /dev/null +++ b/www/apps/resources/app/commerce-modules/promotion/application-method/page.mdx @@ -0,0 +1,90 @@ +import { Table } from "docs-ui" + +export const metadata = { + title: `Application Method`, +} + +# {metadata.title} + +In this document, you'll learn what an application method is. + +## What is an Application Method? + +The [ApplicationMethod data model](/references/promotion/models/ApplicationMethod) defines how a promotion is applied: + + + + + + + Field + + + + + Purpose + + + + + + + + + `type` + + + + + Does the promotion discount a fixed amount or a percentage? + + + + + + + `target_type` + + + + + Is the promotion applied on a cart item, shipping method, or the entire order? + + + + + + + `allocation` + + + + + Is the discounted amount applied on each item or split between the applicable items? + + + + +
+ +## Target Promotion Rules + +When the promotion is applied to a cart item or a shipping method, you can restrict which items/shipping methods the promotion is applied to. + +The `ApplicationMethod` data model has a collection of `PromotionRule` records to restrict which items or shipping methods the promotion applies to. The `target_rules` field represents this relation. + +![A diagram showcasing the target_rules relation between the ApplicationMethod and PromotionRule data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709898273/Medusa%20Resources/application-method-target-rules_hqaymz.jpg) + +In this example, the promotion is only applied on products in the cart having the SKU `SHIRT`. + +--- + +## Buy Promotion Rules + +When the promotion’s type is `buyget`, you must specify the “buy X” condition. For example, a cart must have two shirts before the promotion can be applied. + +The application method has a collection of `PromotionRule` items to define the “buy X” rule. The `buy_rules` field represents this relation. + +![A diagram showcasing the buy_rules relation between the ApplicationMethod and PromotionRule data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709898453/Medusa%20Resources/application-method-buy-rules_djjuhw.jpg) + +In this example, the cart must have two products with the SKU `SHIRT` for the promotion to be applied. \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/promotion/campaign/page.mdx b/www/apps/resources/app/commerce-modules/promotion/campaign/page.mdx new file mode 100644 index 0000000000..90449870f7 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/promotion/campaign/page.mdx @@ -0,0 +1,26 @@ +export const metadata = { + title: `Campaign`, +} + +# {metadata.title} + +In this document, you'll learn about campaigns. + +## What is a Campaign? + +A [Campaign](/references/promotion/models/Campaign) combines promotions under the same conditions, such as start and end dates. + +![A diagram showcasing the relation between the Campaign and Promotion data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709899225/Medusa%20Resources/campagin-promotion_hh3qsi.jpg) + +--- + +## Campaign Limits + +Each campaign has a budget represented by the [CampaignBudget data model](/references/promotion/models/CampaignBudget). The budget limits how many times the promotion can be used. + +There are two types of budgets: + +- `spend`: An amount that, when crossed, the promotion becomes unusable. For example, if the amount limit is set to `$100`, and the total amount of usage of this promotion crosses that threshold, the promotion can no longer be applied. +- `usage`: The number of times that a promotion can be used. For example, if the usage limit is set to `10`, the promotion can be used only 10 times by customers. After that, it can no longer be applied. + +![A diagram showcasing the relation between the Campaign and CampaignBudget data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709899463/Medusa%20Resources/campagin-budget_rvqlmi.jpg) diff --git a/www/apps/resources/app/commerce-modules/promotion/concepts/page.mdx b/www/apps/resources/app/commerce-modules/promotion/concepts/page.mdx index ebb4f68001..ffa68a442a 100644 --- a/www/apps/resources/app/commerce-modules/promotion/concepts/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/concepts/page.mdx @@ -6,11 +6,11 @@ export const metadata = { # {metadata.title} -In this document, you’ll learn about the concepts in the Promotion Module. +In this document, you’ll learn about the main promotion and rule concepts in the Promotion Module. -## Promotion +## What is a Promotion? -A promotion, represented by the `Promotion` data model, represents a discount applied on cart items, shipping methods, or entire orders. +A promotion, represented by the [Promotion data model](/references/promotion/models/Promotion), represents a discount applied on cart items, shipping methods, or entire orders. A promotion has two types: @@ -72,131 +72,27 @@ A promotion has two types: -### PromotionRule +## PromotionRule -A promotion can be restricted by a set of rules, each rule is represented by the `PromotionRule` data model. For example, you can create a promotion that only customers of the `VIP` customer group can use it. +A promotion can be restricted by a set of rules, each rule is represented by the [PromotionRule data model](/references/promotion/models/PromotionRule). For example, you can create a promotion that only customers of the `VIP` customer group can use. ![A diagram showcasing the relation between Promotion and PromotionRule](https://res.cloudinary.com/dza7lstvk/image/upload/v1709833196/Medusa%20Resources/promotion-promotion-rule_msbx0w.jpg) -A `PromotionRule`'s `field` field indicates the field's name to which this rule is applied. For example, `customer_group_id`. Its value is stored in the `PromotionRuleValue` data model. So, a rule can have multiple values. +A `PromotionRule`'s `attribute` field indicates the field's name to which this rule is applied. For example, `customer_group_id`. Its value is stored in the `PromotionRuleValue` data model. So, a rule can have multiple values. -When testing whether a promotion can be applied to a cart, the rule's `field` field and its values are tested on the cart itself. For example, the cart's customer must be part of the customer group(s) indicated in the promotion rule's value. +When testing whether a promotion can be applied to a cart, the rule's `attribute` field and its values are tested on the cart itself. For example, the cart's customer must be part of the customer group(s) indicated in the promotion rule's value. -### Flexible Rules +--- + +## Flexible Rules The `PromotionRule`'s `operator` field adds more flexibility to the rule’s condition rather than simple equality (`eq`). For example, to restrict the promotion to only `VIP` and `B2B` customer groups: -- Add a `PromotionRule` with its `field` field set to `customer_group_id` and `operator` field to `in`. +- Add a `PromotionRule` with its `attribute` field set to `customer_group_id` and `operator` field to `in`. - Add two `PromotionRuleValue` associated with the rule: one with the value `VIP` and the other `B2B`. ![A diagram showcasing the relation between PromotionRule and PromotionRuleValue when a rule has multiple values](https://res.cloudinary.com/dza7lstvk/image/upload/v1709897383/Medusa%20Resources/promotion-promotion-rule-multiple_hctpmt.jpg) In this case, a customer’s group must be in the `VIP` and `B2B` set of values to use the promotion. - ---- - -## Application Method - -The `ApplicationMethod` data model defines how a promotion is applied: - - - - - - - field - - - - - Purpose - - - - - - - - - `type` - - - - - Does the promotion discount a fixed amount or a percentage? - - - - - - - `target_type` - - - - - Is the promotion applied on a cart item, shipping method, or the entire order? - - - - - - - `allocation` - - - - - Is the discounted amount applied on each item or split between the applicable items? - - - - -
- -### Target Promotion Rules - -When the promotion is applied to a cart item or a shipping method, you can restrict which items/shipping methods the promotion is applied to. - -The `ApplicationMethod` data model has a collection of `PromotionRule` records to restrict which items or shipping methods the promotion applies to. The `target_rules` field represents this relation. - -![A diagram showcasing the target_rules relation between the ApplicationMethod and PromotionRule data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709898273/Medusa%20Resources/application-method-target-rules_hqaymz.jpg) - -In this example, the promotion is only applied on products in the cart having the SKU `SHIRT`. - -### Buy Promotion Rules - -When the promotion’s type is `buyget`, you must specify the “buy X” condition. For example, a cart must have two shirts before the promotion can be applied. - -The application method has a collection of `PromotionRule` items to define the “buy X” rule. The `buy_rules` field represents this relation. - -![A diagram showcasing the buy_rules relation between the ApplicationMethod and PromotionRule data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709898453/Medusa%20Resources/application-method-buy-rules_djjuhw.jpg) - -In this example, the cart must have two products with the SKU `SHIRT` for the promotion to be applied. - ---- - -## Campaign - -A `Campaign` combines promotions under the same conditions, such as start and end dates. - -![A diagram showcasing the relation between the Campaign and Promotion data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709899225/Medusa%20Resources/campagin-promotion_hh3qsi.jpg) - -### Campaign Limits - -Each campaign has a budget represented by the `CampaignBudget` data model. The budget limits how many times the promotion can be used. - -There are two types of budgets: - -- `spend`: An amount that, when crossed, the promotion becomes unusable. For example, if the amount limit is set to `$100`, and the total amount of usage of this promotion crosses that threshold, the promotion can no longer be applied. -- `usage`: The number of times that a promotion can be used. For example, if the usage limit is set to `10`, the promotion can be used only 10 times by customers. After that, it can no longer be applied. - -![A diagram showcasing the relation between the Campaign and CampaignBudget data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1709899463/Medusa%20Resources/campagin-budget_rvqlmi.jpg) - ---- - -## Full Data Models Diagram - -![A diagram showcasing all data models and the relations between them](https://res.cloudinary.com/dza7lstvk/image/upload/v1709900277/Medusa%20Resources/promotion-architecture_an8mzy.jpg) \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/promotion/events/page.mdx b/www/apps/resources/app/commerce-modules/promotion/events/page.mdx index edb96a2ce2..41b7e449af 100644 --- a/www/apps/resources/app/commerce-modules/promotion/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Promotion Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/promotion/examples/page.mdx b/www/apps/resources/app/commerce-modules/promotion/examples/page.mdx index 34625644cc..b810fb89a6 100644 --- a/www/apps/resources/app/commerce-modules/promotion/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/examples/page.mdx @@ -32,6 +32,7 @@ In this document, you’ll find common examples of how you can use the Promotion type: "percentage", target_type: "order", value: "10", + currency_code: "usd", }, }) @@ -61,6 +62,7 @@ In this document, you’ll find common examples of how you can use the Promotion type: "percentage", target_type: "order", value: "10", + currency_code: "usd", }, }) @@ -96,11 +98,6 @@ In this document, you’ll find common examples of how you can use the Promotion campaign_identifier: "G-123445", starts_at: new Date("2024-05-02"), ends_at: new Date("2024-07-20"), - promotions: [ - { - id: "promo_123", - }, - ], } ) @@ -129,11 +126,6 @@ In this document, you’ll find common examples of how you can use the Promotion campaign_identifier: "G-123445", starts_at: new Date("2024-05-02"), ends_at: new Date("2024-07-20"), - promotions: [ - { - id: "promo_123", - }, - ], } ) @@ -170,10 +162,11 @@ In this document, you’ll find common examples of how you can use the Promotion type: "percentage", target_type: "order", value: "10", + currency_code: "usd", }, rules: [ { - field: "customer_group_id", + attribute: "customer_group_id", operator: "eq", values: ["VIP"], }, @@ -205,10 +198,11 @@ In this document, you’ll find common examples of how you can use the Promotion type: "percentage", target_type: "order", value: "10", + currency_code: "usd", }, rules: [ { - field: "customer_group_id", + attribute: "customer_group_id", operator: "eq", values: ["VIP"], }, @@ -257,7 +251,7 @@ In this document, you’ll find common examples of how you can use the Promotion initialize as initializePromotionModule, } from "@medusajs/promotion" - export async function POST(request: Request) { + export async function GET(request: Request) { const promotionModuleService = await initializePromotionModule() @@ -274,4 +268,4 @@ In this document, you’ll find common examples of how you can use the Promotion ## More Examples -The [module interface reference](/references/promotion) provides a reference to all the methods available for use with examples for each. +The [Promotion Module's main service reference](/references/promotion) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/promotion/page.mdx b/www/apps/resources/app/commerce-modules/promotion/page.mdx index a77de7e4af..9355c01173 100644 --- a/www/apps/resources/app/commerce-modules/promotion/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/page.mdx @@ -24,6 +24,7 @@ const promotion = await promotionModuleService.create({ type: "percentage", target_type: "order", value: "10", + currency_code: "usd" }, }) ``` @@ -40,10 +41,11 @@ const promotion = await promotionModuleService.create({ type: "percentage", target_type: "order", value: "10", + currency_code: "usd" }, rules: [ { - field: "customer_group_id", + attribute: "customer_group_id", operator: "eq", values: ["VIP"], }, @@ -64,11 +66,6 @@ const campaign = await promotionModuleService.createCampaigns( campaign_identifier: "G-123445", starts_at: new Date("2024-05-02"), ends_at: new Date("2024-07-20"), - promotions: [ - { - id: "promo_123", - }, - ], } ) ``` @@ -77,14 +74,16 @@ const campaign = await promotionModuleService.createCampaigns( ## Configure Promotion Module -After installing the `@medusajs/promotion` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Promotion Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - promotion: { - resolve: "@medusajs/promotion", - }, + [Modules.PROMOTION]: true, } ``` @@ -143,9 +142,11 @@ For example: import { IPromotionModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const promotionModuleService: IPromotionModuleService = - context.container.resolve(ModuleRegistrationName.PROMOTION) + container.resolve(ModuleRegistrationName.PROMOTION) const promotions = await promotionModuleService.list() }) diff --git a/www/apps/resources/app/commerce-modules/promotion/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/promotion/relations-to-other-modules/page.mdx index 210c144296..836f1c4986 100644 --- a/www/apps/resources/app/commerce-modules/promotion/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/relations-to-other-modules/page.mdx @@ -4,14 +4,18 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Promotion Module and other Commerce Modules. +This document showcases the link modules defined between the Promotion Module and other commerce modules. ## Cart Module -When the Cart and Promotion modules are used together, the Medusa application links the `Promotion` data model to the `Cart`, `LineItemAdjustment`, and `ShippingMethodAdjustment` data models of the Cart Module. +A promotion can be applied on line items and shipping methods of a cart. Medusa defines a link module that builds a relationship between the `Cart`, `LineItemAdjustment`, and `Promotion` data models. -![A diagram showcasing an example of how resources from the Promotion and Cart modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709905821/Medusa%20Resources/promotion-cart_z5qklr.jpg) +![A diagram showcasing an example of how data models from the Cart and Promotion modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538015/Medusa%20Resources/cart-promotion_kuh9vm.jpg) -A promotion is linked to a cart when a promotion is applied on the cart. Adjustments on items and shipping methods, represented by the `LineItemAdjustment` and `ShippingMethodAdjustment` data models, are linked to the promotion as well. +--- + +## Order Module + +An order is associated with the promotion applied on it. Medusa defines a link module that builds a relationship between the `Order` and `Promotion` data models. + +![A diagram showcasing an example of how data models from the Order and Promotion modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716555015/Medusa%20Resources/order-promotion_dgjzzd.jpg) \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/region/events/page.mdx b/www/apps/resources/app/commerce-modules/region/events/page.mdx index 84b31aeecb..5b2cdcabb5 100644 --- a/www/apps/resources/app/commerce-modules/region/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/region/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Region Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/region/examples/page.mdx b/www/apps/resources/app/commerce-modules/region/examples/page.mdx index dead0401fd..39592e078c 100644 --- a/www/apps/resources/app/commerce-modules/region/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/region/examples/page.mdx @@ -263,4 +263,4 @@ In this guide, you’ll find common examples of how you can use the Region Modul ## More Examples -The [Region Module interface reference](/references/region) provides a reference to all the methods available for use with examples for each. +The [Region Module's main service reference](/references/region) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/region/page.mdx b/www/apps/resources/app/commerce-modules/region/page.mdx index 497aa86185..9b9550b539 100644 --- a/www/apps/resources/app/commerce-modules/region/page.mdx +++ b/www/apps/resources/app/commerce-modules/region/page.mdx @@ -8,8 +8,6 @@ export const metadata = { The Region Module is the `@medusajs/region` NPM package that provides region-related features in your Medusa and Node.js applications. ---- - ## What is a Region? A region represents the area you sell products in. Each region can cover multiple countries, but uses a single currency. @@ -48,7 +46,7 @@ const regions = await regionModuleService.create([ ### Different Settings Per Region -Each region has its own settings, such as what countries belong to a region or its tax settings. When using other commerce modules such as the Tax Module or Payment Module, each region has different tax rates, payment providers, and more. +Each region has its own settings, such as what countries belong to a region or its tax settings. Each region has different tax rates, payment providers, and more provided by other commerce modules. ```ts const regions = await regionModuleService.create([ @@ -62,7 +60,7 @@ const regions = await regionModuleService.create([ name: "United States of America", currency_code: "usd", countries: ["us"], - automatic_taxes: false, + payment_providers: ["stripe"] }, ]) ``` @@ -71,14 +69,16 @@ const regions = await regionModuleService.create([ ## Configure Region Module -After installing the `@medusajs/region` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Region Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - region: { - resolve: "@medusajs/region", - }, + [Modules.REGION]: true, } ``` @@ -137,9 +137,11 @@ For example: import { IRegionModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const regionModuleService: IRegionModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.REGION ) diff --git a/www/apps/resources/app/commerce-modules/region/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/region/relations-to-other-modules/page.mdx index 2a45cdc88b..0dbd8c76fe 100644 --- a/www/apps/resources/app/commerce-modules/region/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/region/relations-to-other-modules/page.mdx @@ -4,14 +4,28 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. - -This document showcases the relation between the Region Module and other Commerce Modules. +This document showcases the link modules defined between the Region Module and other commerce modules. ## Cart Module -Carts are associated with a region. The Medusa application forms a relation between the `Region` and the `Cart` data models. +Carts are associated with a region. Medusa defines a link module that builds a relationship between the `Region` and the `Cart` data models. -![A diagram showcasing an example of how resources from the API Key and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711116934/Medusa%20Resources/region-cart_hffaib.jpg) +![A diagram showcasing an example of how resources from the API Key and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716543714/Medusa%20Resources/customer-region_rtmymb.jpg) The cart then uses the same currency as the region. During checkout, the cart's taxes, payment, and fulfillment providers are available based on the region's settings. + +--- + +## Order Module + +An order is associated with the customer's region. Medusa defines a link module that builds a relationship between the `Order` and `Region` data models. + +![A diagram showcasing an example of how data models from the Order and Region modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716555119/Medusa%20Resources/order-region_ihkp2u.jpg) + +--- + +## Payment Module + +You can specify for each region which payment providers are available. Medusa defines a link module that builds a relationship between the `PaymentProvider` and the `Region` data models. + +![A diagram showcasing an example of how resources from the Payment and Region modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711569520/Medusa%20Resources/payment-region_jyo2dz.jpg) diff --git a/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx index ca9c133a22..736bfbd43f 100644 --- a/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/sales-channel/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Sales Channel Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/sales-channel/examples/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/examples/page.mdx index c44ab484c1..e32e55df3b 100644 --- a/www/apps/resources/app/commerce-modules/sales-channel/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/sales-channel/examples/page.mdx @@ -26,7 +26,7 @@ In this guide, you’ll find common examples of how you can use the Sales Channe request.scope.resolve(ModuleRegistrationName.SALES_CHANNEL) const salesChannel = await salesChannelModuleService.create({ - name: request.body.name, + name: "B2B", }) res.json({ @@ -48,10 +48,9 @@ In this guide, you’ll find common examples of how you can use the Sales Channe export async function POST(request: Request) { const salesChannelModuleService = await initializeSalesChannelModule() - const body = await request.json() const salesChannel = await salesChannelModuleService.create({ - name: body.name, + name: "B2B", }) return NextResponse.json({ sales_channel: salesChannel }) @@ -129,7 +128,7 @@ In this guide, you’ll find common examples of how you can use the Sales Channe request.scope.resolve(ModuleRegistrationName.SALES_CHANNEL) const salesChannel = await salesChannelModuleService.retrieve( - request.params.id + "sc_123" ) res.json({ @@ -148,22 +147,14 @@ In this guide, you’ll find common examples of how you can use the Sales Channe initialize as initializeSalesChannelModule, } from "@medusajs/sales-channel" - type ContextType = { - params: { - id: string - } - } - export async function GET( - request: Request, - { params }: ContextType + request: Request ) { const salesChannelModuleService = await initializeSalesChannelModule() - const body = await request.json() const salesChannel = await salesChannelModuleService.retrieve( - params.id + "sc_123" ) return NextResponse.json({ sales_channel: salesChannel }) @@ -193,8 +184,8 @@ In this guide, you’ll find common examples of how you can use the Sales Channe request.scope.resolve(ModuleRegistrationName.SALES_CHANNEL) const salesChannel = await salesChannelModuleService.update({ - id: request.params.id, - description: request.body.description, + id: "sc_123", + description: "Sales channel for B2B customers", }) res.json({ @@ -213,23 +204,15 @@ In this guide, you’ll find common examples of how you can use the Sales Channe initialize as initializeSalesChannelModule, } from "@medusajs/sales-channel" - type ContextType = { - params: { - id: string - } - } - export async function POST( - request: Request, - { params }: ContextType + request: Request ) { const salesChannelModuleService = await initializeSalesChannelModule() - const body = await request.json() const salesChannel = await salesChannelModuleService.update({ - id: params.id, - description: body.description, + id: "sc_123", + description: "Sales channel for B2B customers", }) return NextResponse.json({ sales_channel: salesChannel }) @@ -258,7 +241,7 @@ In this guide, you’ll find common examples of how you can use the Sales Channe const salesChannelModuleService: ISalesChannelModuleService = request.scope.resolve(ModuleRegistrationName.SALES_CHANNEL) - await salesChannelModuleService.delete(request.params.id) + await salesChannelModuleService.delete("sc_123") res.status(200) } @@ -274,20 +257,13 @@ In this guide, you’ll find common examples of how you can use the Sales Channe initialize as initializeSalesChannelModule, } from "@medusajs/sales-channel" - type ContextType = { - params: { - id: string - } - } - export async function DELETE( - request: Request, - { params }: ContextType + request: Request ) { const salesChannelModuleService = await initializeSalesChannelModule() - await salesChannelModuleService.delete(params.id) + await salesChannelModuleService.delete("sc_123") } ``` @@ -298,4 +274,4 @@ In this guide, you’ll find common examples of how you can use the Sales Channe ## More Examples -The [Sales Channel Module interface reference](/references/sales-channel) provides a reference to all the methods available for use with examples for each. +The [Sales Channel Module's main service reference](/references/sales-channel) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/sales-channel/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/page.mdx index 59e83d4627..854c795d61 100644 --- a/www/apps/resources/app/commerce-modules/sales-channel/page.mdx +++ b/www/apps/resources/app/commerce-modules/sales-channel/page.mdx @@ -16,7 +16,7 @@ Some use case examples for using a sales channel: - Implement a B2B Ecommerce Store. - Specify different products for each channel you sell in. -- Support Omnichannel in your ecommerce store. +- Support omnichannel in your ecommerce store. --- @@ -24,9 +24,7 @@ Some use case examples for using a sales channel: ### Sales Channel Management -Store and manage sales channels in your store. - -Each sales channel has different meta information such as name or description, allowing you to easily differentiate between sales channels. +Manage sales channels in your store. Each sales channel has different meta information such as name or description, allowing you to easily differentiate between sales channels. ```ts const salesChannels = await salesChannelModuleService.create([ @@ -41,7 +39,7 @@ const salesChannels = await salesChannelModuleService.create([ ### Product Availability -By combining the Product and Sales Channel modules, you can specify a product's availability per sales channel. +Medusa links the Product and Sales Channel modules, allowing merchants to specify a product's availability per sales channel. For example, B2B customers viewing products only see products in the B2B sales channel. @@ -55,14 +53,16 @@ Orders are also scoped to a sales channel due to the relation between the Sales ## Configure Sales Channel Module -After installing the `@medusajs/sales-channel` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Sales Channel Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - salesChannel: { - resolve: "@medusajs/sales-channel", - }, + [Modules.SALES_CHANNEL]: true, } ``` @@ -121,11 +121,14 @@ For example: import { ISalesChannelModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const salesChannelModuleService: ISalesChannelModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.SALES_CHANNEL ) + const salesChannels = await salesChannelModuleService.list() }) ``` diff --git a/www/apps/resources/app/commerce-modules/sales-channel/publishable-api-keys/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/publishable-api-keys/page.mdx index b472966c04..862dd04d2b 100644 --- a/www/apps/resources/app/commerce-modules/sales-channel/publishable-api-keys/page.mdx +++ b/www/apps/resources/app/commerce-modules/sales-channel/publishable-api-keys/page.mdx @@ -12,7 +12,7 @@ In this document, you’ll learn what publishable API keys are and how to use th When using multiple sales channels, you’ll need to specify the ID of a storefront’s sales channel. This ensures that you retrieve the products available in that sales channel and associate the sales channel with the storefront’s carts and orders. -The Store API routes accept the sales channel’s IDs differently. For example, the [List Products API route](https://docs.medusajs.com/api/store#products) accepts the sales channel’s ID as a query parameter, whereas the [Create Cart API route](https://docs.medusajs.com/api/store#carts_postcart) accepts it in the request’s body. +The [Store API routes](!api!/store) accept the sales channel’s IDs differently depending on the API route's HTTP method. Some accept it as a query parameter whereas others accept it as a request body parameter. This approach is tedious and error-prone as your storefront scales and as you develop multiple types of storefronts. @@ -20,59 +20,17 @@ This approach is tedious and error-prone as your storefront scales and as you de ## Introducing Publishable API Keys -The API Key module allows you to create keys for different usages. One of those usages is to create a publishable API key. +A publishable API key, provided by the API Key Module, is a client key scoped to one or more sales channels. When passed in the header of a request, the Medusa application infers the associated sales channels. -A publishable API key is a client key scoped to one or more sales channels. When passed in the header of a request, the Medusa application infers the associated sales channels. - -So, instead of the previous approach of manually passing the sales channel’s ID based on the API route, you always pass the publishable API key in the header of your requests: +So, instead of the approach, indicated in the previous section, of manually passing the sales channel’s ID based on the API route, you always pass the publishable API key in the header of your requests: ```bash curl http://localhost:9000/store/products \ x-publishable-api-key: {your_publishable_api_key} ``` -The Medusa JS Client and Medusa React both provide the option to pass the publishable API key during initialization: - - - - - ```ts - const medusa = new Medusa({ - maxRetries: 3, - baseUrl: "http://localhost:9000", - publishableApiKey, - }) - ``` - - - - - ```tsx - import { MedusaProvider } from "medusa-react" - - // define query client... - - const App = () => { - return ( - - - - ) - } - ``` - - - - -Then, all requests using the client/hooks automatically include the publishable API key in the header. - --- ## How to Create a Publishable API Key? -To create a publishable API key, either use the Medusa Admin or the [Admin API Routes](https://docs.medusajs.com/api/admin#publishable-api-keys). +To create a publishable API key, either use the Medusa Admin or the [Admin API Routes](!api!/admin#publishable-api-keys). diff --git a/www/apps/resources/app/commerce-modules/sales-channel/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/sales-channel/relations-to-other-modules/page.mdx index b5b6babc1f..44f9a5a44b 100644 --- a/www/apps/resources/app/commerce-modules/sales-channel/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/sales-channel/relations-to-other-modules/page.mdx @@ -4,25 +4,23 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Sales Channel Module and other commerce modules. -This document showcases the relation between the Sales Channel Module and other Commerce Modules. +## API Key Module -## Product Module +A publishable API key allows you to easily specify the sales channel scope in a client request. Medusa defines a link module that builds a relationship between the `ApiKey` and the `SalesChannel` data models. -A product has different availability for different sales channels. The Medusa application forms a relation between the `Product` and the `SalesChannel` data models. +![A diagram showcasing an example of how resources from the Sales Channel and API Key modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709812064/Medusa%20Resources/sales-channel-api-key_zmqi2l.jpg) -A product can be available in more than one sales channel. Then, you can retrieve only the products of a sales channel. - -![A diagram showcasing an example of how resources from the Sales Channel and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709809833/Medusa%20Resources/product-sales-channel_ciqj6i.jpg) +Using the API Key Module, you create a publishable key and associate it with a sales channel. Learn more in [this document](../publishable-api-keys/page.mdx) --- ## Cart Module -A cart is associated with the sales channel it's created in. The Medusa application forms a relation between the `Cart` and the `SalesChannel` data models. +A cart is associated with the sales channel it's created in. Medusa defines a link module that builds a relationship between the `Cart` and the `SalesChannel` data models. -![A diagram showcasing an example of how resources from the Sales Channel and Cart modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709811093/Medusa%20Resources/sales-channel-cart_m0hozt.jpg) +![A diagram showcasing an example of how data models from the Cart and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1711538159/Medusa%20Resources/cart-sales-channel_n2oi0v.jpg) For example, if a customer adds an item to the cart in a mobile app, the cart is associated with the mobile app's sales channel. However, if a customer adds an item to the cart in a web storefront, the cart is associated with the storefront's sales channel. @@ -30,20 +28,28 @@ For example, if a customer adds an item to the cart in a mobile app, the cart is ## Order Module -An order is associated with the sales channel it's created in. The Medusa application forms a relation between the `Order` and the `SalesChannel` data models. +An order is associated with the sales channel it's created in. Medusa defines a link module that builds a relationship between the `Order` and the `SalesChannel` data models. -![A diagram showcasing an example of how resources from the Sales Channel and Order modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709810401/Medusa%20Resources/sales-channel-order_ixayla.jpg) +![A diagram showcasing an example of how resources from the Order and Sales Channel modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1712315409/Medusa%20Resources/order-sales-channel_dy72gx.jpg) For example, if an order is created in a mobile app, it'll be associated with its sales channel. If another order is created through a POS system, it'll be associated with the POS's sales channel. --- -## API Key Module +## Product Module -A publishable API key allows you to easily specify the sales channel scope in a client request. The Medusa application forms a relation between the `ApiKey` and the `SalesChannel` data models. +A product has different availability for different sales channels. Medusa defines a link module that builds a relationship between the `Product` and the `SalesChannel` data models. -![A diagram showcasing an example of how resources from the Sales Channel and API Key modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709812064/Medusa%20Resources/sales-channel-api-key_zmqi2l.jpg) +A product can be available in more than one sales channel. Then, you can retrieve only the products of a sales channel. -Using the API Key Module, you create a publishable key and associate it with a sales channel. +![A diagram showcasing an example of how resources from the Sales Channel and Product modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1709809833/Medusa%20Resources/product-sales-channel_ciqj6i.jpg) -Instead of passing the sales channel's ID in every request either in the query or body parameters, you always pass the API key in the header of your requests. The Medusa application then infers the sales channel scope from it. +--- + +## Stock Location Module + +A stock location is associated with a sales channel. This scopes inventory quantities associated with that stock location by the associated sales channel. + +Medusa defines a link module that builds a relationship between the `SalesChannel` and `StockLocation` data models. + +![A diagram showcasing an example of how resources from the Sales Channel and Stock Location modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716796872/Medusa%20Resources/sales-channel-location_cqrih1.jpg) diff --git a/www/apps/resources/app/commerce-modules/stock-location/events/page.mdx b/www/apps/resources/app/commerce-modules/stock-location/events/page.mdx index 1cd83b1a5b..bea4646ecc 100644 --- a/www/apps/resources/app/commerce-modules/stock-location/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/stock-location/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Stock Location Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx b/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx index 2d3b887405..65c122f185 100644 --- a/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/stock-location/examples/page.mdx @@ -27,7 +27,7 @@ In this document, you’ll find common examples of how you can use the Stock Loc const stockLocation = await stockLocationModuleService.create( { - name: request.body.name, + name: "Warehouse 1", } ) @@ -50,11 +50,10 @@ In this document, you’ll find common examples of how you can use the Stock Loc export async function POST(request: Request) { const stockLocationModuleService = await initializeStockLocationModule({}) - const body = await request.json() const stockLocation = await stockLocationModuleService.create( { - name: body.name, + name: "Warehouse 1", } ) @@ -132,17 +131,15 @@ In this document, you’ll find common examples of how you can use the Stock Loc const stockLocationModuleService: IStockLocationService = request.scope.resolve(ModuleRegistrationName.STOCK_LOCATION) - const stockLocation = await stockLocationModuleService.update( - { - id: request.params.id, - address: { - country_code: request.body.country_code, - city: request.body.city, - address_1: request.body.address_1, - postal_code: request.body.postal_code, - }, - } - ) + const stockLocation = await stockLocationModuleService.update({ + id: "sloc_123", + address: { + country_code: "US", + city: "New York City", + address_1: "52 Stone St", + postal_code: "10004", + }, + }) res.json({ stock_location: stockLocation, @@ -160,31 +157,21 @@ In this document, you’ll find common examples of how you can use the Stock Loc initialize as initializeStockLocationModule, } from "@medusajs/stock-location-next" - type ContextType = { - params: { - id: string - } - } - export async function POST( - request: Request, - { params }: ContextType + request: Request ) { const stockLocationModuleService = await initializeStockLocationModule({}) - const body = await request.json() - const stockLocation = await stockLocationModuleService.update( - { - id: params.id, - address: { - country_code: body.country_code, - city: body.city, - address_1: body.address_1, - postal_code: body.postal_code, - }, - } - ) + const stockLocation = await stockLocationModuleService.update({ + id: "sloc_123", + address: { + country_code: "us", + city: "New York City", + address_1: "52 Stone St", + postal_code: "10004", + }, + }) return NextResponse.json({ stock_location: stockLocation, @@ -214,7 +201,7 @@ In this document, you’ll find common examples of how you can use the Stock Loc const stockLocationModuleService: IStockLocationService = request.scope.resolve(ModuleRegistrationName.STOCK_LOCATION) - await stockLocationModuleService.delete(request.params.id) + await stockLocationModuleService.delete("sloc_123") res.status(200) } @@ -230,20 +217,13 @@ In this document, you’ll find common examples of how you can use the Stock Loc initialize as initializeStockLocationModule, } from "@medusajs/stock-location-next" - type ContextType = { - params: { - id: string - } - } - export async function DELETE( - request: Request, - { params }: ContextType + request: Request ) { const stockLocationModuleService = await initializeStockLocationModule({}) - await stockLocationModuleService.delete(params.id) + await stockLocationModuleService.delete("sloc_123") } ``` @@ -254,4 +234,4 @@ In this document, you’ll find common examples of how you can use the Stock Loc ## More Examples -The [module interface reference](/references/stock-location) provides a reference to all the methods available for use with examples for each. +The [Stock Location Module's main service reference](/references/stock-location) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/stock-location/page.mdx b/www/apps/resources/app/commerce-modules/stock-location/page.mdx index 76278f2a33..3e250db814 100644 --- a/www/apps/resources/app/commerce-modules/stock-location/page.mdx +++ b/www/apps/resources/app/commerce-modules/stock-location/page.mdx @@ -8,19 +8,11 @@ export const metadata = { The Stock Location Module is the `@medusajs/stock-location-next` NPM package that provides stock-location-related features in your Medusa and Node.js applications. -It's mainly useful with the [Inventory Module](../inventory/page.mdx). - - - -This module is an updated version of the [Stock Location Module part of the multi-warehouse feature](../../modules/multiwarehouse/stock-location-module.md). In Medusa V2, the previous version of the module will no longer be in use. - - - ## Features ### Stock Location Management -Store and manage stock locations. Stock locations can be associated with other models that require a location, such as the [Inventory Module's InventoryLevel](../inventory/concepts/page.mdx#inventory-level). +Store and manage stock locations. Stock locations are associated with data models of other modules that require a location, such as the [Inventory Module's InventoryLevel](../inventory/concepts/page.mdx#inventory-level). ```ts const stockLocation = await stockLocationModuleService.create( @@ -32,14 +24,14 @@ const stockLocation = await stockLocationModuleService.create( ### Address Management -A stock location can have detailed address details. +Manage the address of each stock location. ```ts const stockLocation = await stockLocationModuleService.update( { id: "sloc_123", address: { - country_code: "US", + country_code: "us", city: "New York City", address_1: "52 Stone St", postal_code: "10004", @@ -52,14 +44,16 @@ const stockLocation = await stockLocationModuleService.update( ## Configure Stock Location Module -After installing the `@medusajs/stock-location` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Stock Location Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - stockLocationService: { - resolve: "@medusajs/stock-location-next", - }, + [Modules.STOCK_LOCATION]: true, } ``` @@ -120,9 +114,11 @@ For example: import { IStockLocationService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const stockLocationModuleService: IStockLocationService = - context.container.resolve( + container.resolve( ModuleRegistrationName.STOCK_LOCATION ) diff --git a/www/apps/resources/app/commerce-modules/stock-location/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/stock-location/relations-to-other-modules/page.mdx index 6153895d75..1bfd95a79c 100644 --- a/www/apps/resources/app/commerce-modules/stock-location/relations-to-other-modules/page.mdx +++ b/www/apps/resources/app/commerce-modules/stock-location/relations-to-other-modules/page.mdx @@ -4,14 +4,30 @@ export const metadata = { # {metadata.title} -When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules. +This document showcases the link modules defined between the Stock Location Module and other commerce modules. -This document showcases the relation between the Stock Location Module and other Commerce Modules. +## Fulfillment Module + +A fulfillment set can be conditioned to a specific stock location. Medusa defines a link module that builds a relationship between the `FulfillmentSet` and `StockLocation` data models. + +![A diagram showcasing an example of how data models from the Fulfillment and Stock Location modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1712567101/Medusa%20Resources/fulfillment-stock-location_nlkf7e.jpg) + +--- ## Inventory Module -Reservation items and inventory items are associated with a location. The Medusa application forms a relation between the `ReservationItem` and `StockLocation` data models, and the `InventoryLevel` and `StockLocation` data models. +Reservation items and inventory items are associated with a location. Medusa defines a link module that builds a relationship between the `ReservationItem` and `StockLocation` data models, and the `InventoryLevel` and `StockLocation` data models. -![A diagram showcasing an example of how resources from the Stock Location and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709716521/Medusa%20Resources/stock-location-inventory_logsrt.jpg) +![A diagram showcasing an example of how resources from the Stock Location and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1709660383/Medusa%20Resources/inventory-stock-location_yp26k3.jpg) With this relation, stock and reserved quantity is specific to a location, providing you with more flexibility. The location can be as simple as having only a name, and more flexible by adding more address details to it. + +--- + +## Sales Channel Module + +A stock location is associated with a sales channel. This scopes inventory quantities associated with that stock location by the associated sales channel. + +Medusa defines a link module that builds a relationship between the `SalesChannel` and `StockLocation` data models. + +![A diagram showcasing an example of how resources from the Sales Channel and Stock Location modules are linked](https://res.cloudinary.com/dza7lstvk/image/upload/v1716796872/Medusa%20Resources/sales-channel-location_cqrih1.jpg) diff --git a/www/apps/resources/app/commerce-modules/store/events/page.mdx b/www/apps/resources/app/commerce-modules/store/events/page.mdx index 8466518395..75e23ca1df 100644 --- a/www/apps/resources/app/commerce-modules/store/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/store/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Store Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/store/examples/page.mdx b/www/apps/resources/app/commerce-modules/store/examples/page.mdx index a2ad993e21..3a8d4ffda3 100644 --- a/www/apps/resources/app/commerce-modules/store/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/store/examples/page.mdx @@ -243,7 +243,7 @@ In this guide, you’ll find common examples of how you can use the Store Module const storeModuleService: IStoreModuleService = request.scope.resolve(ModuleRegistrationName.STORE) - await storeModuleService.delete(request.params.id) + await storeModuleService.delete("store_123") res.status(200) } @@ -259,19 +259,13 @@ In this guide, you’ll find common examples of how you can use the Store Module initialize as initializeStoreModule, } from "@medusajs/store" - type ContextType = { - params: { - id: string - } - } - export async function DELETE( request: Request, { params }: ContextType ) { const storeModuleService = await initializeStoreModule() - await storeModuleService.delete(params.id) + await storeModuleService.delete("store_123") } ``` @@ -282,5 +276,5 @@ In this guide, you’ll find common examples of how you can use the Store Module ## More Examples -The [Store Module interface reference](/references/store) provides a reference to all the methods available for use with examples for each. +The [Store Module's main service reference](/references/store) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/store/page.mdx b/www/apps/resources/app/commerce-modules/store/page.mdx index 47c09ed515..9ce75f1775 100644 --- a/www/apps/resources/app/commerce-modules/store/page.mdx +++ b/www/apps/resources/app/commerce-modules/store/page.mdx @@ -8,8 +8,6 @@ export const metadata = { The Store Module is the `@medusajs/store` NPM package that provides store-related features in your Medusa and Node.js applications. ---- - ## Features ### Store Management @@ -28,31 +26,32 @@ const store = await storeModuleService.create({ You can create multiple stores, each having its own configurations. ```ts -const store1 = await storeModuleService.create({ - name: "USA Store", - supported_currency_codes: ["usd"], -}) - -const store2 = storeModuleService.create({ - name: "Europe Store", - supported_currency_codes: [ - "eur", - ], -}) +const stores = await storeModuleService.create([ + { + name: "USA Store", + supported_currency_codes: ["usd"], + }, + { + name: "Europe Store", + supported_currency_codes: ["eur"], + } +]) ``` --- ## Configure Store Module -After installing the `@medusajs/store` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Store Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - store: { - resolve: "@medusajs/store", - }, + [Modules.STORE]: true, } ``` @@ -111,11 +110,14 @@ For example: import { IStoreModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const storeModuleService: IStoreModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.STORE ) + const stores = await storeModuleService.list() }) ``` diff --git a/www/apps/resources/app/commerce-modules/store/relations-to-other-modules/page.mdx b/www/apps/resources/app/commerce-modules/store/relations-to-other-modules/page.mdx new file mode 100644 index 0000000000..911a559c63 --- /dev/null +++ b/www/apps/resources/app/commerce-modules/store/relations-to-other-modules/page.mdx @@ -0,0 +1,13 @@ +export const metadata = { + title: `Relations between Store Module and Other Modules`, +} + +# {metadata.title} + +This document showcases the link modules defined between the Store Module and other commerce modules. + +## Currency Module + +A store has a default currency. Medusa defines a link module that builds a relationship between the `Store` and `Currency` data models. + +![A diagram showcasing an example of how resources from the Stock Location and Inventory modules are linked.](https://res.cloudinary.com/dza7lstvk/image/upload/v1716798146/Medusa%20Resources/store-currency_wzftwh.jpg) diff --git a/www/apps/resources/app/commerce-modules/tax/events/page.mdx b/www/apps/resources/app/commerce-modules/tax/events/page.mdx index dc2866fadb..c9878a80a0 100644 --- a/www/apps/resources/app/commerce-modules/tax/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the Tax Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/tax/examples/page.mdx b/www/apps/resources/app/commerce-modules/tax/examples/page.mdx index 6cbef4188b..51569dcf8e 100644 --- a/www/apps/resources/app/commerce-modules/tax/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/examples/page.mdx @@ -27,7 +27,7 @@ In this guide, you’ll find common examples of how you can use the Tax Module i ) const taxRegion = await taxModuleService.createTaxRegions({ - country_code: "US", + country_code: "us", default_tax_rate: { rate: 10, name: "Default rate", @@ -54,7 +54,7 @@ In this guide, you’ll find common examples of how you can use the Tax Module i const taxModuleService = await initializeTaxModule() const taxRegion = await taxModuleService.createTaxRegions({ - country_code: "US", + country_code: "us", default_tax_rate: { rate: 10, name: "Default rate", @@ -262,7 +262,7 @@ In this guide, you’ll find common examples of how you can use the Tax Module i import { ITaxModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - export async function POST( + export async function GET( req: MedusaRequest, res: MedusaResponse ): Promise { @@ -312,7 +312,7 @@ In this guide, you’ll find common examples of how you can use the Tax Module i initialize as initializeTaxModule, } from "@medusajs/tax" - export async function POST( + export async function GET( request: Request ) { const taxModuleService = await initializeTaxModule() @@ -356,4 +356,4 @@ In this guide, you’ll find common examples of how you can use the Tax Module i ## More Examples -The [module interface reference](/references/tax) provides a reference to all the methods available for use with examples for each. +The [Tax Module's main service reference](/references/tax) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/tax/page.mdx b/www/apps/resources/app/commerce-modules/tax/page.mdx index 8afd516985..0389ba6774 100644 --- a/www/apps/resources/app/commerce-modules/tax/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/page.mdx @@ -8,13 +8,11 @@ export const metadata = { The Tax Module is the `@medusajs/tax` NPM package that provides tax-related features in your Medusa and Node.js applications. ---- - ## Features ### Tax Settings Per Region -Set different tax settings for each region. This is especially useful with the [Region Module](../region/page.mdx). +Set different tax settings for each tax region. ```ts const taxRegion = await taxModuleService.createTaxRegions({ @@ -80,14 +78,16 @@ const taxLines = await taxModuleService.getTaxLines( ## Configure Tax Module -After installing the `@medusajs/tax` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the Tax Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - tax: { - resolve: "@medusajs/tax", - }, + [Modules.TAX]: true, } ``` @@ -151,11 +151,14 @@ For example: import { ITaxModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const taxModuleService: ITaxModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.TAX ) + const taxRegions = await taxModuleService.listTaxRegions() }) ``` diff --git a/www/apps/resources/app/commerce-modules/tax/tax-calculation-with-provider/page.mdx b/www/apps/resources/app/commerce-modules/tax/tax-calculation-with-provider/page.mdx index 88dc3c7de0..0a76925c7c 100644 --- a/www/apps/resources/app/commerce-modules/tax/tax-calculation-with-provider/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/tax-calculation-with-provider/page.mdx @@ -8,7 +8,7 @@ In this document, you’ll learn how tax lines are calculated and what a tax pro ## Tax Lines Calculation -Tax lines are calculated and retrieved using the `getTaxLines` method of the Tax Module’s main service (`ITaxModuleService`). It accepts an array of line items and shipping methods, and the context of the calculation. +Tax lines are calculated and retrieved using the [getTaxLines method of the Tax Module’s main service](/references/tax/getTaxLines). It accepts an array of line items and shipping methods, and the context of the calculation. It returns the tax lines that are used to adjust the cart’s tax and grand totals. @@ -35,32 +35,24 @@ const taxLines = await taxModuleService.getTaxLines( ) ``` -The context object is used to determine which tax regions and rates to use in the calculation. The object includes fields related to the address and customer. - - - -Learn more about the `getTaxLines` method’s parameters and return type in [this reference](/references/tax/getTaxLines). - - +The context object is used to determine which tax regions and rates to use in the calculation. It includes fields related to the address and customer. The example above returns the tax lines based on the tax region for the United States. --- -## Tax Provider Usage in the Calculation +## Using the Tax Provider in the Calculation The tax lines retrieved by the `getTaxLines` method are actually retrieved from the tax region’s provider. -A tax provider is a TypeScript or JavaScript class that implements the logic to shape tax lines. Each tax region has a tax provider. +A tax provider module whose main service implements the logic to shape tax lines. Each tax region has a tax provider. The Tax Module provides a `system` tax provider that only transforms calculated item and shipping tax rates into the required return type. ---- +{/* --- + +TODO add once tax provider guide is updated + add provider modules match other modules. ## Create Tax Provider -You can create a tax provider by implementing the `ITaxProvider` imported from `@meduasjs/types`. - -Then, you can add the tax provider to the [providers](../module-options/page.mdx#providers) option and use it to retrieve tax lines. - -Refer to [this reference](/modules/tax/provider) to learn more about creating a tax provider. +Refer to [this guide](/modules/tax/provider) to learn more about creating a tax provider. */} diff --git a/www/apps/resources/app/commerce-modules/tax/tax-rates-and-rules/page.mdx b/www/apps/resources/app/commerce-modules/tax/tax-rates-and-rules/page.mdx index 7ff6d7451b..43d33c66c3 100644 --- a/www/apps/resources/app/commerce-modules/tax/tax-rates-and-rules/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/tax-rates-and-rules/page.mdx @@ -16,15 +16,15 @@ Each tax region has a default tax rate. This tax rate is applied to all taxable Tax regions can have parent tax regions. To inherit the tax rates of the parent tax region, set the `is_combinable` of the child’s tax rates to `true`. -Then, when tax rates are retrieved for a taxable item in the child region, both the child and the parent tax regions’ applicable rates are returned. Otherwise, only the child tax region’s applicable rates are returned. +Then, when tax rates are retrieved for a taxable item in the child region, both the child and the parent tax regions’ applicable rates are returned. --- -## What are Tax Rules? +## Override Tax Rates with Rules -You can also create tax rates that override the default for specific conditions or rules. For example, the default tax rate is 10%, but for products of type “Shirt” is %15. +You can create tax rates that override the default for specific conditions or rules. For example, the default tax rate is 10%, but for products of type “Shirt” is %15. -A tax region can have multiple tax rates, and each tax rate can have multiple tax rules. The `TaxRateRule` data model represents a tax rate’s rule. +A tax region can have multiple tax rates, and each tax rate can have multiple tax rules. The [TaxRateRule data model](/references/tax/models/TaxRateRule) represents a tax rate’s rule. ![A diagram showcasing the relation between TaxRegion, TaxRate, and TaxRateRule](https://res.cloudinary.com/dza7lstvk/image/upload/v1711462167/Medusa%20Resources/tax-rate-rule_enzbp2.jpg) diff --git a/www/apps/resources/app/commerce-modules/tax/tax-region/page.mdx b/www/apps/resources/app/commerce-modules/tax/tax-region/page.mdx index 93f8e93b2d..db6fe8ffd6 100644 --- a/www/apps/resources/app/commerce-modules/tax/tax-region/page.mdx +++ b/www/apps/resources/app/commerce-modules/tax/tax-region/page.mdx @@ -8,18 +8,8 @@ In this document, you’ll learn about tax regions and how to use them with the ## What is a Tax Region? -A tax region, represented by the `TaxRegion` data model, stores settings related to a region that your store serves. +A tax region, represented by the [TaxRegion data model](/references/tax/models/TaxRegion), stores settings related to a region that your store serves. Tax regions can inherit settings and rules from a parent tax region. Each tax region has tax rules and a tax provider. - ---- - -## Settings Per Region with the Region Module - -By combining the Tax and [Region](../../region/page.mdx) Modules, as done in the Medusa application, each region has its own tax providers and rates. - -This adds more flexibility to your commerce store. - -![Diagram showcasing the relation between the Tax and Region Modules](https://res.cloudinary.com/dza7lstvk/image/upload/v1711454031/Medusa%20Resources/tax-region_adr4kz.jpg) diff --git a/www/apps/resources/app/commerce-modules/user/events/page.mdx b/www/apps/resources/app/commerce-modules/user/events/page.mdx index a8ce44deb7..fe9a27763f 100644 --- a/www/apps/resources/app/commerce-modules/user/events/page.mdx +++ b/www/apps/resources/app/commerce-modules/user/events/page.mdx @@ -8,4 +8,10 @@ export const metadata = { Find in this reference the list of events emitted by the User Module. + + +Events are still in development, so this reference will change in the future. + + + \ No newline at end of file diff --git a/www/apps/resources/app/commerce-modules/user/examples/page.mdx b/www/apps/resources/app/commerce-modules/user/examples/page.mdx index 1dd5e1b449..aee2e27d1a 100644 --- a/www/apps/resources/app/commerce-modules/user/examples/page.mdx +++ b/www/apps/resources/app/commerce-modules/user/examples/page.mdx @@ -408,4 +408,4 @@ In this guide, you’ll find common examples of how you can use the User Module ## More Examples -The [module interface reference](/references/user) provides a reference to all the methods available for use with examples for each. +The [User Module's main service reference](/references/user) provides a reference to all the methods available for use with examples for each. diff --git a/www/apps/resources/app/commerce-modules/user/page.mdx b/www/apps/resources/app/commerce-modules/user/page.mdx index 07d28ef928..3af35e3af1 100644 --- a/www/apps/resources/app/commerce-modules/user/page.mdx +++ b/www/apps/resources/app/commerce-modules/user/page.mdx @@ -8,8 +8,6 @@ export const metadata = { The User Module is the `@medusajs/user` NPM package that provides user-related features in your Medusa and Node.js applications. ---- - ## Features ### User Management @@ -41,15 +39,19 @@ await userModuleService.refreshInviteTokens([invite.id]) ## Configure User Module -After installing the `@medusajs/user` package in your Medusa application, add it to the `modules` object in `medusa-config.js`: +To use the User Module, enable it in the `modules` object in `medusa-config.js`: ```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + const modules = { // ... - user: { + [Modules.USER]: { resolve: "@medusajs/user", options: { - jwt_secret: process.env.JWT_SECRET, + jwt_secret: process.env.JWT_SECRET ?? "supersecret", }, }, } @@ -114,11 +116,14 @@ For example: import { IUserModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/modules-sdk" - const step1 = createStep("step-1", async (_, context) => { + const step1 = createStep( + "step-1", + async (_, { container }) => { const userModuleService: IUserModuleService = - context.container.resolve( + container.resolve( ModuleRegistrationName.USER ) + const users = await userModuleService.list() }) ``` diff --git a/www/apps/resources/app/commerce-modules/user/user-creation-flows/page.mdx b/www/apps/resources/app/commerce-modules/user/user-creation-flows/page.mdx index 1109e3b857..77c3f41bf6 100644 --- a/www/apps/resources/app/commerce-modules/user/user-creation-flows/page.mdx +++ b/www/apps/resources/app/commerce-modules/user/user-creation-flows/page.mdx @@ -4,7 +4,7 @@ export const metadata = { # {metadata.title} -This document provides some possible flows to create a user. +This document provides flows to create a user. ## Using the Auth Module @@ -50,7 +50,7 @@ await userModuleService.refreshInviteTokens(["invite_123"]) ## Straightforward Creation -Finally, you can create a user using the `create` method of the User Module’s main service (`IUserModuleService`): +Finally, you can create a user using the [create method of the User Module’s main service](/references/user/create): ```ts const user = await userModuleService.create({ diff --git a/www/apps/resources/app/events-reference/page.mdx b/www/apps/resources/app/events-reference/page.mdx index c4ef34ccde..f44ec3cda4 100644 --- a/www/apps/resources/app/events-reference/page.mdx +++ b/www/apps/resources/app/events-reference/page.mdx @@ -26,6 +26,12 @@ export const metadata = { This documentation page includes the list of all events triggered by Medusa's commerce modules. + + +Events are still in development, so this reference will change in the future. + + + ## API Key Module Events diff --git a/www/apps/resources/generated/files-map.mjs b/www/apps/resources/generated/files-map.mjs index dbe69c3a1e..0f91de8f5d 100644 --- a/www/apps/resources/generated/files-map.mjs +++ b/www/apps/resources/generated/files-map.mjs @@ -279,10 +279,6 @@ export const filesMap = [ "filePath": "/www/apps/resources/app/commerce-modules/auth/page.mdx", "pathname": "/commerce-modules/auth" }, - { - "filePath": "/www/apps/resources/app/commerce-modules/auth/persisting-auth-user/page.mdx", - "pathname": "/commerce-modules/auth/persisting-auth-user" - }, { "filePath": "/www/apps/resources/app/commerce-modules/auth/user-creation/page.mdx", "pathname": "/commerce-modules/auth/user-creation" @@ -392,8 +388,8 @@ export const filesMap = [ "pathname": "/commerce-modules/fulfillment/relations-to-other-modules" }, { - "filePath": "/www/apps/resources/app/commerce-modules/fulfillment/shipping-options/page.mdx", - "pathname": "/commerce-modules/fulfillment/shipping-options" + "filePath": "/www/apps/resources/app/commerce-modules/fulfillment/shipping-option/page.mdx", + "pathname": "/commerce-modules/fulfillment/shipping-option" }, { "filePath": "/www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx", @@ -439,10 +435,6 @@ export const filesMap = [ "filePath": "/www/apps/resources/app/commerce-modules/order/order-change/page.mdx", "pathname": "/commerce-modules/order/order-change" }, - { - "filePath": "/www/apps/resources/app/commerce-modules/order/order-items/page.mdx", - "pathname": "/commerce-modules/order/order-items" - }, { "filePath": "/www/apps/resources/app/commerce-modules/order/order-versioning/page.mdx", "pathname": "/commerce-modules/order/order-versioning" @@ -547,6 +539,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/app/commerce-modules/pricing/price-calculation/page.mdx", "pathname": "/commerce-modules/pricing/price-calculation" }, + { + "filePath": "/www/apps/resources/app/commerce-modules/pricing/price-rules/page.mdx", + "pathname": "/commerce-modules/pricing/price-rules" + }, { "filePath": "/www/apps/resources/app/commerce-modules/pricing/relations-to-other-modules/page.mdx", "pathname": "/commerce-modules/pricing/relations-to-other-modules" @@ -575,6 +571,14 @@ export const filesMap = [ "filePath": "/www/apps/resources/app/commerce-modules/promotion/actions/page.mdx", "pathname": "/commerce-modules/promotion/actions" }, + { + "filePath": "/www/apps/resources/app/commerce-modules/promotion/application-method/page.mdx", + "pathname": "/commerce-modules/promotion/application-method" + }, + { + "filePath": "/www/apps/resources/app/commerce-modules/promotion/campaign/page.mdx", + "pathname": "/commerce-modules/promotion/campaign" + }, { "filePath": "/www/apps/resources/app/commerce-modules/promotion/concepts/page.mdx", "pathname": "/commerce-modules/promotion/concepts" @@ -1176,8 +1180,8 @@ export const filesMap = [ "pathname": "/references/auth/IMessageAggregator/methods/auth.IMessageAggregator.saveRawMessageData" }, { - "filePath": "/www/apps/resources/references/auth/interfaces/auth.AuthUserDTO/page.mdx", - "pathname": "/references/auth/interfaces/auth.AuthUserDTO" + "filePath": "/www/apps/resources/references/auth/interfaces/auth.AuthIdentityDTO/page.mdx", + "pathname": "/references/auth/interfaces/auth.AuthIdentityDTO" }, { "filePath": "/www/apps/resources/references/auth/interfaces/auth.AuthenticationInput/page.mdx", @@ -1196,12 +1200,12 @@ export const filesMap = [ "pathname": "/references/auth/interfaces/auth.Context" }, { - "filePath": "/www/apps/resources/references/auth/interfaces/auth.CreateAuthUserDTO/page.mdx", - "pathname": "/references/auth/interfaces/auth.CreateAuthUserDTO" + "filePath": "/www/apps/resources/references/auth/interfaces/auth.CreateAuthIdentityDTO/page.mdx", + "pathname": "/references/auth/interfaces/auth.CreateAuthIdentityDTO" }, { - "filePath": "/www/apps/resources/references/auth/interfaces/auth.FilterableAuthUserProps/page.mdx", - "pathname": "/references/auth/interfaces/auth.FilterableAuthUserProps" + "filePath": "/www/apps/resources/references/auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx", + "pathname": "/references/auth/interfaces/auth.FilterableAuthIdentityProps" }, { "filePath": "/www/apps/resources/references/auth/interfaces/auth.FindConfig/page.mdx", @@ -1232,8 +1236,8 @@ export const filesMap = [ "pathname": "/references/auth/interfaces/auth.MessageAggregatorFormat" }, { - "filePath": "/www/apps/resources/references/auth/interfaces/auth.UpdateAuthUserDTO/page.mdx", - "pathname": "/references/auth/interfaces/auth.UpdateAuthUserDTO" + "filePath": "/www/apps/resources/references/auth/interfaces/auth.UpdateAuthIdentityDTO/page.mdx", + "pathname": "/references/auth/interfaces/auth.UpdateAuthIdentityDTO" }, { "filePath": "/www/apps/resources/references/auth/types/auth.JoinerRelationship/page.mdx", @@ -1260,8 +1264,12 @@ export const filesMap = [ "pathname": "/references/auth/types/auth.ModuleJoinerRelationship" }, { - "filePath": "/www/apps/resources/references/auth_models/classes/auth_models.AuthUser/page.mdx", - "pathname": "/references/auth_models/classes/auth_models.AuthUser" + "filePath": "/www/apps/resources/references/auth_models/classes/auth_models.AuthIdentity/page.mdx", + "pathname": "/references/auth_models/classes/auth_models.AuthIdentity" + }, + { + "filePath": "/www/apps/resources/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx", + "pathname": "/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider" }, { "filePath": "/www/apps/resources/references/cart/ICartModuleService/methods/cart.ICartModuleService.addLineItemAdjustments/page.mdx", @@ -2851,6 +2859,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/references/fulfillment_models/classes/fulfillment_models.ShippingProfile/page.mdx", "pathname": "/references/fulfillment_models/classes/fulfillment_models.ShippingProfile" }, + { + "filePath": "/www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx", + "pathname": "/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService" + }, { "filePath": "/www/apps/resources/references/inventory_next/IInventoryServiceNext/methods/inventory_next.IInventoryServiceNext.adjustInventory/page.mdx", "pathname": "/references/inventory_next/IInventoryServiceNext/methods/inventory_next.IInventoryServiceNext.adjustInventory" @@ -5807,6 +5819,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/references/medusa/types/medusa.payload/page.mdx", "pathname": "/references/medusa/types/medusa.payload" }, + { + "filePath": "/www/apps/resources/references/medusa_config/interfaces/medusa_config.AdminOptions/page.mdx", + "pathname": "/references/medusa_config/interfaces/medusa_config.AdminOptions" + }, { "filePath": "/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx", "pathname": "/references/medusa_config/interfaces/medusa_config.ConfigModule" @@ -6251,6 +6267,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/references/modules/auth_models/page.mdx", "pathname": "/references/modules/auth_models" }, + { + "filePath": "/www/apps/resources/references/modules/auth_provider/page.mdx", + "pathname": "/references/modules/auth_provider" + }, { "filePath": "/www/apps/resources/references/modules/cart/page.mdx", "pathname": "/references/modules/cart" @@ -6287,6 +6307,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/references/modules/fulfillment_models/page.mdx", "pathname": "/references/modules/fulfillment_models" }, + { + "filePath": "/www/apps/resources/references/modules/fulfillment_provider/page.mdx", + "pathname": "/references/modules/fulfillment_provider" + }, { "filePath": "/www/apps/resources/references/modules/inventory_next/page.mdx", "pathname": "/references/modules/inventory_next" diff --git a/www/apps/resources/generated/sidebar.mjs b/www/apps/resources/generated/sidebar.mjs index 84e6097fc4..2c7fcc0c6d 100644 --- a/www/apps/resources/generated/sidebar.mjs +++ b/www/apps/resources/generated/sidebar.mjs @@ -59,9 +59,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/api-key", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IApiKeyModuleService Reference", + "childSidebarTitle": "API Key Module's Main Service Reference", "children": [ { "loaded": true, @@ -181,13 +181,6 @@ export const generatedSidebar = [ "title": "Auth Module", "hasTitleStyling": true, "children": [ - { - "loaded": true, - "isPathHref": true, - "path": "/commerce-modules/auth/module-options", - "title": "Module Options", - "children": [] - }, { "loaded": true, "isPathHref": true, @@ -220,13 +213,6 @@ export const generatedSidebar = [ "path": "/commerce-modules/auth/user-creation", "title": "User Creation", "children": [] - }, - { - "loaded": true, - "isPathHref": true, - "path": "/commerce-modules/auth/persisting-auth-user", - "title": "Persisting Auth User", - "children": [] } ] }, @@ -235,13 +221,20 @@ export const generatedSidebar = [ "isPathHref": true, "title": "References", "children": [ + { + "loaded": true, + "isPathHref": true, + "path": "/references/auth/provider", + "title": "Create Auth Provider Module", + "children": [] + }, { "loaded": true, "isPathHref": true, "path": "/references/auth", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IAuthModuleService Reference", + "childSidebarTitle": "Auth Module's Main Service Reference", "children": [ { "loaded": true, @@ -328,8 +321,8 @@ export const generatedSidebar = [ { "loaded": true, "isPathHref": true, - "path": "/references/auth/models/AuthUser", - "title": "AuthUser", + "path": "/references/auth/models/AuthIdentity", + "title": "AuthIdentity", "children": [] } ] @@ -405,9 +398,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/cart", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "ICartModuleService Reference", + "childSidebarTitle": "Cart Module's Main Service Reference", "children": [ { "loaded": true, @@ -879,9 +872,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/currency", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "ICurrencyModuleService Reference", + "childSidebarTitle": "Cart Module's Main Service Reference", "children": [ { "loaded": true, @@ -996,9 +989,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/customer", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "ICustomerModuleService Reference", + "childSidebarTitle": "Customer Module's Main Service Reference", "children": [ { "loaded": true, @@ -1273,8 +1266,8 @@ export const generatedSidebar = [ { "loaded": true, "isPathHref": true, - "path": "/commerce-modules/fulfillment/shipping-options", - "title": "Shipping Options", + "path": "/commerce-modules/fulfillment/shipping-option", + "title": "Shipping Option", "children": [] }, { @@ -1287,7 +1280,7 @@ export const generatedSidebar = [ { "loaded": true, "isPathHref": true, - "path": "/commerce-modules/fulfillment/relation-to-other-modules", + "path": "/commerce-modules/fulfillment/relations-to-other-modules", "title": "Relations to Other Modules", "children": [] } @@ -1298,13 +1291,20 @@ export const generatedSidebar = [ "isPathHref": true, "title": "References", "children": [ + { + "loaded": true, + "isPathHref": true, + "path": "/references/fulfillment/provider", + "title": "Create Fulfillment Provider Module", + "children": [] + }, { "loaded": true, "isPathHref": true, "path": "/references/fulfillment", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IFulfillmentModuleService Reference", + "childSidebarTitle": "Fulfillment Module's Main Service Reference", "children": [ { "loaded": true, @@ -1923,9 +1923,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/inventory_next", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IInventoryServiceNext Reference", + "childSidebarTitle": "Inventory Module's Main Service Reference", "children": [ { "loaded": true, @@ -2246,13 +2246,6 @@ export const generatedSidebar = [ "title": "Order Concepts", "children": [] }, - { - "loaded": true, - "isPathHref": true, - "path": "/commerce-modules/order/order-items", - "title": "Order Title", - "children": [] - }, { "loaded": true, "isPathHref": true, @@ -2306,9 +2299,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/order", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IOrderModuleService Reference", + "childSidebarTitle": "Order Module's Main Service Reference", "children": [ { "loaded": true, @@ -2903,13 +2896,6 @@ export const generatedSidebar = [ } ] }, - { - "loaded": true, - "isPathHref": true, - "path": "/commerce-modules/payment/payment-flow", - "title": "Payment Flow", - "children": [] - }, { "loaded": true, "isPathHref": true, @@ -2926,6 +2912,20 @@ export const generatedSidebar = [ } ] }, + { + "loaded": true, + "isPathHref": true, + "title": "Guides", + "children": [ + { + "loaded": true, + "isPathHref": true, + "path": "/commerce-modules/payment/payment-flow", + "title": "Accept Payment Flow", + "children": [] + } + ] + }, { "loaded": true, "isPathHref": true, @@ -2942,9 +2942,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/payment", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IPaymentModuleService Reference", + "childSidebarTitle": "Payment Module's Main Service Reference", "children": [ { "loaded": true, @@ -3223,6 +3223,13 @@ export const generatedSidebar = [ "title": "Pricing Concepts", "children": [] }, + { + "loaded": true, + "isPathHref": true, + "path": "/commerce-modules/pricing/price-rules", + "title": "Price Rules", + "children": [] + }, { "loaded": true, "isPathHref": true, @@ -3248,9 +3255,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/pricing", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IPricingModuleService Reference", + "childSidebarTitle": "Pricing Module's Main Service Reference", "children": [ { "loaded": true, @@ -3708,9 +3715,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/product", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IProductModuleService Reference", + "childSidebarTitle": "Product Module's Main Service Reference", "children": [ { "loaded": true, @@ -4231,7 +4238,21 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/commerce-modules/promotion/concepts", - "title": "Promotion Concepts", + "title": "Promotion", + "children": [] + }, + { + "loaded": true, + "isPathHref": true, + "path": "/commerce-modules/promotion/application-method", + "title": "Application Method", + "children": [] + }, + { + "loaded": true, + "isPathHref": true, + "path": "/commerce-modules/promotion/campaign", + "title": "Campaign", "children": [] }, { @@ -4259,9 +4280,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/promotion", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IPromotionModuleService Reference", + "childSidebarTitle": "Promotion Module's Main Service Reference", "children": [ { "loaded": true, @@ -4565,9 +4586,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/region", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IRegionModuleService Reference", + "childSidebarTitle": "Region Module's Main Service Reference", "children": [ { "loaded": true, @@ -4752,9 +4773,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/sales-channel", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "ISalesChannelModuleService Reference", + "childSidebarTitle": "Sales Channel Module's Main Service Reference", "children": [ { "loaded": true, @@ -4911,9 +4932,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/stock-location", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IStockLocationServiceNext Reference", + "childSidebarTitle": "Stock Location Module's Main Service Reference", "children": [ { "loaded": true, @@ -5056,9 +5077,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/store", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IStoreModuleService Reference", + "childSidebarTitle": "Store Module's Main Service Reference", "children": [ { "loaded": true, @@ -5236,9 +5257,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/tax", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "ITaxModuleService Reference", + "childSidebarTitle": "Tax Module's Main Service Reference", "children": [ { "loaded": true, @@ -5493,9 +5514,9 @@ export const generatedSidebar = [ "loaded": true, "isPathHref": true, "path": "/references/user", - "title": "Interface Reference", + "title": "Main Service Reference", "isChildSidebar": true, - "childSidebarTitle": "IUserModuleService Reference", + "childSidebarTitle": "User Module's Main Service Reference", "children": [ { "loaded": true, diff --git a/www/apps/resources/generated/slug-changes.mjs b/www/apps/resources/generated/slug-changes.mjs index 246ff0432a..927d0a2ad6 100644 --- a/www/apps/resources/generated/slug-changes.mjs +++ b/www/apps/resources/generated/slug-changes.mjs @@ -100,9 +100,14 @@ export const slugChanges = [ "filePath": "/www/apps/resources/references/auth/interfaces/auth.IAuthModuleService/page.mdx" }, { - "origSlug": "/references/auth_models/classes/auth_models.AuthUser", - "newSlug": "/references/auth/models/AuthUser", - "filePath": "/www/apps/resources/references/auth_models/classes/auth_models.AuthUser/page.mdx" + "origSlug": "/references/auth_models/classes/auth_models.AuthIdentity", + "newSlug": "/references/auth/models/AuthIdentity", + "filePath": "/www/apps/resources/references/auth_models/classes/auth_models.AuthIdentity/page.mdx" + }, + { + "origSlug": "/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider", + "newSlug": "/references/auth/provider", + "filePath": "/www/apps/resources/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx" }, { "origSlug": "/references/cart/ICartModuleService/methods/cart.ICartModuleService.addLineItemAdjustments", @@ -954,6 +959,11 @@ export const slugChanges = [ "newSlug": "/references/fulfillment/models/ShippingProfile", "filePath": "/www/apps/resources/references/fulfillment_models/classes/fulfillment_models.ShippingProfile/page.mdx" }, + { + "origSlug": "/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService", + "newSlug": "/references/fulfillment/provider", + "filePath": "/www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx" + }, { "origSlug": "/references/inventory_next/IInventoryServiceNext/methods/inventory_next.IInventoryServiceNext.adjustInventory", "newSlug": "/references/inventory-next/adjustInventory", diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.authenticate/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.authenticate/page.mdx index 9f881c520f..e622fa6a63 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.authenticate/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.authenticate/page.mdx @@ -22,21 +22,20 @@ The following example is in the context of an API route, where `req` is an instance of the `MedusaRequest` object: ```ts -const { success, authUser, location, error } = +const { success, authIdentity, location, error } = await authModuleService.authenticate("emailpass", { url: req.url, headers: req.headers, query: req.query, body: req.body, - authScope: "admin", protocol: req.protocol, } as AuthenticationInput) ``` ## Parameters -`","description":"Headers of incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"authScope","type":"`string`","description":"Scope for the authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="authenticate"/> +`","description":"Headers of incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="authenticate"/> ## Returns - + diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.create/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.create/page.mdx index b9d40aa699..cb0556e20f 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.create/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.create/page.mdx @@ -10,53 +10,50 @@ import { TypeList } from "docs-ui" This documentation provides a reference to the `create` method. This belongs to the Auth Module. -## create(data, sharedContext?): Promise<[AuthUserDTO](../../../interfaces/auth.AuthUserDTO/page.mdx)[]> +## create(data, sharedContext?): Promise<[AuthIdentityDTO](../../../interfaces/auth.AuthIdentityDTO/page.mdx)[]> -This method creates auth users. +This method creates auth identities. ### Example ```ts -const authUsers = await authModuleService.create([ +const authIdentities = await authModuleService.create([ { provider: "emailpass", entity_id: "user@example.com", - scope: "admin", }, { provider: "google", entity_id: "user@gmail.com", - scope: "email profile", }, ]) ``` ### Parameters -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/> +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/> ### Returns - + -## create(data, sharedContext?): Promise<[AuthUserDTO](../../../interfaces/auth.AuthUserDTO/page.mdx)> +## create(data, sharedContext?): Promise<[AuthIdentityDTO](../../../interfaces/auth.AuthIdentityDTO/page.mdx)> -This method creates an auth user. +This method creates an auth identity. ### Example ```ts -const authUser = await authModuleService.create({ +const authIdentity = await authModuleService.create({ provider: "emailpass", entity_id: "user@example.com", - scope: "admin", }) ``` ### Parameters -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/> +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="create"/> ### Returns -`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/> +`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/> diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.list/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.list/page.mdx index 02609f364d..ced3f52fc5 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.list/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.list/page.mdx @@ -10,14 +10,14 @@ import { TypeList } from "docs-ui" This documentation provides a reference to the `list` method. This belongs to the Auth Module. -This method retrieves a paginated list of auth users based on optional filters and configuration. +This method retrieves a paginated list of auth identities based on optional filters and configuration. ## Example -To retrieve a list of auth users using their IDs: +To retrieve a list of auth identities using their IDs: ```ts -const authUsers = await authModuleService.list({ +const authIdentities = await authModuleService.list({ id: ["authusr_123", "authusr_321"], }) ``` @@ -25,7 +25,7 @@ const authUsers = await authModuleService.list({ By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: ```ts -const authUsers = await authModuleService.list( +const authIdentities = await authModuleService.list( { id: ["authusr_123", "authusr_321"], }, @@ -38,8 +38,8 @@ const authUsers = await authModuleService.list( ## Parameters -`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="list"/> +`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="list"/> ## Returns - + diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.listAndCount/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.listAndCount/page.mdx index 7fa0696b4d..4746ad95d0 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.listAndCount/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.listAndCount/page.mdx @@ -10,14 +10,14 @@ import { TypeList } from "docs-ui" This documentation provides a reference to the `listAndCount` method. This belongs to the Auth Module. -This method retrieves a paginated list of auth users along with the total count of available auth users satisfying the provided filters. +This method retrieves a paginated list of auth identities along with the total count of available auth identities satisfying the provided filters. ## Example -To retrieve a list of auth users using their IDs: +To retrieve a list of auth identities using their IDs: ```ts -const [authUsers, count] = +const [authIdentities, count] = await authModuleService.listAndCount({ id: ["authusr_123", "authusr_321"], }) @@ -26,7 +26,7 @@ const [authUsers, count] = By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: ```ts -const [authUsers, count] = +const [authIdentities, count] = await authModuleService.listAndCount( { id: ["authusr_123", "authusr_321"], @@ -40,8 +40,8 @@ const [authUsers, count] = ## Parameters -`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="listAndCount"/> +`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="listAndCount"/> ## Returns - + diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.retrieve/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.retrieve/page.mdx index 3fc9cfcfce..e3ffa65911 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.retrieve/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.retrieve/page.mdx @@ -10,18 +10,18 @@ import { TypeList } from "docs-ui" This documentation provides a reference to the `retrieve` method. This belongs to the Auth Module. -This method retrieves an auth user by its ID. +This method retrieves an auth identity by its ID. ## Example ```ts -const authUser = await authModuleService.retrieve("authusr_1") +const authIdentity = await authModuleService.retrieve("authusr_1") ``` ## Parameters -`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/> +`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/> ## Returns -`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieve"/> +`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="retrieve"/> diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.update/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.update/page.mdx index 57126aafc9..0afb1454b0 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.update/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.update/page.mdx @@ -10,50 +10,44 @@ import { TypeList } from "docs-ui" This documentation provides a reference to the `update` method. This belongs to the Auth Module. -## update(data, sharedContext?): Promise<[AuthUserDTO](../../../interfaces/auth.AuthUserDTO/page.mdx)[]> +## update(data, sharedContext?): Promise<[AuthIdentityDTO](../../../interfaces/auth.AuthIdentityDTO/page.mdx)[]> This method updates existing auths. ### Example ```ts -const authUsers = await authModuleService.update([ +const authIdentities = await authModuleService.update([ { id: "authusr_123", - app_metadata: { - test: true, - }, }, ]) ``` ### Parameters -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/> +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/> ### Returns - + -## update(data, sharedContext?): Promise<[AuthUserDTO](../../../interfaces/auth.AuthUserDTO/page.mdx)> +## update(data, sharedContext?): Promise<[AuthIdentityDTO](../../../interfaces/auth.AuthIdentityDTO/page.mdx)> This method updates an existing auth. ### Example ```ts -const authUser = await authModuleService.update({ +const authIdentity = await authModuleService.update({ id: "authusr_123", - app_metadata: { - test: true, - }, }) ``` ### Parameters -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/> +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/auth.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/auth.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/> ### Returns -`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/> +`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/> diff --git a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.validateCallback/page.mdx b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.validateCallback/page.mdx index fdc2f57bc5..9f0e42d621 100644 --- a/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.validateCallback/page.mdx +++ b/www/apps/resources/references/auth/IAuthModuleService/methods/auth.IAuthModuleService.validateCallback/page.mdx @@ -28,21 +28,20 @@ The following example is in the context of an API route, where `req` is an instance of the `MedusaRequest` object: ```ts -const { success, authUser, error, successRedirectUrl } = +const { success, authIdentity, error, successRedirectUrl } = await authModuleService.validateCallback("google", { url: req.url, headers: req.headers, query: req.query, body: req.body, - authScope: "admin", protocol: req.protocol, } as AuthenticationInput) ``` ## Parameters -`","description":"Headers of incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"authScope","type":"`string`","description":"Scope for the authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="validateCallback"/> +`","description":"Headers of incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="validateCallback"/> ## Returns - + diff --git a/www/apps/resources/references/auth/interfaces/auth.AuthIdentityDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.AuthIdentityDTO/page.mdx new file mode 100644 index 0000000000..938cef3e30 --- /dev/null +++ b/www/apps/resources/references/auth/interfaces/auth.AuthIdentityDTO/page.mdx @@ -0,0 +1,11 @@ +--- +displayed_sidebar: authReference +--- + +import { TypeList } from "docs-ui" + +# AuthIdentityDTO + +The auth identity details. + +`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AuthIdentityDTO"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.AuthUserDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.AuthUserDTO/page.mdx deleted file mode 100644 index f867d4d15e..0000000000 --- a/www/apps/resources/references/auth/interfaces/auth.AuthUserDTO/page.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -displayed_sidebar: authReference ---- - -import { TypeList } from "docs-ui" - -# AuthUserDTO - -The auth user details. - -`","description":"Holds custom data related to the user in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AuthUserDTO"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.AuthenticationInput/page.mdx b/www/apps/resources/references/auth/interfaces/auth.AuthenticationInput/page.mdx index ced7084956..e2a4c0c600 100644 --- a/www/apps/resources/references/auth/interfaces/auth.AuthenticationInput/page.mdx +++ b/www/apps/resources/references/auth/interfaces/auth.AuthenticationInput/page.mdx @@ -9,4 +9,4 @@ import { TypeList } from "docs-ui" The data passed to the auth provider when authenticating a user or validating a callback. -`","description":"Headers of incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"authScope","type":"`string`","description":"Scope for the authentication request.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AuthenticationInput"/> +`","description":"Headers of incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AuthenticationInput"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.AuthenticationResponse/page.mdx b/www/apps/resources/references/auth/interfaces/auth.AuthenticationResponse/page.mdx index 0a5936e7eb..98eaa52681 100644 --- a/www/apps/resources/references/auth/interfaces/auth.AuthenticationResponse/page.mdx +++ b/www/apps/resources/references/auth/interfaces/auth.AuthenticationResponse/page.mdx @@ -8,4 +8,4 @@ import { TypeList } from "docs-ui" The details of the authentication response. - + diff --git a/www/apps/resources/references/auth/interfaces/auth.CreateAuthIdentityDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.CreateAuthIdentityDTO/page.mdx new file mode 100644 index 0000000000..50d88a8c6c --- /dev/null +++ b/www/apps/resources/references/auth/interfaces/auth.CreateAuthIdentityDTO/page.mdx @@ -0,0 +1,11 @@ +--- +displayed_sidebar: authReference +--- + +import { TypeList } from "docs-ui" + +# CreateAuthIdentityDTO + +The auth identity to be created. + +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateAuthIdentityDTO"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.CreateAuthUserDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.CreateAuthUserDTO/page.mdx deleted file mode 100644 index cc47cc6c14..0000000000 --- a/www/apps/resources/references/auth/interfaces/auth.CreateAuthUserDTO/page.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -displayed_sidebar: authReference ---- - -import { TypeList } from "docs-ui" - -# CreateAuthUserDTO - -The auth user to be created. - -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateAuthUserDTO"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx b/www/apps/resources/references/auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx new file mode 100644 index 0000000000..e27df76d3c --- /dev/null +++ b/www/apps/resources/references/auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx @@ -0,0 +1,11 @@ +--- +displayed_sidebar: authReference +--- + +import { TypeList } from "docs-ui" + +# FilterableAuthIdentityProps + +The filters to apply on the retrieved auth identity. + + diff --git a/www/apps/resources/references/auth/interfaces/auth.FilterableAuthUserProps/page.mdx b/www/apps/resources/references/auth/interfaces/auth.FilterableAuthUserProps/page.mdx deleted file mode 100644 index f1cca9d4e7..0000000000 --- a/www/apps/resources/references/auth/interfaces/auth.FilterableAuthUserProps/page.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -displayed_sidebar: authReference ---- - -import { TypeList } from "docs-ui" - -# FilterableAuthUserProps - -The filters to apply on the retrieved auth user. - - diff --git a/www/apps/resources/references/auth/interfaces/auth.FindConfig/page.mdx b/www/apps/resources/references/auth/interfaces/auth.FindConfig/page.mdx index fb7e4fbb29..e1f8915c45 100644 --- a/www/apps/resources/references/auth/interfaces/auth.FindConfig/page.mdx +++ b/www/apps/resources/references/auth/interfaces/auth.FindConfig/page.mdx @@ -13,4 +13,4 @@ which provides correct typing of field names in its properties. -`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/> +`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="FindConfig"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.JoinerServiceConfig/page.mdx b/www/apps/resources/references/auth/interfaces/auth.JoinerServiceConfig/page.mdx index 4ebab0ddf2..d19e072afd 100644 --- a/www/apps/resources/references/auth/interfaces/auth.JoinerServiceConfig/page.mdx +++ b/www/apps/resources/references/auth/interfaces/auth.JoinerServiceConfig/page.mdx @@ -6,4 +6,4 @@ import { TypeList } from "docs-ui" # JoinerServiceConfig -`","description":"alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[JoinerRelationship](../../types/auth.JoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isInternalService","type":"`boolean`","description":"If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"relationship","type":"[JoinerRelationship](../../types/auth.JoinerRelationship/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isInternalService","type":"`boolean`","description":"If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerServiceConfig"/> +`","description":"alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[JoinerRelationship](../../types/auth.JoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"relationship","type":"[JoinerRelationship](../../types/auth.JoinerRelationship/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inverse","type":"`boolean`","description":"In an inverted relationship the foreign key is on the other service and the primary key is on the current service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isList","type":"`boolean`","description":"Force the relationship to return a list","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"args","type":"`Record`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerServiceConfig"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.UpdateAuthIdentityDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.UpdateAuthIdentityDTO/page.mdx new file mode 100644 index 0000000000..fa232d9166 --- /dev/null +++ b/www/apps/resources/references/auth/interfaces/auth.UpdateAuthIdentityDTO/page.mdx @@ -0,0 +1,11 @@ +--- +displayed_sidebar: authReference +--- + +import { TypeList } from "docs-ui" + +# UpdateAuthIdentityDTO + +The attributes to update in the auth identity. + +`","description":"Holds information related to the actor IDs tied to the auth identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`Record`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateAuthIdentityDTO"/> diff --git a/www/apps/resources/references/auth/interfaces/auth.UpdateAuthUserDTO/page.mdx b/www/apps/resources/references/auth/interfaces/auth.UpdateAuthUserDTO/page.mdx deleted file mode 100644 index f261eab6e7..0000000000 --- a/www/apps/resources/references/auth/interfaces/auth.UpdateAuthUserDTO/page.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -displayed_sidebar: authReference ---- - -import { TypeList } from "docs-ui" - -# UpdateAuthUserDTO - -The attributes to update in the auth user. - -`","description":"Holds custom data related to the provider in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"user_metadata","type":"`Record`","description":"Holds custom data related to the user in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"Holds custom data related to the third-party app in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="UpdateAuthUserDTO"/> diff --git a/www/apps/resources/references/auth/types/auth.JoinerRelationship/page.mdx b/www/apps/resources/references/auth/types/auth.JoinerRelationship/page.mdx index 32565e9dfc..80ef557f9c 100644 --- a/www/apps/resources/references/auth/types/auth.JoinerRelationship/page.mdx +++ b/www/apps/resources/references/auth/types/auth.JoinerRelationship/page.mdx @@ -10,4 +10,4 @@ import { TypeList } from "docs-ui" ## Properties -`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerRelationship"/> +`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="JoinerRelationship"/> diff --git a/www/apps/resources/references/auth_models/classes/auth_models.AuthIdentity/page.mdx b/www/apps/resources/references/auth_models/classes/auth_models.AuthIdentity/page.mdx new file mode 100644 index 0000000000..43f522d379 --- /dev/null +++ b/www/apps/resources/references/auth_models/classes/auth_models.AuthIdentity/page.mdx @@ -0,0 +1,13 @@ +--- +displayed_sidebar: authModelReference +slug: /references/auth/models/AuthIdentity +sidebar_label: AuthIdentity +--- + +import { TypeList } from "docs-ui" + +# AuthIdentity - Auth Module Data Models Reference + +This documentation provides a reference to the AuthIdentity . This belongs to the Auth Module. + +`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`null` \\| `Record`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`null` \\| `Record`","description":"","optional":false,"defaultValue":"null","expandable":false,"children":[]}]} sectionTitle="AuthIdentity"/> diff --git a/www/apps/resources/references/auth_models/classes/auth_models.AuthUser/page.mdx b/www/apps/resources/references/auth_models/classes/auth_models.AuthUser/page.mdx deleted file mode 100644 index 37dd1900f2..0000000000 --- a/www/apps/resources/references/auth_models/classes/auth_models.AuthUser/page.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -displayed_sidebar: authModelReference -slug: /references/auth/models/AuthUser -sidebar_label: AuthUser ---- - -import { TypeList } from "docs-ui" - -# AuthUser - Auth Module Data Models Reference - -This documentation provides a reference to the AuthUser . This belongs to the Auth Module. - -`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"app_metadata","type":"`Record`","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[]},{"name":"provider_metadata","type":"`null` \\| `Record`","description":"","optional":false,"defaultValue":"null","expandable":false,"children":[]}]} sectionTitle="AuthUser"/> diff --git a/www/apps/resources/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx b/www/apps/resources/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx new file mode 100644 index 0000000000..eec8cc5d54 --- /dev/null +++ b/www/apps/resources/references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx @@ -0,0 +1,118 @@ +--- +slug: /references/auth/provider +--- + +import { TypeList } from "docs-ui" + +# How to Create an Auth Provider Module + +In this document, you’ll learn how to create an auth provider module and the methods you must implement in its main service. + +--- + +## 1. Create Module Directory + +Start by creating a new directory for your module. For example, `src/modules/my-auth`. + +--- + +## 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`: + +```ts title="src/modules/my-auth/service.ts" +import { AbstractAuthModuleProvider } from "@medusajs/utils" + +class MyAuthProviderService extends AbstractAuthModuleProvider { + // TODO implement methods +} + +export default MyAuthProviderService +``` + +### constructor + +#### Parameters + + + +### provider + +#### Returns + + + +### displayName + +#### Returns + + + +### authenticate + +#### Parameters + +`","description":"Headers of incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"authIdentityProviderService","type":"`AuthIdentityProviderService`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="authenticate"/> + +#### Returns + + + +### validateCallback + +#### Parameters + +`","description":"Headers of incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`Record`","description":"Query params of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"`Record`","description":"Body of the incoming authentication request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"protocol","type":"`string`","description":"Protocol of the incoming authentication request (For example, `https`).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"authIdentityProviderService","type":"`AuthIdentityProviderService`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="validateCallback"/> + +#### Returns + + + +--- + +## 3. Create Module Definition File + +Create the file `src/modules/my-auth/index.ts` with the following content: + +```ts title="src/modules/my-auth/index.ts" +import MyAuthProviderService from "./service" + +export default { + service: MyAuthProviderService, +} +``` + +This exports the module's definition, indicating that the `MyAuthProviderService` is the main service of the module. + +--- + +## 4. Use Module + +To use your Auth Provider Module, add it to the `providers` array of the Auth Module: + +```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + +const modules = { + // ... + [Modules.AUTH]: { + resolve: "@medusajs/auth", + options: { + providers: [ + { + resolve: "./dist/modules/my-auth", + options: { + config: { + "my-auth": { + // provider options... + }, + }, + }, + }, + ], + }, + }, +} +``` diff --git a/www/apps/resources/references/file/classes/file.AbstractFileProviderService/page.mdx b/www/apps/resources/references/file/classes/file.AbstractFileProviderService/page.mdx index d53d60ffb1..d331492f10 100644 --- a/www/apps/resources/references/file/classes/file.AbstractFileProviderService/page.mdx +++ b/www/apps/resources/references/file/classes/file.AbstractFileProviderService/page.mdx @@ -6,7 +6,7 @@ import { TypeList } from "docs-ui" # How to Create a File Provider Module -In this document, you’ll learn how to create a file provider module and the methods you must implement in it. +In this document, you’ll learn how to create a file provider module and the methods you must implement in its main service. --- @@ -18,9 +18,7 @@ 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 file service. - -The File Provider Module's main service 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/utils`: ```ts title="src/modules/my-file/service.ts" import { AbstractFileProviderService } from "@medusajs/utils" diff --git a/www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx b/www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx new file mode 100644 index 0000000000..a8abfab739 --- /dev/null +++ b/www/apps/resources/references/fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx @@ -0,0 +1,214 @@ +--- +slug: /references/fulfillment/provider +--- + +import { TypeList } from "docs-ui" + +# How to Create a Fulfillment Provider Module + +In this document, you’ll learn how to create a fulfillment provider module and the methods you must implement in its main service. + +--- + +## 1. Create Module Directory + +Start by creating a new directory for your module. For example, `src/modules/my-fulfillment`. + +--- + +## 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`: + +```ts title="src/modules/my-fulfillment/service.ts" +import { AbstractFulfillmentProviderService } from "@medusajs/utils" + +class MyFulfillmentProviderService extends AbstractFulfillmentProviderService { + // TODO implement methods +} + +export default MyFulfillmentProviderService +``` + +### constructor + +### isFulfillmentService + +#### Parameters + + + +#### Returns + + + +### getIdentifier + +#### Returns + + + +### getFulfillmentOptions + +#### Returns + +`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"Record","type":"`Record`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]} sectionTitle="getFulfillmentOptions"/> + +### validateFulfillmentData + +#### Parameters + + + +#### Returns + + + +### validateOption + +#### Parameters + + + +#### Returns + + + +### canCalculate + +#### Parameters + + + +#### Returns + + + +### calculatePrice + +#### Parameters + + + +#### Returns + + + +### createFulfillment + +#### Parameters + + + +#### Returns + + + +### cancelFulfillment + +#### Parameters + + + +#### Returns + + + +### getFulfillmentDocuments + +#### Parameters + + + +#### Returns + + + +### createReturnFulfillment + +#### Parameters + + + +#### Returns + + + +### getReturnDocuments + +#### Parameters + + + +#### Returns + + + +### getShipmentDocuments + +#### Parameters + + + +#### Returns + + + +### retrieveDocuments + +#### Parameters + + + +#### Returns + + + +--- + +## 3. Create Module Definition File + +Create the file `src/modules/my-fulfillment/index.ts` with the following content: + +```ts title="src/modules/my-fulfillment/index.ts" +import MyFulfillmentProviderService from "./service" + +export default { + service: MyFulfillmentProviderService, +} +``` + +This exports the module's definition, indicating that the `MyFulfillmentProviderService` is the main service of the module. + +--- + +## 4. Use Module + +To use your Fulfillment Provider Module, add it to the `providers` array of the Fulfillment Module: + +```js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + +const modules = { + // ... + [Modules.FULFILLMENT]: { + resolve: "@medusajs/fulfillment", + options: { + providers: [ + { + resolve: "./dist/modules/my-fulfillment", + options: { + config: { + "my-fulfillment": { + // provider options... + }, + }, + }, + }, + ], + }, + }, +} +``` diff --git a/www/apps/resources/references/medusa_config/interfaces/medusa_config.AdminOptions/page.mdx b/www/apps/resources/references/medusa_config/interfaces/medusa_config.AdminOptions/page.mdx new file mode 100644 index 0000000000..71bbf13918 --- /dev/null +++ b/www/apps/resources/references/medusa_config/interfaces/medusa_config.AdminOptions/page.mdx @@ -0,0 +1,7 @@ +import { TypeList } from "docs-ui" + +# AdminOptions + +Admin dashboard configurations. + + `InlineConfig`","description":"Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration\nand returns the modified configuration. The default value is `undefined`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="AdminOptions"/> diff --git a/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx b/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx index b6bfd695b3..1679b79af5 100644 --- a/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx +++ b/www/apps/resources/references/medusa_config/interfaces/medusa_config.ConfigModule/page.mdx @@ -8,17 +8,12 @@ import { TypeList } from "docs-ui" In this document, you’ll learn how to create a file service in the Medusa backend and the methods you must implement in it. -## Prerequisites - -This document assumes you already followed along with the [Prepare Environment documentation](https://docs.medusajs.com/development/backend/prepare-environment) and have a Medusa backend installed. - ---- - The configurations for your Medusa backend are in `medusa-config.js` located in the root of your Medusa project. The configurations include database, modules, and plugin configurations, among other configurations. `medusa-config.js` exports an object having the following properties: -- [projectConfig](page.mdx#projectconfig): (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations. +- [projectConfig](page.mdx#projectconfig) (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations. +- [admin](page.mdx#admin): An object that holds admin-related configurations. - [plugins](page.mdx#plugins): An array of plugin configurations that defines what plugins are installed and optionally specifies each of their configurations. - [modules](page.mdx#modules): An object that defines what modules are installed and optionally specifies each of their configurations. - [featureFlags](page.mdx#featureflags): An object that enables or disables features guarded by a feature flag. @@ -28,7 +23,7 @@ For example: ```js title="medusa-config.js" module.exports = { projectConfig, - plugins, + admin, modules, featureFlags, } @@ -49,195 +44,7 @@ setting the environment variables depends on the hosting provider. This property holds essential configurations related to the Medusa backend, such as database and CORS configurations. -### store_cors - -The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes. - -`store_cors` is a string used to specify the accepted URLs or patterns for store API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins. - -Every origin in that list must either be: - -1. A URL. For example, `http://localhost:8000`. The URL must not end with a backslash; -2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\1([gimsuy]*)$`. - -#### Example - -Some example values of common use cases: - -```bash -# Allow different ports locally starting with 800 -STORE_CORS=/http://localhost:800\d+$/ - -# Allow any origin ending with vercel.app. For example, storefront.vercel.app -STORE_CORS=/vercel\.app$/ - -# Allow all HTTP requests -STORE_CORS=/http://.+/ -``` - -Then, set the configuration in `medusa-config.js`: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - store_cors: process.env.STORE_CORS, - // ... - }, - // ... -} -``` - -If you’re adding the value directly within `medusa-config.js`, make sure to add an extra escaping `/` for every backslash in the pattern. For example: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - store_cors: "/vercel\\.app$/", - // ... - }, - // ... -} -``` - -### admin_cors - -The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes. - -`admin_cors` is a string used to specify the accepted URLs or patterns for admin API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins. - -Every origin in that list must either be: - -1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash; -2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\1([gimsuy]*)$`. - -#### Example - -Some example values of common use cases: - -```bash -# Allow different ports locally starting with 700 -ADMIN_CORS=/http://localhost:700\d+$/ - -# Allow any origin ending with vercel.app. For example, admin.vercel.app -ADMIN_CORS=/vercel\.app$/ - -# Allow all HTTP requests -ADMIN_CORS=/http://.+/ -``` - -Then, set the configuration in `medusa-config.js`: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - admin_cors: process.env.ADMIN_CORS, - // ... - }, - // ... -} -``` - -If you’re adding the value directly within `medusa-config.js`, make sure to add an extra escaping `/` for every backslash in the pattern. For example: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - admin_cors: "/http:\\/\\/localhost:700\\d+$/", - // ... - }, - // ... -} -``` - -### authCors - -The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes. - -`auth_cors` is a string used to specify the accepted URLs or patterns for API Routes starting with `/auth`. It can either be one accepted origin, or a comma-separated list of accepted origins. - -Every origin in that list must either be: - -1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash; -2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\1([gimsuy]*)$`. - -#### Example - -Some example values of common use cases: - -```bash -# Allow different ports locally starting with 700 -AUTH_CORS=/http://localhost:700\d+$/ - -# Allow any origin ending with vercel.app. For example, admin.vercel.app -AUTH_CORS=/vercel\.app$/ - -# Allow all HTTP requests -AUTH_CORS=/http://.+/ -``` - -Then, set the configuration in `medusa-config.js`: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - authCors: process.env.AUTH_CORS, - // ... - }, - // ... -} -``` - -If you’re adding the value directly within `medusa-config.js`, make sure to add an extra escaping `/` for every backslash in the pattern. For example: - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - authCors: "/http:\\/\\/localhost:700\\d+$/", - // ... - }, - // ... -} -``` - -### cookieSecret - -A random string used to create cookie tokens. Although this configuration option is not required, it’s highly recommended to set it for better security. - -In a development environment, if this option is not set, the default secret is `supersecret` However, in production, if this configuration is not set, an error is thrown and -the backend crashes. - -#### Example - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - cookieSecret: process.env.COOKIE_SECRET || "supersecret", - // ... - }, - // ... -} -``` - -### jwtSecret - -A random string used to create authentication tokens. Although this configuration option is not required, it’s highly recommended to set it for better security. - -In a development environment, if this option is not set the default secret is `supersecret` However, in production, if this configuration is not set an error, an -error is thrown and the backend crashes. - -#### Example - -```js title="medusa-config.js" -module.exports = { - projectConfig: { - jwtSecret: process.env.JWT_SECRET || "supersecret", - // ... - }, - // ... -} -``` - -### databaseName +### database\_database The name of the database to connect to. If specified in `databaseUrl`, then it’s not required to include it. @@ -600,10 +407,14 @@ module.exports = { Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there. However, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative. -Its value is an object that has the following properties: - If you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `"x-no-compression": true`. +:::note[Deprecated] + +use [http](../medusa_config.ProjectConfigOptions/page.mdx#http)'s `compression` property instead. + +::: + #### Example ```js title="medusa-config.js" @@ -707,7 +518,76 @@ module.exports = { } ``` ---- +### http + +Configure the application's http-specific settings + +#### Example + +```js title="medusa-config.js" +module.exports = { + projectConfig: { + http: { + cookieSecret: "some-super-secret", + compression: { ... }, + } + // ... + }, + // ... +} +``` + +#### Properties + +`","description":"Optionally you can specify the supported authentication providers per actor type (such as user, customer, or any custom actors).\nFor example, you only want to allow SSO logins for `users` to the admin, while you want to allow email/password logins for `customers` to the storefront.\n\n`authMethodsPerActor` is a a map where the actor type (eg. 'user') is the key, and an array of supported auth providers as the value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtSecret","type":"`string`","description":"A random string used to create authentication tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is `supersecret` However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtExpiresIn","type":"`string`","description":"The expiration time for the JWT token. If not provided, the default value is `24h`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cookieSecret","type":"`string`","description":"A random string used to create cookie tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is `supersecret` However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compression","type":"[HttpCompressionOptions](../medusa_config.HttpCompressionOptions/page.mdx)","description":"Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `\"x-no-compression\": true`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enabled","type":"`boolean`","description":"Whether HTTP compression is enabled. By default, it's `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"level","type":"`number`","description":"The level of zlib compression to apply to responses. A higher level will result in better compression but will take longer to complete.\nA lower level will result in less compression but will be much faster. The default value is `6`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"memLevel","type":"`number`","description":"How much memory should be allocated to the internal compression state. It's an integer in the range of 1 (minimum level) and 9 (maximum level).\nThe default value is `8`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"threshold","type":"`string` \\| `number`","description":"The minimum response body size that compression is applied on. Its value can be the number of bytes or any string accepted by the\n[bytes](https://www.npmjs.com/package/bytes) module. The default value is `1024`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="http"/> + +___ + +## admin + +Admin dashboard configurations. + +### Example + +```js title="medusa-config.js" +module.exports = { + admin: { + backendUrl: process.env.MEDUSA_BACKEND_URL || "http://localhost:9000" + } + // ... +} +``` + +### disable + +Whether to disable the admin dashboard. If set to `true`, the admin dashboard is disabled, +in both development and production environments. The default value is `false`. + +### path + +The path to the admin dashboard. The default value is `/app`. + +The value cannot be one of the reserved paths: +- `/admin` +- `/store` +- `/auth` +- `/` + +### outDir + +The directory where the admin build is output. This is where the build process places the generated files. +The default value is `./build`. + +### backendUrl + +The URL of your Medusa backend. Defaults to an empty string, which means requests will hit the same server that serves the dashboard. + +### vite + +Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration +and returns the modified configuration. The default value is `undefined`. + +___ ## plugins diff --git a/www/apps/resources/references/medusa_config/interfaces/medusa_config.ProjectConfigOptions/page.mdx b/www/apps/resources/references/medusa_config/interfaces/medusa_config.ProjectConfigOptions/page.mdx index 11a7c0e6e9..dddda11d60 100644 --- a/www/apps/resources/references/medusa_config/interfaces/medusa_config.ProjectConfigOptions/page.mdx +++ b/www/apps/resources/references/medusa_config/interfaces/medusa_config.ProjectConfigOptions/page.mdx @@ -4,4 +4,4 @@ import { TypeList } from "docs-ui" Essential configurations related to the Medusa backend, such as database and CORS configurations. -` & `object`","description":"An object that includes additional configurations to pass to the database connection. You can pass any configuration. One defined configuration to pass is\n`ssl` which enables support for TLS/SSL connections.\n\nThis is useful for production databases, which can be supported by setting the `rejectUnauthorized` attribute of `ssl` object to `false`.\nDuring development, it’s recommended not to pass this option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ssl","type":"`object`","description":"Configure support for TLS/SSL connection","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rejectUnauthorized","type":"`false`","description":"Whether to fail connection if the server certificate is verified against the list of supplied CAs and the hostname and no match is found.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"database_driver_options","type":"`Record` & `object`","description":"An object that includes additional configurations to pass to the database connection for v2. You can pass any configuration. One defined configuration to pass is\n`ssl` which enables support for TLS/SSL connections.\n\nThis is useful for production databases, which can be supported by setting the `rejectUnauthorized` attribute of `ssl` object to `false`.\nDuring development, it’s recommended not to pass this option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"connection","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ssl","type":"`object`","description":"Configure support for TLS/SSL connection","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"redis_url","type":"`string`","description":"Used to specify the URL to connect to Redis. This is only used for scheduled jobs. If you omit this configuration, scheduled jobs won't work.\n\n:::note\n\nYou must first have Redis installed. You can refer to [Redis's installation guide](https://redis.io/docs/getting-started/installation/).\n\n:::\n\nThe Redis connection URL has the following format:\n\n```bash\nredis[s]://[[username][:password]@][host][:port][/db-number]\n```\n\nFor a local Redis installation, the connection URL should be `redis://localhost:6379` unless you’ve made any changes to the Redis configuration during installation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"redis_prefix","type":"`string`","description":"The prefix set on all keys stored in Redis. The default value is `sess:`.\n\nIf this configuration option is provided, it is prepended to `sess:`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"redis_options","type":"`RedisOptions`","description":"An object of options to pass ioredis. You can refer to [ioredis’s RedisOptions documentation](https://redis.github.io/ioredis/index.html#RedisOptions)\nfor the list of available options.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"session_options","type":"[SessionOptions](../../../medusa/interfaces/medusa.SessionOptions/page.mdx)","description":"An object of options to pass to [express-session](https://www.npmjs.com/package/express-session).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the session ID cookie to set in the response (and read from in the request). The default value is `connect.sid`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#name) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resave","type":"`boolean`","description":"Whether the session should be saved back to the session store, even if the session was never modified during the request. The default value is `true`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#resave) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rolling","type":"`boolean`","description":"Whether the session identifier cookie should be force-set on every response. The default value is `false`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#rolling) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"saveUninitialized","type":"`boolean`","description":"Whether a session that is \"uninitialized\" is forced to be saved to the store. The default value is `true`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#saveUninitialized) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"secret","type":"`string`","description":"The secret to sign the session ID cookie. By default, the value of `cookie_secret` is used.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#secret) for details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ttl","type":"`number`","description":"Used when calculating the `Expires` `Set-Cookie` attribute of cookies. By default, its value is `10 * 60 * 60 * 1000`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#cookiemaxage) for details.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"http_compression","type":"[HttpCompressionOptions](../medusa_config.HttpCompressionOptions/page.mdx)","description":"Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `\"x-no-compression\": true`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enabled","type":"`boolean`","description":"Whether HTTP compression is enabled. By default, it's `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"level","type":"`number`","description":"The level of zlib compression to apply to responses. A higher level will result in better compression but will take longer to complete.\nA lower level will result in less compression but will be much faster. The default value is `6`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"memLevel","type":"`number`","description":"How much memory should be allocated to the internal compression state. It's an integer in the range of 1 (minimum level) and 9 (maximum level).\nThe default value is `8`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"threshold","type":"`string` \\| `number`","description":"The minimum response body size that compression is applied on. Its value can be the number of bytes or any string accepted by the\n[bytes](https://www.npmjs.com/package/bytes) module. The default value is `1024`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"jobs_batch_size","type":"`number`","description":"Configure the number of staged jobs that are polled from the database. Default is `1000`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"Configure the application's worker mode. Default is `shared`.\n\n- Use `shared` to run the application in a single process.\n- Use `worker` to run the a worker process only.\n- Use `server` to run the application server only.\n\nLearn more in [this guide](https://docs.medusajs.com/development/medusa-worker).","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ProjectConfigOptions"/> +`","description":"Optionally you can specify the supported authentication providers per actor type (such as user, customer, or any custom actors).\nFor example, you only want to allow SSO logins for `users` to the admin, while you want to allow email/password logins for `customers` to the storefront.\n\n`authMethodsPerActor` is a a map where the actor type (eg. 'user') is the key, and an array of supported auth providers as the value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtSecret","type":"`string`","description":"A random string used to create authentication tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is `supersecret` However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtExpiresIn","type":"`string`","description":"The expiration time for the JWT token. If not provided, the default value is `24h`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cookieSecret","type":"`string`","description":"A random string used to create cookie tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is `supersecret` However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compression","type":"[HttpCompressionOptions](../medusa_config.HttpCompressionOptions/page.mdx)","description":"Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `\"x-no-compression\": true`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enabled","type":"`boolean`","description":"Whether HTTP compression is enabled. By default, it's `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"level","type":"`number`","description":"The level of zlib compression to apply to responses. A higher level will result in better compression but will take longer to complete.\nA lower level will result in less compression but will be much faster. The default value is `6`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"memLevel","type":"`number`","description":"How much memory should be allocated to the internal compression state. It's an integer in the range of 1 (minimum level) and 9 (maximum level).\nThe default value is `8`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"threshold","type":"`string` \\| `number`","description":"The minimum response body size that compression is applied on. Its value can be the number of bytes or any string accepted by the\n[bytes](https://www.npmjs.com/package/bytes) module. The default value is `1024`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"http.authCors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`cors` is a string used to specify the accepted URLs or patterns for API Routes starting with `/auth`. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"http.storeCors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`store_cors` is a string used to specify the accepted URLs or patterns for store API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:8000`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"http.adminCors","type":"`string`","description":"The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n`admin_cors` is a string used to specify the accepted URLs or patterns for admin API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, `http://localhost:7001`. The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, `.example.com`. The regex pattern that the backend tests for is `^([/~@;%#'])(.*?)\\1([gimsuy]*)$`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"http.authMethodsPerActor","type":"`Record`","description":"Optionally you can specify the supported authentication providers per actor type (such as user, customer, or any custom actors).\nFor example, you only want to allow SSO logins for `users` to the admin, while you want to allow email/password logins for `customers` to the storefront.\n\n`authMethodsPerActor` is a a map where the actor type (eg. 'user') is the key, and an array of supported auth providers as the value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"database_database","type":"`string`","description":"The name of the database to connect to. If specified in `database_url`, then it’s not required to include it.\n\nMake sure to create the PostgreSQL database before using it. You can check how to create a database in\n[PostgreSQL's documentation](https://www.postgresql.org/docs/current/sql-createdatabase.html).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"database_url","type":"`string`","description":"The connection URL of the database. The format of the connection URL for PostgreSQL is:\n\n```bash\npostgres://[user][:password]@[host][:port]/[dbname]\n```\n\nWhere:\n\n- `[user]`: (required) your PostgreSQL username. If not specified, the system's username is used by default. The database user that you use must have create privileges. If you're using the `postgres` superuser, then it should have these privileges by default. Otherwise, make sure to grant your user create privileges. You can learn how to do that in [PostgreSQL's documentation](https://www.postgresql.org/docs/current/ddl-priv.html).\n- `[:password]`: an optional password for the user. When provided, make sure to put `:` before the password.\n- `[host]`: (required) your PostgreSQL host. When run locally, it should be `localhost`.\n- `[:port]`: an optional port that the PostgreSQL server is listening on. By default, it's `5432`. When provided, make sure to put `:` before the port.\n- `[dbname]`: (required) the name of the database.\n\nYou can learn more about the connection URL format in [PostgreSQL’s documentation](https://www.postgresql.org/docs/current/libpq-connect.html).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"database_schema","type":"`string`","description":"The database schema to connect to. This is not required to provide if you’re using the default schema, which is `public`.\n\n```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n database_schema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n}\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"database_extra","type":"`Record` & `object`","description":"An object that includes additional configurations to pass to the database connection. You can pass any configuration. One defined configuration to pass is\n`ssl` which enables support for TLS/SSL connections.\n\nThis is useful for production databases, which can be supported by setting the `rejectUnauthorized` attribute of `ssl` object to `false`.\nDuring development, it’s recommended not to pass this option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ssl","type":"`object`","description":"Configure support for TLS/SSL connection","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"rejectUnauthorized","type":"`false`","description":"Whether to fail connection if the server certificate is verified against the list of supplied CAs and the hostname and no match is found.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"database_driver_options","type":"`Record` & `object`","description":"An object that includes additional configurations to pass to the database connection for v2. You can pass any configuration. One defined configuration to pass is\n`ssl` which enables support for TLS/SSL connections.\n\nThis is useful for production databases, which can be supported by setting the `rejectUnauthorized` attribute of `ssl` object to `false`.\nDuring development, it’s recommended not to pass this option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"connection","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"ssl","type":"`object`","description":"Configure support for TLS/SSL connection","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"redis_url","type":"`string`","description":"Used to specify the URL to connect to Redis. This is only used for scheduled jobs. If you omit this configuration, scheduled jobs won't work.\n\n:::note\n\nYou must first have Redis installed. You can refer to [Redis's installation guide](https://redis.io/docs/getting-started/installation/).\n\n:::\n\nThe Redis connection URL has the following format:\n\n```bash\nredis[s]://[[username][:password]@][host][:port][/db-number]\n```\n\nFor a local Redis installation, the connection URL should be `redis://localhost:6379` unless you’ve made any changes to the Redis configuration during installation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"redis_prefix","type":"`string`","description":"The prefix set on all keys stored in Redis. The default value is `sess:`.\n\nIf this configuration option is provided, it is prepended to `sess:`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"redis_options","type":"`RedisOptions`","description":"An object of options to pass ioredis. You can refer to [ioredis’s RedisOptions documentation](https://redis.github.io/ioredis/index.html#RedisOptions)\nfor the list of available options.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"session_options","type":"[SessionOptions](../../../medusa/interfaces/medusa.SessionOptions/page.mdx)","description":"An object of options to pass to [express-session](https://www.npmjs.com/package/express-session).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the session ID cookie to set in the response (and read from in the request). The default value is `connect.sid`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#name) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resave","type":"`boolean`","description":"Whether the session should be saved back to the session store, even if the session was never modified during the request. The default value is `true`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#resave) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rolling","type":"`boolean`","description":"Whether the session identifier cookie should be force-set on every response. The default value is `false`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#rolling) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"saveUninitialized","type":"`boolean`","description":"Whether a session that is \"uninitialized\" is forced to be saved to the store. The default value is `true`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#saveUninitialized) for more details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"secret","type":"`string`","description":"The secret to sign the session ID cookie. By default, the value of `cookie_secret` is used.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#secret) for details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ttl","type":"`number`","description":"Used when calculating the `Expires` `Set-Cookie` attribute of cookies. By default, its value is `10 * 60 * 60 * 1000`.\nRefer to [express-session’s documentation](https://www.npmjs.com/package/express-session#cookiemaxage) for details.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"http_compression","type":"[HttpCompressionOptions](../medusa_config.HttpCompressionOptions/page.mdx)","description":"Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `\"x-no-compression\": true`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enabled","type":"`boolean`","description":"Whether HTTP compression is enabled. By default, it's `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"level","type":"`number`","description":"The level of zlib compression to apply to responses. A higher level will result in better compression but will take longer to complete.\nA lower level will result in less compression but will be much faster. The default value is `6`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"memLevel","type":"`number`","description":"How much memory should be allocated to the internal compression state. It's an integer in the range of 1 (minimum level) and 9 (maximum level).\nThe default value is `8`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"threshold","type":"`string` \\| `number`","description":"The minimum response body size that compression is applied on. Its value can be the number of bytes or any string accepted by the\n[bytes](https://www.npmjs.com/package/bytes) module. The default value is `1024`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"jobs_batch_size","type":"`number`","description":"Configure the number of staged jobs that are polled from the database. Default is `1000`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"Configure the application's worker mode. Default is `shared`.\n\n- Use `shared` to run the application in a single process.\n- Use `worker` to run the a worker process only.\n- Use `server` to run the application server only.\n\nLearn more in [this guide](https://docs.medusajs.com/development/medusa-worker).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"http.jwtSecret","type":"`string`","description":"A random string used to create authentication tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is `supersecret` However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"http.jwtExpiresIn","type":"`string`","description":"The expiration time for the JWT token. If not provided, the default value is `24h`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"http.cookieSecret","type":"`string`","description":"A random string used to create cookie tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is `supersecret` However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"http.compression","type":"[HttpCompressionOptions](../medusa_config.HttpCompressionOptions/page.mdx)","description":"Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `\"x-no-compression\": true`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"enabled","type":"`boolean`","description":"Whether HTTP compression is enabled. By default, it's `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"level","type":"`number`","description":"The level of zlib compression to apply to responses. A higher level will result in better compression but will take longer to complete.\nA lower level will result in less compression but will be much faster. The default value is `6`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"memLevel","type":"`number`","description":"How much memory should be allocated to the internal compression state. It's an integer in the range of 1 (minimum level) and 9 (maximum level).\nThe default value is `8`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"threshold","type":"`string` \\| `number`","description":"The minimum response body size that compression is applied on. Its value can be the number of bytes or any string accepted by the\n[bytes](https://www.npmjs.com/package/bytes) module. The default value is `1024`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="ProjectConfigOptions"/> diff --git a/www/apps/resources/references/modules/auth/page.mdx b/www/apps/resources/references/modules/auth/page.mdx index 8340211286..10ed06879d 100644 --- a/www/apps/resources/references/modules/auth/page.mdx +++ b/www/apps/resources/references/modules/auth/page.mdx @@ -4,10 +4,10 @@ import { TypeList } from "docs-ui" ## Interfaces -- [AuthUserDTO](../../auth/interfaces/auth.AuthUserDTO/page.mdx) -- [CreateAuthUserDTO](../../auth/interfaces/auth.CreateAuthUserDTO/page.mdx) -- [UpdateAuthUserDTO](../../auth/interfaces/auth.UpdateAuthUserDTO/page.mdx) -- [FilterableAuthUserProps](../../auth/interfaces/auth.FilterableAuthUserProps/page.mdx) +- [AuthIdentityDTO](../../auth/interfaces/auth.AuthIdentityDTO/page.mdx) +- [CreateAuthIdentityDTO](../../auth/interfaces/auth.CreateAuthIdentityDTO/page.mdx) +- [UpdateAuthIdentityDTO](../../auth/interfaces/auth.UpdateAuthIdentityDTO/page.mdx) +- [FilterableAuthIdentityProps](../../auth/interfaces/auth.FilterableAuthIdentityProps/page.mdx) - [AuthenticationResponse](../../auth/interfaces/auth.AuthenticationResponse/page.mdx) - [AuthenticationInput](../../auth/interfaces/auth.AuthenticationInput/page.mdx) - [IAuthModuleService](../../auth/interfaces/auth.IAuthModuleService/page.mdx) diff --git a/www/apps/resources/references/modules/auth_models/page.mdx b/www/apps/resources/references/modules/auth_models/page.mdx index fb451ccc4d..18ed0ab29b 100644 --- a/www/apps/resources/references/modules/auth_models/page.mdx +++ b/www/apps/resources/references/modules/auth_models/page.mdx @@ -11,4 +11,4 @@ This documentation provides a reference to the data models in the Auth Module ## Classes -- [AuthUser](../../auth_models/classes/auth_models.AuthUser/page.mdx) +- [AuthIdentity](../../auth_models/classes/auth_models.AuthIdentity/page.mdx) diff --git a/www/apps/resources/references/modules/auth_provider/page.mdx b/www/apps/resources/references/modules/auth_provider/page.mdx new file mode 100644 index 0000000000..d17eb50e6a --- /dev/null +++ b/www/apps/resources/references/modules/auth_provider/page.mdx @@ -0,0 +1,7 @@ +import { TypeList } from "docs-ui" + +# auth-provider + +## Classes + +- [AbstractAuthModuleProvider](../../auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx) diff --git a/www/apps/resources/references/modules/fulfillment_provider/page.mdx b/www/apps/resources/references/modules/fulfillment_provider/page.mdx new file mode 100644 index 0000000000..4fdc0c3815 --- /dev/null +++ b/www/apps/resources/references/modules/fulfillment_provider/page.mdx @@ -0,0 +1,7 @@ +import { TypeList } from "docs-ui" + +# fulfillment-provider + +## Classes + +- [AbstractFulfillmentProviderService](../../fulfillment_provider/classes/fulfillment_provider.AbstractFulfillmentProviderService/page.mdx) diff --git a/www/apps/resources/references/modules/medusa/page.mdx b/www/apps/resources/references/modules/medusa/page.mdx index ea430b3e50..379b918473 100644 --- a/www/apps/resources/references/modules/medusa/page.mdx +++ b/www/apps/resources/references/modules/medusa/page.mdx @@ -1105,10 +1105,12 @@ ___ `","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]} sectionTitle="wrapHandler"/> -#### Deprecated +:::note[Deprecated] use `import { wrapHandler } from "@medusajs/utils"` +::: + ### canAccessBatchJob #### Parameters @@ -1285,10 +1287,12 @@ Middleware that transform the query input for the store endpoints -#### Deprecated +:::note[Deprecated] use `transformQuery` instead +::: + ### reserveQuantityForDraftOrder #### Parameters diff --git a/www/apps/resources/references/modules/medusa_config/page.mdx b/www/apps/resources/references/modules/medusa_config/page.mdx index ad6de1ce1f..253c5652de 100644 --- a/www/apps/resources/references/modules/medusa_config/page.mdx +++ b/www/apps/resources/references/modules/medusa_config/page.mdx @@ -4,6 +4,7 @@ import { TypeList } from "docs-ui" ## Interfaces +- [AdminOptions](../../medusa_config/interfaces/medusa_config.AdminOptions/page.mdx) - [HttpCompressionOptions](../../medusa_config/interfaces/medusa_config.HttpCompressionOptions/page.mdx) - [ProjectConfigOptions](../../medusa_config/interfaces/medusa_config.ProjectConfigOptions/page.mdx) - [ConfigModule](../../medusa_config/interfaces/medusa_config.ConfigModule/page.mdx) diff --git a/www/apps/resources/references/types/interfaces/types.SharedContext/page.mdx b/www/apps/resources/references/types/interfaces/types.SharedContext/page.mdx index caaac84009..a4b57b6353 100644 --- a/www/apps/resources/references/types/interfaces/types.SharedContext/page.mdx +++ b/www/apps/resources/references/types/interfaces/types.SharedContext/page.mdx @@ -2,12 +2,14 @@ import { TypeList } from "docs-ui" # SharedContext -## Deprecated +:::note[Deprecated] use `Context` instead A context used to share resources, such as transaction manager, between the application and the module. +::: + ## Properties diff --git a/www/apps/resources/sidebar.mjs b/www/apps/resources/sidebar.mjs index bf28f8b5e1..b02d915747 100644 --- a/www/apps/resources/sidebar.mjs +++ b/www/apps/resources/sidebar.mjs @@ -26,8 +26,8 @@ export const sidebar = sidebarAttachHrefCommonOptions([ title: "Concepts", children: [ { - path: "/commerce-modules/api-key/tokens", - title: "Tokens", + path: "/commerce-modules/api-key/concepts", + title: "API Key Concepts", }, { path: "/commerce-modules/api-key/relations-to-other-modules", @@ -40,9 +40,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/api-key", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IApiKeyModuleService Reference", + childSidebarTitle: "API Key Module's Main Service Reference", children: [ { title: "Methods", @@ -78,10 +78,6 @@ export const sidebar = sidebarAttachHrefCommonOptions([ title: "Auth Module", hasTitleStyling: true, children: [ - { - path: "/commerce-modules/auth/module-options", - title: "Module Options", - }, { path: "/commerce-modules/auth/examples", title: "Examples", @@ -101,20 +97,20 @@ export const sidebar = sidebarAttachHrefCommonOptions([ path: "/commerce-modules/auth/user-creation", title: "User Creation", }, - { - path: "/commerce-modules/auth/persisting-auth-user", - title: "Persisting Auth User", - }, ], }, { title: "References", children: [ + { + path: "/references/auth/provider", + title: "Create Auth Provider Module", + }, { path: "/references/auth", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IAuthModuleService Reference", + childSidebarTitle: "Auth Module's Main Service Reference", children: [ { title: "Methods", @@ -180,9 +176,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/cart", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "ICartModuleService Reference", + childSidebarTitle: "Cart Module's Main Service Reference", children: [ { title: "Methods", @@ -222,14 +218,23 @@ export const sidebar = sidebarAttachHrefCommonOptions([ path: "/commerce-modules/currency/examples", title: "Examples", }, + { + title: "Concepts", + children: [ + { + path: "/commerce-modules/currency/relations-to-other-modules", + title: "Relation to Modules", + }, + ], + }, { title: "References", children: [ { path: "/references/currency", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "ICurrencyModuleService Reference", + childSidebarTitle: "Cart Module's Main Service Reference", children: [ { title: "Methods", @@ -287,9 +292,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/customer", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "ICustomerModuleService Reference", + childSidebarTitle: "Customer Module's Main Service Reference", children: [ { title: "Methods", @@ -341,15 +346,15 @@ export const sidebar = sidebarAttachHrefCommonOptions([ title: "Fulfillment Provider", }, { - path: "/commerce-modules/fulfillment/shipping-options", - title: "Shipping Options", + path: "/commerce-modules/fulfillment/shipping-option", + title: "Shipping Option", }, { path: "/commerce-modules/fulfillment/item-fulfillment", title: "Item Fulfillment", }, { - path: "/commerce-modules/fulfillment/relation-to-other-modules", + path: "/commerce-modules/fulfillment/relations-to-other-modules", title: "Relations to Other Modules", }, ], @@ -357,11 +362,16 @@ export const sidebar = sidebarAttachHrefCommonOptions([ { title: "References", children: [ + { + path: "/references/fulfillment/provider", + title: "Create Fulfillment Provider Module", + }, { path: "/references/fulfillment", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IFulfillmentModuleService Reference", + childSidebarTitle: + "Fulfillment Module's Main Service Reference", children: [ { title: "Methods", @@ -423,9 +433,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/inventory_next", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IInventoryServiceNext Reference", + childSidebarTitle: "Inventory Module's Main Service Reference", children: [ { title: "Methods", @@ -469,10 +479,6 @@ export const sidebar = sidebarAttachHrefCommonOptions([ path: "/commerce-modules/order/concepts", title: "Order Concepts", }, - { - path: "/commerce-modules/order/order-items", - title: "Order Title", - }, { path: "/commerce-modules/order/promotion-adjustments", title: "Promotions Adjustments", @@ -504,9 +510,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/order", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IOrderModuleService Reference", + childSidebarTitle: "Order Module's Main Service Reference", children: [ { title: "Methods", @@ -575,10 +581,6 @@ export const sidebar = sidebarAttachHrefCommonOptions([ }, ], }, - { - path: "/commerce-modules/payment/payment-flow", - title: "Payment Flow", - }, { path: "/commerce-modules/payment/webhook-events", title: "Webhook Events", @@ -589,6 +591,15 @@ export const sidebar = sidebarAttachHrefCommonOptions([ }, ], }, + { + title: "Guides", + children: [ + { + path: "/commerce-modules/payment/payment-flow", + title: "Accept Payment Flow", + }, + ], + }, { title: "References", children: [ @@ -598,9 +609,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ }, { path: "/references/payment", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IPaymentModuleService Reference", + childSidebarTitle: "Payment Module's Main Service Reference", children: [ { title: "Methods", @@ -647,6 +658,10 @@ export const sidebar = sidebarAttachHrefCommonOptions([ path: "/commerce-modules/pricing/concepts", title: "Pricing Concepts", }, + { + path: "/commerce-modules/pricing/price-rules", + title: "Price Rules", + }, { path: "/commerce-modules/pricing/price-calculation", title: "Prices Calculation", @@ -662,9 +677,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/pricing", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IPricingModuleService Reference", + childSidebarTitle: "Pricing Module's Main Service Reference", children: [ { title: "Methods", @@ -718,9 +733,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/product", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IProductModuleService Reference", + childSidebarTitle: "Product Module's Main Service Reference", children: [ { title: "Methods", @@ -765,7 +780,15 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/commerce-modules/promotion/concepts", - title: "Promotion Concepts", + title: "Promotion", + }, + { + path: "/commerce-modules/promotion/application-method", + title: "Application Method", + }, + { + path: "/commerce-modules/promotion/campaign", + title: "Campaign", }, { path: "/commerce-modules/promotion/actions", @@ -782,9 +805,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/promotion", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IPromotionModuleService Reference", + childSidebarTitle: "Promotion Module's Main Service Reference", children: [ { title: "Methods", @@ -838,9 +861,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/region", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IRegionModuleService Reference", + childSidebarTitle: "Region Module's Main Service Reference", children: [ { title: "Methods", @@ -898,9 +921,10 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/sales-channel", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "ISalesChannelModuleService Reference", + childSidebarTitle: + "Sales Channel Module's Main Service Reference", children: [ { title: "Methods", @@ -959,9 +983,10 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/stock-location", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IStockLocationServiceNext Reference", + childSidebarTitle: + "Stock Location Module's Main Service Reference", children: [ { title: "Methods", @@ -1003,14 +1028,23 @@ export const sidebar = sidebarAttachHrefCommonOptions([ path: "/commerce-modules/store/examples", title: "Examples", }, + { + title: "Concepts", + children: [ + { + path: "/commerce-modules/store/relations-to-other-modules", + title: "Relation to Modules", + }, + ], + }, { title: "References", children: [ { path: "/references/store", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IStoreModuleService Reference", + childSidebarTitle: "Store Module's Main Service Reference", children: [ { title: "Methods", @@ -1067,22 +1101,22 @@ export const sidebar = sidebarAttachHrefCommonOptions([ }, { path: "/commerce-modules/tax/tax-calculation-with-provider", - title: "Tax Calculation", + title: "Tax Calculation and Providers", }, ], }, { title: "References", children: [ - { - path: "/references/tax/provider", - title: "Tax Provider Reference", - }, + // { + // path: "/references/tax/provider", + // title: "Tax Provider Reference", + // }, { path: "/references/tax", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "ITaxModuleService Reference", + childSidebarTitle: "Tax Module's Main Service Reference", children: [ { title: "Methods", @@ -1140,9 +1174,9 @@ export const sidebar = sidebarAttachHrefCommonOptions([ children: [ { path: "/references/user", - title: "Interface Reference", + title: "Main Service Reference", isChildSidebar: true, - childSidebarTitle: "IUserModuleService Reference", + childSidebarTitle: "User Module's Main Service Reference", children: [ { title: "Methods", diff --git a/www/utils/generated/typedoc-json-output/auth-models.json b/www/utils/generated/typedoc-json-output/auth-models.json index e2908ec68b..ab4375ea93 100644 --- a/www/utils/generated/typedoc-json-output/auth-models.json +++ b/www/utils/generated/typedoc-json-output/auth-models.json @@ -1,33 +1,33 @@ { - "id": 519, + "id": 242, "name": "auth-models", "variant": "project", "kind": 1, "flags": {}, "children": [ { - "id": 520, - "name": "AuthUser", + "id": 243, + "name": "AuthIdentity", "variant": "declaration", "kind": 128, "flags": {}, "children": [ { - "id": 521, + "id": 244, "name": "constructor", "variant": "declaration", "kind": 512, "flags": {}, "signatures": [ { - "id": 522, - "name": "new AuthUser", + "id": 245, + "name": "new AuthIdentity", "variant": "signature", "kind": 16384, "flags": {}, "type": { "type": "reference", - "target": 520, + "target": 243, "name": "default", "package": "@medusajs/auth" } @@ -35,7 +35,7 @@ ] }, { - "id": 534, + "id": 256, "name": "[OptionalProps]", "variant": "declaration", "kind": 1024, @@ -43,7 +43,7 @@ "type": { "type": "reference", "target": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "OptionalFields" }, "name": "OptionalFields", @@ -51,7 +51,7 @@ } }, { - "id": 523, + "id": 246, "name": "id", "variant": "declaration", "kind": 1024, @@ -62,7 +62,7 @@ } }, { - "id": 524, + "id": 247, "name": "entity_id", "variant": "declaration", "kind": 1024, @@ -73,7 +73,7 @@ } }, { - "id": 525, + "id": 248, "name": "provider", "variant": "declaration", "kind": 1024, @@ -84,18 +84,7 @@ } }, { - "id": 526, - "name": "scope", - "variant": "declaration", - "kind": 1024, - "flags": {}, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 527, + "id": 249, "name": "user_metadata", "variant": "declaration", "kind": 1024, @@ -130,34 +119,42 @@ } }, { - "id": 528, + "id": 250, "name": "app_metadata", "variant": "declaration", "kind": 1024, "flags": {}, "type": { - "type": "reference", - "target": { - "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", - "qualifiedName": "Record" - }, - "typeArguments": [ + "type": "union", + "types": [ { - "type": "intrinsic", - "name": "string" + "type": "literal", + "value": null }, { - "type": "intrinsic", - "name": "unknown" + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "unknown" + } + ], + "name": "Record", + "package": "typescript" } - ], - "name": "Record", - "package": "typescript" - }, - "defaultValue": "{}" + ] + } }, { - "id": 529, + "id": 251, "name": "provider_metadata", "variant": "declaration", "kind": 1024, @@ -193,14 +190,14 @@ "defaultValue": "null" }, { - "id": 530, + "id": 252, "name": "onCreate", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 531, + "id": 253, "name": "onCreate", "variant": "signature", "kind": 4096, @@ -213,14 +210,14 @@ ] }, { - "id": 532, + "id": 254, "name": "onInit", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 533, + "id": 255, "name": "onInit", "variant": "signature", "kind": 4096, @@ -237,27 +234,26 @@ { "title": "Constructors", "children": [ - 521 + 244 ] }, { "title": "Properties", "children": [ - 534, - 523, - 524, - 525, - 526, - 527, - 528, - 529 + 256, + 246, + 247, + 248, + 249, + 250, + 251 ] }, { "title": "Methods", "children": [ - 530, - 532 + 252, + 254 ] } ] @@ -267,66 +263,62 @@ { "title": "Classes", "children": [ - 520 + 243 ] } ], "packageName": "@medusajs/auth", "symbolIdMap": { - "519": { - "sourceFileName": "../../../packages/auth/src/models/index.ts", + "242": { + "sourceFileName": "../../../../packages/modules/auth/src/models/index.ts", "qualifiedName": "" }, - "520": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "243": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default" }, - "523": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "246": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.id" }, - "524": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "247": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.entity_id" }, - "525": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "248": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.provider" }, - "526": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", - "qualifiedName": "default.scope" - }, - "527": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "249": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.user_metadata" }, - "528": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "250": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.app_metadata" }, - "529": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "251": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.provider_metadata" }, - "530": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "252": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.onCreate" }, - "531": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "253": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.onCreate" }, - "532": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "254": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.onInit" }, - "533": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "255": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.onInit" }, - "534": { - "sourceFileName": "../../../packages/auth/src/models/auth-user.ts", + "256": { + "sourceFileName": "../../../../packages/modules/auth/src/models/auth-identity.ts", "qualifiedName": "default.[OptionalProps]" } } diff --git a/www/utils/generated/typedoc-json-output/auth-provider.json b/www/utils/generated/typedoc-json-output/auth-provider.json new file mode 100644 index 0000000000..c482e4d131 --- /dev/null +++ b/www/utils/generated/typedoc-json-output/auth-provider.json @@ -0,0 +1,505 @@ +{ + "id": 0, + "name": "auth-provider", + "variant": "project", + "kind": 1, + "flags": {}, + "children": [ + { + "id": 1, + "name": "AbstractAuthModuleProvider", + "variant": "declaration", + "kind": 128, + "flags": { + "isAbstract": true + }, + "children": [ + { + "id": 2, + "name": "PROVIDER", + "variant": "declaration", + "kind": 1024, + "flags": { + "isPrivate": true, + "isStatic": true + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 3, + "name": "DISPLAY_NAME", + "variant": "declaration", + "kind": 1024, + "flags": { + "isPrivate": true, + "isStatic": true + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 12, + "name": "container_", + "variant": "declaration", + "kind": 1024, + "flags": { + "isProtected": true, + "isReadonly": true + }, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 13, + "name": "provider", + "variant": "declaration", + "kind": 262144, + "flags": { + "isPublic": true + }, + "getSignature": { + "id": 14, + "name": "provider", + "variant": "signature", + "kind": 524288, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "id": 15, + "name": "displayName", + "variant": "declaration", + "kind": 262144, + "flags": { + "isPublic": true + }, + "getSignature": { + "id": 16, + "name": "displayName", + "variant": "signature", + "kind": 524288, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + }, + { + "id": 4, + "name": "constructor", + "variant": "declaration", + "kind": 512, + "flags": { + "isProtected": true + }, + "signatures": [ + { + "id": 5, + "name": "new AbstractAuthModuleProvider", + "variant": "signature", + "kind": 16384, + "flags": {}, + "parameters": [ + { + "id": 6, + "name": "__namedParameters", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reflection", + "declaration": { + "id": 7, + "name": "__type", + "variant": "declaration", + "kind": 65536, + "flags": {} + } + } + }, + { + "id": 8, + "name": "config", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reflection", + "declaration": { + "id": 9, + "name": "__type", + "variant": "declaration", + "kind": 65536, + "flags": {}, + "children": [ + { + "id": 10, + "name": "provider", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 11, + "name": "displayName", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "string" + } + } + ], + "groups": [ + { + "title": "Properties", + "children": [ + 10, + 11 + ] + } + ] + } + } + } + ], + "type": { + "type": "reference", + "target": 1, + "name": "AbstractAuthModuleProvider", + "package": "@medusajs/utils" + } + } + ] + }, + { + "id": 17, + "name": "authenticate", + "variant": "declaration", + "kind": 2048, + "flags": { + "isAbstract": true + }, + "signatures": [ + { + "id": 18, + "name": "authenticate", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 19, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", + "qualifiedName": "AuthenticationInput" + }, + "name": "AuthenticationInput", + "package": "@medusajs/types" + } + }, + { + "id": 20, + "name": "authIdentityProviderService", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/provider.ts", + "qualifiedName": "AuthIdentityProviderService" + }, + "name": "AuthIdentityProviderService", + "package": "@medusajs/types" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", + "qualifiedName": "AuthenticationResponse" + }, + "name": "AuthenticationResponse", + "package": "@medusajs/types" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IAuthProvider.authenticate" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IAuthProvider.authenticate" + } + }, + { + "id": 21, + "name": "validateCallback", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 22, + "name": "validateCallback", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 23, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", + "qualifiedName": "AuthenticationInput" + }, + "name": "AuthenticationInput", + "package": "@medusajs/types" + } + }, + { + "id": 24, + "name": "authIdentityProviderService", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/provider.ts", + "qualifiedName": "AuthIdentityProviderService" + }, + "name": "AuthIdentityProviderService", + "package": "@medusajs/types" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", + "qualifiedName": "AuthenticationResponse" + }, + "name": "AuthenticationResponse", + "package": "@medusajs/types" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IAuthProvider.validateCallback" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IAuthProvider.validateCallback" + } + } + ], + "groups": [ + { + "title": "Constructors", + "children": [ + 4 + ] + }, + { + "title": "Properties", + "children": [ + 2, + 3, + 12 + ] + }, + { + "title": "Accessors", + "children": [ + 13, + 15 + ] + }, + { + "title": "Methods", + "children": [ + 17, + 21 + ] + } + ], + "implementedTypes": [ + { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/auth/provider.ts", + "qualifiedName": "IAuthProvider" + }, + "name": "IAuthProvider", + "package": "@medusajs/types" + } + ] + } + ], + "groups": [ + { + "title": "Classes", + "children": [ + 1 + ] + } + ], + "packageName": "@medusajs/utils", + "symbolIdMap": { + "0": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "" + }, + "1": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider" + }, + "2": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.PROVIDER" + }, + "3": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.DISPLAY_NAME" + }, + "4": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.__constructor" + }, + "5": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider" + }, + "6": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "__0" + }, + "8": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "config" + }, + "9": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "__type" + }, + "10": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "__type.provider" + }, + "11": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "__type.displayName" + }, + "12": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.container_" + }, + "13": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.provider" + }, + "14": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.provider" + }, + "15": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.displayName" + }, + "16": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.displayName" + }, + "17": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.authenticate" + }, + "18": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.authenticate" + }, + "19": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "data" + }, + "20": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "authIdentityProviderService" + }, + "21": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.validateCallback" + }, + "22": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "AbstractAuthModuleProvider.validateCallback" + }, + "23": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "data" + }, + "24": { + "sourceFileName": "../../../../packages/core/utils/src/auth/abstract-auth-provider.ts", + "qualifiedName": "authIdentityProviderService" + } + } +} \ No newline at end of file diff --git a/www/utils/generated/typedoc-json-output/auth.json b/www/utils/generated/typedoc-json-output/auth.json index bbcb4eecae..f85cf0fa10 100644 --- a/www/utils/generated/typedoc-json-output/auth.json +++ b/www/utils/generated/typedoc-json-output/auth.json @@ -1,13 +1,13 @@ { - "id": 273, + "id": 0, "name": "auth", "variant": "project", "kind": 1, "flags": {}, "children": [ { - "id": 371, - "name": "AuthUserDTO", + "id": 98, + "name": "AuthIdentityDTO", "variant": "declaration", "kind": 256, "flags": {}, @@ -15,13 +15,13 @@ "summary": [ { "kind": "text", - "text": "The auth user details." + "text": "The auth identity details." } ] }, "children": [ { - "id": 372, + "id": 99, "name": "id", "variant": "declaration", "kind": 1024, @@ -30,7 +30,7 @@ "summary": [ { "kind": "text", - "text": "The ID of the auth user." + "text": "The ID of the auth identity." } ] }, @@ -40,7 +40,7 @@ } }, { - "id": 373, + "id": 100, "name": "provider", "variant": "declaration", "kind": 1024, @@ -59,7 +59,7 @@ } }, { - "id": 374, + "id": 101, "name": "entity_id", "variant": "declaration", "kind": 1024, @@ -94,42 +94,43 @@ } }, { - "id": 375, - "name": "scope", + "id": 102, + "name": "app_metadata", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { "kind": "text", - "text": "The scope of the auth user. For example,\n" - }, - { - "kind": "code", - "text": "`admin`" - }, - { - "kind": "text", - "text": " or " - }, - { - "kind": "code", - "text": "`store`" - }, - { - "kind": "text", - "text": "." + "text": "Holds information related to the actor IDs tied to the auth identity." } ] }, "type": { - "type": "intrinsic", - "name": "string" + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "unknown" + } + ], + "name": "Record", + "package": "typescript" } }, { - "id": 376, + "id": 103, "name": "provider_metadata", "variant": "declaration", "kind": 1024, @@ -165,7 +166,7 @@ } }, { - "id": 377, + "id": 104, "name": "user_metadata", "variant": "declaration", "kind": 1024, @@ -197,60 +198,25 @@ "name": "Record", "package": "typescript" } - }, - { - "id": 378, - "name": "app_metadata", - "variant": "declaration", - "kind": 1024, - "flags": {}, - "comment": { - "summary": [ - { - "kind": "text", - "text": "Holds custom data related to the third-party app in key-value pairs." - } - ] - }, - "type": { - "type": "reference", - "target": { - "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", - "qualifiedName": "Record" - }, - "typeArguments": [ - { - "type": "intrinsic", - "name": "string" - }, - { - "type": "intrinsic", - "name": "unknown" - } - ], - "name": "Record", - "package": "typescript" - } } ], "groups": [ { "title": "Properties", "children": [ - 372, - 373, - 374, - 375, - 376, - 377, - 378 + 99, + 100, + 101, + 102, + 103, + 104 ] } ] }, { - "id": 396, - "name": "CreateAuthUserDTO", + "id": 122, + "name": "CreateAuthIdentityDTO", "variant": "declaration", "kind": 256, "flags": {}, @@ -258,13 +224,13 @@ "summary": [ { "kind": "text", - "text": "The auth user to be created." + "text": "The auth identity to be created." } ] }, "children": [ { - "id": 397, + "id": 123, "name": "id", "variant": "declaration", "kind": 1024, @@ -275,7 +241,7 @@ "summary": [ { "kind": "text", - "text": "The ID of the auth user." + "text": "The ID of the auth identity." } ] }, @@ -285,7 +251,7 @@ } }, { - "id": 398, + "id": 124, "name": "provider", "variant": "declaration", "kind": 1024, @@ -304,7 +270,7 @@ } }, { - "id": 399, + "id": 125, "name": "entity_id", "variant": "declaration", "kind": 1024, @@ -339,42 +305,43 @@ } }, { - "id": 400, - "name": "scope", + "id": 126, + "name": "app_metadata", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { "kind": "text", - "text": "The scope of the auth user. For example,\n" - }, - { - "kind": "code", - "text": "`admin`" - }, - { - "kind": "text", - "text": " or " - }, - { - "kind": "code", - "text": "`store`" - }, - { - "kind": "text", - "text": "." + "text": "Holds information related to the actor IDs tied to the auth identity." } ] }, "type": { - "type": "intrinsic", - "name": "string" + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "unknown" + } + ], + "name": "Record", + "package": "typescript" } }, { - "id": 401, + "id": 127, "name": "provider_metadata", "variant": "declaration", "kind": 1024, @@ -410,7 +377,7 @@ } }, { - "id": 402, + "id": 128, "name": "user_metadata", "variant": "declaration", "kind": 1024, @@ -444,9 +411,58 @@ "name": "Record", "package": "typescript" } + } + ], + "groups": [ + { + "title": "Properties", + "children": [ + 123, + 124, + 125, + 126, + 127, + 128 + ] + } + ] + }, + { + "id": 129, + "name": "UpdateAuthIdentityDTO", + "variant": "declaration", + "kind": 256, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The attributes to update in the auth identity." + } + ] + }, + "children": [ + { + "id": 130, + "name": "id", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The ID of the auth identity." + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } }, { - "id": 403, + "id": 131, "name": "app_metadata", "variant": "declaration", "kind": 1024, @@ -457,7 +473,7 @@ "summary": [ { "kind": "text", - "text": "Holds custom data related to the third-party app in key-value pairs." + "text": "Holds information related to the actor IDs tied to the auth identity." } ] }, @@ -480,59 +496,9 @@ "name": "Record", "package": "typescript" } - } - ], - "groups": [ - { - "title": "Properties", - "children": [ - 397, - 398, - 399, - 400, - 401, - 402, - 403 - ] - } - ] - }, - { - "id": 404, - "name": "UpdateAuthUserDTO", - "variant": "declaration", - "kind": 256, - "flags": {}, - "comment": { - "summary": [ - { - "kind": "text", - "text": "The attributes to update in the auth user." - } - ] - }, - "children": [ - { - "id": 405, - "name": "id", - "variant": "declaration", - "kind": 1024, - "flags": {}, - "comment": { - "summary": [ - { - "kind": "text", - "text": "The ID of the auth user." - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } }, { - "id": 406, + "id": 132, "name": "provider_metadata", "variant": "declaration", "kind": 1024, @@ -568,7 +534,7 @@ } }, { - "id": 407, + "id": 133, "name": "user_metadata", "variant": "declaration", "kind": 1024, @@ -602,59 +568,23 @@ "name": "Record", "package": "typescript" } - }, - { - "id": 408, - "name": "app_metadata", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "Holds custom data related to the third-party app in key-value pairs." - } - ] - }, - "type": { - "type": "reference", - "target": { - "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", - "qualifiedName": "Record" - }, - "typeArguments": [ - { - "type": "intrinsic", - "name": "string" - }, - { - "type": "intrinsic", - "name": "unknown" - } - ], - "name": "Record", - "package": "typescript" - } } ], "groups": [ { "title": "Properties", "children": [ - 405, - 406, - 407, - 408 + 130, + 131, + 132, + 133 ] } ] }, { - "id": 391, - "name": "FilterableAuthUserProps", + "id": 117, + "name": "FilterableAuthIdentityProps", "variant": "declaration", "kind": 256, "flags": {}, @@ -662,13 +592,13 @@ "summary": [ { "kind": "text", - "text": "The filters to apply on the retrieved auth user." + "text": "The filters to apply on the retrieved auth identity." } ] }, "children": [ { - "id": 392, + "id": 118, "name": "id", "variant": "declaration", "kind": 1024, @@ -679,7 +609,7 @@ "summary": [ { "kind": "text", - "text": "The IDs to filter the auth user by." + "text": "The IDs to filter the auth identity by." } ] }, @@ -692,7 +622,7 @@ } }, { - "id": 393, + "id": 119, "name": "provider", "variant": "declaration", "kind": 1024, @@ -703,7 +633,7 @@ "summary": [ { "kind": "text", - "text": "Filter the auth users by the ID of their auth provider." + "text": "Filter the auth identities by the ID of their auth provider." } ] }, @@ -725,7 +655,7 @@ } }, { - "id": 394, + "id": 120, "name": "$and", "variant": "declaration", "kind": 1024, @@ -747,18 +677,18 @@ "types": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" }, { "type": "reference", - "target": 451, + "target": 176, "typeArguments": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" } ], @@ -770,12 +700,12 @@ }, "inheritedFrom": { "type": "reference", - "target": 452, + "target": 177, "name": "BaseFilterable.$and" } }, { - "id": 395, + "id": 121, "name": "$or", "variant": "declaration", "kind": 1024, @@ -797,18 +727,18 @@ "types": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" }, { "type": "reference", - "target": 451, + "target": 176, "typeArguments": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" } ], @@ -820,7 +750,7 @@ }, "inheritedFrom": { "type": "reference", - "target": 453, + "target": 178, "name": "BaseFilterable.$or" } } @@ -829,22 +759,22 @@ { "title": "Properties", "children": [ - 392, - 393, - 394, - 395 + 118, + 119, + 120, + 121 ] } ], "extendedTypes": [ { "type": "reference", - "target": 451, + "target": 176, "typeArguments": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" } ], @@ -854,7 +784,7 @@ ] }, { - "id": 353, + "id": 79, "name": "AuthenticationResponse", "variant": "declaration", "kind": 256, @@ -869,7 +799,7 @@ }, "children": [ { - "id": 354, + "id": 80, "name": "success", "variant": "declaration", "kind": 1024, @@ -888,8 +818,8 @@ } }, { - "id": 355, - "name": "authUser", + "id": 81, + "name": "authIdentity", "variant": "declaration", "kind": 1024, "flags": { @@ -909,7 +839,7 @@ } }, { - "id": 356, + "id": 82, "name": "error", "variant": "declaration", "kind": 1024, @@ -930,7 +860,7 @@ } }, { - "id": 357, + "id": 83, "name": "location", "variant": "declaration", "kind": 1024, @@ -959,7 +889,7 @@ } }, { - "id": 358, + "id": 84, "name": "successRedirectUrl", "variant": "declaration", "kind": 1024, @@ -1000,17 +930,17 @@ { "title": "Properties", "children": [ - 354, - 355, - 356, - 357, - 358 + 80, + 81, + 82, + 83, + 84 ] } ] }, { - "id": 346, + "id": 73, "name": "AuthenticationInput", "variant": "declaration", "kind": 256, @@ -1025,11 +955,13 @@ }, "children": [ { - "id": 347, + "id": 74, "name": "url", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { @@ -1044,11 +976,13 @@ } }, { - "id": 348, + "id": 75, "name": "headers", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { @@ -1078,11 +1012,13 @@ } }, { - "id": 349, + "id": 76, "name": "query", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { @@ -1112,11 +1048,13 @@ } }, { - "id": 350, + "id": 77, "name": "body", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { @@ -1146,30 +1084,13 @@ } }, { - "id": 351, - "name": "authScope", - "variant": "declaration", - "kind": 1024, - "flags": {}, - "comment": { - "summary": [ - { - "kind": "text", - "text": "Scope for the authentication request." - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 352, + "id": 78, "name": "protocol", "variant": "declaration", "kind": 1024, - "flags": {}, + "flags": { + "isOptional": true + }, "comment": { "summary": [ { @@ -1196,18 +1117,17 @@ { "title": "Properties", "children": [ - 347, - 348, - 349, - 350, - 351, - 352 + 74, + 75, + 76, + 77, + 78 ] } ] }, { - "id": 277, + "id": 4, "name": "IAuthModuleService", "variant": "declaration", "kind": 256, @@ -1222,14 +1142,14 @@ }, "children": [ { - "id": 278, + "id": 5, "name": "authenticate", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 279, + "id": 6, "name": "authenticate", "variant": "signature", "kind": 4096, @@ -1292,7 +1212,7 @@ }, { "kind": "code", - "text": "```ts\nconst { success, authUser, location, error } =\n await authModuleService.authenticate(\"emailpass\", {\n url: req.url,\n headers: req.headers,\n query: req.query,\n body: req.body,\n authScope: \"admin\",\n protocol: req.protocol,\n } as AuthenticationInput)\n```" + "text": "```ts\nconst { success, authIdentity, location, error } =\n await authModuleService.authenticate(\"emailpass\", {\n url: req.url,\n headers: req.headers,\n query: req.query,\n body: req.body,\n protocol: req.protocol,\n } as AuthenticationInput)\n```" } ] } @@ -1300,7 +1220,7 @@ }, "parameters": [ { - "id": 280, + "id": 7, "name": "provider", "variant": "param", "kind": 32768, @@ -1319,7 +1239,7 @@ } }, { - "id": 281, + "id": 8, "name": "providerData", "variant": "param", "kind": 32768, @@ -1334,7 +1254,7 @@ }, "type": { "type": "reference", - "target": 346, + "target": 73, "name": "AuthenticationInput", "package": "@medusajs/types" } @@ -1349,7 +1269,7 @@ "typeArguments": [ { "type": "reference", - "target": 353, + "target": 79, "name": "AuthenticationResponse", "package": "@medusajs/types" } @@ -1361,14 +1281,14 @@ ] }, { - "id": 282, + "id": 9, "name": "validateCallback", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 283, + "id": 10, "name": "validateCallback", "variant": "signature", "kind": 4096, @@ -1415,7 +1335,7 @@ }, { "kind": "code", - "text": "```ts\nconst { success, authUser, error, successRedirectUrl } =\n await authModuleService.validateCallback(\"google\", {\n url: req.url,\n headers: req.headers,\n query: req.query,\n body: req.body,\n authScope: \"admin\",\n protocol: req.protocol,\n } as AuthenticationInput)\n```" + "text": "```ts\nconst { success, authIdentity, error, successRedirectUrl } =\n await authModuleService.validateCallback(\"google\", {\n url: req.url,\n headers: req.headers,\n query: req.query,\n body: req.body,\n protocol: req.protocol,\n } as AuthenticationInput)\n```" } ] } @@ -1423,7 +1343,7 @@ }, "parameters": [ { - "id": 284, + "id": 11, "name": "provider", "variant": "param", "kind": 32768, @@ -1442,7 +1362,7 @@ } }, { - "id": 285, + "id": 12, "name": "providerData", "variant": "param", "kind": 32768, @@ -1457,7 +1377,7 @@ }, "type": { "type": "reference", - "target": 346, + "target": 73, "name": "AuthenticationInput", "package": "@medusajs/types" } @@ -1472,7 +1392,7 @@ "typeArguments": [ { "type": "reference", - "target": 353, + "target": 79, "name": "AuthenticationResponse", "package": "@medusajs/types" } @@ -1484,14 +1404,14 @@ ] }, { - "id": 286, + "id": 13, "name": "retrieve", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 287, + "id": 14, "name": "retrieve", "variant": "signature", "kind": 4096, @@ -1500,7 +1420,7 @@ "summary": [ { "kind": "text", - "text": "This method retrieves an auth user by its ID." + "text": "This method retrieves an auth identity by its ID." } ], "blockTags": [ @@ -1509,7 +1429,7 @@ "content": [ { "kind": "text", - "text": "The retrieved auth user." + "text": "The retrieved auth identity." } ] }, @@ -1518,7 +1438,7 @@ "content": [ { "kind": "code", - "text": "```ts\nconst authUser = await authModuleService.retrieve(\"authusr_1\")\n```" + "text": "```ts\nconst authIdentity = await authModuleService.retrieve(\"authusr_1\")\n```" } ] } @@ -1526,7 +1446,7 @@ }, "parameters": [ { - "id": 288, + "id": 15, "name": "id", "variant": "param", "kind": 32768, @@ -1535,7 +1455,7 @@ "summary": [ { "kind": "text", - "text": "The ID of the auth user." + "text": "The ID of the auth identity." } ] }, @@ -1545,7 +1465,7 @@ } }, { - "id": 289, + "id": 16, "name": "config", "variant": "param", "kind": 32768, @@ -1556,7 +1476,7 @@ "summary": [ { "kind": "text", - "text": "The configurations determining how the auth user is retrieved. Its properties, such as " + "text": "The configurations determining how the auth identity is retrieved. Its properties, such as " }, { "kind": "code", @@ -1572,18 +1492,18 @@ }, { "kind": "text", - "text": ", accept the\nattributes or relations associated with a auth user." + "text": ", accept the\nattributes or relations associated with a auth identity." } ] }, "type": { "type": "reference", - "target": 359, + "target": 85, "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -1592,7 +1512,7 @@ } }, { - "id": 290, + "id": 17, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -1609,7 +1529,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -1624,8 +1544,8 @@ "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -1636,14 +1556,14 @@ ] }, { - "id": 291, + "id": 18, "name": "list", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 292, + "id": 19, "name": "list", "variant": "signature", "kind": 4096, @@ -1652,7 +1572,7 @@ "summary": [ { "kind": "text", - "text": "This method retrieves a paginated list of auth users based on optional filters and configuration." + "text": "This method retrieves a paginated list of auth identities based on optional filters and configuration." } ], "blockTags": [ @@ -1661,7 +1581,7 @@ "content": [ { "kind": "text", - "text": "The list of auth users." + "text": "The list of auth identities." } ] }, @@ -1670,11 +1590,11 @@ "content": [ { "kind": "text", - "text": "To retrieve a list of auth users using their IDs:\n\n" + "text": "To retrieve a list of auth identities using their IDs:\n\n" }, { "kind": "code", - "text": "```ts\nconst authUsers = await authModuleService.list({\n id: [\"authusr_123\", \"authusr_321\"],\n})\n```" + "text": "```ts\nconst authIdentities = await authModuleService.list({\n id: [\"authusr_123\", \"authusr_321\"],\n})\n```" }, { "kind": "text", @@ -1714,7 +1634,7 @@ }, { "kind": "code", - "text": "```ts\nconst authUsers = await authModuleService.list(\n {\n id: [\"authusr_123\", \"authusr_321\"],\n },\n {\n take: 20,\n skip: 2,\n }\n)\n```" + "text": "```ts\nconst authIdentities = await authModuleService.list(\n {\n id: [\"authusr_123\", \"authusr_321\"],\n },\n {\n take: 20,\n skip: 2,\n }\n)\n```" } ] } @@ -1722,7 +1642,7 @@ }, "parameters": [ { - "id": 293, + "id": 20, "name": "filters", "variant": "param", "kind": 32768, @@ -1733,19 +1653,19 @@ "summary": [ { "kind": "text", - "text": "The filters to apply on the retrieved auth users." + "text": "The filters to apply on the retrieved auth identities." } ] }, "type": { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" } }, { - "id": 294, + "id": 21, "name": "config", "variant": "param", "kind": 32768, @@ -1756,7 +1676,7 @@ "summary": [ { "kind": "text", - "text": "The configurations determining how the auth user is retrieved. Its properties, such as " + "text": "The configurations determining how the auth identity is retrieved. Its properties, such as " }, { "kind": "code", @@ -1772,18 +1692,18 @@ }, { "kind": "text", - "text": ", accept the\nattributes or relations associated with a auth user." + "text": ", accept the\nattributes or relations associated with a auth identity." } ] }, "type": { "type": "reference", - "target": 359, + "target": 85, "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -1792,7 +1712,7 @@ } }, { - "id": 295, + "id": 22, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -1809,7 +1729,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -1826,8 +1746,8 @@ "type": "array", "elementType": { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } } @@ -1839,14 +1759,14 @@ ] }, { - "id": 296, + "id": 23, "name": "listAndCount", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 297, + "id": 24, "name": "listAndCount", "variant": "signature", "kind": 4096, @@ -1855,7 +1775,7 @@ "summary": [ { "kind": "text", - "text": "This method retrieves a paginated list of auth users along with the total count of available auth users satisfying the provided filters." + "text": "This method retrieves a paginated list of auth identities along with the total count of available auth identities satisfying the provided filters." } ], "blockTags": [ @@ -1864,7 +1784,7 @@ "content": [ { "kind": "text", - "text": "The list of auth users along with their total count." + "text": "The list of auth identities along with their total count." } ] }, @@ -1873,11 +1793,11 @@ "content": [ { "kind": "text", - "text": "To retrieve a list of auth users using their IDs:\n\n" + "text": "To retrieve a list of auth identities using their IDs:\n\n" }, { "kind": "code", - "text": "```ts\nconst [authUsers, count] =\n await authModuleService.listAndCount({\n id: [\"authusr_123\", \"authusr_321\"],\n })\n```" + "text": "```ts\nconst [authIdentities, count] =\n await authModuleService.listAndCount({\n id: [\"authusr_123\", \"authusr_321\"],\n })\n```" }, { "kind": "text", @@ -1917,7 +1837,7 @@ }, { "kind": "code", - "text": "```ts\nconst [authUsers, count] =\n await authModuleService.listAndCount(\n {\n id: [\"authusr_123\", \"authusr_321\"],\n },\n {\n take: 20,\n skip: 2,\n }\n )\n```" + "text": "```ts\nconst [authIdentities, count] =\n await authModuleService.listAndCount(\n {\n id: [\"authusr_123\", \"authusr_321\"],\n },\n {\n take: 20,\n skip: 2,\n }\n )\n```" } ] } @@ -1925,7 +1845,7 @@ }, "parameters": [ { - "id": 298, + "id": 25, "name": "filters", "variant": "param", "kind": 32768, @@ -1936,19 +1856,19 @@ "summary": [ { "kind": "text", - "text": "The filters to apply on the retrieved auth users." + "text": "The filters to apply on the retrieved auth identities." } ] }, "type": { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps", + "target": 117, + "name": "FilterableAuthIdentityProps", "package": "@medusajs/types" } }, { - "id": 299, + "id": 26, "name": "config", "variant": "param", "kind": 32768, @@ -1959,7 +1879,7 @@ "summary": [ { "kind": "text", - "text": "The configurations determining how the auth user is retrieved. Its properties, such as " + "text": "The configurations determining how the auth identity is retrieved. Its properties, such as " }, { "kind": "code", @@ -1975,18 +1895,18 @@ }, { "kind": "text", - "text": ", accept the\nattributes or relations associated with a auth user." + "text": ", accept the\nattributes or relations associated with a auth identity." } ] }, "type": { "type": "reference", - "target": 359, + "target": 85, "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -1995,7 +1915,7 @@ } }, { - "id": 300, + "id": 27, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2012,7 +1932,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2032,8 +1952,8 @@ "type": "array", "elementType": { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } }, @@ -2051,14 +1971,14 @@ ] }, { - "id": 301, + "id": 28, "name": "create", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 302, + "id": 29, "name": "create", "variant": "signature", "kind": 4096, @@ -2067,7 +1987,7 @@ "summary": [ { "kind": "text", - "text": "This method creates auth users." + "text": "This method creates auth identities." } ], "blockTags": [ @@ -2076,7 +1996,7 @@ "content": [ { "kind": "text", - "text": "The created auth users." + "text": "The created auth identities." } ] }, @@ -2085,7 +2005,7 @@ "content": [ { "kind": "code", - "text": "```ts\nconst authUsers = await authModuleService.create([\n {\n provider: \"emailpass\",\n entity_id: \"user@example.com\",\n scope: \"admin\",\n },\n {\n provider: \"google\",\n entity_id: \"user@gmail.com\",\n scope: \"email profile\",\n },\n])\n```" + "text": "```ts\nconst authIdentities = await authModuleService.create([\n {\n provider: \"emailpass\",\n entity_id: \"user@example.com\",\n },\n {\n provider: \"google\",\n entity_id: \"user@gmail.com\",\n },\n])\n```" } ] } @@ -2093,7 +2013,7 @@ }, "parameters": [ { - "id": 303, + "id": 30, "name": "data", "variant": "param", "kind": 32768, @@ -2102,7 +2022,7 @@ "summary": [ { "kind": "text", - "text": "The auth users to be created." + "text": "The auth identities to be created." } ] }, @@ -2110,14 +2030,14 @@ "type": "array", "elementType": { "type": "reference", - "target": 396, - "name": "CreateAuthUserDTO", + "target": 122, + "name": "CreateAuthIdentityDTO", "package": "@medusajs/types" } } }, { - "id": 304, + "id": 31, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2134,7 +2054,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2151,8 +2071,8 @@ "type": "array", "elementType": { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } } @@ -2162,7 +2082,7 @@ } }, { - "id": 305, + "id": 32, "name": "create", "variant": "signature", "kind": 4096, @@ -2171,7 +2091,7 @@ "summary": [ { "kind": "text", - "text": "This method creates an auth user." + "text": "This method creates an auth identity." } ], "blockTags": [ @@ -2180,7 +2100,7 @@ "content": [ { "kind": "text", - "text": "The created auth user." + "text": "The created auth identity." } ] }, @@ -2189,7 +2109,7 @@ "content": [ { "kind": "code", - "text": "```ts\nconst authUser = await authModuleService.create({\n provider: \"emailpass\",\n entity_id: \"user@example.com\",\n scope: \"admin\",\n})\n```" + "text": "```ts\nconst authIdentity = await authModuleService.create({\n provider: \"emailpass\",\n entity_id: \"user@example.com\",\n})\n```" } ] } @@ -2197,7 +2117,7 @@ }, "parameters": [ { - "id": 306, + "id": 33, "name": "data", "variant": "param", "kind": 32768, @@ -2206,19 +2126,19 @@ "summary": [ { "kind": "text", - "text": "The auth user to be created." + "text": "The auth identity to be created." } ] }, "type": { "type": "reference", - "target": 396, - "name": "CreateAuthUserDTO", + "target": 122, + "name": "CreateAuthIdentityDTO", "package": "@medusajs/types" } }, { - "id": 307, + "id": 34, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2235,7 +2155,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2250,8 +2170,8 @@ "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -2262,14 +2182,14 @@ ] }, { - "id": 308, + "id": 35, "name": "update", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 309, + "id": 36, "name": "update", "variant": "signature", "kind": 4096, @@ -2296,7 +2216,7 @@ "content": [ { "kind": "code", - "text": "```ts\nconst authUsers = await authModuleService.update([\n {\n id: \"authusr_123\",\n app_metadata: {\n test: true,\n },\n },\n])\n```" + "text": "```ts\nconst authIdentities = await authModuleService.update([\n {\n id: \"authusr_123\",\n },\n])\n```" } ] } @@ -2304,7 +2224,7 @@ }, "parameters": [ { - "id": 310, + "id": 37, "name": "data", "variant": "param", "kind": 32768, @@ -2313,7 +2233,7 @@ "summary": [ { "kind": "text", - "text": "The attributes to update in the auth users." + "text": "The attributes to update in the auth identities." } ] }, @@ -2321,14 +2241,14 @@ "type": "array", "elementType": { "type": "reference", - "target": 404, - "name": "UpdateAuthUserDTO", + "target": 129, + "name": "UpdateAuthIdentityDTO", "package": "@medusajs/types" } } }, { - "id": 311, + "id": 38, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2345,7 +2265,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2362,8 +2282,8 @@ "type": "array", "elementType": { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } } @@ -2373,7 +2293,7 @@ } }, { - "id": 312, + "id": 39, "name": "update", "variant": "signature", "kind": 4096, @@ -2400,7 +2320,7 @@ "content": [ { "kind": "code", - "text": "```ts\nconst authUser = await authModuleService.update({\n id: \"authusr_123\",\n app_metadata: {\n test: true,\n },\n})\n```" + "text": "```ts\nconst authIdentity = await authModuleService.update({\n id: \"authusr_123\",\n})\n```" } ] } @@ -2408,7 +2328,7 @@ }, "parameters": [ { - "id": 313, + "id": 40, "name": "data", "variant": "param", "kind": 32768, @@ -2417,19 +2337,19 @@ "summary": [ { "kind": "text", - "text": "The attributes to update in the auth user." + "text": "The attributes to update in the auth identity." } ] }, "type": { "type": "reference", - "target": 404, - "name": "UpdateAuthUserDTO", + "target": 129, + "name": "UpdateAuthIdentityDTO", "package": "@medusajs/types" } }, { - "id": 314, + "id": 41, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2446,7 +2366,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2461,8 +2381,8 @@ "typeArguments": [ { "type": "reference", - "target": 371, - "name": "AuthUserDTO", + "target": 98, + "name": "AuthIdentityDTO", "package": "@medusajs/types" } ], @@ -2473,14 +2393,14 @@ ] }, { - "id": 315, + "id": 42, "name": "delete", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 316, + "id": 43, "name": "delete", "variant": "signature", "kind": 4096, @@ -2515,7 +2435,7 @@ }, "parameters": [ { - "id": 317, + "id": 44, "name": "ids", "variant": "param", "kind": 32768, @@ -2537,7 +2457,7 @@ } }, { - "id": 318, + "id": 45, "name": "sharedContext", "variant": "param", "kind": 32768, @@ -2554,7 +2474,7 @@ }, "type": { "type": "reference", - "target": 379, + "target": 105, "name": "Context", "package": "@medusajs/types" } @@ -2583,28 +2503,28 @@ { "title": "Methods", "children": [ - 278, - 282, - 286, - 291, - 296, - 301, - 308, - 315 + 5, + 9, + 13, + 18, + 23, + 28, + 35, + 42 ] } ], "extendedTypes": [ { "type": "reference", - "target": 332, + "target": 59, "name": "IModuleService", "package": "@medusajs/types" } ] }, { - "id": 359, + "id": 85, "name": "FindConfig", "variant": "declaration", "kind": 256, @@ -2627,7 +2547,7 @@ }, "children": [ { - "id": 360, + "id": 86, "name": "select", "variant": "declaration", "kind": 1024, @@ -2656,7 +2576,7 @@ "operator": "keyof", "target": { "type": "reference", - "target": 370, + "target": 97, "name": "Entity", "package": "@medusajs/types", "qualifiedName": "FindConfig.Entity", @@ -2668,7 +2588,7 @@ } }, { - "id": 361, + "id": 87, "name": "skip", "variant": "declaration", "kind": 1024, @@ -2698,7 +2618,7 @@ } }, { - "id": 362, + "id": 88, "name": "take", "variant": "declaration", "kind": 1024, @@ -2728,7 +2648,7 @@ } }, { - "id": 363, + "id": 89, "name": "relations", "variant": "declaration", "kind": 1024, @@ -2752,7 +2672,7 @@ } }, { - "id": 364, + "id": 90, "name": "order", "variant": "declaration", "kind": 1024, @@ -2786,20 +2706,20 @@ "type": { "type": "reflection", "declaration": { - "id": 365, + "id": 91, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "indexSignature": { - "id": 366, + "id": 92, "name": "__index", "variant": "signature", "kind": 8192, "flags": {}, "parameters": [ { - "id": 367, + "id": 93, "name": "K", "variant": "param", "kind": 32768, @@ -2828,7 +2748,7 @@ } }, { - "id": 368, + "id": 94, "name": "withDeleted", "variant": "declaration", "kind": 1024, @@ -2857,7 +2777,7 @@ } }, { - "id": 369, + "id": 95, "name": "filters", "variant": "declaration", "kind": 1024, @@ -2891,25 +2811,62 @@ "name": "Record", "package": "typescript" } + }, + { + "id": 96, + "name": "options", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Enable ORM specific defined options" + } + ] + }, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "any" + } + ], + "name": "Record", + "package": "typescript" + } } ], "groups": [ { "title": "Properties", "children": [ - 360, - 361, - 362, - 363, - 364, - 368, - 369 + 86, + 87, + 88, + 89, + 90, + 94, + 95, + 96 ] } ], "typeParameters": [ { - "id": 370, + "id": 97, "name": "Entity", "variant": "typeParam", "kind": 131072, @@ -2918,7 +2875,7 @@ ] }, { - "id": 451, + "id": 176, "name": "BaseFilterable", "variant": "declaration", "kind": 256, @@ -2933,7 +2890,7 @@ }, "children": [ { - "id": 452, + "id": 177, "name": "$and", "variant": "declaration", "kind": 1024, @@ -2955,11 +2912,11 @@ "types": [ { "type": "reference", - "target": 451, + "target": 176, "typeArguments": [ { "type": "reference", - "target": 454, + "target": 179, "name": "T", "package": "@medusajs/types", "qualifiedName": "BaseFilterable.T", @@ -2971,7 +2928,7 @@ }, { "type": "reference", - "target": 454, + "target": 179, "name": "T", "package": "@medusajs/types", "qualifiedName": "BaseFilterable.T", @@ -2982,7 +2939,7 @@ } }, { - "id": 453, + "id": 178, "name": "$or", "variant": "declaration", "kind": 1024, @@ -3004,11 +2961,11 @@ "types": [ { "type": "reference", - "target": 451, + "target": 176, "typeArguments": [ { "type": "reference", - "target": 454, + "target": 179, "name": "T", "package": "@medusajs/types", "qualifiedName": "BaseFilterable.T", @@ -3020,7 +2977,7 @@ }, { "type": "reference", - "target": 454, + "target": 179, "name": "T", "package": "@medusajs/types", "qualifiedName": "BaseFilterable.T", @@ -3035,14 +2992,14 @@ { "title": "Properties", "children": [ - 452, - 453 + 177, + 178 ] } ], "typeParameters": [ { - "id": 454, + "id": 179, "name": "T", "variant": "typeParam", "kind": 131072, @@ -3052,20 +3009,20 @@ "extendedBy": [ { "type": "reference", - "target": 391, - "name": "FilterableAuthUserProps" + "target": 117, + "name": "FilterableAuthIdentityProps" } ] }, { - "id": 509, + "id": 232, "name": "MessageBody", "variant": "declaration", "kind": 2097152, "flags": {}, "typeParameters": [ { - "id": 518, + "id": 241, "name": "T", "variant": "typeParam", "kind": 131072, @@ -3079,14 +3036,14 @@ "type": { "type": "reflection", "declaration": { - "id": 510, + "id": 233, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 511, + "id": 234, "name": "metadata", "variant": "declaration", "kind": 1024, @@ -3094,14 +3051,14 @@ "type": { "type": "reflection", "declaration": { - "id": 512, + "id": 235, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 513, + "id": 236, "name": "service", "variant": "declaration", "kind": 1024, @@ -3112,7 +3069,7 @@ } }, { - "id": 514, + "id": 237, "name": "action", "variant": "declaration", "kind": 1024, @@ -3123,7 +3080,7 @@ } }, { - "id": 515, + "id": 238, "name": "object", "variant": "declaration", "kind": 1024, @@ -3134,7 +3091,7 @@ } }, { - "id": 516, + "id": 239, "name": "eventGroupId", "variant": "declaration", "kind": 1024, @@ -3151,10 +3108,10 @@ { "title": "Properties", "children": [ - 513, - 514, - 515, - 516 + 236, + 237, + 238, + 239 ] } ] @@ -3162,14 +3119,14 @@ } }, { - "id": 517, + "id": 240, "name": "data", "variant": "declaration", "kind": 1024, "flags": {}, "type": { "type": "reference", - "target": 518, + "target": 241, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -3180,8 +3137,8 @@ { "title": "Properties", "children": [ - 511, - 517 + 234, + 240 ] } ] @@ -3189,14 +3146,14 @@ } }, { - "id": 473, + "id": 197, "name": "Message", "variant": "declaration", "kind": 2097152, "flags": {}, "typeParameters": [ { - "id": 478, + "id": 202, "name": "T", "variant": "typeParam", "kind": 131072, @@ -3210,14 +3167,14 @@ "type": { "type": "reflection", "declaration": { - "id": 474, + "id": 198, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 475, + "id": 199, "name": "eventName", "variant": "declaration", "kind": 1024, @@ -3228,18 +3185,18 @@ } }, { - "id": 476, + "id": 200, "name": "body", "variant": "declaration", "kind": 1024, "flags": {}, "type": { "type": "reference", - "target": 509, + "target": 232, "typeArguments": [ { "type": "reference", - "target": 478, + "target": 202, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -3250,7 +3207,7 @@ } }, { - "id": 477, + "id": 201, "name": "options", "variant": "declaration", "kind": 1024, @@ -3282,9 +3239,9 @@ { "title": "Properties", "children": [ - 475, - 476, - 477 + 199, + 200, + 201 ] } ] @@ -3292,14 +3249,14 @@ } }, { - "id": 485, + "id": 209, "name": "MessageFormat", "variant": "declaration", "kind": 2097152, "flags": {}, "typeParameters": [ { - "id": 495, + "id": 219, "name": "T", "variant": "typeParam", "kind": 131072, @@ -3313,14 +3270,14 @@ "type": { "type": "reflection", "declaration": { - "id": 486, + "id": 210, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 487, + "id": 211, "name": "eventName", "variant": "declaration", "kind": 1024, @@ -3331,7 +3288,7 @@ } }, { - "id": 488, + "id": 212, "name": "metadata", "variant": "declaration", "kind": 1024, @@ -3339,14 +3296,14 @@ "type": { "type": "reflection", "declaration": { - "id": 489, + "id": 213, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 490, + "id": 214, "name": "service", "variant": "declaration", "kind": 1024, @@ -3357,7 +3314,7 @@ } }, { - "id": 491, + "id": 215, "name": "action", "variant": "declaration", "kind": 1024, @@ -3368,7 +3325,7 @@ } }, { - "id": 492, + "id": 216, "name": "object", "variant": "declaration", "kind": 1024, @@ -3379,7 +3336,7 @@ } }, { - "id": 493, + "id": 217, "name": "eventGroupId", "variant": "declaration", "kind": 1024, @@ -3396,10 +3353,10 @@ { "title": "Properties", "children": [ - 490, - 491, - 492, - 493 + 214, + 215, + 216, + 217 ] } ] @@ -3407,7 +3364,7 @@ } }, { - "id": 494, + "id": 218, "name": "data", "variant": "declaration", "kind": 1024, @@ -3417,7 +3374,7 @@ "types": [ { "type": "reference", - "target": 495, + "target": 219, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -3426,7 +3383,7 @@ "type": "array", "elementType": { "type": "reference", - "target": 495, + "target": 219, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -3440,9 +3397,9 @@ { "title": "Properties", "children": [ - 487, - 488, - 494 + 211, + 212, + 218 ] } ] @@ -3450,7 +3407,7 @@ } }, { - "id": 499, + "id": 223, "name": "JoinerRelationship", "variant": "declaration", "kind": 2097152, @@ -3458,14 +3415,14 @@ "type": { "type": "reflection", "declaration": { - "id": 500, + "id": 224, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 501, + "id": 225, "name": "alias", "variant": "declaration", "kind": 1024, @@ -3476,7 +3433,7 @@ } }, { - "id": 502, + "id": 226, "name": "foreignKey", "variant": "declaration", "kind": 1024, @@ -3487,7 +3444,7 @@ } }, { - "id": 503, + "id": 227, "name": "primaryKey", "variant": "declaration", "kind": 1024, @@ -3498,7 +3455,7 @@ } }, { - "id": 504, + "id": 228, "name": "serviceName", "variant": "declaration", "kind": 1024, @@ -3509,28 +3466,7 @@ } }, { - "id": 505, - "name": "isInternalService", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "If true, the relationship is an internal service from the medusa core\nTODO: Remove when there are no more \"internal\" services" - } - ] - }, - "type": { - "type": "intrinsic", - "name": "boolean" - } - }, - { - "id": 506, + "id": 229, "name": "inverse", "variant": "declaration", "kind": 1024, @@ -3551,7 +3487,7 @@ } }, { - "id": 507, + "id": 230, "name": "isList", "variant": "declaration", "kind": 1024, @@ -3572,7 +3508,7 @@ } }, { - "id": 508, + "id": 231, "name": "args", "variant": "declaration", "kind": 1024, @@ -3612,14 +3548,13 @@ { "title": "Properties", "children": [ - 501, - 502, - 503, - 504, - 505, - 506, - 507, - 508 + 225, + 226, + 227, + 228, + 229, + 230, + 231 ] } ] @@ -3627,14 +3562,14 @@ } }, { - "id": 496, + "id": 220, "name": "JoinerServiceConfigAlias", "variant": "declaration", "kind": 256, "flags": {}, "children": [ { - "id": 497, + "id": 221, "name": "name", "variant": "declaration", "kind": 1024, @@ -3657,7 +3592,7 @@ } }, { - "id": 498, + "id": 222, "name": "args", "variant": "declaration", "kind": 1024, @@ -3697,21 +3632,21 @@ { "title": "Properties", "children": [ - 497, - 498 + 221, + 222 ] } ] }, { - "id": 455, + "id": 180, "name": "JoinerServiceConfig", "variant": "declaration", "kind": 256, "flags": {}, "children": [ { - "id": 456, + "id": 181, "name": "serviceName", "variant": "declaration", "kind": 1024, @@ -3722,7 +3657,7 @@ } }, { - "id": 457, + "id": 182, "name": "alias", "variant": "declaration", "kind": 1024, @@ -3742,7 +3677,7 @@ "types": [ { "type": "reference", - "target": 496, + "target": 220, "name": "JoinerServiceConfigAlias", "package": "@medusajs/types" }, @@ -3750,7 +3685,7 @@ "type": "array", "elementType": { "type": "reference", - "target": 496, + "target": 220, "name": "JoinerServiceConfigAlias", "package": "@medusajs/types" } @@ -3759,7 +3694,7 @@ } }, { - "id": 458, + "id": 183, "name": "fieldAlias", "variant": "declaration", "kind": 1024, @@ -3795,14 +3730,14 @@ { "type": "reflection", "declaration": { - "id": 459, + "id": 184, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 460, + "id": 185, "name": "path", "variant": "declaration", "kind": 1024, @@ -3813,7 +3748,7 @@ } }, { - "id": 461, + "id": 186, "name": "forwardArgumentsOnPath", "variant": "declaration", "kind": 1024, @@ -3831,8 +3766,8 @@ { "title": "Properties", "children": [ - 460, - 461 + 185, + 186 ] } ] @@ -3846,7 +3781,7 @@ } }, { - "id": 462, + "id": 187, "name": "primaryKeys", "variant": "declaration", "kind": 1024, @@ -3860,7 +3795,7 @@ } }, { - "id": 463, + "id": 188, "name": "relationships", "variant": "declaration", "kind": 1024, @@ -3871,14 +3806,14 @@ "type": "array", "elementType": { "type": "reference", - "target": 499, + "target": 223, "name": "JoinerRelationship", "package": "@medusajs/types" } } }, { - "id": 464, + "id": 189, "name": "extends", "variant": "declaration", "kind": 1024, @@ -3890,14 +3825,14 @@ "elementType": { "type": "reflection", "declaration": { - "id": 465, + "id": 190, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 466, + "id": 191, "name": "serviceName", "variant": "declaration", "kind": 1024, @@ -3908,14 +3843,14 @@ } }, { - "id": 467, + "id": 192, "name": "relationship", "variant": "declaration", "kind": 1024, "flags": {}, "type": { "type": "reference", - "target": 499, + "target": 223, "name": "JoinerRelationship", "package": "@medusajs/types" } @@ -3925,8 +3860,8 @@ { "title": "Properties", "children": [ - 466, - 467 + 191, + 192 ] } ] @@ -3935,7 +3870,7 @@ } }, { - "id": 468, + "id": 193, "name": "args", "variant": "declaration", "kind": 1024, @@ -3975,19 +3910,19 @@ { "title": "Properties", "children": [ - 456, - 457, - 458, - 462, - 463, - 464, - 468 + 181, + 182, + 183, + 187, + 188, + 189, + 193 ] } ] }, { - "id": 409, + "id": 134, "name": "ModuleJoinerConfig", "variant": "declaration", "kind": 2097152, @@ -4004,7 +3939,7 @@ "typeArguments": [ { "type": "reference", - "target": 455, + "target": 180, "name": "JoinerServiceConfig", "package": "@medusajs/types" }, @@ -4036,14 +3971,14 @@ { "type": "reflection", "declaration": { - "id": 410, + "id": 135, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 411, + "id": 136, "name": "schema", "variant": "declaration", "kind": 1024, @@ -4064,7 +3999,7 @@ } }, { - "id": 412, + "id": 137, "name": "relationships", "variant": "declaration", "kind": 1024, @@ -4075,14 +4010,14 @@ "type": "array", "elementType": { "type": "reference", - "target": 469, + "target": 194, "name": "ModuleJoinerRelationship", "package": "@medusajs/types" } } }, { - "id": 413, + "id": 138, "name": "extends", "variant": "declaration", "kind": 1024, @@ -4094,14 +4029,14 @@ "elementType": { "type": "reflection", "declaration": { - "id": 414, + "id": 139, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 415, + "id": 140, "name": "serviceName", "variant": "declaration", "kind": 1024, @@ -4112,7 +4047,7 @@ } }, { - "id": 416, + "id": 141, "name": "fieldAlias", "variant": "declaration", "kind": 1024, @@ -4140,14 +4075,14 @@ { "type": "reflection", "declaration": { - "id": 417, + "id": 142, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 418, + "id": 143, "name": "path", "variant": "declaration", "kind": 1024, @@ -4158,7 +4093,7 @@ } }, { - "id": 419, + "id": 144, "name": "forwardArgumentsOnPath", "variant": "declaration", "kind": 1024, @@ -4174,7 +4109,7 @@ } }, { - "id": 420, + "id": 145, "name": "isList", "variant": "declaration", "kind": 1024, @@ -4191,9 +4126,9 @@ { "title": "Properties", "children": [ - 418, - 419, - 420 + 143, + 144, + 145 ] } ] @@ -4207,14 +4142,14 @@ } }, { - "id": 421, + "id": 146, "name": "relationship", "variant": "declaration", "kind": 1024, "flags": {}, "type": { "type": "reference", - "target": 469, + "target": 194, "name": "ModuleJoinerRelationship", "package": "@medusajs/types" } @@ -4224,9 +4159,9 @@ { "title": "Properties", "children": [ - 415, - 416, - 421 + 140, + 141, + 146 ] } ] @@ -4235,7 +4170,7 @@ } }, { - "id": 422, + "id": 147, "name": "serviceName", "variant": "declaration", "kind": 1024, @@ -4248,7 +4183,7 @@ } }, { - "id": 423, + "id": 148, "name": "primaryKeys", "variant": "declaration", "kind": 1024, @@ -4264,7 +4199,7 @@ } }, { - "id": 424, + "id": 149, "name": "isLink", "variant": "declaration", "kind": 1024, @@ -4285,7 +4220,7 @@ } }, { - "id": 425, + "id": 150, "name": "linkableKeys", "variant": "declaration", "kind": 1024, @@ -4321,7 +4256,7 @@ } }, { - "id": 426, + "id": 151, "name": "isReadOnlyLink", "variant": "declaration", "kind": 1024, @@ -4342,7 +4277,7 @@ } }, { - "id": 427, + "id": 152, "name": "databaseConfig", "variant": "declaration", "kind": 1024, @@ -4352,14 +4287,14 @@ "type": { "type": "reflection", "declaration": { - "id": 428, + "id": 153, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 429, + "id": 154, "name": "tableName", "variant": "declaration", "kind": 1024, @@ -4380,7 +4315,7 @@ } }, { - "id": 430, + "id": 155, "name": "idPrefix", "variant": "declaration", "kind": 1024, @@ -4401,7 +4336,7 @@ } }, { - "id": 431, + "id": 156, "name": "extraFields", "variant": "declaration", "kind": 1024, @@ -4422,14 +4357,14 @@ { "type": "reflection", "declaration": { - "id": 432, + "id": 157, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 433, + "id": 158, "name": "type", "variant": "declaration", "kind": 1024, @@ -4525,7 +4460,7 @@ } }, { - "id": 434, + "id": 159, "name": "defaultValue", "variant": "declaration", "kind": 1024, @@ -4538,7 +4473,7 @@ } }, { - "id": 435, + "id": 160, "name": "nullable", "variant": "declaration", "kind": 1024, @@ -4551,7 +4486,7 @@ } }, { - "id": 436, + "id": 161, "name": "options", "variant": "declaration", "kind": 1024, @@ -4591,10 +4526,10 @@ { "title": "Properties", "children": [ - 433, - 434, - 435, - 436 + 158, + 159, + 160, + 161 ] } ] @@ -4610,9 +4545,9 @@ { "title": "Properties", "children": [ - 429, - 430, - 431 + 154, + 155, + 156 ] } ] @@ -4624,15 +4559,15 @@ { "title": "Properties", "children": [ - 411, - 412, - 413, - 422, - 423, - 424, - 425, - 426, - 427 + 136, + 137, + 138, + 147, + 148, + 149, + 150, + 151, + 152 ] } ] @@ -4642,7 +4577,7 @@ } }, { - "id": 469, + "id": 194, "name": "ModuleJoinerRelationship", "variant": "declaration", "kind": 2097152, @@ -4652,42 +4587,21 @@ "types": [ { "type": "reference", - "target": 499, + "target": 223, "name": "JoinerRelationship", "package": "@medusajs/types" }, { "type": "reflection", "declaration": { - "id": 470, + "id": 195, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 471, - "name": "isInternalService", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services" - } - ] - }, - "type": { - "type": "intrinsic", - "name": "boolean" - } - }, - { - "id": 472, + "id": 196, "name": "deleteCascade", "variant": "declaration", "kind": 1024, @@ -4712,8 +4626,7 @@ { "title": "Properties", "children": [ - 471, - 472 + 196 ] } ] @@ -4723,7 +4636,7 @@ } }, { - "id": 332, + "id": 59, "name": "IModuleService", "variant": "declaration", "kind": 256, @@ -4731,20 +4644,20 @@ "extendedBy": [ { "type": "reference", - "target": 277, + "target": 4, "name": "IAuthModuleService" } ] }, { - "id": 479, + "id": 203, "name": "MessageAggregatorFormat", "variant": "declaration", "kind": 256, "flags": {}, "children": [ { - "id": 480, + "id": 204, "name": "groupBy", "variant": "declaration", "kind": 1024, @@ -4760,7 +4673,7 @@ } }, { - "id": 481, + "id": 205, "name": "sortBy", "variant": "declaration", "kind": 1024, @@ -4770,20 +4683,20 @@ "type": { "type": "reflection", "declaration": { - "id": 482, + "id": 206, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "indexSignature": { - "id": 483, + "id": 207, "name": "__index", "variant": "signature", "kind": 8192, "flags": {}, "parameters": [ { - "id": 484, + "id": 208, "name": "key", "variant": "param", "kind": 32768, @@ -4823,35 +4736,35 @@ { "title": "Properties", "children": [ - 480, - 481 + 204, + 205 ] } ] }, { - "id": 437, + "id": 162, "name": "IMessageAggregator", "variant": "declaration", "kind": 256, "flags": {}, "children": [ { - "id": 438, + "id": 163, "name": "save", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 439, + "id": 164, "name": "save", "variant": "signature", "kind": 4096, "flags": {}, "parameters": [ { - "id": 440, + "id": 165, "name": "msg", "variant": "param", "kind": 32768, @@ -4861,7 +4774,7 @@ "types": [ { "type": "reference", - "target": 473, + "target": 197, "name": "Message", "package": "@medusajs/types" }, @@ -4869,7 +4782,7 @@ "type": "array", "elementType": { "type": "reference", - "target": 473, + "target": 197, "name": "Message", "package": "@medusajs/types" } @@ -4886,21 +4799,21 @@ ] }, { - "id": 441, + "id": 166, "name": "getMessages", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 442, + "id": 167, "name": "getMessages", "variant": "signature", "kind": 4096, "flags": {}, "parameters": [ { - "id": 443, + "id": 168, "name": "format", "variant": "param", "kind": 32768, @@ -4909,7 +4822,7 @@ }, "type": { "type": "reference", - "target": 479, + "target": 203, "name": "MessageAggregatorFormat", "package": "@medusajs/types" } @@ -4930,7 +4843,7 @@ "type": "array", "elementType": { "type": "reference", - "target": 473, + "target": 197, "name": "Message", "package": "@medusajs/types" } @@ -4943,14 +4856,14 @@ ] }, { - "id": 444, + "id": 169, "name": "clearMessages", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 445, + "id": 170, "name": "clearMessages", "variant": "signature", "kind": 4096, @@ -4963,21 +4876,21 @@ ] }, { - "id": 446, + "id": 171, "name": "saveRawMessageData", "variant": "declaration", "kind": 2048, "flags": {}, "signatures": [ { - "id": 447, + "id": 172, "name": "saveRawMessageData", "variant": "signature", "kind": 4096, "flags": {}, "typeParameter": [ { - "id": 448, + "id": 173, "name": "T", "variant": "typeParam", "kind": 131072, @@ -4986,7 +4899,7 @@ ], "parameters": [ { - "id": 449, + "id": 174, "name": "messageData", "variant": "param", "kind": 32768, @@ -4996,11 +4909,11 @@ "types": [ { "type": "reference", - "target": 485, + "target": 209, "typeArguments": [ { "type": "reference", - "target": 448, + "target": 173, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -5013,11 +4926,11 @@ "type": "array", "elementType": { "type": "reference", - "target": 485, + "target": 209, "typeArguments": [ { "type": "reference", - "target": 448, + "target": 173, "name": "T", "package": "@medusajs/types", "refersToTypeParameter": true @@ -5031,7 +4944,7 @@ } }, { - "id": 450, + "id": 175, "name": "options", "variant": "param", "kind": 32768, @@ -5071,16 +4984,16 @@ { "title": "Methods", "children": [ - 438, - 441, - 444, - 446 + 163, + 166, + 169, + 171 ] } ] }, { - "id": 379, + "id": 105, "name": "Context", "variant": "declaration", "kind": 256, @@ -5095,7 +5008,7 @@ }, "children": [ { - "id": 380, + "id": 106, "name": "__type", "variant": "declaration", "kind": 1024, @@ -5108,7 +5021,7 @@ } }, { - "id": 381, + "id": 107, "name": "transactionManager", "variant": "declaration", "kind": 1024, @@ -5141,14 +5054,14 @@ }, "type": { "type": "reference", - "target": 390, + "target": 116, "name": "TManager", "package": "@medusajs/types", "refersToTypeParameter": true } }, { - "id": 382, + "id": 108, "name": "manager", "variant": "declaration", "kind": 1024, @@ -5181,14 +5094,14 @@ }, "type": { "type": "reference", - "target": 390, + "target": 116, "name": "TManager", "package": "@medusajs/types", "refersToTypeParameter": true } }, { - "id": 383, + "id": 109, "name": "isolationLevel", "variant": "declaration", "kind": 1024, @@ -5241,7 +5154,7 @@ } }, { - "id": 384, + "id": 110, "name": "enableNestedTransactions", "variant": "declaration", "kind": 1024, @@ -5262,7 +5175,7 @@ } }, { - "id": 385, + "id": 111, "name": "eventGroupId", "variant": "declaration", "kind": 1024, @@ -5283,7 +5196,7 @@ } }, { - "id": 386, + "id": 112, "name": "transactionId", "variant": "declaration", "kind": 1024, @@ -5304,7 +5217,7 @@ } }, { - "id": 387, + "id": 113, "name": "messageAggregator", "variant": "declaration", "kind": 1024, @@ -5321,13 +5234,13 @@ }, "type": { "type": "reference", - "target": 437, + "target": 162, "name": "IMessageAggregator", "package": "@medusajs/types" } }, { - "id": 388, + "id": 114, "name": "requestId", "variant": "declaration", "kind": 1024, @@ -5348,7 +5261,7 @@ } }, { - "id": 389, + "id": 115, "name": "idempotencyKey", "variant": "declaration", "kind": 1024, @@ -5373,22 +5286,22 @@ { "title": "Properties", "children": [ - 380, - 381, - 382, - 383, - 384, - 385, - 386, - 387, - 388, - 389 + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115 ] } ], "typeParameters": [ { - "id": 390, + "id": 116, "name": "TManager", "variant": "typeParam", "kind": 131072, @@ -5405,895 +5318,879 @@ { "title": "Interfaces", "children": [ - 371, - 396, - 404, - 391, - 353, - 346, - 277, - 359, - 451, - 496, - 455, - 332, - 479, - 437, - 379 + 98, + 122, + 129, + 117, + 79, + 73, + 4, + 85, + 176, + 220, + 180, + 59, + 203, + 162, + 105 ] }, { "title": "Type Aliases", "children": [ - 509, - 473, - 485, - 499, - 409, - 469 + 232, + 197, + 209, + 223, + 134, + 194 ] } ], "packageName": "@medusajs/types", "symbolIdMap": { - "273": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "0": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "" }, - "277": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "4": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService" }, - "278": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "5": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.authenticate" }, - "279": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "6": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.authenticate" }, - "280": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "7": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "provider" }, - "281": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "8": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "providerData" }, - "282": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "9": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.validateCallback" }, - "283": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "10": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.validateCallback" }, - "284": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "11": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "provider" }, - "285": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "12": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "providerData" }, - "286": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "13": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.retrieve" }, - "287": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "14": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.retrieve" }, - "288": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "15": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "id" }, - "289": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "16": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "config" }, - "290": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "17": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "291": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "18": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.list" }, - "292": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "19": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.list" }, - "293": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "20": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "filters" }, - "294": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "21": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "config" }, - "295": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "22": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "296": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "23": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.listAndCount" }, - "297": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "24": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.listAndCount" }, - "298": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "25": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "filters" }, - "299": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "26": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "config" }, - "300": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "27": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "301": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "28": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.create" }, - "302": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "29": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.create" }, - "303": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "30": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "data" }, - "304": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "31": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "305": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "32": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.create" }, - "306": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "33": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "data" }, - "307": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "34": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "308": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "35": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.update" }, - "309": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "36": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.update" }, - "310": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "37": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "data" }, - "311": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "38": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "312": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "39": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.update" }, - "313": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "40": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "data" }, - "314": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "41": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "315": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "42": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.delete" }, - "316": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "43": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "IAuthModuleService.delete" }, - "317": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "44": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "ids" }, - "318": { - "sourceFileName": "../../../packages/types/src/auth/service.ts", + "45": { + "sourceFileName": "../../../../packages/core/types/src/auth/service.ts", "qualifiedName": "sharedContext" }, - "332": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "59": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "IModuleService" }, - "346": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "73": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "AuthenticationInput" }, - "347": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "74": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.url" }, - "348": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "75": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.headers" }, - "349": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "76": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.query" }, - "350": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "77": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.body" }, - "351": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", - "qualifiedName": "__type.authScope" - }, - "352": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "78": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.protocol" }, - "353": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "79": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "AuthenticationResponse" }, - "354": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "80": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.success" }, - "355": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", - "qualifiedName": "__type.authUser" + "81": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", + "qualifiedName": "__type.authIdentity" }, - "356": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "82": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.error" }, - "357": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "83": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.location" }, - "358": { - "sourceFileName": "../../../packages/types/src/auth/common/provider.ts", + "84": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/provider.ts", "qualifiedName": "__type.successRedirectUrl" }, - "359": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "85": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig" }, - "360": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "86": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.select" }, - "361": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "87": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.skip" }, - "362": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "88": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.take" }, - "363": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "89": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.relations" }, - "364": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "90": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.order" }, - "365": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "91": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "__type" }, - "366": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "92": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "__type.__index" }, - "368": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "94": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.withDeleted" }, - "369": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "95": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.filters" }, - "370": { - "sourceFileName": "../../../packages/types/src/common/common.ts", + "96": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", + "qualifiedName": "FindConfig.options" + }, + "97": { + "sourceFileName": "../../../../packages/core/types/src/common/common.ts", "qualifiedName": "FindConfig.Entity" }, - "371": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "AuthUserDTO" + "98": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "AuthIdentityDTO" }, - "372": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "99": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.id" }, - "373": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "100": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.provider" }, - "374": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "101": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.entity_id" }, - "375": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.scope" - }, - "376": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.provider_metadata" - }, - "377": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.user_metadata" - }, - "378": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "102": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.app_metadata" }, - "379": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "103": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.provider_metadata" + }, + "104": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.user_metadata" + }, + "105": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "Context" }, - "380": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "106": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.__type" }, - "381": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "107": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.transactionManager" }, - "382": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "108": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.manager" }, - "383": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "109": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.isolationLevel" }, - "384": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "110": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.enableNestedTransactions" }, - "385": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "111": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.eventGroupId" }, - "386": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "112": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.transactionId" }, - "387": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "113": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.messageAggregator" }, - "388": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "114": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.requestId" }, - "389": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "115": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.idempotencyKey" }, - "390": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "116": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "TManager" }, - "391": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "FilterableAuthUserProps" + "117": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "FilterableAuthIdentityProps" }, - "392": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "FilterableAuthUserProps.id" + "118": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "FilterableAuthIdentityProps.id" }, - "393": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "FilterableAuthUserProps.provider" + "119": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "FilterableAuthIdentityProps.provider" }, - "394": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "120": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable.$and" }, - "395": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "121": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable.$or" }, - "396": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "CreateAuthUserDTO" + "122": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "CreateAuthIdentityDTO" }, - "397": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "123": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.id" }, - "398": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "124": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.provider" }, - "399": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "125": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.entity_id" }, - "400": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.scope" - }, - "401": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.provider_metadata" - }, - "402": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.user_metadata" - }, - "403": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "126": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.app_metadata" }, - "404": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "UpdateAuthUserDTO" + "127": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.provider_metadata" }, - "405": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "128": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.user_metadata" + }, + "129": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "UpdateAuthIdentityDTO" + }, + "130": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.id" }, - "406": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.provider_metadata" - }, - "407": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", - "qualifiedName": "__type.user_metadata" - }, - "408": { - "sourceFileName": "../../../packages/types/src/auth/common/auth-user.ts", + "131": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", "qualifiedName": "__type.app_metadata" }, - "409": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "132": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.provider_metadata" + }, + "133": { + "sourceFileName": "../../../../packages/core/types/src/auth/common/auth-identity.ts", + "qualifiedName": "__type.user_metadata" + }, + "134": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "ModuleJoinerConfig" }, - "410": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "135": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "411": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "136": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.schema" }, - "412": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "137": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.relationships" }, - "413": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "138": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.extends" }, - "414": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "139": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "415": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "140": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.serviceName" }, - "416": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "141": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.fieldAlias" }, - "417": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "142": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "418": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "143": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.path" }, - "419": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "144": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.forwardArgumentsOnPath" }, - "420": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "145": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.isList" }, - "421": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "146": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.relationship" }, - "422": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "147": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.serviceName" }, - "423": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "148": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.primaryKeys" }, - "424": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "149": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.isLink" }, - "425": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "150": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.linkableKeys" }, - "426": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "151": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.isReadOnlyLink" }, - "427": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "152": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.databaseConfig" }, - "428": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "153": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "429": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "154": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.tableName" }, - "430": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "155": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.idPrefix" }, - "431": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "156": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.extraFields" }, - "432": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "157": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "433": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "158": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.type" }, - "434": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "159": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.defaultValue" }, - "435": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "160": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.nullable" }, - "436": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "161": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.options" }, - "437": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "162": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator" }, - "438": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "163": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.save" }, - "439": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "164": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.save" }, - "440": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "165": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "msg" }, - "441": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "166": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.getMessages" }, - "442": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "167": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.getMessages" }, - "443": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "168": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "format" }, - "444": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "169": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.clearMessages" }, - "445": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "170": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.clearMessages" }, - "446": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "171": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.saveRawMessageData" }, - "447": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "172": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "IMessageAggregator.saveRawMessageData" }, - "448": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "173": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "T" }, - "449": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "174": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "messageData" }, - "450": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "175": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "options" }, - "451": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "176": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable" }, - "452": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "177": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable.$and" }, - "453": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "178": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable.$or" }, - "454": { - "sourceFileName": "../../../packages/types/src/dal/index.ts", + "179": { + "sourceFileName": "../../../../packages/core/types/src/dal/index.ts", "qualifiedName": "BaseFilterable.T" }, - "455": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "180": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig" }, - "456": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "181": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.serviceName" }, - "457": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "182": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.alias" }, - "458": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "183": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.fieldAlias" }, - "459": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "184": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type" }, - "460": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "185": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.path" }, - "461": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "186": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.forwardArgumentsOnPath" }, - "462": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "187": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.primaryKeys" }, - "463": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "188": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.relationships" }, - "464": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "189": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.extends" }, - "465": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "190": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type" }, - "466": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "191": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.serviceName" }, - "467": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "192": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.relationship" }, - "468": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "193": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfig.args" }, - "469": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "194": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "ModuleJoinerRelationship" }, - "470": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "195": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type" }, - "471": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", - "qualifiedName": "__type.isInternalService" - }, - "472": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "196": { + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "__type.deleteCascade" }, - "473": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "197": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "Message" }, - "474": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "198": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type" }, - "475": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "199": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.eventName" }, - "476": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "200": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.body" }, - "477": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "201": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.options" }, - "478": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "202": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "T" }, - "479": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "203": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "MessageAggregatorFormat" }, - "480": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "204": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "MessageAggregatorFormat.groupBy" }, - "481": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "205": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "MessageAggregatorFormat.sortBy" }, - "482": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "206": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type" }, - "483": { - "sourceFileName": "../../../packages/types/src/shared-context.ts", + "207": { + "sourceFileName": "../../../../packages/core/types/src/shared-context.ts", "qualifiedName": "__type.__index" }, - "485": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "209": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "MessageFormat" }, - "486": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "210": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type" }, - "487": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "211": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.eventName" }, - "488": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "212": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.metadata" }, - "489": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "213": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type" }, - "490": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "214": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.service" }, - "491": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "215": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.action" }, - "492": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "216": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.object" }, - "493": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "217": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.eventGroupId" }, - "494": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "218": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.data" }, - "495": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "219": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "T" }, - "496": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "220": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfigAlias" }, - "497": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "221": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfigAlias.name" }, - "498": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "222": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerServiceConfigAlias.args" }, - "499": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "223": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "JoinerRelationship" }, - "500": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "224": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type" }, - "501": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "225": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.alias" }, - "502": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "226": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.foreignKey" }, - "503": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "227": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.primaryKey" }, - "504": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "228": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.serviceName" }, - "505": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", - "qualifiedName": "__type.isInternalService" - }, - "506": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "229": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.inverse" }, - "507": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "230": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.isList" }, - "508": { - "sourceFileName": "../../../packages/types/src/joiner/index.ts", + "231": { + "sourceFileName": "../../../../packages/core/types/src/joiner/index.ts", "qualifiedName": "__type.args" }, - "509": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "232": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "MessageBody" }, - "510": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "233": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type" }, - "511": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "234": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.metadata" }, - "512": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "235": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type" }, - "513": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "236": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.service" }, - "514": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "237": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.action" }, - "515": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "238": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.object" }, - "516": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "239": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.eventGroupId" }, - "517": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "240": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "__type.data" }, - "518": { - "sourceFileName": "../../../packages/types/src/event-bus/common.ts", + "241": { + "sourceFileName": "../../../../packages/core/types/src/event-bus/common.ts", "qualifiedName": "T" } } diff --git a/www/utils/generated/typedoc-json-output/fulfillment-provider.json b/www/utils/generated/typedoc-json-output/fulfillment-provider.json new file mode 100644 index 0000000000..702f09ddc4 --- /dev/null +++ b/www/utils/generated/typedoc-json-output/fulfillment-provider.json @@ -0,0 +1,1146 @@ +{ + "id": 0, + "name": "fulfillment-provider", + "variant": "project", + "kind": 1, + "flags": {}, + "children": [ + { + "id": 1, + "name": "AbstractFulfillmentProviderService", + "variant": "declaration", + "kind": 128, + "flags": {}, + "children": [ + { + "id": 2, + "name": "identifier", + "variant": "declaration", + "kind": 1024, + "flags": { + "isStatic": true + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 3, + "name": "_isFulfillmentService", + "variant": "declaration", + "kind": 1024, + "flags": { + "isStatic": true + }, + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "defaultValue": "true" + }, + { + "id": 4, + "name": "isFulfillmentService", + "variant": "declaration", + "kind": 2048, + "flags": { + "isStatic": true + }, + "signatures": [ + { + "id": 5, + "name": "isFulfillmentService", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 6, + "name": "obj", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "intrinsic", + "name": "any" + } + } + ] + }, + { + "id": 7, + "name": "constructor", + "variant": "declaration", + "kind": 512, + "flags": {}, + "signatures": [ + { + "id": 8, + "name": "new AbstractFulfillmentProviderService", + "variant": "signature", + "kind": 16384, + "flags": {}, + "type": { + "type": "reference", + "target": 1, + "name": "AbstractFulfillmentProviderService", + "package": "@medusajs/utils" + } + } + ] + }, + { + "id": 9, + "name": "getIdentifier", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 10, + "name": "getIdentifier", + "variant": "signature", + "kind": 4096, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getIdentifier" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getIdentifier" + } + }, + { + "id": 11, + "name": "getFulfillmentOptions", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 12, + "name": "getFulfillmentOptions", + "variant": "signature", + "kind": 4096, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "array", + "elementType": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "intrinsic", + "name": "unknown" + } + ], + "name": "Record", + "package": "typescript" + } + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getFulfillmentOptions" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getFulfillmentOptions" + } + }, + { + "id": 13, + "name": "validateFulfillmentData", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 14, + "name": "validateFulfillmentData", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 15, + "name": "optionData", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 16, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 17, + "name": "context", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.validateFulfillmentData" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.validateFulfillmentData" + } + }, + { + "id": 18, + "name": "validateOption", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 19, + "name": "validateOption", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 20, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "boolean" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.validateOption" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.validateOption" + } + }, + { + "id": 21, + "name": "canCalculate", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 22, + "name": "canCalculate", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 23, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "void" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.canCalculate" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.canCalculate" + } + }, + { + "id": 24, + "name": "calculatePrice", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 25, + "name": "calculatePrice", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 26, + "name": "optionData", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 27, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 28, + "name": "cart", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "void" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.calculatePrice" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.calculatePrice" + } + }, + { + "id": 29, + "name": "createFulfillment", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 30, + "name": "createFulfillment", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 31, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 32, + "name": "items", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 33, + "name": "order", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 34, + "name": "fulfillment", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.createFulfillment" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.createFulfillment" + } + }, + { + "id": 35, + "name": "cancelFulfillment", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 36, + "name": "cancelFulfillment", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 37, + "name": "fulfillment", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.cancelFulfillment" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.cancelFulfillment" + } + }, + { + "id": 38, + "name": "getFulfillmentDocuments", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 39, + "name": "getFulfillmentDocuments", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 40, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "array", + "elementType": { + "type": "intrinsic", + "name": "never" + } + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getFulfillmentDocuments" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getFulfillmentDocuments" + } + }, + { + "id": 41, + "name": "createReturnFulfillment", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 42, + "name": "createReturnFulfillment", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 43, + "name": "fromData", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "any" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.createReturnFulfillment" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.createReturnFulfillment" + } + }, + { + "id": 44, + "name": "getReturnDocuments", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 45, + "name": "getReturnDocuments", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 46, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "array", + "elementType": { + "type": "intrinsic", + "name": "never" + } + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getReturnDocuments" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getReturnDocuments" + } + }, + { + "id": 47, + "name": "getShipmentDocuments", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 48, + "name": "getShipmentDocuments", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 49, + "name": "data", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "array", + "elementType": { + "type": "intrinsic", + "name": "never" + } + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getShipmentDocuments" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.getShipmentDocuments" + } + }, + { + "id": 50, + "name": "retrieveDocuments", + "variant": "declaration", + "kind": 2048, + "flags": {}, + "signatures": [ + { + "id": 51, + "name": "retrieveDocuments", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 52, + "name": "fulfillmentData", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "id": 53, + "name": "documentType", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "intrinsic", + "name": "any" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Promise" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "void" + } + ], + "name": "Promise", + "package": "typescript" + }, + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.retrieveDocuments" + } + } + ], + "implementationOf": { + "type": "reference", + "target": -1, + "name": "IFulfillmentProvider.retrieveDocuments" + } + } + ], + "groups": [ + { + "title": "Constructors", + "children": [ + 7 + ] + }, + { + "title": "Properties", + "children": [ + 2, + 3 + ] + }, + { + "title": "Methods", + "children": [ + 4, + 9, + 11, + 13, + 18, + 21, + 24, + 29, + 35, + 38, + 41, + 44, + 47, + 50 + ] + } + ], + "implementedTypes": [ + { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/src/fulfillment/provider.ts", + "qualifiedName": "IFulfillmentProvider" + }, + "name": "IFulfillmentProvider", + "package": "@medusajs/types" + } + ] + } + ], + "groups": [ + { + "title": "Classes", + "children": [ + 1 + ] + } + ], + "packageName": "@medusajs/utils", + "symbolIdMap": { + "0": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "" + }, + "1": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService" + }, + "2": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.identifier" + }, + "3": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService._isFulfillmentService" + }, + "4": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.isFulfillmentService" + }, + "5": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.isFulfillmentService" + }, + "6": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "obj" + }, + "9": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getIdentifier" + }, + "10": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getIdentifier" + }, + "11": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getFulfillmentOptions" + }, + "12": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getFulfillmentOptions" + }, + "13": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.validateFulfillmentData" + }, + "14": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.validateFulfillmentData" + }, + "15": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "optionData" + }, + "16": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "17": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "context" + }, + "18": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.validateOption" + }, + "19": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.validateOption" + }, + "20": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "21": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.canCalculate" + }, + "22": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.canCalculate" + }, + "23": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "24": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.calculatePrice" + }, + "25": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.calculatePrice" + }, + "26": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "optionData" + }, + "27": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "28": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "cart" + }, + "29": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.createFulfillment" + }, + "30": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.createFulfillment" + }, + "31": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "32": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "items" + }, + "33": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "order" + }, + "34": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "fulfillment" + }, + "35": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.cancelFulfillment" + }, + "36": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.cancelFulfillment" + }, + "37": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "fulfillment" + }, + "38": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getFulfillmentDocuments" + }, + "39": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getFulfillmentDocuments" + }, + "40": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "41": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.createReturnFulfillment" + }, + "42": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.createReturnFulfillment" + }, + "43": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "fromData" + }, + "44": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getReturnDocuments" + }, + "45": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getReturnDocuments" + }, + "46": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "47": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getShipmentDocuments" + }, + "48": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.getShipmentDocuments" + }, + "49": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "data" + }, + "50": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.retrieveDocuments" + }, + "51": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "AbstractFulfillmentProviderService.retrieveDocuments" + }, + "52": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "fulfillmentData" + }, + "53": { + "sourceFileName": "../../../../packages/core/utils/src/fulfillment/provider.ts", + "qualifiedName": "documentType" + } + } +} \ No newline at end of file diff --git a/www/utils/generated/typedoc-json-output/medusa-config.json b/www/utils/generated/typedoc-json-output/medusa-config.json index d5414a55b9..b1cbe6b9f6 100644 --- a/www/utils/generated/typedoc-json-output/medusa-config.json +++ b/www/utils/generated/typedoc-json-output/medusa-config.json @@ -1,12 +1,265 @@ { - "id": 16332, + "id": 25, "name": "medusa-config", "variant": "project", "kind": 1, "flags": {}, "children": [ { - "id": 16333, + "id": 26, + "name": "AdminOptions", + "variant": "declaration", + "kind": 256, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Admin dashboard configurations." + } + ] + }, + "children": [ + { + "id": 27, + "name": "disable", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Whether to disable the admin dashboard. If set to " + }, + { + "kind": "code", + "text": "`true`" + }, + { + "kind": "text", + "text": ", the admin dashboard is disabled,\nin both development and production environments. The default value is " + }, + { + "kind": "code", + "text": "`false`" + }, + { + "kind": "text", + "text": "." + } + ] + }, + "type": { + "type": "intrinsic", + "name": "boolean" + } + }, + { + "id": 28, + "name": "path", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The path to the admin dashboard. The default value is " + }, + { + "kind": "code", + "text": "`/app`" + }, + { + "kind": "text", + "text": ".\n\nThe value cannot be one of the reserved paths:\n- " + }, + { + "kind": "code", + "text": "`/admin`" + }, + { + "kind": "text", + "text": "\n- " + }, + { + "kind": "code", + "text": "`/store`" + }, + { + "kind": "text", + "text": "\n- " + }, + { + "kind": "code", + "text": "`/auth`" + }, + { + "kind": "text", + "text": "\n- " + }, + { + "kind": "code", + "text": "`/`" + } + ] + }, + "type": { + "type": "templateLiteral", + "head": "/", + "tail": [ + [ + { + "type": "intrinsic", + "name": "string" + }, + "" + ] + ] + } + }, + { + "id": 29, + "name": "outDir", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The directory where the admin build is output. This is where the build process places the generated files.\nThe default value is " + }, + { + "kind": "code", + "text": "`./build`" + }, + { + "kind": "text", + "text": "." + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 30, + "name": "backendUrl", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The URL of your Medusa backend. Defaults to an empty string, which means requests will hit the same server that serves the dashboard." + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 31, + "name": "vite", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration\nand returns the modified configuration. The default value is " + }, + { + "kind": "code", + "text": "`undefined`" + }, + { + "kind": "text", + "text": "." + } + ] + }, + "type": { + "type": "reflection", + "declaration": { + "id": 32, + "name": "__type", + "variant": "declaration", + "kind": 65536, + "flags": {}, + "signatures": [ + { + "id": 33, + "name": "__type", + "variant": "signature", + "kind": 4096, + "flags": {}, + "parameters": [ + { + "id": 34, + "name": "config", + "variant": "param", + "kind": 32768, + "flags": {}, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/node_modules/vite/dist/node/index.d.ts", + "qualifiedName": "InlineConfig" + }, + "name": "InlineConfig", + "package": "vite" + } + } + ], + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../../../packages/core/types/node_modules/vite/dist/node/index.d.ts", + "qualifiedName": "InlineConfig" + }, + "name": "InlineConfig", + "package": "vite" + } + } + ] + } + } + } + ], + "groups": [ + { + "title": "Properties", + "children": [ + 27, + 28, + 29, + 30, + 31 + ] + } + ] + }, + { + "id": 35, "name": "HttpCompressionOptions", "variant": "declaration", "kind": 256, @@ -21,7 +274,7 @@ }, "children": [ { - "id": 16334, + "id": 36, "name": "enabled", "variant": "declaration", "kind": 1024, @@ -50,7 +303,7 @@ } }, { - "id": 16335, + "id": 37, "name": "level", "variant": "declaration", "kind": 1024, @@ -79,7 +332,7 @@ } }, { - "id": 16336, + "id": 38, "name": "memLevel", "variant": "declaration", "kind": 1024, @@ -108,7 +361,7 @@ } }, { - "id": 16337, + "id": 39, "name": "threshold", "variant": "declaration", "kind": 1024, @@ -150,16 +403,16 @@ { "title": "Properties", "children": [ - 16334, - 16335, - 16336, - 16337 + 36, + 37, + 38, + 39 ] } ] }, { - "id": 16338, + "id": 40, "name": "ProjectConfigOptions", "variant": "declaration", "kind": 256, @@ -174,419 +427,7 @@ }, "children": [ { - "id": 16339, - "name": "store_cors", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" - }, - { - "kind": "code", - "text": "`store_cors`" - }, - { - "kind": "text", - "text": " is a string used to specify the accepted URLs or patterns for store API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " - }, - { - "kind": "code", - "text": "`http://localhost:8000`" - }, - { - "kind": "text", - "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " - }, - { - "kind": "code", - "text": "`.example.com`" - }, - { - "kind": "text", - "text": ". The regex pattern that the backend tests for is " - }, - { - "kind": "code", - "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" - }, - { - "kind": "text", - "text": "." - } - ], - "blockTags": [ - { - "tag": "@example", - "content": [ - { - "kind": "text", - "text": "Some example values of common use cases:\n\n" - }, - { - "kind": "code", - "text": "```bash\n# Allow different ports locally starting with 800\nSTORE_CORS=/http://localhost:800\\d+$/\n\n# Allow any origin ending with vercel.app. For example, storefront.vercel.app\nSTORE_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nSTORE_CORS=/http://.+/\n```" - }, - { - "kind": "text", - "text": "\n\nThen, set the configuration in " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ":\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n store_cors: process.env.STORE_CORS,\n // ...\n },\n // ...\n}\n```" - }, - { - "kind": "text", - "text": "\n\nIf you’re adding the value directly within " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ", make sure to add an extra escaping " - }, - { - "kind": "code", - "text": "`/`" - }, - { - "kind": "text", - "text": " for every backslash in the pattern. For example:\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n store_cors: \"/vercel\\\\.app$/\",\n // ...\n },\n // ...\n}\n```" - } - ] - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 16340, - "name": "admin_cors", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" - }, - { - "kind": "code", - "text": "`admin_cors`" - }, - { - "kind": "text", - "text": " is a string used to specify the accepted URLs or patterns for admin API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " - }, - { - "kind": "code", - "text": "`http://localhost:7001`" - }, - { - "kind": "text", - "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " - }, - { - "kind": "code", - "text": "`.example.com`" - }, - { - "kind": "text", - "text": ". The regex pattern that the backend tests for is " - }, - { - "kind": "code", - "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" - }, - { - "kind": "text", - "text": "." - } - ], - "blockTags": [ - { - "tag": "@example", - "content": [ - { - "kind": "text", - "text": "Some example values of common use cases:\n\n" - }, - { - "kind": "code", - "text": "```bash\n# Allow different ports locally starting with 700\nADMIN_CORS=/http://localhost:700\\d+$/\n\n# Allow any origin ending with vercel.app. For example, admin.vercel.app\nADMIN_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nADMIN_CORS=/http://.+/\n```" - }, - { - "kind": "text", - "text": "\n\nThen, set the configuration in " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ":\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n admin_cors: process.env.ADMIN_CORS,\n // ...\n },\n // ...\n}\n```" - }, - { - "kind": "text", - "text": "\n\nIf you’re adding the value directly within " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ", make sure to add an extra escaping " - }, - { - "kind": "code", - "text": "`/`" - }, - { - "kind": "text", - "text": " for every backslash in the pattern. For example:\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n admin_cors: \"/http:\\\\/\\\\/localhost:700\\\\d+$/\",\n // ...\n },\n // ...\n}\n```" - } - ] - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 16341, - "name": "auth_cors", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" - }, - { - "kind": "code", - "text": "`auth_cors`" - }, - { - "kind": "text", - "text": " is a string used to specify the accepted URLs or patterns for API Routes starting with " - }, - { - "kind": "code", - "text": "`/auth`" - }, - { - "kind": "text", - "text": ". It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " - }, - { - "kind": "code", - "text": "`http://localhost:7001`" - }, - { - "kind": "text", - "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " - }, - { - "kind": "code", - "text": "`.example.com`" - }, - { - "kind": "text", - "text": ". The regex pattern that the backend tests for is " - }, - { - "kind": "code", - "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" - }, - { - "kind": "text", - "text": "." - } - ], - "blockTags": [ - { - "tag": "@example", - "content": [ - { - "kind": "text", - "text": "Some example values of common use cases:\n\n" - }, - { - "kind": "code", - "text": "```bash\n# Allow different ports locally starting with 700\nAUTH_CORS=/http://localhost:700\\d+$/\n\n# Allow any origin ending with vercel.app. For example, admin.vercel.app\nAUTH_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nAUTH_CORS=/http://.+/\n```" - }, - { - "kind": "text", - "text": "\n\nThen, set the configuration in " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ":\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n auth_cors: process.env.AUTH_CORS,\n // ...\n },\n // ...\n}\n```" - }, - { - "kind": "text", - "text": "\n\nIf you’re adding the value directly within " - }, - { - "kind": "code", - "text": "`medusa-config.js`" - }, - { - "kind": "text", - "text": ", make sure to add an extra escaping " - }, - { - "kind": "code", - "text": "`/`" - }, - { - "kind": "text", - "text": " for every backslash in the pattern. For example:\n\n" - }, - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n auth_cors: \"/http:\\\\/\\\\/localhost:700\\\\d+$/\",\n // ...\n },\n // ...\n}\n```" - } - ] - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 16342, - "name": "cookie_secret", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "A random string used to create cookie tokens. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is " - }, - { - "kind": "code", - "text": "`supersecret`" - }, - { - "kind": "text", - "text": " However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes." - } - ], - "blockTags": [ - { - "tag": "@example", - "content": [ - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n cookie_secret: process.env.COOKIE_SECRET ||\n \"supersecret\",\n // ...\n },\n // ...\n}\n```" - } - ] - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 16343, - "name": "jwt_secret", - "variant": "declaration", - "kind": 1024, - "flags": { - "isOptional": true - }, - "comment": { - "summary": [ - { - "kind": "text", - "text": "A random string used to create authentication tokens. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is " - }, - { - "kind": "code", - "text": "`supersecret`" - }, - { - "kind": "text", - "text": " However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes." - } - ], - "blockTags": [ - { - "tag": "@example", - "content": [ - { - "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n jwt_secret: process.env.JWT_SECRET ||\n \"supersecret\",\n // ...\n },\n // ...\n}\n```" - } - ] - } - ] - }, - "type": { - "type": "intrinsic", - "name": "string" - } - }, - { - "id": 16344, + "id": 41, "name": "database_database", "variant": "declaration", "kind": 1024, @@ -626,7 +467,7 @@ } }, { - "id": 16345, + "id": 42, "name": "database_url", "variant": "declaration", "kind": 1024, @@ -766,7 +607,7 @@ } }, { - "id": 16346, + "id": 43, "name": "database_schema", "variant": "declaration", "kind": 1024, @@ -799,7 +640,7 @@ } }, { - "id": 16347, + "id": 44, "name": "database_logging", "variant": "declaration", "kind": 1024, @@ -898,7 +739,7 @@ "type": { "type": "reference", "target": { - "sourceFileName": "../../../node_modules/typeorm/logger/LoggerOptions.d.ts", + "sourceFileName": "../../../../node_modules/typeorm/logger/LoggerOptions.d.ts", "qualifiedName": "LoggerOptions" }, "name": "LoggerOptions", @@ -906,7 +747,7 @@ } }, { - "id": 16349, + "id": 46, "name": "database_extra", "variant": "declaration", "kind": 1024, @@ -989,14 +830,14 @@ { "type": "reflection", "declaration": { - "id": 16350, + "id": 47, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16351, + "id": 48, "name": "ssl", "variant": "declaration", "kind": 1024, @@ -1012,14 +853,14 @@ "type": { "type": "reflection", "declaration": { - "id": 16352, + "id": 49, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16353, + "id": 50, "name": "rejectUnauthorized", "variant": "declaration", "kind": 1024, @@ -1042,7 +883,7 @@ { "title": "Properties", "children": [ - 16353 + 50 ] } ] @@ -1054,7 +895,7 @@ { "title": "Properties", "children": [ - 16351 + 48 ] } ] @@ -1064,7 +905,7 @@ } }, { - "id": 16354, + "id": 51, "name": "database_driver_options", "variant": "declaration", "kind": 1024, @@ -1147,14 +988,14 @@ { "type": "reflection", "declaration": { - "id": 16355, + "id": 52, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16356, + "id": 53, "name": "connection", "variant": "declaration", "kind": 1024, @@ -1164,14 +1005,14 @@ "type": { "type": "reflection", "declaration": { - "id": 16357, + "id": 54, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16358, + "id": 55, "name": "ssl", "variant": "declaration", "kind": 1024, @@ -1189,14 +1030,14 @@ "type": { "type": "reflection", "declaration": { - "id": 16359, + "id": 56, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16360, + "id": 57, "name": "rejectUnauthorized", "variant": "declaration", "kind": 1024, @@ -1221,7 +1062,7 @@ { "title": "Properties", "children": [ - 16360 + 57 ] } ] @@ -1233,7 +1074,7 @@ { "title": "Properties", "children": [ - 16358 + 55 ] } ] @@ -1245,7 +1086,7 @@ { "title": "Properties", "children": [ - 16356 + 53 ] } ] @@ -1255,7 +1096,7 @@ } }, { - "id": 16361, + "id": 58, "name": "redis_url", "variant": "declaration", "kind": 1024, @@ -1303,7 +1144,7 @@ } }, { - "id": 16362, + "id": 59, "name": "redis_prefix", "variant": "declaration", "kind": 1024, @@ -1351,7 +1192,7 @@ } }, { - "id": 16363, + "id": 60, "name": "redis_options", "variant": "declaration", "kind": 1024, @@ -1380,7 +1221,7 @@ "type": { "type": "reference", "target": { - "sourceFileName": "../../../node_modules/ioredis/built/redis/RedisOptions.d.ts", + "sourceFileName": "../../../../node_modules/ioredis/built/redis/RedisOptions.d.ts", "qualifiedName": "RedisOptions" }, "name": "RedisOptions", @@ -1388,7 +1229,7 @@ } }, { - "id": 16364, + "id": 61, "name": "session_options", "variant": "declaration", "kind": 1024, @@ -1417,7 +1258,7 @@ "type": { "type": "reference", "target": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "SessionOptions" }, "name": "SessionOptions", @@ -1425,7 +1266,7 @@ } }, { - "id": 16365, + "id": 62, "name": "http_compression", "variant": "declaration", "kind": 1024, @@ -1436,7 +1277,7 @@ "summary": [ { "kind": "text", - "text": "Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header " + "text": "Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header " }, { "kind": "code", @@ -1456,18 +1297,45 @@ "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http_compression: {\n enabled: true,\n level: 6,\n memLevel: 8,\n threshold: 1024,\n },\n // ...\n },\n // ...\n}\n```" } ] + }, + { + "tag": "@deprecated", + "content": [ + { + "kind": "text", + "text": "use " + }, + { + "kind": "inline-tag", + "tag": "@link", + "text": "http", + "target": 65 + }, + { + "kind": "text", + "text": "'s " + }, + { + "kind": "code", + "text": "`compression`" + }, + { + "kind": "text", + "text": " property instead." + } + ] } ] }, "type": { "type": "reference", - "target": 16333, + "target": 35, "name": "HttpCompressionOptions", "package": "@medusajs/types" } }, { - "id": 16366, + "id": 63, "name": "jobs_batch_size", "variant": "declaration", "kind": 1024, @@ -1507,7 +1375,7 @@ } }, { - "id": 16367, + "id": 64, "name": "worker_mode", "variant": "declaration", "kind": 1024, @@ -1582,36 +1450,657 @@ } ] } + }, + { + "id": 65, + "name": "http", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Configure the application's http-specific settings" + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n cookieSecret: \"some-super-secret\",\n compression: { ... },\n }\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "reflection", + "declaration": { + "id": 66, + "name": "__type", + "variant": "declaration", + "kind": 65536, + "flags": {}, + "children": [ + { + "id": 67, + "name": "jwtSecret", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "A random string used to create authentication tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set the default secret is " + }, + { + "kind": "code", + "text": "`supersecret`" + }, + { + "kind": "text", + "text": " However, in production, if this configuration is not set an error, an\nerror is thrown and the backend crashes." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n cookieSecret: \"supersecret\"\n }\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 68, + "name": "jwtExpiresIn", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The expiration time for the JWT token. If not provided, the default value is " + }, + { + "kind": "code", + "text": "`24h`" + }, + { + "kind": "text", + "text": "." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n jwtExpiresIn: \"2d\"\n }\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 69, + "name": "cookieSecret", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "A random string used to create cookie tokens in the http layer. Although this configuration option is not required, it’s highly recommended to set it for better security.\n\nIn a development environment, if this option is not set, the default secret is " + }, + { + "kind": "code", + "text": "`supersecret`" + }, + { + "kind": "text", + "text": " However, in production, if this configuration is not set, an error is thrown and\nthe backend crashes." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n cookieSecret: \"supersecret\"\n }\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 70, + "name": "authCors", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" + }, + { + "kind": "code", + "text": "`cors`" + }, + { + "kind": "text", + "text": " is a string used to specify the accepted URLs or patterns for API Routes starting with " + }, + { + "kind": "code", + "text": "`/auth`" + }, + { + "kind": "text", + "text": ". It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " + }, + { + "kind": "code", + "text": "`http://localhost:7001`" + }, + { + "kind": "text", + "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " + }, + { + "kind": "code", + "text": "`.example.com`" + }, + { + "kind": "text", + "text": ". The regex pattern that the backend tests for is " + }, + { + "kind": "code", + "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" + }, + { + "kind": "text", + "text": "." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "text", + "text": "Some example values of common use cases:\n\n" + }, + { + "kind": "code", + "text": "```bash\n# Allow different ports locally starting with 700\nAUTH_CORS=/http://localhost:700\\d+$/\n\n# Allow any origin ending with vercel.app. For example, admin.vercel.app\nAUTH_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nAUTH_CORS=/http://.+/\n```" + }, + { + "kind": "text", + "text": "\n\nThen, set the configuration in " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ":\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n authCors: process.env.AUTH_CORS\n }\n // ...\n },\n // ...\n}\n```" + }, + { + "kind": "text", + "text": "\n\nIf you’re adding the value directly within " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ", make sure to add an extra escaping " + }, + { + "kind": "code", + "text": "`/`" + }, + { + "kind": "text", + "text": " for every backslash in the pattern. For example:\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n authCors: \"/http:\\\\/\\\\/localhost:700\\\\d+$/\",\n }\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 71, + "name": "compression", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.\nHowever, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.\n\nIts value is an object that has the following properties:\n\nIf you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header " + }, + { + "kind": "code", + "text": "`\"x-no-compression\": true`" + }, + { + "kind": "text", + "text": "." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n compression: {\n enabled: true,\n level: 6,\n memLevel: 8,\n threshold: 1024,\n }\n },\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "reference", + "target": 35, + "name": "HttpCompressionOptions", + "package": "@medusajs/types" + } + }, + { + "id": 72, + "name": "storeCors", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" + }, + { + "kind": "code", + "text": "`store_cors`" + }, + { + "kind": "text", + "text": " is a string used to specify the accepted URLs or patterns for store API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " + }, + { + "kind": "code", + "text": "`http://localhost:8000`" + }, + { + "kind": "text", + "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " + }, + { + "kind": "code", + "text": "`.example.com`" + }, + { + "kind": "text", + "text": ". The regex pattern that the backend tests for is " + }, + { + "kind": "code", + "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" + }, + { + "kind": "text", + "text": "." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "text", + "text": "Some example values of common use cases:\n\n" + }, + { + "kind": "code", + "text": "```bash\n# Allow different ports locally starting with 800\nSTORE_CORS=/http://localhost:800\\d+$/\n\n# Allow any origin ending with vercel.app. For example, storefront.vercel.app\nSTORE_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nSTORE_CORS=/http://.+/\n```" + }, + { + "kind": "text", + "text": "\n\nThen, set the configuration in " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ":\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n storeCors: process.env.STORE_CORS,\n }\n // ...\n },\n // ...\n}\n```" + }, + { + "kind": "text", + "text": "\n\nIf you’re adding the value directly within " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ", make sure to add an extra escaping " + }, + { + "kind": "code", + "text": "`/`" + }, + { + "kind": "text", + "text": " for every backslash in the pattern. For example:\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n storeCors: \"/vercel\\\\.app$/\",\n }\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 73, + "name": "adminCors", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "The Medusa backend’s API Routes are protected by Cross-Origin Resource Sharing (CORS). So, only allowed URLs or URLs matching a specified pattern can send requests to the backend’s API Routes.\n\n" + }, + { + "kind": "code", + "text": "`admin_cors`" + }, + { + "kind": "text", + "text": " is a string used to specify the accepted URLs or patterns for admin API Routes. It can either be one accepted origin, or a comma-separated list of accepted origins.\n\nEvery origin in that list must either be:\n\n1. A URL. For example, " + }, + { + "kind": "code", + "text": "`http://localhost:7001`" + }, + { + "kind": "text", + "text": ". The URL must not end with a backslash;\n2. Or a regular expression pattern that can match more than one origin. For example, " + }, + { + "kind": "code", + "text": "`.example.com`" + }, + { + "kind": "text", + "text": ". The regex pattern that the backend tests for is " + }, + { + "kind": "code", + "text": "`^([/~@;%#'])(.*?)\\1([gimsuy]*)$`" + }, + { + "kind": "text", + "text": "." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "text", + "text": "Some example values of common use cases:\n\n" + }, + { + "kind": "code", + "text": "```bash\n# Allow different ports locally starting with 700\nADMIN_CORS=/http://localhost:700\\d+$/\n\n# Allow any origin ending with vercel.app. For example, admin.vercel.app\nADMIN_CORS=/vercel\\.app$/\n\n# Allow all HTTP requests\nADMIN_CORS=/http://.+/\n```" + }, + { + "kind": "text", + "text": "\n\nThen, set the configuration in " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ":\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n adminCors: process.env.ADMIN_CORS,\n }\n // ...\n },\n // ...\n}\n```" + }, + { + "kind": "text", + "text": "\n\nIf you’re adding the value directly within " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ", make sure to add an extra escaping " + }, + { + "kind": "code", + "text": "`/`" + }, + { + "kind": "text", + "text": " for every backslash in the pattern. For example:\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n adminCors: process.env.ADMIN_CORS,\n }\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "id": 74, + "name": "authMethodsPerActor", + "variant": "declaration", + "kind": 1024, + "flags": {}, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Optionally you can specify the supported authentication providers per actor type (such as user, customer, or any custom actors).\nFor example, you only want to allow SSO logins for " + }, + { + "kind": "code", + "text": "`users`" + }, + { + "kind": "text", + "text": " to the admin, while you want to allow email/password logins for " + }, + { + "kind": "code", + "text": "`customers`" + }, + { + "kind": "text", + "text": " to the storefront.\n\n" + }, + { + "kind": "code", + "text": "`authMethodsPerActor`" + }, + { + "kind": "text", + "text": " is a a map where the actor type (eg. 'user') is the key, and an array of supported auth providers as the value." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "text", + "text": "Some example values of common use cases:\n\nThen, set the configuration in " + }, + { + "kind": "code", + "text": "`medusa-config.js`" + }, + { + "kind": "text", + "text": ":\n\n" + }, + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig: {\n http: {\n authMethodsPerActor: {\n user: ['sso'],\n customer: [\"emailpass\", \"google\"]\n },\n },\n // ...\n },\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "reference", + "target": { + "sourceFileName": "../../node_modules/typescript/lib/lib.es5.d.ts", + "qualifiedName": "Record" + }, + "typeArguments": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elementType": { + "type": "intrinsic", + "name": "string" + } + } + ], + "name": "Record", + "package": "typescript" + } + } + ], + "groups": [ + { + "title": "Properties", + "children": [ + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74 + ] + } + ] + } + } } ], "groups": [ { "title": "Properties", "children": [ - 16339, - 16340, - 16341, - 16342, - 16343, - 16344, - 16345, - 16346, - 16347, - 16349, - 16354, - 16361, - 16362, - 16363, - 16364, - 16365, - 16366, - 16367 + 41, + 42, + 43, + 44, + 46, + 51, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65 ] } ] }, { - "id": 16368, + "id": 75, "name": "ConfigModule", "variant": "declaration", "kind": 256, @@ -1642,18 +2131,29 @@ "kind": "inline-tag", "tag": "@link", "text": "projectConfig", - "target": 16369, + "target": 76, "tsLinkText": "projectConfig" }, { "kind": "text", - "text": ": (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations.\n- " + "text": " (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations.\n- " + }, + { + "kind": "inline-tag", + "tag": "@link", + "text": "admin", + "target": 77, + "tsLinkText": "admin" + }, + { + "kind": "text", + "text": ": An object that holds admin-related configurations.\n- " }, { "kind": "inline-tag", "tag": "@link", "text": "plugins", - "target": 16370, + "target": 78, "tsLinkText": "plugins" }, { @@ -1664,7 +2164,7 @@ "kind": "inline-tag", "tag": "@link", "text": "modules", - "target": 16374, + "target": 82, "tsLinkText": "modules" }, { @@ -1675,7 +2175,7 @@ "kind": "inline-tag", "tag": "@link", "text": "featureFlags", - "target": 16375, + "target": 83, "tsLinkText": "featureFlags" }, { @@ -1684,7 +2184,7 @@ }, { "kind": "code", - "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig,\n plugins,\n modules,\n featureFlags,\n}\n```" + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n projectConfig,\n admin,\n modules,\n featureFlags,\n}\n```" }, { "kind": "text", @@ -1710,7 +2210,7 @@ }, "children": [ { - "id": 16369, + "id": 76, "name": "projectConfig", "variant": "declaration", "kind": 1024, @@ -1725,13 +2225,47 @@ }, "type": { "type": "reference", - "target": 16338, + "target": 40, "name": "ProjectConfigOptions", "package": "@medusajs/types" } }, { - "id": 16370, + "id": 77, + "name": "admin", + "variant": "declaration", + "kind": 1024, + "flags": { + "isOptional": true + }, + "comment": { + "summary": [ + { + "kind": "text", + "text": "Admin dashboard configurations." + } + ], + "blockTags": [ + { + "tag": "@example", + "content": [ + { + "kind": "code", + "text": "```js title=\"medusa-config.js\"\nmodule.exports = {\n admin: {\n backendUrl: process.env.MEDUSA_BACKEND_URL || \"http://localhost:9000\"\n }\n // ...\n}\n```" + } + ] + } + ] + }, + "type": { + "type": "reference", + "target": 26, + "name": "AdminOptions", + "package": "@medusajs/types" + } + }, + { + "id": 78, "name": "plugins", "variant": "declaration", "kind": 1024, @@ -1799,14 +2333,14 @@ { "type": "reflection", "declaration": { - "id": 16371, + "id": 79, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16372, + "id": 80, "name": "resolve", "variant": "declaration", "kind": 1024, @@ -1817,7 +2351,7 @@ } }, { - "id": 16373, + "id": 81, "name": "options", "variant": "declaration", "kind": 1024, @@ -1847,8 +2381,8 @@ { "title": "Properties", "children": [ - 16372, - 16373 + 80, + 81 ] } ] @@ -1859,7 +2393,7 @@ } }, { - "id": 16374, + "id": 82, "name": "modules", "variant": "declaration", "kind": 1024, @@ -2004,7 +2538,7 @@ { "type": "reference", "target": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "InternalModuleDeclaration" }, "name": "InternalModuleDeclaration", @@ -2013,7 +2547,7 @@ { "type": "reference", "target": { - "sourceFileName": "../../../packages/types/src/modules-sdk/index.ts", + "sourceFileName": "../../../../packages/core/types/src/modules-sdk/index.ts", "qualifiedName": "ExternalModuleDeclaration" }, "name": "ExternalModuleDeclaration", @@ -2033,7 +2567,7 @@ } }, { - "id": 16375, + "id": 83, "name": "featureFlags", "variant": "declaration", "kind": 1024, @@ -2111,16 +2645,17 @@ { "title": "Properties", "children": [ - 16369, - 16370, - 16374, - 16375 + 76, + 77, + 78, + 82, + 83 ] } ] }, { - "id": 16376, + "id": 84, "name": "PluginDetails", "variant": "declaration", "kind": 2097152, @@ -2128,14 +2663,14 @@ "type": { "type": "reflection", "declaration": { - "id": 16377, + "id": 85, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { - "id": 16378, + "id": 86, "name": "resolve", "variant": "declaration", "kind": 1024, @@ -2146,7 +2681,7 @@ } }, { - "id": 16379, + "id": 87, "name": "name", "variant": "declaration", "kind": 1024, @@ -2157,7 +2692,7 @@ } }, { - "id": 16380, + "id": 88, "name": "id", "variant": "declaration", "kind": 1024, @@ -2168,7 +2703,7 @@ } }, { - "id": 16381, + "id": 89, "name": "options", "variant": "declaration", "kind": 1024, @@ -2194,7 +2729,7 @@ } }, { - "id": 16382, + "id": 90, "name": "version", "variant": "declaration", "kind": 1024, @@ -2209,11 +2744,11 @@ { "title": "Properties", "children": [ - 16378, - 16379, - 16380, - 16381, - 16382 + 86, + 87, + 88, + 89, + 90 ] } ] @@ -2225,218 +2760,279 @@ { "title": "Interfaces", "children": [ - 16333, - 16338, - 16368 + 26, + 35, + 40, + 75 ] }, { "title": "Type Aliases", "children": [ - 16376 + 84 ] } ], "packageName": "@medusajs/types", "symbolIdMap": { - "16332": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "25": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "" }, - "16333": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "26": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "AdminOptions" + }, + "27": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.disable" + }, + "28": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.path" + }, + "29": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.outDir" + }, + "30": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.backendUrl" + }, + "31": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.vite" + }, + "32": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type" + }, + "33": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type" + }, + "34": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "config" + }, + "35": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "HttpCompressionOptions" }, - "16334": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "36": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.enabled" }, - "16335": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "37": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.level" }, - "16336": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "38": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.memLevel" }, - "16337": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "39": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.threshold" }, - "16338": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "40": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "ProjectConfigOptions" }, - "16339": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", - "qualifiedName": "__type.store_cors" - }, - "16340": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", - "qualifiedName": "__type.admin_cors" - }, - "16341": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", - "qualifiedName": "__type.auth_cors" - }, - "16342": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", - "qualifiedName": "__type.cookie_secret" - }, - "16343": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", - "qualifiedName": "__type.jwt_secret" - }, - "16344": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "41": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_database" }, - "16345": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "42": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_url" }, - "16346": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "43": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_schema" }, - "16347": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "44": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_logging" }, - "16349": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "46": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_extra" }, - "16350": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "47": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16351": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "48": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.ssl" }, - "16352": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "49": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16353": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "50": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.rejectUnauthorized" }, - "16354": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "51": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.database_driver_options" }, - "16355": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "52": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16356": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "53": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.connection" }, - "16357": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "54": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16358": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "55": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.ssl" }, - "16359": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "56": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16360": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "57": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.rejectUnauthorized" }, - "16361": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "58": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.redis_url" }, - "16362": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "59": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.redis_prefix" }, - "16363": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "60": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.redis_options" }, - "16364": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "61": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.session_options" }, - "16365": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "62": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.http_compression" }, - "16366": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "63": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.jobs_batch_size" }, - "16367": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "64": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.worker_mode" }, - "16368": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "65": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.http" + }, + "66": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type" + }, + "67": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.jwtSecret" + }, + "68": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.jwtExpiresIn" + }, + "69": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.cookieSecret" + }, + "70": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.authCors" + }, + "71": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.compression" + }, + "72": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.storeCors" + }, + "73": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.adminCors" + }, + "74": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.authMethodsPerActor" + }, + "75": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "ConfigModule" }, - "16369": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "76": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.projectConfig" }, - "16370": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "77": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", + "qualifiedName": "__type.admin" + }, + "78": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.plugins" }, - "16371": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "79": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16372": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "80": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.resolve" }, - "16373": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "81": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.options" }, - "16374": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "82": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.modules" }, - "16375": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "83": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.featureFlags" }, - "16376": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "84": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "PluginDetails" }, - "16377": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "85": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type" }, - "16378": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "86": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.resolve" }, - "16379": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "87": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.name" }, - "16380": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "88": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.id" }, - "16381": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "89": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.options" }, - "16382": { - "sourceFileName": "../../../packages/types/src/common/config-module.ts", + "90": { + "sourceFileName": "../../../../packages/core/types/src/common/config-module.ts", "qualifiedName": "__type.version" } } diff --git a/www/utils/packages/typedoc-generate-references/src/constants/custom-options.ts b/www/utils/packages/typedoc-generate-references/src/constants/custom-options.ts index 83bd11c6fd..cad0a80f05 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/custom-options.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/custom-options.ts @@ -10,10 +10,11 @@ import { rootPathPrefix } from "./general.js" import { modules } from "./references.js" const customOptions: Record> = { - entities: getOptions({ - entryPointPath: "packages/medusa/src/models/index.ts", - tsConfigName: "medusa.json", - name: "entities", + "auth-provider": getOptions({ + entryPointPath: "packages/core/utils/src/auth/abstract-auth-provider.ts", + tsConfigName: "utils.json", + name: "auth-provider", + parentIgnore: true, }), file: getOptions({ entryPointPath: "packages/core/utils/src/file/abstract-file-provider.ts", @@ -21,10 +22,10 @@ const customOptions: Record> = { name: "file", parentIgnore: true, }), - "fulfillment-service": getOptions({ - entryPointPath: "packages/medusa/src/interfaces/fulfillment-service.ts", - tsConfigName: "medusa.json", - name: "fulfillment-service", + "fulfillment-provider": getOptions({ + entryPointPath: "packages/core/utils/src/fulfillment/provider.ts", + tsConfigName: "utils.json", + name: "fulfillment-provider", parentIgnore: true, }), "js-client": getOptions({ @@ -84,24 +85,12 @@ const customOptions: Record> = { name: "notification", parentIgnore: true, }), - "payment-processor": getOptions({ - entryPointPath: "packages/medusa/src/interfaces/payment-processor.ts", - tsConfigName: "medusa.json", - name: "payment-processor", - }), "payment-provider": getOptions({ entryPointPath: "packages/core/utils/src/payment/abstract-payment-provider.ts", tsConfigName: "utils.json", name: "payment-provider", }), - "price-selection": getOptions({ - entryPointPath: - "packages/medusa/src/interfaces/price-selection-strategy.ts", - tsConfigName: "medusa.json", - name: "price-selection", - parentIgnore: true, - }), search: getOptions({ entryPointPath: "packages/core/utils/src/search/abstract-service.ts", tsConfigName: "utils.json", @@ -112,24 +101,11 @@ const customOptions: Record> = { tsConfigName: "medusa.json", name: "services", }), - "tax-calculation": getOptions({ - entryPointPath: - "packages/medusa/src/interfaces/tax-calculation-strategy.ts", - tsConfigName: "medusa.json", - name: "tax-calculation", - parentIgnore: true, - }), "tax-provider": getOptions({ entryPointPath: "packages/core/types/src/tax/provider.ts", tsConfigName: "types.json", name: "tax-provider", }), - "tax-service": getOptions({ - entryPointPath: "packages/medusa/src/interfaces/tax-service.ts", - tsConfigName: "medusa.json", - name: "tax-service", - parentIgnore: true, - }), types: getOptions({ entryPointPath: "packages/core/types/src/index.ts", tsConfigName: "types.json", diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts new file mode 100644 index 0000000000..9afbb2775b --- /dev/null +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts @@ -0,0 +1,84 @@ +import { FormattingOptionsType } from "types" + +const authProviderOptions: FormattingOptionsType = { + "^auth_provider/.*AbstractAuthModuleProvider": { + reflectionGroups: { + Properties: false, + }, + reflectionDescription: `In this document, you’ll learn how to create an auth provider module and the methods you must implement in its main service.`, + frontmatterData: { + slug: "/references/auth/provider", + }, + reflectionTitle: { + fullReplacement: "How to Create an Auth Provider Module", + }, + shouldIncrementAfterStartSections: true, + expandMembers: true, + startSections: [ + `## 1. Create Module Directory + +Start by creating a new directory for your module. For example, \`src/modules/my-auth\`.`, + `## 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\`: + +\`\`\`ts title="src/modules/my-auth/service.ts" +import { AbstractAuthModuleProvider } from "@medusajs/utils" + +class MyAuthProviderService extends AbstractAuthModuleProvider { + // TODO implement methods +} + +export default MyAuthProviderService +\`\`\``, + ], + endSections: [ + `## 3. Create Module Definition File + +Create the file \`src/modules/my-auth/index.ts\` with the following content: + +\`\`\`ts title="src/modules/my-auth/index.ts" +import MyAuthProviderService from "./service" + +export default { + service: MyAuthProviderService, +} +\`\`\` + +This exports the module's definition, indicating that the \`MyAuthProviderService\` is the main service of the module.`, + `## 4. Use Module + +To use your Auth Provider Module, add it to the \`providers\` array of the Auth Module: + +\`\`\`js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + +const modules = { + // ... + [Modules.AUTH]: { + resolve: "@medusajs/auth", + options: { + providers: [ + { + resolve: "./dist/modules/my-auth", + options: { + config: { + "my-auth": { + // provider options... + }, + }, + }, + }, + ], + }, + }, +} +\`\`\` +`, + ], + }, +} + +export default authProviderOptions diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts index cdf034204a..b92124a85b 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts @@ -1,16 +1,11 @@ import { FormattingOptionsType } from "types" const fileOptions: FormattingOptionsType = { - "^file": { - frontmatterData: { - displayed_sidebar: "core", - }, - }, "^file/.*AbstractFileProviderService": { reflectionGroups: { Properties: false, }, - reflectionDescription: `In this document, you’ll learn how to create a file provider module and the methods you must implement in it.`, + reflectionDescription: `In this document, you’ll learn how to create a file provider module and the methods you must implement in its main service.`, frontmatterData: { slug: "/references/file-provider-module", }, @@ -25,9 +20,7 @@ const fileOptions: FormattingOptionsType = { Start by creating a new directory for your module. For example, \`src/modules/my-file\`.`, `## 2. Create the File Provider Service -Create the file \`src/modules/my-file/service.ts\` that holds the implementation of the file service. - -The File Provider Module's main service 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/utils\`: \`\`\`ts title="src/modules/my-file/service.ts" import { AbstractFileProviderService } from "@medusajs/utils" diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts new file mode 100644 index 0000000000..e2214614ea --- /dev/null +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts @@ -0,0 +1,84 @@ +import { FormattingOptionsType } from "types" + +const fulfillmentProviderOptions: FormattingOptionsType = { + "^fulfillment_provider/.*AbstractFulfillmentProviderService": { + reflectionGroups: { + Properties: false, + }, + reflectionDescription: `In this document, you’ll learn how to create a fulfillment provider module and the methods you must implement in its main service.`, + frontmatterData: { + slug: "/references/fulfillment/provider", + }, + reflectionTitle: { + fullReplacement: "How to Create a Fulfillment Provider Module", + }, + shouldIncrementAfterStartSections: true, + expandMembers: true, + startSections: [ + `## 1. Create Module Directory + +Start by creating a new directory for your module. For example, \`src/modules/my-fulfillment\`.`, + `## 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\`: + +\`\`\`ts title="src/modules/my-fulfillment/service.ts" +import { AbstractFulfillmentProviderService } from "@medusajs/utils" + +class MyFulfillmentProviderService extends AbstractFulfillmentProviderService { + // TODO implement methods +} + +export default MyFulfillmentProviderService +\`\`\``, + ], + endSections: [ + `## 3. Create Module Definition File + +Create the file \`src/modules/my-fulfillment/index.ts\` with the following content: + +\`\`\`ts title="src/modules/my-fulfillment/index.ts" +import MyFulfillmentProviderService from "./service" + +export default { + service: MyFulfillmentProviderService, +} +\`\`\` + +This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the main service of the module.`, + `## 4. Use Module + +To use your Fulfillment Provider Module, add it to the \`providers\` array of the Fulfillment Module: + +\`\`\`js title="medusa-config.js" +const { Modules } = require("@medusajs/modules-sdk") + +// ... + +const modules = { + // ... + [Modules.FULFILLMENT]: { + resolve: "@medusajs/fulfillment", + options: { + providers: [ + { + resolve: "./dist/modules/my-fulfillment", + options: { + config: { + "my-fulfillment": { + // provider options... + }, + }, + }, + }, + ], + }, + }, +} +\`\`\` +`, + ], + }, +} + +export default fulfillmentProviderOptions diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/index.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/index.ts index 396992bbe8..b2c02559a7 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/index.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/index.ts @@ -1,5 +1,7 @@ import { FormattingOptionsType } from "types" +import authProviderOptions from "./auth-provider.js" import fileOptions from "./file.js" +import fulfillmentProviderOptions from "./fulfillment-provider.js" import jsClientOptions from "./js-client.js" import medusaConfigOptions from "./medusa-config.js" import medusaReactOptions from "./medusa-react.js" @@ -11,7 +13,9 @@ import taxProviderOptions from "./tax-provider.js" import workflowsOptions from "./workflows.js" const mergerCustomOptions: FormattingOptionsType = { + ...authProviderOptions, ...fileOptions, + ...fulfillmentProviderOptions, ...jsClientOptions, ...medusaConfigOptions, ...medusaReactOptions, diff --git a/www/utils/packages/typedoc-generate-references/src/constants/references.ts b/www/utils/packages/typedoc-generate-references/src/constants/references.ts index 4b964f48e2..b21d76d40b 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/references.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/references.ts @@ -21,10 +21,10 @@ export const modules = [ const allReferences = [ ...modules, + "auth-provider", "file", - // "js-client", + "fulfillment-provider", "medusa-config", - // "medusa-react", "medusa", "notification", "payment-provider",