docs: create docs workspace (#5174)
* docs: migrate ui docs to docs universe * created yarn workspace * added eslint and tsconfig configurations * fix eslint configurations * fixed eslint configurations * shared tailwind configurations * added shared ui package * added more shared components * migrating more components * made details components shared * move InlineCode component * moved InputText * moved Loading component * Moved Modal component * moved Select components * Moved Tooltip component * moved Search components * moved ColorMode provider * Moved Notification components and providers * used icons package * use UI colors in api-reference * moved Navbar component * used Navbar and Search in UI docs * added Feedback to UI docs * general enhancements * fix color mode * added copy colors file from ui-preset * added features and enhancements to UI docs * move Sidebar component and provider * general fixes and preparations for deployment * update docusaurus version * adjusted versions * fix output directory * remove rootDirectory property * fix yarn.lock * moved code component * added vale for all docs MD and MDX * fix tests * fix vale error * fix deployment errors * change ignore commands * add output directory * fix docs test * general fixes * content fixes * fix announcement script * added changeset * fix vale checks * added nofilter option * fix vale error
This commit is contained in:
@@ -0,0 +1,248 @@
|
||||
# Class: MiddlewareService
|
||||
|
||||
Orchestrates dynamic middleware registered through the Medusa Middleware API
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new MiddlewareService**()
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L22)
|
||||
|
||||
## Properties
|
||||
|
||||
### postAuthentication\_
|
||||
|
||||
• `Protected` `Readonly` **postAuthentication\_**: `middlewareType`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### preAuthentication\_
|
||||
|
||||
• `Protected` `Readonly` **preAuthentication\_**: `middlewareType`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### preCartCreation\_
|
||||
|
||||
• `Protected` `Readonly` **preCartCreation\_**: `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L19)
|
||||
|
||||
___
|
||||
|
||||
### routers
|
||||
|
||||
• `Protected` `Readonly` **routers**: `Record`<`string`, `Router`[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L20)
|
||||
|
||||
## Methods
|
||||
|
||||
### addPostAuthentication
|
||||
|
||||
▸ **addPostAuthentication**(`middleware`, `options`): `void`
|
||||
|
||||
Adds a middleware function to be called after authentication is completed.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. |
|
||||
| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
void
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L60)
|
||||
|
||||
___
|
||||
|
||||
### addPreAuthentication
|
||||
|
||||
▸ **addPreAuthentication**(`middleware`, `options`): `void`
|
||||
|
||||
Adds a middleware function to be called before authentication is completed.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. |
|
||||
| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
void
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L79)
|
||||
|
||||
___
|
||||
|
||||
### addPreCartCreation
|
||||
|
||||
▸ **addPreCartCreation**(`middleware`): `void`
|
||||
|
||||
Adds a middleware function to be called before cart creation
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `middleware` | `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> | the middleware function. Should return a middleware function. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L96)
|
||||
|
||||
___
|
||||
|
||||
### addRouter
|
||||
|
||||
▸ **addRouter**(`path`, `router`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `path` | `string` |
|
||||
| `router` | `Router` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L29)
|
||||
|
||||
___
|
||||
|
||||
### getRouters
|
||||
|
||||
▸ **getRouters**(`path`): `Router`[]
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `path` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Router`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L34)
|
||||
|
||||
___
|
||||
|
||||
### usePostAuthentication
|
||||
|
||||
▸ **usePostAuthentication**(`app`): `void`
|
||||
|
||||
Adds post authentication middleware to an express app.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `app` | `Router` | the express app to add the middleware to |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L106)
|
||||
|
||||
___
|
||||
|
||||
### usePreAuthentication
|
||||
|
||||
▸ **usePreAuthentication**(`app`): `void`
|
||||
|
||||
Adds pre authentication middleware to an express app.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `app` | `Router` | the express app to add the middleware to |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L117)
|
||||
|
||||
___
|
||||
|
||||
### usePreCartCreation
|
||||
|
||||
▸ **usePreCartCreation**(): `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
|
||||
|
||||
#### Returns
|
||||
|
||||
`RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L123)
|
||||
|
||||
___
|
||||
|
||||
### validateMiddleware\_
|
||||
|
||||
▸ **validateMiddleware_**(`fn`): `void`
|
||||
|
||||
Validates a middleware function, throws if fn is not of type function.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `fn` | `unknown` | the middleware function to validate. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
nothing if the middleware is a function
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/755f9cf30/packages/medusa/src/services/middleware.ts#L43)
|
||||
Reference in New Issue
Block a user