diff --git a/www/apps/resources/generated/files-map.mjs b/www/apps/resources/generated/files-map.mjs index 4bd5f62aa9..96d02b7f28 100644 --- a/www/apps/resources/generated/files-map.mjs +++ b/www/apps/resources/generated/files-map.mjs @@ -10463,6 +10463,10 @@ export const filesMap = [ "filePath": "/www/apps/resources/references/workflows/functions/workflows.transform/page.mdx", "pathname": "/references/workflows/functions/workflows.transform" }, + { + "filePath": "/www/apps/resources/references/workflows/functions/workflows.when/page.mdx", + "pathname": "/references/workflows/functions/workflows.when" + }, { "filePath": "/www/apps/resources/references/workflows/interfaces/workflows.StepExecutionContext/page.mdx", "pathname": "/references/workflows/interfaces/workflows.StepExecutionContext" diff --git a/www/apps/resources/generated/sidebar.mjs b/www/apps/resources/generated/sidebar.mjs index ec63840cda..1be600d098 100644 --- a/www/apps/resources/generated/sidebar.mjs +++ b/www/apps/resources/generated/sidebar.mjs @@ -7931,6 +7931,13 @@ export const generatedSidebar = [ "path": "/references/workflows/transform", "title": "transform", "children": [] + }, + { + "loaded": true, + "isPathHref": true, + "path": "/references/workflows/when", + "title": "when", + "children": [] } ] } diff --git a/www/apps/resources/generated/slug-changes.mjs b/www/apps/resources/generated/slug-changes.mjs index ceb9618de6..5968e46359 100644 --- a/www/apps/resources/generated/slug-changes.mjs +++ b/www/apps/resources/generated/slug-changes.mjs @@ -4083,5 +4083,10 @@ export const slugChanges = [ "origSlug": "/references/workflows/functions/workflows.transform", "newSlug": "/references/workflows/transform", "filePath": "/www/apps/resources/references/workflows/functions/workflows.transform/page.mdx" + }, + { + "origSlug": "/references/workflows/functions/workflows.when", + "newSlug": "/references/workflows/when", + "filePath": "/www/apps/resources/references/workflows/functions/workflows.when/page.mdx" } ] \ No newline at end of file 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 ad45f9c6b6..99d2fc8436 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 @@ -64,7 +64,7 @@ Make sure to create the PostgreSQL database before using it. You can check how t ```js title="medusa-config.js" module.exports = defineConfig({ projectConfig: { - databaseName: process.env.DATABASE_NAME || + databaseName: process.env.DATABASE_NAME || "medusa-store", // ... }, @@ -147,31 +147,6 @@ module.exports = defineConfig({ }) ``` -### databaseExtra - -An object that includes additional configurations to pass to the database connection. You can pass any configuration. One defined configuration to pass is -`ssl` which enables support for TLS/SSL connections. - -This is useful for production databases, which can be supported by setting the `rejectUnauthorized` attribute of `ssl` object to `false`. -During development, it’s recommended not to pass this option. - -#### Example - -```js title="medusa-config.js" -module.exports = defineConfig({ - projectConfig: { - databaseExtra: process.env.NODE_ENV !== "development" ? - { ssl: { rejectUnauthorized: false } } : {} - // ... - }, - // ... -}) -``` - -#### Properties - - - ### databaseDriverOptions 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 @@ -220,7 +195,7 @@ For a local Redis installation, the connection URL should be `redis://localhost: ```js title="medusa-config.js" module.exports = defineConfig({ projectConfig: { - redisUrl: process.env.REDIS_URL || + redisUrl: process.env.REDIS_URL || "redis://localhost:6379", // ... }, @@ -257,7 +232,7 @@ for the list of available options. module.exports = defineConfig({ projectConfig: { redisOptions: { - connectionName: process.env.REDIS_CONNECTION_NAME || + connectionName: process.env.REDIS_CONNECTION_NAME || "medusa", } // ... @@ -362,7 +337,7 @@ Admin dashboard configurations. ```js title="medusa-config.js" module.exports = defineConfig({ admin: { - backendUrl: process.env.MEDUSA_BACKEND_URL || + backendUrl: process.env.MEDUSA_BACKEND_URL || "http://localhost:9000" }, // ... 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 d9e991de5c..3f6e965869 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. -`","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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseExtra","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":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../types/interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../types/interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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"/> diff --git a/www/apps/resources/references/modules/workflows/page.mdx b/www/apps/resources/references/modules/workflows/page.mdx index 42efb78f69..5ece33907a 100644 --- a/www/apps/resources/references/modules/workflows/page.mdx +++ b/www/apps/resources/references/modules/workflows/page.mdx @@ -14,3 +14,4 @@ This section of the documentation provides a reference to the utility functions - [createWorkflow](../../workflows/functions/workflows.createWorkflow/page.mdx) - [parallelize](../../workflows/functions/workflows.parallelize/page.mdx) - [transform](../../workflows/functions/workflows.transform/page.mdx) +- [when](../../workflows/functions/workflows.when/page.mdx) diff --git a/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ConfigModule/page.mdx b/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ConfigModule/page.mdx index 8bf8fdb7b5..0e73bcf34e 100644 --- a/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ConfigModule/page.mdx +++ b/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ConfigModule/page.mdx @@ -44,4 +44,4 @@ setting the environment variables depends on the hosting provider. ## 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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseExtra","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":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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":"featureFlags","type":"`Record`","description":"Some features in the Medusa backend are guarded by a feature flag. This ensures constant shipping of new features while maintaining the engine’s stability.\n\nYou can specify whether a feature should or shouldn’t be used in your backend by enabling its feature flag. Feature flags can be enabled through either environment\nvariables or through this configuration exported in `medusa-config.js`.\n\nThe `featureFlags` configuration is an object. Its properties are the names of the feature flags. Each property’s value is a boolean indicating whether the feature flag is enabled.\n\nYou can find available feature flags and their key name [here](https://github.com/medusajs/medusa/tree/develop/packages/medusa/src/loaders/feature-flags).","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"admin","type":"[AdminOptions](../types.CommonTypes.AdminOptions/page.mdx)","description":"Admin dashboard configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"disable","type":"`boolean`","description":"Whether to disable the admin dashboard. If set to `true`, the admin dashboard is disabled,\nin both development and production environments. The default value is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"path","type":"\\`/${string}\\`","description":"The path to the admin dashboard. The default value is `/app`.\n\nThe value cannot be one of the reserved paths:\n- `/admin`\n- `/store`\n- `/auth`\n- `/`","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"outDir","type":"`string`","description":"The directory where the admin build is output. This is where the build process places the generated files.\nThe default value is `./build`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"backendUrl","type":"`string`","description":"The URL of your Medusa backend. Defaults to an empty string, which means requests will hit the same server that serves the dashboard.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"vite","type":"(`config`: `InlineConfig`) => `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":[]}]},{"name":"modules","type":"`Record`","description":"In Medusa, commerce and core logic are modularized to allow developers to extend or replace certain [modules](https://docs.medusajs.com/development/modules/overview)\nwith custom implementations.\n\nAside from installing the module with NPM, you must add it to the exported object in `medusa-config.js`.\n\nThe keys of the `modules` configuration object refer to the module's registration name. Its value can be one of the following:\n\n1. A boolean value indicating whether the module type is enabled. This is only supported for Medusa's commerce and architectural modules;\n2. Or an object having the following properties:\n 1. `resolve`: a string indicating the path to the module relative to `src`, or the module's NPM package name.\n 2. `options`: (optional) an object indicating the options to pass to the module.\n 3. `definition`: (optional) an object of extra configurations, such as `isQueryable` used when a module has relationships.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ConfigModule"/> +`","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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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":"featureFlags","type":"`Record`","description":"Some features in the Medusa backend are guarded by a feature flag. This ensures constant shipping of new features while maintaining the engine’s stability.\n\nYou can specify whether a feature should or shouldn’t be used in your backend by enabling its feature flag. Feature flags can be enabled through either environment\nvariables or through this configuration exported in `medusa-config.js`.\n\nThe `featureFlags` configuration is an object. Its properties are the names of the feature flags. Each property’s value is a boolean indicating whether the feature flag is enabled.\n\nYou can find available feature flags and their key name [here](https://github.com/medusajs/medusa/tree/develop/packages/medusa/src/loaders/feature-flags).","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"admin","type":"[AdminOptions](../types.CommonTypes.AdminOptions/page.mdx)","description":"Admin dashboard configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"disable","type":"`boolean`","description":"Whether to disable the admin dashboard. If set to `true`, the admin dashboard is disabled,\nin both development and production environments. The default value is `false`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"path","type":"\\`/${string}\\`","description":"The path to the admin dashboard. The default value is `/app`.\n\nThe value cannot be one of the reserved paths:\n- `/admin`\n- `/store`\n- `/auth`\n- `/`","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"outDir","type":"`string`","description":"The directory where the admin build is output. This is where the build process places the generated files.\nThe default value is `./build`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"backendUrl","type":"`string`","description":"The URL of your Medusa backend. Defaults to an empty string, which means requests will hit the same server that serves the dashboard.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"vite","type":"(`config`: `InlineConfig`) => `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":[]}]},{"name":"modules","type":"`Record`","description":"In Medusa, commerce and core logic are modularized to allow developers to extend or replace certain [modules](https://docs.medusajs.com/development/modules/overview)\nwith custom implementations.\n\nAside from installing the module with NPM, you must add it to the exported object in `medusa-config.js`.\n\nThe keys of the `modules` configuration object refer to the module's registration name. Its value can be one of the following:\n\n1. A boolean value indicating whether the module type is enabled. This is only supported for Medusa's commerce and architectural modules;\n2. Or an object having the following properties:\n 1. `resolve`: a string indicating the path to the module relative to `src`, or the module's NPM package name.\n 2. `options`: (optional) an object indicating the options to pass to the module.\n 3. `definition`: (optional) an object of extra configurations, such as `isQueryable` used when a module has relationships.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ConfigModule"/> diff --git a/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ProjectConfigOptions/page.mdx b/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ProjectConfigOptions/page.mdx index 007346e126..9aba7b8efe 100644 --- a/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ProjectConfigOptions/page.mdx +++ b/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ProjectConfigOptions/page.mdx @@ -6,4 +6,4 @@ Essential configurations related to the Medusa backend, such as database and COR ## 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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseExtra","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":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"databaseName","type":"`string`","description":"The name of the database to connect to. If specified in `databaseUrl`, 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":"databaseUrl","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":"databaseSchema","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 = defineConfig({\n projectConfig: {\n databaseSchema: process.env.DATABASE_SCHEMA ||\n \"custom\",\n // ...\n },\n // ...\n})\n```","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseLogging","type":"`LoggerOptions`","description":"This configuration specifies what database messages to log. Its value can be one of the following:\n\n- (default) A boolean value that indicates whether any messages should be logged.\n- The string value `all` that indicates all types of messages should be logged.\n- An array of log-level strings to indicate which type of messages to show in the logs. The strings can be `query`, `schema`, `error`, `warn`, `info`, `log`, or `migration`. Refer to [Typeorm’s documentation](https://typeorm.io/logging#logging-options) for more details on what each of these values means.\n\nIf this configuration isn't set, its default value is `false`, meaning no database messages are logged.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseDriverOptions","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":"redisUrl","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":"redisPrefix","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":"redisOptions","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":"sessionOptions","type":"[SessionOptions](../../../interfaces/types.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 `http.cookieSecret` 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":"jobsBatchSize","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":"workerMode","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"/> diff --git a/www/apps/resources/references/workflows/functions/workflows.when/page.mdx b/www/apps/resources/references/workflows/functions/workflows.when/page.mdx new file mode 100644 index 0000000000..aa5f8c20a7 --- /dev/null +++ b/www/apps/resources/references/workflows/functions/workflows.when/page.mdx @@ -0,0 +1,24 @@ +--- +slug: /references/workflows/when +sidebar_label: when +--- + +import { TypeList } from "docs-ui" + +# when - Workflows API Reference + +This documentation provides a reference to the `when` . It belongs to the `@medusajs/workflows-sdk` package. + +## Type Parameters + + + +## Parameters + + + +## Returns + + + +