docs: update typedoc, convert packages to esm, generate references (#10699)
This commit is contained in:
1 parent
0559d54c18
commit
870cb6e88c
1210 files changed
+746989
-813362
No files matched your search
+2
-2
@@ -26,8 +26,8 @@ const Product = model.define("product", {
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"The type of the entity builder passed as a first parameter. By default, it's\na function returning the related model.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="belongsTo"/>
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"The type of the entity builder passed as a first parameter. By default, it's\na function returning the related model.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ForeignKeyName","type":"`undefined` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="belongsTo"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"A function that returns the data model this model is related to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[RelationshipOptions](../../../../types/DmlTypes/types/types.DmlTypes.RelationshipOptions/page.mdx)","description":"The relationship's options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="belongsTo"/>
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"A function that returns the data model this model is related to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object` & `Record<string, any>` & `object`","description":"The relationship's options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKeyName","type":"ForeignKeyName","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="belongsTo"/>
|
||||
+34
-10
@@ -7,7 +7,37 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# hasOne Relationship Method - DML Reference
|
||||
|
||||
## hasOne<TypeParameter T>(entityBuilder, options): HasOneWithForeignKey<T>
|
||||
## hasOne<TypeParameter T, TypeParameter ForeignKeyName>(entityBuilder, options): HasOneWithForeignKey<T, ForeignKeyName>
|
||||
|
||||
This method defines a relationship between two data models,
|
||||
where the owner of the relationship has one record of the related
|
||||
data model.
|
||||
|
||||
For example: A user "hasOne" email.
|
||||
|
||||
Use the [belongsTo](../dml.Relationship_Methods.belongsTo/page.mdx) method to define the inverse of this relationship in
|
||||
the other data model.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
import { model } from "@medusajs/framework/utils"
|
||||
|
||||
const User = model.define("user", {
|
||||
id: model.id(),
|
||||
email: model.hasOne(() => Email),
|
||||
})
|
||||
```
|
||||
|
||||
### Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"The type of the entity builder passed as a first parameter. By default, it's\na function returning the related model.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ForeignKeyName","type":"`undefined` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"A function that returns the data model this model is related to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object` & `Record<string, any>` & `object`","description":"The relationship's options.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"foreignKey","type":"`true`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKeyName","type":"ForeignKeyName","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
|
||||
## hasOne<TypeParameter T>(entityBuilder, options?): HasOne<T>
|
||||
|
||||
This method defines a relationship between two data models,
|
||||
where the owner of the relationship has one record of the related
|
||||
@@ -35,14 +65,8 @@ const User = model.define("user", {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"A function that returns the data model this model is related to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object` & `Record<string, any>` & `object`","description":"The relationship's options.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"foreignKey","type":"`true`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"A function that returns the data model this model is related to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object` & `Record<string, any>` & `object`","description":"The relationship's options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`false`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
|
||||
## hasOne<TypeParameter T>(entityBuilder, options?): HasOne<T>
|
||||
### Custom Namespace
|
||||
|
||||
### Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"entityBuilder","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object` & `Record<string, any>` & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"mappedBy","type":"`string`","description":"The name of the relationship as defined in the other\ndata model. This is only required by the `belongsTo` and `manyToMany`\nrelationship method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"foreignKey","type":"`false`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="hasOne"/>
|
||||
Relationship Methods
|
||||
@@ -31,11 +31,11 @@ name, its schema and relationships.
|
||||
|
||||
### Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"Schema","type":"[DMLSchema](../../../../types/DmlTypes/types/types.DmlTypes.DMLSchema/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[RelationshipTypes](../../../../types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"TConfig","type":"[IDmlEntityConfig](../../../../types/DmlTypes/types/types.DmlTypes.IDmlEntityConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tableName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="new DmlEntity"/>
|
||||
<TypeList types={[{"name":"Schema","type":"[DMLSchema](../../../../types/DmlTypes/types/types.DmlTypes.DMLSchema/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[RelationshipTypes](../../../../types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"TConfig","type":"[IDmlEntityConfig](../../../../types/DmlTypes/types/types.DmlTypes.IDmlEntityConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tableName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="DmlEntity"/>
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"TConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"schema","type":"Schema","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="new DmlEntity"/>
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"TConfig","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"schema","type":"Schema","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="DmlEntity"/>
|
||||
|
||||
___
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# DMLEntitySchemaBuilder
|
||||
|
||||
**DMLEntitySchemaBuilder**: DMLSchemaWithBigNumber<Schema> & `DMLSchemaDefaults` & Schema
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"Schema","type":"[DMLSchema](../../../../types/DmlTypes/types/types.DmlTypes.DMLSchema/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"$dataType","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[RelationshipTypes](../../../../types/DmlTypes/types/types.DmlTypes.RelationshipTypes/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="DMLEntitySchemaBuilder"/>
|
||||
@@ -5,3 +5,7 @@ import { TypeList } from "docs-ui"
|
||||
## Classes
|
||||
|
||||
- [DmlEntity](../../entity/classes/dml.entity.DmlEntity/page.mdx)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
- [DMLEntitySchemaBuilder](../../entity/types/dml.entity.DMLEntitySchemaBuilder/page.mdx)
|
||||
+1
-1
@@ -31,7 +31,7 @@ property classes
|
||||
|
||||
### Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="new BaseProperty"/>
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="BaseProperty"/>
|
||||
|
||||
___
|
||||
|
||||
|
||||
Reference in new issue
Block a user