chore: update imports in tsdocs (#9379)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-10-01 11:04:03 +02:00
1 parent 4587a69f3f
commit 20943902f9
22 files changed
+105 -93

No files matched your search

@@ -15,7 +15,7 @@ export const createLinksStepId = "create-remote-links"
* } from "@medusajs/framework/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { * import {
* createRemoteLinkStep * createRemoteLinkStep
* } from "@medusajs/core-flows" * } from "@medusajs/medusa/core-flows"
* import { * import {
* Modules * Modules
* } from "@medusajs/framework/utils" * } from "@medusajs/framework/utils"
@@ -19,7 +19,7 @@ export const dismissRemoteLinkStepId = "dismiss-remote-links"
* } from "@medusajs/framework/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { * import {
* dismissRemoteLinkStep * dismissRemoteLinkStep
* } from "@medusajs/core-flows" * } from "@medusajs/medusa/core-flows"
* import { * import {
* Modules * Modules
* } from "@medusajs/framework/utils" * } from "@medusajs/framework/utils"
@@ -46,7 +46,7 @@ export const emitEventStepId = "emit-event-step"
* } from "@medusajs/framework/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { * import {
* emitEventStep * emitEventStep
* } from "@medusajs/core-flows" * } from "@medusajs/medusa/core-flows"
* *
* const helloWorldWorkflow = createWorkflow( * const helloWorldWorkflow = createWorkflow(
* "hello-world", * "hello-world",
@@ -17,7 +17,7 @@ export const removeRemoteLinkStepId = "remove-remote-links"
* } from "@medusajs/framework/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { * import {
* removeRemoteLinkStep * removeRemoteLinkStep
* } from "@medusajs/core-flows" * } from "@medusajs/medusa/core-flows"
* import { * import {
* Modules * Modules
* } from "@medusajs/framework/utils" * } from "@medusajs/framework/utils"
@@ -62,7 +62,7 @@ export const useRemoteQueryStepId = "use-remote-query"
* } from "@medusajs/framework/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { * import {
* useRemoteQueryStep * useRemoteQueryStep
* } from "@medusajs/core-flows" * } from "@medusajs/medusa/core-flows"
* *
* const helloWorldWorkflow = createWorkflow( * const helloWorldWorkflow = createWorkflow(
* "hello-world", * "hello-world",
+1 -1
View File
@@ -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. * 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: * `defineConfig` accepts as a parameter an object with the following properties:
* *
+2 -2
View File
@@ -48,7 +48,7 @@ export type ItemTaxCalculationLine = {
* ## How to Create a Tax Provider * ## How to Create a Tax Provider
* *
* A tax provider class is defined in a TypeScript or JavaScript file. The class must implement the * 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 * 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. * path to the file in the `providers` option of the Tax Module.
@@ -56,7 +56,7 @@ export type ItemTaxCalculationLine = {
* For example: * For example:
* *
* ```ts title="src/services/my-tax.ts" * ```ts title="src/services/my-tax.ts"
* import { ITaxProvider } from "@medusajs/types" * import { ITaxProvider } from "@medusajs/framework/types"
* *
* export default class MyTaxProvider implements ITaxProvider { * export default class MyTaxProvider implements ITaxProvider {
* // ... * // ...
@@ -23,8 +23,8 @@ import {
* #### Example * #### Example
* *
* ```ts * ```ts
* import { AbstractAuthModuleProvider } from "@medusajs/utils" * import { AbstractAuthModuleProvider } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/types" * import { Logger } from "@medusajs/framework/types"
* *
* type InjectedDependencies = { * type InjectedDependencies = {
* logger: Logger * logger: Logger
@@ -136,7 +136,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService, * AuthIdentityProviderService,
* AuthenticationInput, * AuthenticationInput,
* AuthenticationResponse * AuthenticationResponse
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* // ... * // ...
* *
* class MyAuthProviderService extends AbstractAuthModuleProvider { * class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -179,7 +179,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService, * AuthIdentityProviderService,
* AuthenticationInput, * AuthenticationInput,
* AuthenticationResponse * AuthenticationResponse
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* // ... * // ...
* *
* class MyAuthProviderService extends AbstractAuthModuleProvider { * class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -238,8 +238,8 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService, * AuthIdentityProviderService,
* AuthenticationInput, * AuthenticationInput,
* AuthenticationResponse * AuthenticationResponse
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* import { MedusaError } from "@medusajs/utils" * import { MedusaError } from "@medusajs/framework/utils"
* // ... * // ...
* *
* class MyAuthProviderService extends AbstractAuthModuleProvider { * class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -305,8 +305,8 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService, * AuthIdentityProviderService,
* AuthenticationInput, * AuthenticationInput,
* AuthenticationResponse * AuthenticationResponse
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* import { MedusaError } from "@medusajs/utils" * import { MedusaError } from "@medusajs/framework/utils"
* // ... * // ...
* *
* class MyAuthProviderService extends AbstractAuthModuleProvider { * class MyAuthProviderService extends AbstractAuthModuleProvider {
@@ -371,7 +371,7 @@ export abstract class AbstractAuthModuleProvider implements IAuthProvider {
* AuthIdentityProviderService, * AuthIdentityProviderService,
* AuthenticationInput, * AuthenticationInput,
* AuthenticationResponse * AuthenticationResponse
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* // ... * // ...
* *
* class MyAuthProviderService extends AbstractAuthModuleProvider { * 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. * @param {Schema} schema - The schema of the data model's properties.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* id: model.id(), * id: model.id(),
@@ -135,7 +135,7 @@ export class EntityBuilder {
* primary key. * primary key.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const User = model.define("User", { * const User = model.define("User", {
* id: model.id().primaryKey(), * id: model.id().primaryKey(),
@@ -154,7 +154,7 @@ export class EntityBuilder {
* This method defines a string property. * This method defines a string property.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* name: model.text(), * name: model.text(),
@@ -173,7 +173,7 @@ export class EntityBuilder {
* This method defines a boolean property. * This method defines a boolean property.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* hasAccount: model.boolean(), * hasAccount: model.boolean(),
@@ -192,7 +192,7 @@ export class EntityBuilder {
* This method defines a number property. * This method defines a number property.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* age: model.number(), * age: model.number(),
@@ -211,7 +211,7 @@ export class EntityBuilder {
* This method defines a number property that expects large numbers, such as prices. * This method defines a number property that expects large numbers, such as prices.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* price: model.bigNumber(), * price: model.bigNumber(),
@@ -235,7 +235,7 @@ export class EntityBuilder {
* This method defines an array of strings property. * This method defines an array of strings property.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* names: model.array(), * names: model.array(),
@@ -254,7 +254,7 @@ export class EntityBuilder {
* This method defines a timestamp property. * This method defines a timestamp property.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* date_of_birth: model.dateTime(), * date_of_birth: model.dateTime(),
@@ -273,7 +273,7 @@ export class EntityBuilder {
* This method defines a property whose value is a stringified JSON object. * This method defines a property whose value is a stringified JSON object.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* metadata: model.json(), * metadata: model.json(),
@@ -296,7 +296,7 @@ export class EntityBuilder {
* @param {Values[]} values - An array of possible values. * @param {Values[]} values - An array of possible values.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* color: model.enum(["black", "white"]), * color: model.enum(["black", "white"]),
@@ -328,7 +328,7 @@ export class EntityBuilder {
* @param {RelationshipOptions} options - The relationship's options. * @param {RelationshipOptions} options - The relationship's options.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const User = model.define("user", { * const User = model.define("user", {
* id: model.id(), * id: model.id(),
@@ -353,6 +353,8 @@ export class EntityBuilder {
* @param {RelationshipOptions} options - The relationship's options. * @param {RelationshipOptions} options - The relationship's options.
* *
* @example * @example
* import { model } from "@medusajs/framework/utils"
*
* const Product = model.define("product", { * const Product = model.define("product", {
* id: model.id(), * id: model.id(),
* store: model.belongsTo(() => Store, { * store: model.belongsTo(() => Store, {
@@ -380,7 +382,7 @@ export class EntityBuilder {
* @param {RelationshipOptions} options - The relationship's options. * @param {RelationshipOptions} options - The relationship's options.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const Store = model.define("store", { * const Store = model.define("store", {
* id: model.id(), * id: model.id(),
@@ -407,7 +409,7 @@ export class EntityBuilder {
* @param {RelationshipOptions} options - The relationship's options. * @param {RelationshipOptions} options - The relationship's options.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const Order = model.define("order", { * const Order = model.define("order", {
* id: model.id(), * id: model.id(),
+4 -4
View File
@@ -117,7 +117,7 @@ export class DmlEntity<
* action should be cascaded to. * action should be cascaded to.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const Store = model.define("store", { * const Store = model.define("store", {
* id: model.id(), * id: model.id(),
@@ -162,7 +162,7 @@ export class DmlEntity<
* An example of a simple index: * An example of a simple index:
* *
* ```ts * ```ts
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* id: model.id(), * id: model.id(),
@@ -180,7 +180,7 @@ export class DmlEntity<
* To add a condition on the index, use the `where` option: * To add a condition on the index, use the `where` option:
* *
* ```ts * ```ts
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* id: model.id(), * id: model.id(),
@@ -201,7 +201,7 @@ export class DmlEntity<
* The condition can also be a negation. For example: * The condition can also be a negation. For example:
* *
* ```ts * ```ts
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* id: model.id(), * 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`. * This method indicates that a property's value can be `null`.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* price: model.bigNumber().nullable(), * price: model.bigNumber().nullable(),
@@ -55,7 +55,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
* Medusa generates the name. * Medusa generates the name.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* id: model.id(), * id: model.id(),
@@ -81,7 +81,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
* Medusa generates the name. * Medusa generates the name.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const User = model.define("user", { * const User = model.define("user", {
* email: model.text().unique(), * email: model.text().unique(),
@@ -103,7 +103,7 @@ export abstract class BaseProperty<T> implements PropertyType<T> {
* @param {T} value - The default value. * @param {T} value - The default value.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* color: model * 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. * This method indicates that the property is the data model's primary key.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const Product = model.define("Product", { * const Product = model.define("Product", {
* id: model.id().primaryKey(), * id: model.id().primaryKey(),
@@ -11,6 +11,21 @@ export class NumberProperty extends BaseProperty<number> {
options: {} 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() { primaryKey() {
return new PrimaryKeyModifier<number, NumberProperty>(this) 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. * This method indicates that the property is the data model's primary key.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const Product = model.define("Product", { * const Product = model.define("Product", {
* code: model.text().primaryKey(), * code: model.text().primaryKey(),
@@ -41,7 +41,7 @@ export class TextProperty extends BaseProperty<string> {
* This method indicates that a text property is searchable. * This method indicates that a text property is searchable.
* *
* @example * @example
* import { model } from "@medusajs/utils" * import { model } from "@medusajs/framework/utils"
* *
* const MyCustom = model.define("my_custom", { * const MyCustom = model.define("my_custom", {
* name: model.text().searchable(), * name: model.text().searchable(),
@@ -11,8 +11,8 @@ import { FileTypes, IFileProvider } from "@medusajs/types"
* #### Example * #### Example
* *
* ```ts * ```ts
* import { Logger } from "@medusajs/types" * import { Logger } from "@medusajs/framework/types"
* import { AbstractFileProviderService } from "@medusajs/utils" * import { AbstractFileProviderService } from "@medusajs/framework/utils"
* *
* type InjectedDependencies = { * type InjectedDependencies = {
* logger: Logger * logger: Logger
@@ -11,8 +11,8 @@ import { INotificationProvider, NotificationTypes } from "@medusajs/types"
* #### Example * #### Example
* *
* ```ts * ```ts
* import { AbstractNotificationProviderService } from "@medusajs/utils" * import { AbstractNotificationProviderService } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/types" * import { Logger } from "@medusajs/framework/types"
* *
* type InjectedDependencies = { * type InjectedDependencies = {
* logger: Logger * logger: Logger
@@ -67,7 +67,7 @@ export class AbstractNotificationProviderService
* import { * import {
* ProviderSendNotificationDTO, * ProviderSendNotificationDTO,
* ProviderSendNotificationResultsDTO * ProviderSendNotificationResultsDTO
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* class MyNotificationProviderService extends AbstractNotificationProviderService { * class MyNotificationProviderService extends AbstractNotificationProviderService {
* // ... * // ...
@@ -34,8 +34,8 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* ```ts * ```ts
* import { * import {
* AbstractPaymentProvider * AbstractPaymentProvider
* } from "@medusajs/utils" * } from "@medusajs/framework/utils"
* import { Logger } from "@medusajs/types" * import { Logger } from "@medusajs/framework/types"
* *
* type InjectedDependencies = { * type InjectedDependencies = {
* logger: Logger * logger: Logger
@@ -138,7 +138,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
* Options * Options
@@ -193,7 +193,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* PaymentSessionStatus * PaymentSessionStatus
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -261,7 +261,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -303,7 +303,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -359,7 +359,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -401,7 +401,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* // other imports... * // other imports...
* import { * import {
* PaymentSessionStatus * PaymentSessionStatus
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -450,7 +450,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -503,7 +503,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* import { * import {
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -547,7 +547,7 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* UpdatePaymentProviderSession, * UpdatePaymentProviderSession,
* PaymentProviderError, * PaymentProviderError,
* PaymentProviderSessionResponse, * PaymentProviderSessionResponse,
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -610,11 +610,11 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* // other imports... * // other imports...
* import { * import {
* BigNumber * BigNumber
* } from "@medusajs/utils" * } from "@medusajs/framework/utils"
* import { * import {
* ProviderWebhookPayload, * ProviderWebhookPayload,
* WebhookActionResult * WebhookActionResult
* } from "@medusajs/types" * } from "@medusajs/framework/types"
* *
* *
* class MyPaymentProviderService extends AbstractPaymentProvider< * class MyPaymentProviderService extends AbstractPaymentProvider<
@@ -35,7 +35,7 @@ export type Hook<Name extends string, Input> = {
* createHook, * createHook,
* createWorkflow, * createWorkflow,
* WorkflowResponse, * WorkflowResponse,
* } from "@medusajs/workflows-sdk" * } from "@medusajs/framework/workflows-sdk"
* import { createProductStep } from "./steps/create-product" * import { createProductStep } from "./steps/create-product"
* *
* export const myWorkflow = createWorkflow( * export const myWorkflow = createWorkflow(
@@ -311,10 +311,8 @@ function wrapConditionalStep(
* @example * @example
* import { * import {
* createStep, * createStep,
* StepResponse, * StepResponse
* StepExecutionContext, * } from "@medusajs/framework/workflows-sdk"
* WorkflowData
* } from "@medusajs/workflows-sdk"
* *
* interface CreateProductInput { * interface CreateProductInput {
* title: string * title: string
@@ -34,8 +34,11 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
* @returns The created workflow. You can later execute the workflow by invoking it, then using its `run` method. * @returns The created workflow. You can later execute the workflow by invoking it, then using its `run` method.
* *
* @example * @example
* import { createWorkflow } from "@medusajs/workflows-sdk" * import {
* import { MedusaRequest, MedusaResponse, Product } from "@medusajs/medusa" * createWorkflow,
* WorkflowResponse
* } from "@medusajs/framework/workflows-sdk"
* import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
* import { * import {
* createProductStep, * createProductStep,
* getProductStep, * getProductStep,
@@ -46,16 +49,15 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
* title: string * title: string
* } * }
* *
* const myWorkflow = createWorkflow< * const myWorkflow = createWorkflow(
* WorkflowInput, * "my-workflow",
* Product * (input: WorkflowInput) => {
* >("my-workflow", (input) => {
* // Everything here will be executed and resolved later * // Everything here will be executed and resolved later
* // during the execution. Including the data access. * // during the execution. Including the data access.
* *
* const product = createProductStep(input) * const product = createProductStep(input)
* const prices = createPricesStep(product) * const prices = createPricesStep(product)
* return getProductStep(product.id) * return new WorkflowResponse(getProductStep(product.id))
* } * }
* ) * )
* *
@@ -11,8 +11,9 @@ import { OrchestrationUtils } from "@medusajs/utils"
* @example * @example
* import { * import {
* createWorkflow, * createWorkflow,
* parallelize * parallelize,
* } from "@medusajs/workflows-sdk" * WorkflowResponse
* } from "@medusajs/framework/workflows-sdk"
* import { * import {
* createProductStep, * createProductStep,
* getProductStep, * getProductStep,
@@ -24,10 +25,9 @@ import { OrchestrationUtils } from "@medusajs/utils"
* title: string * title: string
* } * }
* *
* const myWorkflow = createWorkflow< * const myWorkflow = createWorkflow(
* WorkflowInput, * "my-workflow",
* Product * (input: WorkflowInput) => {
* >("my-workflow", (input) => {
* const product = createProductStep(input) * const product = createProductStep(input)
* *
* const [prices, productSalesChannel] = parallelize( * const [prices, productSalesChannel] = parallelize(
@@ -36,7 +36,7 @@ import { OrchestrationUtils } from "@medusajs/utils"
* ) * )
* *
* const id = product.id * const id = product.id
* return getProductStep(product.id) * return new WorkflowResponse(getProductStep(product.id))
* } * }
* ) * )
*/ */
@@ -30,32 +30,27 @@ type Func<T, U> = (input: T, context: StepExecutionContext) => U | Promise<U>
* @example * @example
* import { * import {
* createWorkflow, * createWorkflow,
* transform * transform,
* } from "@medusajs/workflows-sdk" * WorkflowResponse
* } from "@medusajs/framework/workflows-sdk"
* import { step1, step2 } from "./steps" * import { step1, step2 } from "./steps"
* *
* type WorkflowInput = { * type WorkflowInput = {
* name: string * name: string
* } * }
* *
* type WorkflowOutput = { * const myWorkflow = createWorkflow(
* message: string * "hello-world",
* } * (input: WorkflowInput) => {
*
* const myWorkflow = createWorkflow<
* WorkflowInput,
* WorkflowOutput
* >
* ("hello-world", (input) => {
* const str1 = step1(input) * const str1 = step1(input)
* const str2 = step2(input) * const str2 = step2(input)
* *
* return transform({ * const message = transform({
* str1, * str1,
* str2 * str2
* }, (input) => ({ * }, (input) => `${input.str1}${input.str2}`)
* message: `${input.str1}${input.str2}` *
* })) * return new WorkflowResponse(message)
* }) * })
*/ */
// prettier-ignore // prettier-ignore