chore(docs): Generated References (automated) (#9727)
Generated the following references: - `api_key` - `auth` - `cart` - `core_flows` - `currency` - `customer` - `dml` - `fulfillment` - `helper_steps` - `inventory_next` - `js_sdk` - `medusa` - `medusa_config` - `modules` - `modules_sdk` - `notification` - `order` - `order_models` - `payment` - `pricing` - `product` - `promotion` - `region` - `sales_channel` - `stock_location_next` - `store` - `tax` - `tax_provider` - `types` - `user` - `utils` - `workflows` Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
2313 files changed
+533036
-383477
No files matched your search
@@ -25,15 +25,8 @@ import { TypeList } from "docs-ui"
|
||||
- [PriceListStatus](../../utils/enums/utils.PriceListStatus/page.mdx)
|
||||
- [PriceListType](../../utils/enums/utils.PriceListType/page.mdx)
|
||||
|
||||
## Classes
|
||||
|
||||
- [GraphQLParser](../../utils/classes/utils.GraphQLParser/page.mdx)
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [JoinerArgument](../../utils/interfaces/utils.JoinerArgument/page.mdx)
|
||||
- [JoinerDirective](../../utils/interfaces/utils.JoinerDirective/page.mdx)
|
||||
- [RemoteJoinerQuery](../../utils/interfaces/utils.RemoteJoinerQuery/page.mdx)
|
||||
- [Argument](../../utils/interfaces/utils.Argument/page.mdx)
|
||||
- [Directive](../../utils/interfaces/utils.Directive/page.mdx)
|
||||
- [Entity](../../utils/interfaces/utils.Entity/page.mdx)
|
||||
@@ -41,23 +34,11 @@ import { TypeList } from "docs-ui"
|
||||
## Variables
|
||||
|
||||
- [MedusaModuleType](page.mdx#medusamoduletype)
|
||||
- [MedusaModuleProviderType](page.mdx#medusamoduleprovidertype)
|
||||
- [NotificationEvents](page.mdx#notificationevents)
|
||||
- [PaymentEvents](page.mdx#paymentevents)
|
||||
- [PricingEvents](page.mdx#pricingevents)
|
||||
|
||||
## Functions
|
||||
|
||||
- [generateJwtToken](page.mdx#generatejwttoken)
|
||||
- [cleanGraphQLSchema](page.mdx#cleangraphqlschema)
|
||||
- [extractRelationsFromGQL](page.mdx#extractrelationsfromgql)
|
||||
- [gqlGetFieldsAndRelations](page.mdx#gqlgetfieldsandrelations)
|
||||
- [graphqlSchemaToFields](page.mdx#graphqlschematofields)
|
||||
- [gqlSchemaToTypes](page.mdx#gqlschematotypes)
|
||||
- [parseConnectionString](page.mdx#parseconnectionstring)
|
||||
- [createClient](page.mdx#createclient)
|
||||
- [createDb](page.mdx#createdb)
|
||||
- [dbExists](page.mdx#dbexists)
|
||||
|
||||
___
|
||||
|
||||
## Variables
|
||||
@@ -66,6 +47,10 @@ ___
|
||||
|
||||
`Const` **MedusaModuleType**: typeof [MedusaModuleType](page.mdx#medusamoduletype)
|
||||
|
||||
### MedusaModuleProviderType
|
||||
|
||||
`Const` **MedusaModuleProviderType**: typeof [MedusaModuleProviderType](page.mdx#medusamoduleprovidertype)
|
||||
|
||||
### NotificationEvents
|
||||
|
||||
`Const` **NotificationEvents**: ReturnType<["notification"]>
|
||||
@@ -81,177 +66,3 @@ ___
|
||||
### PricingEvents
|
||||
|
||||
`Const` **PricingEvents**: ReturnType<["priceListRule", "priceList", "priceRule", "priceSet", "price"]>
|
||||
|
||||
___
|
||||
|
||||
## 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"/>
|
||||
|
||||
### cleanGraphQLSchema
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"schema","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="cleanGraphQLSchema"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"schema","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notFound","type":"`Record<string, Record<string, 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="cleanGraphQLSchema"/>
|
||||
|
||||
<TypeList types={[{"name":"schema","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"notFound","type":"`Record<string, Record<string, 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="cleanGraphQLSchema"/>
|
||||
|
||||
### extractRelationsFromGQL
|
||||
|
||||
Extracts only the relation fields from the GraphQL type map.
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"typeMap","type":"Map<string, any>","description":"The GraphQL schema TypeMap.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="extractRelationsFromGQL"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"Map","type":"Map<string, Map<string, string>>","optional":false,"defaultValue":"","description":"A map where each key is an entity name, and the values are a map of relation fields and their corresponding entity type.","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"Map","type":"Map<string, string>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"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="extractRelationsFromGQL"/>
|
||||
|
||||
### gqlGetFieldsAndRelations
|
||||
|
||||
Generate a list of fields and fields relations for a given type with the requested relations
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"schemaTypeMap","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"typeName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","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="gqlGetFieldsAndRelations"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"Generate a list of fields and fields relations for a given type with the requested relations","expandable":false,"children":[{"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="gqlGetFieldsAndRelations"/>
|
||||
|
||||
### graphqlSchemaToFields
|
||||
|
||||
From graphql schema get all the fields for the requested type and relations
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
const userModule = `
|
||||
type User {
|
||||
id: ID!
|
||||
name: String!
|
||||
blabla: WHATEVER
|
||||
}
|
||||
|
||||
type Post {
|
||||
author: User!
|
||||
}
|
||||
`
|
||||
|
||||
const postModule = `
|
||||
type Post {
|
||||
id: ID!
|
||||
title: String!
|
||||
date: String
|
||||
}
|
||||
|
||||
type User {
|
||||
posts: [Post!]!
|
||||
}
|
||||
|
||||
type WHATEVER {
|
||||
random_field: String
|
||||
post: Post
|
||||
}
|
||||
`
|
||||
|
||||
const mergedSchema = mergeTypeDefs([userModule, postModule])
|
||||
const schema = makeExecutableSchema({
|
||||
typeDefs: mergedSchema,
|
||||
})
|
||||
|
||||
const fields = graphqlSchemaToFields(types, "User", ["posts"])
|
||||
|
||||
console.log(fields)
|
||||
|
||||
// [
|
||||
// "id",
|
||||
// "name",
|
||||
// "posts.id",
|
||||
// "posts.title",
|
||||
// "posts.date",
|
||||
// ]
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"schemaTypeMap","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"typeName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","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="graphqlSchemaToFields"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"string[]","type":"`string`[]","optional":false,"defaultValue":"","description":"From graphql schema get all the fields for the requested type and relations","expandable":false,"children":[{"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="graphqlSchemaToFields"/>
|
||||
|
||||
### gqlSchemaToTypes
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"__namedParameters","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`GraphQLSchema`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"outputDir","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"filename","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"joinerConfigs","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g { product\\_id: \"Product\" } \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"interfaceName","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="gqlSchemaToTypes"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="gqlSchemaToTypes"/>
|
||||
|
||||
### 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<void>","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<boolean>","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"/>
|
||||
Reference in new issue
Block a user