docs: update typedoc, convert packages to esm, generate references (#10699)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-12-23 15:20:09 +02:00
1 parent 0559d54c18
commit 870cb6e88c
1210 files changed
+746989 -813362

No files matched your search

@@ -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"/>
@@ -7,7 +7,37 @@ import { TypeList } from "docs-ui"
# hasOne Relationship Method - DML Reference
## hasOne&#60;TypeParameter T&#62;(entityBuilder, options): HasOneWithForeignKey&#60;T&#62;
## hasOne&#60;TypeParameter T, TypeParameter ForeignKeyName&#62;(entityBuilder, options): HasOneWithForeignKey&#60;T, ForeignKeyName&#62;
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&#60;TypeParameter T&#62;(entityBuilder, options?): HasOne&#60;T&#62;
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&#60;TypeParameter T&#62;(entityBuilder, options?): HasOne&#60;T&#62;
### 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"/>
___
@@ -0,0 +1,9 @@
import { TypeList } from "docs-ui"
# DMLEntitySchemaBuilder
**DMLEntitySchemaBuilder**: DMLSchemaWithBigNumber&#60;Schema&#62; & `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)
@@ -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"/>
___