docs: capitalize use of Framework across docs (#12207)
* docs: capitalize use of Framework across docs * generate llm
This commit is contained in:
1 parent
f6b20a943e
commit
42262d41a1
36 files changed
+14297
-14283
No files matched your search
@@ -63,7 +63,7 @@ export const POST = async (
|
||||
|
||||
You export a route handler function with its name (`POST`) being the HTTP method of the API route you're exposing.
|
||||
|
||||
The function receives two parameters: a `MedusaRequest` object to access request details, and `MedusaResponse` object to return or manipulate the response. The `MedusaRequest` object's `scope` property is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) that holds framework tools and custom and core modules' services.
|
||||
The function receives two parameters: a `MedusaRequest` object to access request details, and `MedusaResponse` object to return or manipulate the response. The `MedusaRequest` object's `scope` property is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) that holds Framework tools and custom and core modules' services.
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ You create a `createBrandStep` using the `createStep` function. It accepts the s
|
||||
|
||||
The step function receives two parameters: input passed to the step when it's invoked, and an object of general context and configurations. This object has a `container` property, which is the Medusa container.
|
||||
|
||||
The [Medusa container](../../../fundamentals/medusa-container/page.mdx) is a registry of framework and commerce tools accessible in your customizations, such as a workflow's step. The Medusa application registers the services of core and custom modules in the container, allowing you to resolve and use them.
|
||||
The [Medusa container](../../../fundamentals/medusa-container/page.mdx) is a registry of Framework and commerce tools accessible in your customizations, such as a workflow's step. The Medusa application registers the services of core and custom modules in the container, allowing you to resolve and use them.
|
||||
|
||||
So, In the step function, you use the Medusa container to resolve the Brand Module's service and use its generated `createBrands` method, which accepts an object of brands to create.
|
||||
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ createProductsWorkflow.hooks.productsCreated(
|
||||
Workflows have a special `hooks` property to access its hooks and consume them. Each hook, such as `productsCreated`, accepts a step function as a parameter. The step function accepts the following parameters:
|
||||
|
||||
1. An object having an `additional_data` property, which is the custom data passed in the request body under `additional_data`. The object will also have properties passed from the workflow to the hook, which in this case is the `products` property that holds an array of the created products.
|
||||
2. An object of properties related to the step's context. It has a `container` property whose value is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) to resolve framework and commerce tools.
|
||||
2. An object of properties related to the step's context. It has a `container` property whose value is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) to resolve Framework and commerce tools.
|
||||
|
||||
In the step, if a brand ID is passed in `additional_data`, you resolve the Brand Module's service and use its generated `retrieveBrand` method to retrieve the brand by its ID. The `retrieveBrand` method will throw an error if the brand doesn't exist.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ In the upcoming chapters, you'll learn about the concepts and tools to extend Me
|
||||
|
||||
In other commerce platforms, you extend core features and models through hacky workarounds that can introduce unexpected issues and side effects across the platform. It also makes your application difficult to maintain and upgrade in the long run.
|
||||
|
||||
Medusa's framework and orchestration tools mitigate these issues while supporting all your customization needs:
|
||||
The Medusa Framework and orchestration tools mitigate these issues while supporting all your customization needs:
|
||||
|
||||
- [Module Links](../../fundamentals/module-links/page.mdx): Link data models of different modules without building direct dependencies, ensuring that the Medusa application integrates your modules without side effects.
|
||||
- [Workflow Hooks](../../fundamentals/workflows/workflow-hooks/page.mdx): inject custom functionalities into a workflow at predefined points, called hooks. This allows you to perform custom actions as a part of a core workflow without hacky workarounds.
|
||||
|
||||
@@ -264,7 +264,7 @@ A subscriber file must export:
|
||||
The subscriber function accepts an object parameter that has two properties:
|
||||
|
||||
- `event`: An object of event details. Its `data` property holds the event's data payload, which is the brand's ID.
|
||||
- `container`: The Medusa container used to resolve framework and commerce tools.
|
||||
- `container`: The Medusa container used to resolve Framework and commerce tools.
|
||||
|
||||
In the function, you execute the `syncBrandToCmsWorkflow`, passing it the data payload as an input. So, everytime a brand is created, Medusa will execute this function, which in turn executes the workflow to sync the brand to the CMS.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export const metadata = {
|
||||
|
||||
Commerce applications often connect to third-party systems that provide additional or specialized features. For example, you may integrate a Content-Management System (CMS) for rich content features, a payment provider to process credit-card payments, and a notification service to send emails.
|
||||
|
||||
Medusa's framework facilitates integrating these systems and orchestrating operations across them, saving you the effort of managing them yourself. You won't find those capabilities in other commerce platforms that in these scenarios become a bottleneck to building customizations and iterating quickly.
|
||||
The Medusa Framework facilitates integrating these systems and orchestrating operations across them, saving you the effort of managing them yourself. You won't find those capabilities in other commerce platforms that in these scenarios become a bottleneck to building customizations and iterating quickly.
|
||||
|
||||
In Medusa, you integrate a third-party system by:
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ A scheduled job file must export:
|
||||
- `name`: A unique name for the scheduled job.
|
||||
- `schedule`: A string that holds a [cron expression](https://crontab.guru/) indicating the schedule to run the job.
|
||||
|
||||
The scheduled job function accepts as a parameter the [Medusa container](../../../fundamentals/medusa-container/page.mdx) used to resolve framework and commerce tools. You then execute the `syncBrandsFromCmsWorkflow` and use its result to log how many brands were created or updated.
|
||||
The scheduled job function accepts as a parameter the [Medusa container](../../../fundamentals/medusa-container/page.mdx) used to resolve Framework and commerce tools. You then execute the `syncBrandsFromCmsWorkflow` and use its result to log how many brands were created or updated.
|
||||
|
||||
Based on the cron expression specified in `config.schedule`, Medusa will run the scheduled job every day at midnight. You can also change it to `* * * * *` to run it every minute for easier debugging.
|
||||
|
||||
@@ -340,6 +340,6 @@ If you set the schedule to `* * * * *` for debugging, the scheduled job will run
|
||||
|
||||
## Summary
|
||||
|
||||
By following the previous chapters, you utilized Medusa's framework and orchestration tools to perform and automate tasks that span across systems.
|
||||
By following the previous chapters, you utilized the Medusa Framework and orchestration tools to perform and automate tasks that span across systems.
|
||||
|
||||
With Medusa, you can integrate any service from your commerce ecosystem with ease. You don't have to set up separate applications to manage your different customizations, or worry about data inconsistency across systems. Your efforts only go into implementing the business logic that ties your systems together.
|
||||
@@ -66,7 +66,7 @@ export default CmsModuleService
|
||||
|
||||
You create a `CmsModuleService` that will hold the methods to connect to the third-party CMS. A service's constructor accepts two parameters:
|
||||
|
||||
1. The module's container. Since a module is [isolated](../../../fundamentals/modules/isolation/page.mdx), it has a [local container](../../../fundamentals/modules/container/page.mdx) different than the Medusa container you use in other customizations. This container holds framework tools like the [Logger utility](../../../debugging-and-testing/logging/page.mdx) and resources within the module.
|
||||
1. The module's container. Since a module is [isolated](../../../fundamentals/modules/isolation/page.mdx), it has a [local container](../../../fundamentals/modules/container/page.mdx) different than the Medusa container you use in other customizations. This container holds Framework tools like the [Logger utility](../../../debugging-and-testing/logging/page.mdx) and resources within the module.
|
||||
2. Options passed to the module when it's later added in Medusa's configurations. These options are useful to pass secret keys or configurations that ensure your module is re-usable across applications. For the CMS Module, you accept the API key to connect to the dummy CMS as an option.
|
||||
|
||||
When integrating a third-party system that has a Node.js SDK or client, you can initialize that client in the constructor to be used in the service's methods.
|
||||
|
||||
@@ -8,7 +8,7 @@ In this chapter, you’ll learn about the Medusa container and how to use it.
|
||||
|
||||
## What is the Medusa Container?
|
||||
|
||||
The Medusa container is a registry of framework and commerce tools that's accessible across your application. Medusa automatically registers these tools in the container, including custom ones that you've built, so that you can use them in your customizations.
|
||||
The Medusa container is a registry of Framework and commerce tools that's accessible across your application. Medusa automatically registers these tools in the container, including custom ones that you've built, so that you can use them in your customizations.
|
||||
|
||||
In other platforms, if you have a resource A (for example, a class) that depends on a resource B, you have to manually add resource B to the container or specify it beforehand as A's dependency, which is often done in a file separate from A's code. This becomes difficult to manage as you maintain larger applications with many changing dependencies.
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ You’ll receive the following response:
|
||||
|
||||
## Access Medusa Container in Workflow Steps
|
||||
|
||||
A step receives an object as a second parameter with configurations and context-related properties. One of these properties is the `container` property, which is the [Medusa container](../medusa-container/page.mdx) to allow you to resolve framework and commerce tools in your application.
|
||||
A step receives an object as a second parameter with configurations and context-related properties. One of these properties is the `container` property, which is the [Medusa container](../medusa-container/page.mdx) to allow you to resolve Framework and commerce tools in your application.
|
||||
|
||||
For example, consider you want to implement a workflow that returns the total products in your application. Create the file `src/workflows/product-count.ts` with the following content:
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
Medusa is a digital commerce platform with a built-in framework for customization.
|
||||
Medusa is a digital commerce platform with a built-in Framework for customization.
|
||||
|
||||
Medusa ships with three main tools:
|
||||
|
||||
1. A suite of [commerce modules](!resources!/commerce-modules) with core commerce functionalities, such as tracking inventory, calculating cart totals, accepting payments, managing orders, and much more.
|
||||
2. A framework for building custom functionalities specific to your business, product, or industry. This includes tools for introducing custom API endpoints, business logic, and data models; building workflows and automations; and integrating with third-party services.
|
||||
2. A Framework for building custom functionalities specific to your business, product, or industry. This includes tools for introducing custom API endpoints, business logic, and data models; building workflows and automations; and integrating with third-party services.
|
||||
3. A customizable admin dashboard for merchants to configure and operate their store.
|
||||
|
||||
When you install Medusa, you get a fully fledged commerce platform with all the features you need to get off the ground. However, unlike other platforms, Medusa is built with customization in mind. You don't need to build hacky workarounds that are difficult to maintain and scale. Your efforts go into building features that brings your business's vision to life.
|
||||
|
||||
Reference in new issue
Block a user