chore(workflows, core-flows): Split workflows tooling and definitions (#5705)
This commit is contained in:
committed by
GitHub
parent
fc1ef29ed9
commit
ddbeed4ea6
8
.changeset/fresh-birds-serve.md
Normal file
8
.changeset/fresh-birds-serve.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/core-flows": patch
|
||||||
|
"@medusajs/orchestration": patch
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
"@medusajs/workflows-sdk": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
chore(workflows, core-flows, ...): Split workflows tooling and definitions
|
||||||
@@ -22,7 +22,8 @@ packages/*
|
|||||||
!packages/create-medusa-app
|
!packages/create-medusa-app
|
||||||
!packages/product
|
!packages/product
|
||||||
!packages/orchestration
|
!packages/orchestration
|
||||||
!packages/workflows
|
!packages/workflows-sdk
|
||||||
|
!packages/core-flows
|
||||||
|
|
||||||
|
|
||||||
**/models/*
|
**/models/*
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ module.exports = {
|
|||||||
"./packages/create-medusa-app/tsconfig.json",
|
"./packages/create-medusa-app/tsconfig.json",
|
||||||
"./packages/product/tsconfig.json",
|
"./packages/product/tsconfig.json",
|
||||||
"./packages/orchestration/tsconfig.json",
|
"./packages/orchestration/tsconfig.json",
|
||||||
"./packages/workflows/tsconfig.spec.json",
|
"./packages/workflows-sdk/tsconfig.spec.json",
|
||||||
|
"./packages/core-flows/tsconfig.spec.json",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ import { IInventoryService, WorkflowTypes } from "@medusajs/types"
|
|||||||
import {
|
import {
|
||||||
CreateInventoryItemActions,
|
CreateInventoryItemActions,
|
||||||
createInventoryItems,
|
createInventoryItems,
|
||||||
pipe,
|
} from "@medusajs/core-flows"
|
||||||
} from "@medusajs/workflows"
|
|
||||||
|
import { pipe } from "@medusajs/workflows-sdk"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
||||||
import { getContainer } from "../../../../environment-helpers/use-container"
|
import { getContainer } from "../../../../environment-helpers/use-container"
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { IProductModuleService, WorkflowTypes } from "@medusajs/types"
|
import { IProductModuleService, WorkflowTypes } from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
|
createProducts,
|
||||||
CreateProductsActions,
|
CreateProductsActions,
|
||||||
Handlers,
|
Handlers,
|
||||||
createProducts,
|
} from "@medusajs/core-flows"
|
||||||
pipe,
|
|
||||||
} from "@medusajs/workflows"
|
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
||||||
import { getContainer } from "../../../../environment-helpers/use-container"
|
import { getContainer } from "../../../../environment-helpers/use-container"
|
||||||
import { initDb, useDb } from "../../../../environment-helpers/use-db"
|
import { initDb, useDb } from "../../../../environment-helpers/use-db"
|
||||||
|
import { pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
jest.setTimeout(30000)
|
jest.setTimeout(30000)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
Handlers,
|
Handlers,
|
||||||
pipe,
|
|
||||||
updateProducts,
|
updateProducts,
|
||||||
UpdateProductsActions,
|
UpdateProductsActions,
|
||||||
} from "@medusajs/workflows"
|
} from "@medusajs/core-flows"
|
||||||
|
import { pipe } from "@medusajs/workflows-sdk"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
|
||||||
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
parallelize,
|
parallelize,
|
||||||
StepResponse,
|
StepResponse,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows"
|
} from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
jest.setTimeout(30000)
|
jest.setTimeout(30000)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const { Modules } = require("@medusajs/modules-sdk")
|
const { Modules } = require("@medusajs/modules-sdk")
|
||||||
const { Workflows } = require("@medusajs/workflows")
|
const { Workflows } = require("@medusajs/core-flows")
|
||||||
const DB_HOST = process.env.DB_HOST
|
const DB_HOST = process.env.DB_HOST
|
||||||
const DB_USERNAME = process.env.DB_USERNAME
|
const DB_USERNAME = process.env.DB_USERNAME
|
||||||
const DB_PASSWORD = process.env.DB_PASSWORD
|
const DB_PASSWORD = process.env.DB_PASSWORD
|
||||||
|
|||||||
1
packages/core-flows/CHANGELOG.md
Normal file
1
packages/core-flows/CHANGELOG.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# @medusajs/core-flows
|
||||||
42
packages/core-flows/package.json
Normal file
42
packages/core-flows/package.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"name": "@medusajs/core-flows",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "Set of workflow definitions for Medusa",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/medusajs/medusa",
|
||||||
|
"directory": "packages/core-flows"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"author": "Medusa",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@medusajs/types": "^1.11.7",
|
||||||
|
"cross-env": "^5.2.1",
|
||||||
|
"jest": "^29.6.3",
|
||||||
|
"rimraf": "^5.0.1",
|
||||||
|
"ts-jest": "^29.1.1",
|
||||||
|
"typescript": "^5.1.6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@medusajs/modules-sdk": "^1.12.3",
|
||||||
|
"@medusajs/orchestration": "^0.4.4",
|
||||||
|
"@medusajs/utils": "^1.11.0",
|
||||||
|
"@medusajs/workflows-sdk": "^0.1.0",
|
||||||
|
"awilix": "^8.0.1",
|
||||||
|
"ulid": "^2.3.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
||||||
|
"build": "rimraf dist && tsc --build",
|
||||||
|
"watch": "tsc --build --watch",
|
||||||
|
"test": "jest --runInBand --bail --forceExit --passWithNoTests"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
RegionHandlers,
|
RegionHandlers,
|
||||||
SalesChannelHandlers,
|
SalesChannelHandlers,
|
||||||
} from "../../handlers"
|
} from "../../handlers"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
enum CreateCartActions {
|
enum CreateCartActions {
|
||||||
setContext = "setContext",
|
setContext = "setContext",
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export * from "./cart"
|
export * from "./cart"
|
||||||
export * from "./product"
|
export * from "./product"
|
||||||
export * from "./inventory"
|
export * from "./inventory"
|
||||||
export * from './price-list'
|
export * from "./price-list"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
TransactionStepsDefinition,
|
TransactionStepsDefinition,
|
||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { InventoryTypes, WorkflowTypes } from "@medusajs/types"
|
import { InventoryTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { InventoryHandlers } from "../../handlers"
|
import { InventoryHandlers } from "../../handlers"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { PricingTypes, WorkflowTypes } from "@medusajs/types"
|
import { PricingTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
export * from "./create-price-lists"
|
export * from "./create-price-lists"
|
||||||
export * from "./remove-price-lists"
|
export * from "./remove-price-lists"
|
||||||
|
export * from "./remove-price-list-prices"
|
||||||
export * from "./remove-product-prices"
|
export * from "./remove-product-prices"
|
||||||
export * from "./remove-variant-prices"
|
export * from "./remove-variant-prices"
|
||||||
export * from "./update-price-lists"
|
export * from "./update-price-lists"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
@@ -62,7 +62,7 @@ WorkflowManager.register(
|
|||||||
handlers
|
handlers
|
||||||
)
|
)
|
||||||
|
|
||||||
export const removePriceListProductPrices = exportWorkflow<
|
export const removePriceListPrices = exportWorkflow<
|
||||||
WorkflowTypes.PriceListWorkflow.RemovePriceListPricesWorkflowInputDTO,
|
WorkflowTypes.PriceListWorkflow.RemovePriceListPricesWorkflowInputDTO,
|
||||||
string[]
|
string[]
|
||||||
>(
|
>(
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
TransactionStepsDefinition,
|
TransactionStepsDefinition,
|
||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { Workflows } from "../../definitions"
|
import { Workflows } from "../../definitions"
|
||||||
import { PriceListHandlers } from "../../handlers"
|
import { PriceListHandlers } from "../../handlers"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { InputAlias, Workflows } from "../../definitions"
|
import { InputAlias, Workflows } from "../../definitions"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { ProductHandlers } from "../../handlers"
|
import { ProductHandlers } from "../../handlers"
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
TransactionStepsDefinition,
|
TransactionStepsDefinition,
|
||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import {
|
import {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ProductTypes } from "@medusajs/types"
|
import { ProductTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type AssociationTaggedVariant = ProductTypes.ProductVariantDTO & {
|
type AssociationTaggedVariant = ProductTypes.ProductVariantDTO & {
|
||||||
_associationTag?: string
|
_associationTag?: string
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
WorkflowManager,
|
WorkflowManager,
|
||||||
} from "@medusajs/orchestration"
|
} from "@medusajs/orchestration"
|
||||||
import { InputAlias, Workflows } from "../../definitions"
|
import { InputAlias, Workflows } from "../../definitions"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { ProductHandlers } from "../../handlers"
|
import { ProductHandlers } from "../../handlers"
|
||||||
@@ -8,7 +8,7 @@ import { InputAlias, Workflows } from "../../definitions"
|
|||||||
import { InventoryHandlers, ProductHandlers } from "../../handlers"
|
import { InventoryHandlers, ProductHandlers } from "../../handlers"
|
||||||
import * as MiddlewareHandlers from "../../handlers/middlewares"
|
import * as MiddlewareHandlers from "../../handlers/middlewares"
|
||||||
import { detachSalesChannelFromProducts } from "../../handlers/product"
|
import { detachSalesChannelFromProducts } from "../../handlers/product"
|
||||||
import { exportWorkflow, pipe } from "../../helper"
|
import { exportWorkflow, pipe } from "@medusajs/workflows-sdk"
|
||||||
import { CreateProductsActions } from "./create-products"
|
import { CreateProductsActions } from "./create-products"
|
||||||
import { prepareCreateInventoryItems } from "./prepare-create-inventory-items"
|
import { prepareCreateInventoryItems } from "./prepare-create-inventory-items"
|
||||||
import { UpdateProductVariantsActions } from "./update-product-variants"
|
import { UpdateProductVariantsActions } from "./update-product-variants"
|
||||||
@@ -137,7 +137,7 @@ const handlers = new Map<string, any>([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
MiddlewareHandlers.mapData((d) => ({
|
MiddlewareHandlers.mapData((d: any) => ({
|
||||||
productsHandleSalesChannelsMap:
|
productsHandleSalesChannelsMap:
|
||||||
d.preparedData.productHandleAddedChannelsMap,
|
d.preparedData.productHandleAddedChannelsMap,
|
||||||
})),
|
})),
|
||||||
@@ -157,7 +157,7 @@ const handlers = new Map<string, any>([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
MiddlewareHandlers.mapData((d) => ({
|
MiddlewareHandlers.mapData((d: any) => ({
|
||||||
productsHandleSalesChannelsMap:
|
productsHandleSalesChannelsMap:
|
||||||
d.preparedData.productHandleAddedChannelsMap,
|
d.preparedData.productHandleAddedChannelsMap,
|
||||||
})),
|
})),
|
||||||
@@ -183,7 +183,7 @@ const handlers = new Map<string, any>([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
MiddlewareHandlers.mapData((d) => ({
|
MiddlewareHandlers.mapData((d: any) => ({
|
||||||
productsHandleSalesChannelsMap:
|
productsHandleSalesChannelsMap:
|
||||||
d.preparedData.productHandleRemovedChannelsMap,
|
d.preparedData.productHandleRemovedChannelsMap,
|
||||||
})),
|
})),
|
||||||
@@ -204,7 +204,7 @@ const handlers = new Map<string, any>([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
MiddlewareHandlers.mapData((d) => ({
|
MiddlewareHandlers.mapData((d: any) => ({
|
||||||
productsHandleSalesChannelsMap:
|
productsHandleSalesChannelsMap:
|
||||||
d.preparedData.productHandleRemovedChannelsMap,
|
d.preparedData.productHandleRemovedChannelsMap,
|
||||||
})),
|
})),
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { AddressDTO } from "@medusajs/types"
|
import { AddressDTO } from "@medusajs/types"
|
||||||
import { MedusaError } from "@medusajs/utils"
|
import { MedusaError } from "@medusajs/utils"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type AddressesDTO = {
|
type AddressesDTO = {
|
||||||
shipping_address_id?: string
|
shipping_address_id?: string
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { CartWorkflow } from "@medusajs/types"
|
import { CartWorkflow } from "@medusajs/types"
|
||||||
import { SalesChannelFeatureFlag } from "@medusajs/utils"
|
import { SalesChannelFeatureFlag } from "@medusajs/utils"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInputData = {
|
type HandlerInputData = {
|
||||||
line_items: {
|
line_items: {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CartDTO } from "@medusajs/types"
|
import { CartDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
enum Aliases {
|
enum Aliases {
|
||||||
SalesChannel = "SalesChannel",
|
SalesChannel = "SalesChannel",
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
enum Aliases {
|
enum Aliases {
|
||||||
Cart = "cart",
|
Cart = "cart",
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { CartDTO } from "@medusajs/types"
|
import { CartDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInputData = {
|
type HandlerInputData = {
|
||||||
cart: {
|
cart: {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type ContextDTO = {
|
type ContextDTO = {
|
||||||
context?: Record<any, any>
|
context?: Record<any, any>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { validateEmail } from "@medusajs/utils"
|
import { validateEmail } from "@medusajs/utils"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type CustomerDTO = {
|
type CustomerDTO = {
|
||||||
customer_id?: string
|
customer_id?: string
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { InventoryItemDTO } from "@medusajs/types"
|
import { InventoryItemDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
export async function attachInventoryItems({
|
export async function attachInventoryItems({
|
||||||
container,
|
container,
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { IInventoryService, InventoryItemDTO } from "@medusajs/types"
|
import { IInventoryService, InventoryItemDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { InventoryItemDTO } from "@medusajs/types"
|
import { InventoryItemDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
export async function detachInventoryItems({
|
export async function detachInventoryItems({
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { InventoryItemDTO } from "@medusajs/types"
|
import { InventoryItemDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
export async function removeInventoryItems({
|
export async function removeInventoryItems({
|
||||||
container,
|
container,
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
InventoryItemDTO,
|
InventoryItemDTO,
|
||||||
SharedContext,
|
SharedContext,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
export async function restoreInventoryItems({
|
export async function restoreInventoryItems({
|
||||||
container,
|
container,
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
type VariantIndexAndPrices = {
|
type VariantIndexAndPrices = {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ProductTypes } from "@medusajs/types"
|
import { ProductTypes } from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
export async function extractVariants({
|
export async function extractVariants({
|
||||||
data,
|
data,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Middleware for map input data to a key/s.
|
* Middleware for map input data to a key/s.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ProductTypes, ProductVariantDTO } from "@medusajs/types"
|
import { ProductTypes, ProductVariantDTO } from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { UpdateProductsPreparedData } from "../product"
|
import { UpdateProductsPreparedData } from "../product"
|
||||||
|
|
||||||
export async function updateProductsExtractCreatedVariants({
|
export async function updateProductsExtractCreatedVariants({
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ProductTypes, ProductVariantDTO } from "@medusajs/types"
|
import { ProductTypes, ProductVariantDTO } from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { UpdateProductsPreparedData } from "../product"
|
import { UpdateProductsPreparedData } from "../product"
|
||||||
|
|
||||||
export async function updateProductsExtractDeletedVariants({
|
export async function updateProductsExtractDeletedVariants({
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { IInventoryService, ProductVariantDTO } from "@medusajs/types"
|
import { IInventoryService, ProductVariantDTO } from "@medusajs/types"
|
||||||
|
|
||||||
export async function useVariantsInventoryItems({
|
export async function useVariantsInventoryItems({
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
|
|
||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
priceList: PriceListDTO
|
priceList: PriceListDTO
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CreatePriceListDTO, PriceListWorkflow } from "@medusajs/types"
|
import { CreatePriceListDTO, PriceListWorkflow } from "@medusajs/types"
|
||||||
import { MedusaError } from "@medusajs/utils"
|
import { MedusaError } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
tag?: string
|
tag?: string
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { IPricingModuleService } from "@medusajs/types"
|
import { IPricingModuleService } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
moneyAmountIds: string[]
|
moneyAmountIds: string[]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
UpdatePriceListDTO,
|
UpdatePriceListDTO,
|
||||||
WorkflowTypes,
|
WorkflowTypes,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
priceLists: UpdatePriceListDTO[]
|
priceLists: UpdatePriceListDTO[]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { IPricingModuleService, PriceListDTO } from "@medusajs/types"
|
import { IPricingModuleService, PriceListDTO } from "@medusajs/types"
|
||||||
|
|
||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
export async function removePriceLists({
|
export async function removePriceLists({
|
||||||
container,
|
container,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { IPricingModuleService } from "@medusajs/types"
|
import { IPricingModuleService } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
import { prepareCreatePriceLists } from "./prepare-create-price-list"
|
||||||
|
|
||||||
export async function removePriceListPriceSetPrices({
|
export async function removePriceListPriceSetPrices({
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { IPricingModuleService } from "@medusajs/types"
|
import { IPricingModuleService } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
deletedPriceIds: string[]
|
deletedPriceIds: string[]
|
||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
|
|
||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
priceLists: PriceListDTO[]
|
priceLists: PriceListDTO[]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ProductWorkflow, WorkflowTypes } from "@medusajs/types"
|
import { ProductWorkflow, WorkflowTypes } from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type VariantPrice = {
|
type VariantPrice = {
|
||||||
region_id?: string
|
region_id?: string
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
import { ProductTypes } from "@medusajs/types"
|
import { ProductTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type VariantPrice = {
|
type VariantPrice = {
|
||||||
region_id?: string
|
region_id?: string
|
||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
kebabCase,
|
kebabCase,
|
||||||
ShippingProfileUtils,
|
ShippingProfileUtils,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type ShippingProfileId = string
|
type ShippingProfileId = string
|
||||||
type SalesChannelId = string
|
type SalesChannelId = string
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ProductTypes } from "@medusajs/types"
|
import { ProductTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
|
|
||||||
type HandlerInput = {
|
type HandlerInput = {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { promiseAll } from "@medusajs/utils"
|
import { promiseAll } from "@medusajs/utils"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInput = {
|
type HandlerInput = {
|
||||||
ids: string[]
|
ids: string[]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
import { IProductModuleService } from "@medusajs/types"
|
import { IProductModuleService } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInput = { productVariants: { id: string }[] }
|
type HandlerInput = { productVariants: { id: string }[] }
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ProductTypes } from "@medusajs/types"
|
import { ProductTypes } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
|
|
||||||
type HandlerInput = { products: { id: string }[] }
|
type HandlerInput = { products: { id: string }[] }
|
||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
UpdateProductDTO,
|
UpdateProductDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
import { UpdateProductsPreparedData } from "./update-products-prepare-data"
|
import { UpdateProductsPreparedData } from "./update-products-prepare-data"
|
||||||
|
|
||||||
type HandlerInput = UpdateProductsPreparedData & {
|
type HandlerInput = UpdateProductsPreparedData & {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { PricingTypes } from "@medusajs/types"
|
import { PricingTypes } from "@medusajs/types"
|
||||||
import { MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInput = {
|
type HandlerInput = {
|
||||||
createdLinks: Record<any, any>[]
|
createdLinks: Record<any, any>[]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
import { ProductTypes, ProductWorkflow, WorkflowTypes } from "@medusajs/types"
|
import { ProductTypes, ProductWorkflow, WorkflowTypes } from "@medusajs/types"
|
||||||
import { MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type VariantPrice = {
|
type VariantPrice = {
|
||||||
region_id?: string
|
region_id?: string
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
import { ProductTypes, UpdateProductVariantOnlyDTO } from "@medusajs/types"
|
import { ProductTypes, UpdateProductVariantOnlyDTO } from "@medusajs/types"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInput = {
|
type HandlerInput = {
|
||||||
productVariantsMap: Map<string, ProductTypes.UpdateProductVariantDTO[]>
|
productVariantsMap: Map<string, ProductTypes.UpdateProductVariantDTO[]>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ProductDTO, SalesChannelDTO, WorkflowTypes } from "@medusajs/types"
|
import { ProductDTO, SalesChannelDTO, WorkflowTypes } from "@medusajs/types"
|
||||||
import { MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type ProductWithSalesChannelsDTO = ProductDTO & {
|
type ProductWithSalesChannelsDTO = ProductDTO & {
|
||||||
sales_channels?: SalesChannelDTO[]
|
sales_channels?: SalesChannelDTO[]
|
||||||
@@ -2,7 +2,7 @@ import { ProductTypes, WorkflowTypes } from "@medusajs/types"
|
|||||||
|
|
||||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||||
import { MedusaError, MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaError, MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type ProductHandle = string
|
type ProductHandle = string
|
||||||
type VariantIndexAndPrices = {
|
type VariantIndexAndPrices = {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||||
import { ProductDTO, ProductTypes } from "@medusajs/types"
|
import { ProductDTO, ProductTypes } from "@medusajs/types"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type HandlerInput = {
|
type HandlerInput = {
|
||||||
products: ProductTypes.UpdateProductDTO[]
|
products: ProductTypes.UpdateProductDTO[]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { PricingTypes } from "@medusajs/types"
|
import { PricingTypes } from "@medusajs/types"
|
||||||
import { MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type VariantPrice = {
|
type VariantPrice = {
|
||||||
id?: string
|
id?: string
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { MedusaError } from "@medusajs/utils"
|
import { MedusaError } from "@medusajs/utils"
|
||||||
import { isDefined } from "medusa-core-utils"
|
import { isDefined } from "medusa-core-utils"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type RegionDTO = {
|
type RegionDTO = {
|
||||||
region_id?: string
|
region_id?: string
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { MedusaError } from "@medusajs/utils"
|
import { MedusaError } from "@medusajs/utils"
|
||||||
import { isDefined } from "medusa-core-utils"
|
import { isDefined } from "medusa-core-utils"
|
||||||
|
|
||||||
import { WorkflowArguments } from "../../helper"
|
import { WorkflowArguments } from "@medusajs/workflows-sdk"
|
||||||
|
|
||||||
type AttachSalesChannelDTO = {
|
type AttachSalesChannelDTO = {
|
||||||
sales_channel_id?: string
|
sales_channel_id?: string
|
||||||
3
packages/core-flows/src/index.ts
Normal file
3
packages/core-flows/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export * from "./definition"
|
||||||
|
export * from "./definitions"
|
||||||
|
export * as Handlers from "./handlers"
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
# @medusajs/inventory
|
# @medusajs/inventory
|
||||||
|
# @medusajs/inventory
|
||||||
|
|
||||||
## 1.11.3
|
## 1.11.3
|
||||||
|
|
||||||
|
|||||||
@@ -47,12 +47,13 @@
|
|||||||
"typeorm": "^0.3.16"
|
"typeorm": "^0.3.16"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@medusajs/core-flows": "^0.0.1",
|
||||||
"@medusajs/link-modules": "^0.2.3",
|
"@medusajs/link-modules": "^0.2.3",
|
||||||
"@medusajs/medusa-cli": "^1.3.21",
|
"@medusajs/medusa-cli": "^1.3.21",
|
||||||
"@medusajs/modules-sdk": "^1.12.3",
|
"@medusajs/modules-sdk": "^1.12.3",
|
||||||
"@medusajs/orchestration": "^0.4.4",
|
"@medusajs/orchestration": "^0.4.4",
|
||||||
"@medusajs/utils": "^1.11.0",
|
"@medusajs/utils": "^1.11.0",
|
||||||
"@medusajs/workflows": "^0.3.0",
|
"@medusajs/workflows-sdk": "^0.1.0",
|
||||||
"awilix": "^8.0.0",
|
"awilix": "^8.0.0",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"boxen": "^5.0.1",
|
"boxen": "^5.0.1",
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
import { FlagRouter, ManyToManyInventoryFeatureFlag } from "@medusajs/utils"
|
import {
|
||||||
|
FlagRouter,
|
||||||
|
ManyToManyInventoryFeatureFlag,
|
||||||
|
MedusaError,
|
||||||
|
} from "@medusajs/utils"
|
||||||
import { IsNumber, IsObject, IsOptional, IsString } from "class-validator"
|
import { IsNumber, IsObject, IsOptional, IsString } from "class-validator"
|
||||||
import {
|
import {
|
||||||
createInventoryItems,
|
|
||||||
CreateInventoryItemActions,
|
CreateInventoryItemActions,
|
||||||
pipe,
|
createInventoryItems,
|
||||||
} from "@medusajs/workflows"
|
} from "@medusajs/core-flows"
|
||||||
|
import { pipe } from "@medusajs/workflows-sdk"
|
||||||
import { ProductVariantInventoryService } from "../../../../services"
|
import { ProductVariantInventoryService } from "../../../../services"
|
||||||
|
|
||||||
import { FindParams } from "../../../../types/common"
|
import { FindParams } from "../../../../types/common"
|
||||||
import { MedusaError } from "@medusajs/utils"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @oas [post] /admin/inventory-items
|
* @oas [post] /admin/inventory-items
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { MedusaV2Flag } from "@medusajs/utils"
|
import { MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { updatePriceLists } from "@medusajs/workflows"
|
import { updatePriceLists } from "@medusajs/core-flows"
|
||||||
import { Type } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
import { IsArray, IsBoolean, IsOptional, ValidateNested } from "class-validator"
|
import { IsArray, IsBoolean, IsOptional, ValidateNested } from "class-validator"
|
||||||
import { EntityManager } from "typeorm"
|
import { EntityManager } from "typeorm"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
PriceListStatus,
|
PriceListStatus,
|
||||||
PriceListType,
|
PriceListType,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/utils"
|
||||||
import { createPriceLists } from "@medusajs/workflows"
|
import { createPriceLists } from "@medusajs/core-flows"
|
||||||
import { Type } from "class-transformer"
|
import { Type } from "class-transformer"
|
||||||
import {
|
import {
|
||||||
IsArray,
|
IsArray,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
import { FlagRouter, MedusaV2Flag } from "@medusajs/utils"
|
import { FlagRouter, MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { removePriceLists } from "@medusajs/workflows"
|
import { removePriceLists } from "@medusajs/core-flows"
|
||||||
import { EntityManager } from "typeorm"
|
import { EntityManager } from "typeorm"
|
||||||
import PriceListService from "../../../../services/price-list"
|
import PriceListService from "../../../../services/price-list"
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { FlagRouter, MedusaV2Flag } from "@medusajs/utils"
|
import { FlagRouter, MedusaV2Flag } from "@medusajs/utils"
|
||||||
import { removePriceListProductPrices } from "@medusajs/workflows/dist/definition/price-list/remove-price-list-prices"
|
|
||||||
import { ArrayNotEmpty, IsString } from "class-validator"
|
import { ArrayNotEmpty, IsString } from "class-validator"
|
||||||
import { EntityManager } from "typeorm"
|
import { EntityManager } from "typeorm"
|
||||||
import PriceListService from "../../../../services/price-list"
|
import PriceListService from "../../../../services/price-list"
|
||||||
import { validator } from "../../../../utils/validator"
|
import { validator } from "../../../../utils/validator"
|
||||||
import { WorkflowTypes } from "@medusajs/types"
|
import { WorkflowTypes } from "@medusajs/types"
|
||||||
|
import { removePriceListPrices } from "@medusajs/core-flows"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @oas [delete] /admin/price-lists/{id}/prices/batch
|
* @oas [delete] /admin/price-lists/{id}/prices/batch
|
||||||
@@ -92,9 +92,7 @@ export default async (req, res) => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (isMedusaV2FlagEnabled) {
|
if (isMedusaV2FlagEnabled) {
|
||||||
const deletePriceListPricesWorkflow = removePriceListProductPrices(
|
const deletePriceListPricesWorkflow = removePriceListPrices(req.scope)
|
||||||
req.scope
|
|
||||||
)
|
|
||||||
|
|
||||||
const input = {
|
const input = {
|
||||||
price_list_id: id,
|
price_list_id: id,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user