chore: update imports in tsdocs (#9379)
This commit is contained in:
1 parent
4587a69f3f
commit
20943902f9
22 files changed
+105
-93
No files matched your search
@@ -100,7 +100,7 @@ export class EntityBuilder {
|
||||
* @param {Schema} schema - The schema of the data model's properties.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* id: model.id(),
|
||||
@@ -135,7 +135,7 @@ export class EntityBuilder {
|
||||
* primary key.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const User = model.define("User", {
|
||||
* id: model.id().primaryKey(),
|
||||
@@ -154,7 +154,7 @@ export class EntityBuilder {
|
||||
* This method defines a string property.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* name: model.text(),
|
||||
@@ -173,7 +173,7 @@ export class EntityBuilder {
|
||||
* This method defines a boolean property.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* hasAccount: model.boolean(),
|
||||
@@ -192,7 +192,7 @@ export class EntityBuilder {
|
||||
* This method defines a number property.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* age: model.number(),
|
||||
@@ -211,7 +211,7 @@ export class EntityBuilder {
|
||||
* This method defines a number property that expects large numbers, such as prices.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* price: model.bigNumber(),
|
||||
@@ -235,7 +235,7 @@ export class EntityBuilder {
|
||||
* This method defines an array of strings property.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* names: model.array(),
|
||||
@@ -254,7 +254,7 @@ export class EntityBuilder {
|
||||
* This method defines a timestamp property.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* date_of_birth: model.dateTime(),
|
||||
@@ -273,7 +273,7 @@ export class EntityBuilder {
|
||||
* This method defines a property whose value is a stringified JSON object.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* metadata: model.json(),
|
||||
@@ -296,7 +296,7 @@ export class EntityBuilder {
|
||||
* @param {Values[]} values - An array of possible values.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* color: model.enum(["black", "white"]),
|
||||
@@ -328,7 +328,7 @@ export class EntityBuilder {
|
||||
* @param {RelationshipOptions} options - The relationship's options.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const User = model.define("user", {
|
||||
* id: model.id(),
|
||||
@@ -353,6 +353,8 @@ export class EntityBuilder {
|
||||
* @param {RelationshipOptions} options - The relationship's options.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Product = model.define("product", {
|
||||
* id: model.id(),
|
||||
* store: model.belongsTo(() => Store, {
|
||||
@@ -380,7 +382,7 @@ export class EntityBuilder {
|
||||
* @param {RelationshipOptions} options - The relationship's options.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Store = model.define("store", {
|
||||
* id: model.id(),
|
||||
@@ -407,7 +409,7 @@ export class EntityBuilder {
|
||||
* @param {RelationshipOptions} options - The relationship's options.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Order = model.define("order", {
|
||||
* id: model.id(),
|
||||
|
||||
@@ -117,7 +117,7 @@ export class DmlEntity<
|
||||
* action should be cascaded to.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Store = model.define("store", {
|
||||
* id: model.id(),
|
||||
@@ -162,7 +162,7 @@ export class DmlEntity<
|
||||
* An example of a simple index:
|
||||
*
|
||||
* ```ts
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* id: model.id(),
|
||||
@@ -180,7 +180,7 @@ export class DmlEntity<
|
||||
* To add a condition on the index, use the `where` option:
|
||||
*
|
||||
* ```ts
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* id: model.id(),
|
||||
@@ -201,7 +201,7 @@ export class DmlEntity<
|
||||
* The condition can also be a negation. For example:
|
||||
*
|
||||
* ```ts
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* id: model.id(),
|
||||
|
||||
@@ -33,7 +33,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
|
||||
* This method indicates that a property's value can be `null`.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* price: model.bigNumber().nullable(),
|
||||
@@ -55,7 +55,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
|
||||
* Medusa generates the name.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* id: model.id(),
|
||||
@@ -81,7 +81,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
|
||||
* Medusa generates the name.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const User = model.define("user", {
|
||||
* email: model.text().unique(),
|
||||
@@ -103,7 +103,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
|
||||
* @param {T} value - The default value.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* color: model
|
||||
|
||||
@@ -33,7 +33,7 @@ export class IdProperty extends BaseProperty<string> {
|
||||
* This method indicates that the property is the data model's primary key.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Product = model.define("Product", {
|
||||
* id: model.id().primaryKey(),
|
||||
|
||||
@@ -11,6 +11,21 @@ export class NumberProperty extends BaseProperty<number> {
|
||||
options: {}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method indicates that the property is the data model's primary key.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Product = model.define("Product", {
|
||||
* code: model.number().primaryKey(),
|
||||
* // ...
|
||||
* })
|
||||
*
|
||||
* export default Product
|
||||
*
|
||||
* @customNamespace Property Configuration Methods
|
||||
*/
|
||||
primaryKey() {
|
||||
return new PrimaryKeyModifier<number, NumberProperty>(this)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class TextProperty extends BaseProperty<string> {
|
||||
* This method indicates that the property is the data model's primary key.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const Product = model.define("Product", {
|
||||
* code: model.text().primaryKey(),
|
||||
@@ -41,7 +41,7 @@ export class TextProperty extends BaseProperty<string> {
|
||||
* This method indicates that a text property is searchable.
|
||||
*
|
||||
* @example
|
||||
* import { model } from "@medusajs/utils"
|
||||
* import { model } from "@medusajs/framework/utils"
|
||||
*
|
||||
* const MyCustom = model.define("my_custom", {
|
||||
* name: model.text().searchable(),
|
||||
|
||||
Reference in new issue
Block a user