Skip to content

Commit

Permalink
chore: update imports in tsdocs (#9379)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Oct 1, 2024
1 parent 4587a69 commit 2094390
Show file tree
Hide file tree
Showing 22 changed files with 105 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const createLinksStepId = "create-remote-links"
* } from "@medusajs/framework/workflows-sdk"
* import {
* createRemoteLinkStep
* } from "@medusajs/core-flows"
* } from "@medusajs/medusa/core-flows"
* import {
* Modules
* } from "@medusajs/framework/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const dismissRemoteLinkStepId = "dismiss-remote-links"
* } from "@medusajs/framework/workflows-sdk"
* import {
* dismissRemoteLinkStep
* } from "@medusajs/core-flows"
* } from "@medusajs/medusa/core-flows"
* import {
* Modules
* } from "@medusajs/framework/utils"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core-flows/src/common/steps/emit-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const emitEventStepId = "emit-event-step"
* } from "@medusajs/framework/workflows-sdk"
* import {
* emitEventStep
* } from "@medusajs/core-flows"
* } from "@medusajs/medusa/core-flows"
*
* const helloWorldWorkflow = createWorkflow(
* "hello-world",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const removeRemoteLinkStepId = "remove-remote-links"
* } from "@medusajs/framework/workflows-sdk"
* import {
* removeRemoteLinkStep
* } from "@medusajs/core-flows"
* } from "@medusajs/medusa/core-flows"
* import {
* Modules
* } from "@medusajs/framework/utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const useRemoteQueryStepId = "use-remote-query"
* } from "@medusajs/framework/workflows-sdk"
* import {
* useRemoteQueryStep
* } from "@medusajs/core-flows"
* } from "@medusajs/medusa/core-flows"
*
* const helloWorldWorkflow = createWorkflow(
* "hello-world",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/framework/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ export type ProjectConfigOptions = {
*
* The configurations for your Medusa application are in `medusa-config.js` located in the root of your Medusa project. The configurations include configurations for database, modules, and more.
*
* `medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/utils`.
* `medusa-config.js` exports the value returned by the `defineConfig` utility function imported from `@medusajs/framework/utils`.
*
* `defineConfig` accepts as a parameter an object with the following properties:
*
Expand Down
4 changes: 2 additions & 2 deletions packages/core/types/src/tax/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ export type ItemTaxCalculationLine = {
* ## How to Create a Tax Provider
*
* A tax provider class is defined in a TypeScript or JavaScript file. The class must implement the
* `ITaxProvider` interface imported from `@medusajs/types`.
* `ITaxProvider` interface imported from `@medusajs/framework/types`.
*
* The file can be defined in a plugin, a provider module, or under the `src/services` directory of your Medusa application. You can later pass the package's name or the
* path to the file in the `providers` option of the Tax Module.
*
* For example:
*
* ```ts title="src/services/my-tax.ts"
* import { ITaxProvider } from "@medusajs/types"
* import { ITaxProvider } from "@medusajs/framework/types"
*
* export default class MyTaxProvider implements ITaxProvider {
* // ...
Expand Down
18 changes: 9 additions & 9 deletions packages/core/utils/src/auth/abstract-auth-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -136,7 +136,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
Expand Down Expand Up @@ -179,7 +179,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -371,7 +371,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService,
* AuthenticationInput,
* AuthenticationResponse
* } from "@medusajs/types"
* } from "@medusajs/framework/types"
* // ...
*
* class MyAuthProviderService extends AbstractAuthModuleProvider {
Expand Down
28 changes: 15 additions & 13 deletions packages/core/utils/src/dml/entity-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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"]),
Expand Down Expand Up @@ -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(),
Expand All @@ -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, {
Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
8 changes: 4 additions & 4 deletions packages/core/utils/src/dml/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down
8 changes: 4 additions & 4 deletions packages/core/utils/src/dml/properties/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/src/dml/properties/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
15 changes: 15 additions & 0 deletions packages/core/utils/src/dml/properties/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/utils/src/dml/properties/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/utils/src/file/abstract-file-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 2094390

Please sign in to comment.