Files
medusa-store/www/apps/resources/references/modules/utils/page.mdx
github-actions[bot] 175ca30f4f chore(docs): Generated References (#9153)
Generated the following references:
- `api_key`
- `auth`
- `auth_provider`
- `cart`
- `core_flows`
- `currency`
- `customer`
- `customer_models`
- `dml`
- `file`
- `fulfillment`
- `fulfillment_provider`
- `inventory_next`
- `modules`
- `modules_sdk`
- `notification`
- `order`
- `order_models`
- `payment`
- `payment_provider`
- `pricing`
- `product`
- `product_models`
- `promotion`
- `region`
- `sales_channel`
- `stock_location_next`
- `store`
- `tax`
- `tax_provider`
- `types`
- `user`
- `utils`
- `workflows`
2024-09-17 07:17:55 +00:00

131 lines
7.2 KiB
Plaintext

import { TypeList } from "docs-ui"
# utils
## Namespaces
- [CoreFlowsUitls](../../utils/utils.CoreFlowsUitls/page.mdx)
- [FulfillmentUtils](../../utils/utils.FulfillmentUtils/page.mdx)
- [InventoryUtils](../../utils/utils.InventoryUtils/page.mdx)
- [LinkUtils](../../utils/utils.LinkUtils/page.mdx)
- [OrderUtils](../../utils/utils.OrderUtils/page.mdx)
- [ProductUtils](../../utils/utils.ProductUtils/page.mdx)
- [PromotionUtils](../../utils/utils.PromotionUtils/page.mdx)
- [ShippingProfileUtils](../../utils/utils.ShippingProfileUtils/page.mdx)
- [UserUtils](../../utils/utils.UserUtils/page.mdx)
## Enumerations
- [NotificationStatus](../../utils/enums/utils.NotificationStatus/page.mdx)
- [PaymentCollectionStatus](../../utils/enums/utils.PaymentCollectionStatus/page.mdx)
- [PaymentSessionStatus](../../utils/enums/utils.PaymentSessionStatus/page.mdx)
- [PaymentWebhookEvents](../../utils/enums/utils.PaymentWebhookEvents/page.mdx)
- [PaymentActions](../../utils/enums/utils.PaymentActions/page.mdx)
- [PriceListStatus](../../utils/enums/utils.PriceListStatus/page.mdx)
- [PriceListType](../../utils/enums/utils.PriceListType/page.mdx)
## Variables
- [MedusaModuleType](page.mdx#medusamoduletype)
- [NotificationEvents](page.mdx#notificationevents)
- [PaymentEvents](page.mdx#paymentevents)
- [PricingEvents](page.mdx#pricingevents)
## Functions
- [generateJwtToken](page.mdx#generatejwttoken)
- [parseConnectionString](page.mdx#parseconnectionstring)
- [createClient](page.mdx#createclient)
- [createDb](page.mdx#createdb)
- [dbExists](page.mdx#dbexists)
___
## Variables
### MedusaModuleType
`Const` **MedusaModuleType**: typeof [MedusaModuleType](page.mdx#medusamoduletype)
### NotificationEvents
`Const` **NotificationEvents**: ReturnType<["notification"]>
### PaymentEvents
`Const` **PaymentEvents**: `Object`
#### Properties
<TypeList types={[{"name":"CAPTURED","type":"`string`","description":"","optional":false,"defaultValue":"\"payment.captured\"","expandable":false,"children":[]},{"name":"REFUNDED","type":"`string`","description":"","optional":false,"defaultValue":"\"payment.refunded\"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="PaymentEvents"/>
### PricingEvents
`Const` **PricingEvents**: ReturnType&#60;["priceListRule", "priceList", "priceRule", "priceSet", "price"]&#62;
___
## Functions
### generateJwtToken
#### Parameters
<TypeList types={[{"name":"tokenPayload","type":"`Record<string, unknown>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtConfig","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"secret","type":"`undefined` \\| `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"expiresIn","type":"`undefined` \\| `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="generateJwtToken"/>
#### Returns
<TypeList types={[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="generateJwtToken"/>
### parseConnectionString
Parsers the database connection string into an object
of postgreSQL options
#### Parameters
<TypeList types={[{"name":"connectionString","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="parseConnectionString"/>
#### Returns
<TypeList types={[{"name":"ConnectionOptions","type":"`ConnectionOptions`","optional":false,"defaultValue":"","description":"Parsers the database connection string into an object\nof postgreSQL options","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="parseConnectionString"/>
### createClient
Creates a PostgreSQL database client using the connection
string or database options
#### Parameters
<TypeList types={[{"name":"options","type":"`string` \\| `ClientConfig`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createClient"/>
#### Returns
<TypeList types={[{"name":"Client","type":"`Client`","optional":false,"defaultValue":"","description":"Creates a PostgreSQL database client using the connection\nstring or database options","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createClient"/>
### createDb
Creates a database using the client. Make sure to call
`client.connect` before using this utility.
#### Parameters
<TypeList types={[{"name":"client","type":"`Client`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDb"/>
#### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Creates a database using the client. Make sure to call\n`client.connect` before using this utility.","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createDb"/>
### dbExists
Checks if a database exists using the Client. Make sure to call
`client.connect` before using this utility.
#### Parameters
<TypeList types={[{"name":"client","type":"`Client`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="dbExists"/>
#### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;boolean&#62;","optional":false,"defaultValue":"","description":"Checks if a database exists using the Client. Make sure to call\n`client.connect` before using this utility.","expandable":false,"children":[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="dbExists"/>