chore: update imports in tsdocs (#9379)

This commit is contained in:
Shahed Nasser
2024-10-01 11:04:03 +02:00
committed by GitHub
parent 4587a69f3f
commit 20943902f9
22 changed files with 105 additions and 93 deletions
@@ -23,8 +23,8 @@ import {
* #### Example
*
* ```ts
* import { AbstractAuthModuleProvider } from "@medusajs/utils"
* import { Logger } from "@medusajs/types"
* import { AbstractAuthModuleProvider } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/framework/types"
*
* type InjectedDependencies = {
* logger: Logger
@@ -136,7 +136,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -179,7 +179,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -238,8 +238,8 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* import { MedusaError } from "@medusajs/utils"
* } from "@medusajs/framework/types"
* import { MedusaError } from "@medusajs/framework/utils"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -305,8 +305,8 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* import { MedusaError } from "@medusajs/utils"
* } from "@medusajs/framework/types"
* import { MedusaError } from "@medusajs/framework/utils"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -371,7 +371,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
+15 -13
View File
@@ -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(),
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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(),
@@ -11,8 +11,8 @@ import { FileTypes, IFileProvider } from "@medusajs/types"
* #### Example
*
* ```ts
* import { Logger } from "@medusajs/types"
* import { AbstractFileProviderService } from "@medusajs/utils"
* import { Logger } from "@medusajs/framework/types"
* import { AbstractFileProviderService } from "@medusajs/framework/utils"
*
* type InjectedDependencies = {
* logger: Logger
@@ -11,8 +11,8 @@ import { INotificationProvider, NotificationTypes } from "@medusajs/types"
* #### Example
*
* ```ts
* import { AbstractNotificationProviderService } from "@medusajs/utils"
* import { Logger } from "@medusajs/types"
* import { AbstractNotificationProviderService } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/framework/types"
*
* type InjectedDependencies = {
* logger: Logger
@@ -67,7 +67,7 @@ export class AbstractNotificationProviderService
* import {
* ProviderSendNotificationDTO,
* ProviderSendNotificationResultsDTO
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
* class MyNotificationProviderService extends AbstractNotificationProviderService {
* // ...
@@ -34,8 +34,8 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* ```ts
* import {
* AbstractPaymentProvider
* } from "@medusajs/utils"
* import { Logger } from "@medusajs/types"
* } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/framework/types"
*
* type InjectedDependencies = {
* logger: Logger
@@ -138,7 +138,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
* Options
@@ -193,7 +193,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* PaymentProviderError,
* PaymentProviderSessionResponse,
* PaymentSessionStatus
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -261,7 +261,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -303,7 +303,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -359,7 +359,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -401,7 +401,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* // other imports...
* import {
* PaymentSessionStatus
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -450,7 +450,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -503,7 +503,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import {
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -547,7 +547,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* UpdatePaymentProviderSession,
* PaymentProviderError,
* PaymentProviderSessionResponse,
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -610,11 +610,11 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* // other imports...
* import {
* BigNumber
* } from "@medusajs/utils"
* } from "@medusajs/framework/utils"
* import {
* ProviderWebhookPayload,
* WebhookActionResult
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
*
*
* class MyPaymentProviderService extends AbstractPaymentProvider<