chore: perform dependencies scan and fix all dependencies (#9296)
This commit is contained in:
1 parent
fba78c0fb1
commit
48bea267dc
593 files changed
+2724
-2309
No files matched your search
@@ -1,5 +1,2 @@
|
|||||||
module.exports = {
|
const defineJestConfig = require("../../../define_jest_config")
|
||||||
transform: { "^.+\\.[jt]s$": ["@swc/jest"] },
|
module.exports = defineJestConfig()
|
||||||
testEnvironment: `node`,
|
|
||||||
moduleFileExtensions: [`js`, `jsx`, `ts`, `tsx`, `json`],
|
|
||||||
}
|
|
||||||
@@ -16,10 +16,13 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"cli.js"
|
"cli.js",
|
||||||
|
"!dist/**/__tests__",
|
||||||
|
"!dist/**/__mocks__",
|
||||||
|
"!dist/**/__fixtures__"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest --passWithNoTests src",
|
"test": "jest --passWithNoTests src",
|
||||||
@@ -29,17 +32,24 @@
|
|||||||
"author": "Sebastian Rindom",
|
"author": "Sebastian Rindom",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@swc/core": "^1.5.29",
|
"@swc/core": "^1.7.28",
|
||||||
"@swc/jest": "^0.2.36",
|
"@swc/jest": "^0.2.36",
|
||||||
"@types/yargs": "^15.0.15",
|
"@types/yargs": "^15.0.15",
|
||||||
"cross-env": "^5.2.1",
|
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"typescript": "^5.3.3"
|
"ts-node": "^10.9.2",
|
||||||
|
"typescript": "^5.6.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"ts-node": "^10.9.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"ts-node": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@medusajs/utils": "^1.11.9",
|
"@medusajs/utils": "1.11.9",
|
||||||
"axios": "^0.21.4",
|
|
||||||
"chalk": "^4.0.0",
|
"chalk": "^4.0.0",
|
||||||
"configstore": "5.0.1",
|
"configstore": "5.0.1",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
@@ -52,19 +62,15 @@
|
|||||||
"is-valid-path": "^0.1.1",
|
"is-valid-path": "^0.1.1",
|
||||||
"meant": "^1.0.3",
|
"meant": "^1.0.3",
|
||||||
"medusa-telemetry": "^0.0.17",
|
"medusa-telemetry": "^0.0.17",
|
||||||
"open": "^8.0.6",
|
|
||||||
"ora": "^5.4.1",
|
"ora": "^5.4.1",
|
||||||
"pg": "^8.11.3",
|
"pg": "^8.11.3",
|
||||||
"pg-god": "^1.0.12",
|
"pg-god": "^1.0.12",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"resolve-cwd": "^3.0.0",
|
"resolve-cwd": "^3.0.0",
|
||||||
"semver": "^7.3.8",
|
|
||||||
"stack-trace": "^0.0.10",
|
"stack-trace": "^0.0.10",
|
||||||
|
"ulid": "^2.3.0",
|
||||||
"winston": "^3.8.2",
|
"winston": "^3.8.2",
|
||||||
"yargs": "^15.3.1"
|
"yargs": "^15.3.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
|
||||||
"ulid": "^2.3.0"
|
|
||||||
},
|
|
||||||
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
|
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
|
||||||
}
|
}
|
||||||
@@ -12,9 +12,10 @@ import sysPath from "path"
|
|||||||
import prompts from "prompts"
|
import prompts from "prompts"
|
||||||
import { Pool } from "pg"
|
import { Pool } from "pg"
|
||||||
import url from "url"
|
import url from "url"
|
||||||
|
// @ts-ignore
|
||||||
|
import inquirer from "inquirer"
|
||||||
import { createDatabase } from "pg-god"
|
import { createDatabase } from "pg-god"
|
||||||
import { track } from "medusa-telemetry"
|
import { track } from "medusa-telemetry"
|
||||||
import inquirer from "inquirer"
|
|
||||||
|
|
||||||
import reporter from "../reporter"
|
import reporter from "../reporter"
|
||||||
import { getPackageManager, setPackageManager } from "../util/package-manager"
|
import { getPackageManager, setPackageManager } from "../util/package-manager"
|
||||||
@@ -180,7 +181,10 @@ const clone = async (hostInfo, rootPath, v2 = false, inputBranch) => {
|
|||||||
url = hostInfo.https({ noCommittish: true, noGitPlus: true })
|
url = hostInfo.https({ noCommittish: true, noGitPlus: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
let branch = (inputBranch || hostInfo.committish ? [`-b`, inputBranch || hostInfo.committish] : [])
|
let branch =
|
||||||
|
inputBranch || hostInfo.committish
|
||||||
|
? [`-b`, inputBranch || hostInfo.committish]
|
||||||
|
: []
|
||||||
|
|
||||||
if (v2) {
|
if (v2) {
|
||||||
branch = [`-b`, inputBranch || "feat/v2"]
|
branch = [`-b`, inputBranch || "feat/v2"]
|
||||||
@@ -215,24 +219,6 @@ const clone = async (hostInfo, rootPath, v2 = false, inputBranch) => {
|
|||||||
if (!isGit) await createInitialGitCommit(rootPath, url)
|
if (!isGit) await createInitialGitCommit(rootPath, url)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getMedusaConfig = (rootPath) => {
|
|
||||||
try {
|
|
||||||
const configPath = sysPath.join(rootPath, "medusa-config.js")
|
|
||||||
if (existsSync(configPath)) {
|
|
||||||
const resolved = sysPath.resolve(configPath)
|
|
||||||
const configModule = require(resolved)
|
|
||||||
return configModule
|
|
||||||
}
|
|
||||||
throw Error()
|
|
||||||
} catch (err) {
|
|
||||||
console.log(err)
|
|
||||||
reporter.warn(
|
|
||||||
`Couldn't find a medusa-config.js file; please double check that you have the correct starter installed`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getPaths = async (starterPath, rootPath, v2 = false) => {
|
const getPaths = async (starterPath, rootPath, v2 = false) => {
|
||||||
let selectedOtherStarter = false
|
let selectedOtherStarter = false
|
||||||
|
|
||||||
@@ -515,7 +501,9 @@ const attemptSeed = async (rootPath) => {
|
|||||||
export const newStarter = async (args) => {
|
export const newStarter = async (args) => {
|
||||||
const nodeVersion = getNodeVersion()
|
const nodeVersion = getNodeVersion()
|
||||||
if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) {
|
if (nodeVersion < MIN_SUPPORTED_NODE_VERSION) {
|
||||||
reporter.error(`Medusa requires at least v20 of Node.js. You're using v${nodeVersion}. Please install at least v20 and try again: https://nodejs.org/en/download`)
|
reporter.error(
|
||||||
|
`Medusa requires at least v20 of Node.js. You're using v${nodeVersion}. Please install at least v20 and try again: https://nodejs.org/en/download`
|
||||||
|
)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
track("CLI_NEW")
|
track("CLI_NEW")
|
||||||
@@ -534,7 +522,7 @@ export const newStarter = async (args) => {
|
|||||||
dbPort,
|
dbPort,
|
||||||
dbHost,
|
dbHost,
|
||||||
v2,
|
v2,
|
||||||
branch
|
branch,
|
||||||
} = args
|
} = args
|
||||||
|
|
||||||
const dbCredentials = removeUndefined({
|
const dbCredentials = removeUndefined({
|
||||||
@@ -656,7 +644,7 @@ medusa new ${rootPath} [url-to-starter]
|
|||||||
// remove demo files
|
// remove demo files
|
||||||
clearProject(rootPath)
|
clearProject(rootPath)
|
||||||
// remove .git directory
|
// remove .git directory
|
||||||
fs.rmSync(path.join(rootPath, '.git'), {
|
fs.rmSync(path.join(rootPath, ".git"), {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,11 +15,6 @@ if (os.platform() === `win32`) {
|
|||||||
// ensureWindowsDriveLetterIsUppercase()
|
// ensureWindowsDriveLetterIsUppercase()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if update is available
|
|
||||||
// updateNotifier({ pkg }).notify({ isGlobal: true })
|
|
||||||
|
|
||||||
const MIN_NODE_VERSION = `10.13.0`
|
|
||||||
|
|
||||||
process.on(`unhandledRejection`, (reason) => {
|
process.on(`unhandledRejection`, (reason) => {
|
||||||
// This will exit the process in newer Node anyway so lets be consistent
|
// This will exit the process in newer Node anyway so lets be consistent
|
||||||
// across versions and crash
|
// across versions and crash
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ import ora from "ora"
|
|||||||
import stackTrace from "stack-trace"
|
import stackTrace from "stack-trace"
|
||||||
import { ulid } from "ulid"
|
import { ulid } from "ulid"
|
||||||
import winston from "winston"
|
import winston from "winston"
|
||||||
|
|
||||||
import * as Transport from "winston-transport"
|
|
||||||
import { panicHandler } from "./panic-handler"
|
import { panicHandler } from "./panic-handler"
|
||||||
|
|
||||||
const LOG_LEVEL = process.env.LOG_LEVEL || "info"
|
const LOG_LEVEL = process.env.LOG_LEVEL || "info"
|
||||||
@@ -12,7 +10,7 @@ const LOG_FILE = process.env.LOG_FILE || ""
|
|||||||
const NODE_ENV = process.env.NODE_ENV || "development"
|
const NODE_ENV = process.env.NODE_ENV || "development"
|
||||||
const IS_DEV = NODE_ENV.startsWith("dev")
|
const IS_DEV = NODE_ENV.startsWith("dev")
|
||||||
|
|
||||||
let transports: Transport[] = []
|
let transports: winston.transport[] = []
|
||||||
|
|
||||||
if (!IS_DEV) {
|
if (!IS_DEV) {
|
||||||
transports.push(new winston.transports.Console())
|
transports.push(new winston.transports.Console())
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-ignore
|
||||||
import ConfigStore from "configstore"
|
import ConfigStore from "configstore"
|
||||||
import reporter from "../reporter"
|
import reporter from "../reporter"
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,3 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"extends": "../../../_tsconfig.base.json"
|
||||||
"lib": ["es2021"],
|
|
||||||
"target": "es2021",
|
|
||||||
"outDir": "./dist",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"declarationMap": true,
|
|
||||||
"declaration": true,
|
|
||||||
"module": "commonjs",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"strictFunctionTypes": true,
|
|
||||||
"noImplicitThis": true,
|
|
||||||
"allowJs": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"downlevelIteration": true // to use ES5 specific tooling
|
|
||||||
},
|
|
||||||
"include": ["src"],
|
|
||||||
"exclude": [
|
|
||||||
"dist",
|
|
||||||
"./src/**/__tests__",
|
|
||||||
"./src/**/__mocks__",
|
|
||||||
"./src/**/__fixtures__",
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"include": ["src"],
|
|
||||||
"exclude": ["node_modules"]
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"yargs": "^15.4.1"
|
"yargs": "^15.4.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@swc/core": "^1.5.29",
|
"@swc/core": "^1.7.28",
|
||||||
"@swc/jest": "^0.2.36",
|
"@swc/jest": "^0.2.36",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
|
|||||||
@@ -1,15 +1,2 @@
|
|||||||
module.exports = {
|
const defineJestConfig = require("../../../define_jest_config")
|
||||||
transform: {
|
module.exports = defineJestConfig()
|
||||||
"^.+\\.[jt]s$": [
|
|
||||||
"@swc/jest",
|
|
||||||
{
|
|
||||||
jsc: {
|
|
||||||
parser: { syntax: "typescript", decorators: true },
|
|
||||||
transform: { decoratorMetadata: true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
testEnvironment: `node`,
|
|
||||||
moduleFileExtensions: [`js`, `ts`],
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
"version": "0.0.9",
|
"version": "0.0.9",
|
||||||
"description": "Set of workflow definitions for Medusa",
|
"description": "Set of workflow definitions for Medusa",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"exports": {
|
||||||
|
".": "./dist/index.js"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/medusajs/medusa",
|
"url": "https://github.com/medusajs/medusa",
|
||||||
@@ -13,31 +15,39 @@
|
|||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=20"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist",
|
||||||
|
"!dist/**/__tests__",
|
||||||
|
"!dist/**/__mocks__",
|
||||||
|
"!dist/**/__fixtures__"
|
||||||
],
|
],
|
||||||
"author": "Medusa",
|
"author": "Medusa",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@medusajs/types": "^1.11.16",
|
"@medusajs/framework": "^0.0.1",
|
||||||
"@swc/core": "^1.5.29",
|
"@mikro-orm/core": "5.9.7",
|
||||||
|
"@mikro-orm/knex": "5.9.7",
|
||||||
|
"@mikro-orm/migrations": "5.9.7",
|
||||||
|
"@mikro-orm/postgresql": "5.9.7",
|
||||||
|
"@swc/core": "^1.7.28",
|
||||||
"@swc/jest": "^0.2.36",
|
"@swc/jest": "^0.2.36",
|
||||||
|
"awilix": "^8.0.1",
|
||||||
|
"bignumber.js": "^9.1.2",
|
||||||
"cross-env": "^5.2.1",
|
"cross-env": "^5.2.1",
|
||||||
|
"ioredis": "^5.4.1",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
|
"pg": "^8.13.0",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"typescript": "^5.1.6"
|
"typescript": "^5.6.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@medusajs/modules-sdk": "^1.12.11",
|
|
||||||
"@medusajs/utils": "^1.11.9",
|
|
||||||
"@medusajs/workflows-sdk": "^0.1.6",
|
|
||||||
"json-2-csv": "^5.5.4"
|
"json-2-csv": "^5.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"awilix": "^8.0.1",
|
"@medusajs/framework": "^0.0.1",
|
||||||
"ulid": "^2.3.0"
|
"awilix": "^8.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rimraf dist && tsc --build",
|
"build": "rimraf dist && tsc --build",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { CreateApiKeyDTO, IApiKeyModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CreateApiKeyDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
IApiKeyModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type CreateApiKeysStepInput = {
|
export type CreateApiKeysStepInput = {
|
||||||
api_keys: CreateApiKeyDTO[]
|
api_keys: CreateApiKeyDTO[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IApiKeyModuleService } from "@medusajs/types"
|
import { IApiKeyModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const deleteApiKeysStepId = "delete-api-keys"
|
export const deleteApiKeysStepId = "delete-api-keys"
|
||||||
/**
|
/**
|
||||||
|
|||||||
+7
-3
@@ -1,6 +1,10 @@
|
|||||||
import { LinkWorkflowInput } from "@medusajs/types"
|
import { LinkWorkflowInput } from "@medusajs/framework/types"
|
||||||
import { ContainerRegistrationKeys, Modules, promiseAll } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ContainerRegistrationKeys,
|
||||||
|
Modules,
|
||||||
|
promiseAll,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const linkSalesChannelsToApiKeyStepId = "link-sales-channels-to-api-key"
|
export const linkSalesChannelsToApiKeyStepId = "link-sales-channels-to-api-key"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import {
|
|||||||
FilterableApiKeyProps,
|
FilterableApiKeyProps,
|
||||||
IApiKeyModuleService,
|
IApiKeyModuleService,
|
||||||
RevokeApiKeyDTO,
|
RevokeApiKeyDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type RevokeApiKeysStepInput = {
|
export type RevokeApiKeysStepInput = {
|
||||||
selector: FilterableApiKeyProps
|
selector: FilterableApiKeyProps
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ import {
|
|||||||
FilterableApiKeyProps,
|
FilterableApiKeyProps,
|
||||||
IApiKeyModuleService,
|
IApiKeyModuleService,
|
||||||
UpdateApiKeyDTO,
|
UpdateApiKeyDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, getSelectsAndRelationsFromObjectArray } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
Modules,
|
||||||
|
getSelectsAndRelationsFromObjectArray,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type UpdateApiKeysStepInput = {
|
export type UpdateApiKeysStepInput = {
|
||||||
selector: FilterableApiKeyProps
|
selector: FilterableApiKeyProps
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { ISalesChannelModuleService } from "@medusajs/types"
|
import { ISalesChannelModuleService } from "@medusajs/framework/types"
|
||||||
import { MedusaError, Modules, arrayDifference } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
MedusaError,
|
||||||
|
Modules,
|
||||||
|
arrayDifference,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ValidateSalesChannelsExistStepInput {
|
export interface ValidateSalesChannelsExistStepInput {
|
||||||
sales_channel_ids: string[]
|
sales_channel_ids: string[]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { ApiKeyDTO, CreateApiKeyDTO } from "@medusajs/types"
|
import { ApiKeyDTO, CreateApiKeyDTO } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { createApiKeysStep } from "../steps"
|
import { createApiKeysStep } from "../steps"
|
||||||
|
|
||||||
export type CreateApiKeysWorkflowInput = { api_keys: CreateApiKeyDTO[] }
|
export type CreateApiKeysWorkflowInput = { api_keys: CreateApiKeyDTO[] }
|
||||||
@@ -14,7 +14,9 @@ export const createApiKeysWorkflowId = "create-api-keys"
|
|||||||
*/
|
*/
|
||||||
export const createApiKeysWorkflow = createWorkflow(
|
export const createApiKeysWorkflow = createWorkflow(
|
||||||
createApiKeysWorkflowId,
|
createApiKeysWorkflowId,
|
||||||
(input: WorkflowData<CreateApiKeysWorkflowInput>): WorkflowResponse<ApiKeyDTO[]> => {
|
(
|
||||||
|
input: WorkflowData<CreateApiKeysWorkflowInput>
|
||||||
|
): WorkflowResponse<ApiKeyDTO[]> => {
|
||||||
return new WorkflowResponse(createApiKeysStep(input))
|
return new WorkflowResponse(createApiKeysStep(input))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createWorkflow, WorkflowData } from "@medusajs/workflows-sdk"
|
import { createWorkflow, WorkflowData } from "@medusajs/framework/workflows-sdk"
|
||||||
import { removeRemoteLinkStep } from "../../common/steps/remove-remote-links"
|
import { removeRemoteLinkStep } from "../../common/steps/remove-remote-links"
|
||||||
import { deleteApiKeysStep } from "../steps"
|
import { deleteApiKeysStep } from "../steps"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
export type DeleteApiKeysWorkflowInput = { ids: string[] }
|
export type DeleteApiKeysWorkflowInput = { ids: string[] }
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { LinkWorkflowInput } from "@medusajs/types"
|
import { LinkWorkflowInput } from "@medusajs/framework/types"
|
||||||
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
import { WorkflowData, createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||||
import {
|
import {
|
||||||
linkSalesChannelsToApiKeyStep,
|
linkSalesChannelsToApiKeyStep,
|
||||||
validateSalesChannelsExistStep,
|
validateSalesChannelsExistStep,
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import {
|
|||||||
ApiKeyDTO,
|
ApiKeyDTO,
|
||||||
FilterableApiKeyProps,
|
FilterableApiKeyProps,
|
||||||
RevokeApiKeyDTO,
|
RevokeApiKeyDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { revokeApiKeysStep } from "../steps"
|
import { revokeApiKeysStep } from "../steps"
|
||||||
|
|
||||||
export type RevokeApiKeysWorkflowInput = {
|
export type RevokeApiKeysWorkflowInput = {
|
||||||
@@ -21,7 +21,9 @@ export const revokeApiKeysWorkflowId = "revoke-api-keys"
|
|||||||
*/
|
*/
|
||||||
export const revokeApiKeysWorkflow = createWorkflow(
|
export const revokeApiKeysWorkflow = createWorkflow(
|
||||||
revokeApiKeysWorkflowId,
|
revokeApiKeysWorkflowId,
|
||||||
(input: WorkflowData<RevokeApiKeysWorkflowInput>): WorkflowResponse<ApiKeyDTO[]> => {
|
(
|
||||||
|
input: WorkflowData<RevokeApiKeysWorkflowInput>
|
||||||
|
): WorkflowResponse<ApiKeyDTO[]> => {
|
||||||
return new WorkflowResponse(revokeApiKeysStep(input))
|
return new WorkflowResponse(revokeApiKeysStep(input))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -2,12 +2,12 @@ import {
|
|||||||
ApiKeyDTO,
|
ApiKeyDTO,
|
||||||
FilterableApiKeyProps,
|
FilterableApiKeyProps,
|
||||||
UpdateApiKeyDTO,
|
UpdateApiKeyDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { updateApiKeysStep } from "../steps"
|
import { updateApiKeysStep } from "../steps"
|
||||||
|
|
||||||
export type UpdateApiKeysWorkflowInput = {
|
export type UpdateApiKeysWorkflowInput = {
|
||||||
@@ -21,7 +21,9 @@ export const updateApiKeysWorkflowId = "update-api-keys"
|
|||||||
*/
|
*/
|
||||||
export const updateApiKeysWorkflow = createWorkflow(
|
export const updateApiKeysWorkflow = createWorkflow(
|
||||||
updateApiKeysWorkflowId,
|
updateApiKeysWorkflowId,
|
||||||
(input: WorkflowData<UpdateApiKeysWorkflowInput>): WorkflowResponse<ApiKeyDTO[]> => {
|
(
|
||||||
|
input: WorkflowData<UpdateApiKeysWorkflowInput>
|
||||||
|
): WorkflowResponse<ApiKeyDTO[]> => {
|
||||||
return new WorkflowResponse(updateApiKeysStep(input))
|
return new WorkflowResponse(updateApiKeysStep(input))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
import { IAuthModuleService } from "@medusajs/types"
|
import { IAuthModuleService } from "@medusajs/framework/types"
|
||||||
import { isDefined, Modules } from "@medusajs/utils"
|
import { isDefined, Modules } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
export type SetAuthAppMetadataStepInput = {
|
export type SetAuthAppMetadataStepInput = {
|
||||||
authIdentityId: string
|
authIdentityId: string
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import {
|
|||||||
AuthWorkflowEvents,
|
AuthWorkflowEvents,
|
||||||
generateJwtToken,
|
generateJwtToken,
|
||||||
MedusaError,
|
MedusaError,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { emitEventStep, useRemoteQueryStep } from "../../common"
|
import { emitEventStep, useRemoteQueryStep } from "../../common"
|
||||||
|
|
||||||
export const generateResetPasswordTokenWorkflow = createWorkflow(
|
export const generateResetPasswordTokenWorkflow = createWorkflow(
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { CreateShippingMethodDTO, ICartModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CreateShippingMethodDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ICartModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface AddShippingMethodToCartStepInput {
|
export interface AddShippingMethodToCartStepInput {
|
||||||
shipping_methods: CreateShippingMethodDTO[]
|
shipping_methods: CreateShippingMethodDTO[]
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { IInventoryService } from "@medusajs/types"
|
import { IInventoryService } from "@medusajs/framework/types"
|
||||||
import { MathBN, MedusaError, Modules, promiseAll } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
MathBN,
|
||||||
|
MedusaError,
|
||||||
|
Modules,
|
||||||
|
promiseAll,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ConfirmVariantInventoryStepInput {
|
export interface ConfirmVariantInventoryStepInput {
|
||||||
items: {
|
items: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CreateCartDTO, ICartModuleService } from "@medusajs/types"
|
import { CreateCartDTO, ICartModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const createCartsStepId = "create-carts"
|
export const createCartsStepId = "create-carts"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
CreateLineItemAdjustmentDTO,
|
CreateLineItemAdjustmentDTO,
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface CreateLineItemAdjustmentsCartStepInput {
|
export interface CreateLineItemAdjustmentsCartStepInput {
|
||||||
lineItemAdjustmentsToCreate: CreateLineItemAdjustmentDTO[]
|
lineItemAdjustmentsToCreate: CreateLineItemAdjustmentDTO[]
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { CreateLineItemForCartDTO, ICartModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CreateLineItemForCartDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ICartModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface CreateLineItemsCartStepInput {
|
export interface CreateLineItemsCartStepInput {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { BigNumberInput, IPaymentModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
BigNumberInput,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
IPaymentModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type CreatePaymentCollectionCartStepInput = {
|
export type CreatePaymentCollectionCartStepInput = {
|
||||||
region_id: string
|
region_id: string
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
CreateShippingMethodAdjustmentDTO,
|
CreateShippingMethodAdjustmentDTO,
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface CreateShippingMethodAdjustmentsStepInput {
|
export interface CreateShippingMethodAdjustmentsStepInput {
|
||||||
shippingMethodAdjustmentsToCreate: CreateShippingMethodAdjustmentDTO[]
|
shippingMethodAdjustmentsToCreate: CreateShippingMethodAdjustmentDTO[]
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { IRegionModuleService, IStoreModuleService } from "@medusajs/types"
|
import {
|
||||||
import { MedusaError, Modules } from "@medusajs/utils"
|
IRegionModuleService,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
IStoreModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { MedusaError, Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const findOneOrAnyRegionStepId = "find-one-or-any-region"
|
export const findOneOrAnyRegionStepId = "find-one-or-any-region"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CustomerDTO, ICustomerModuleService } from "@medusajs/types"
|
import { CustomerDTO, ICustomerModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules, validateEmail } from "@medusajs/utils"
|
import { Modules, validateEmail } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface FindOrCreateCustomerStepInput {
|
export interface FindOrCreateCustomerStepInput {
|
||||||
customerId?: string | null
|
customerId?: string | null
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import {
|
|||||||
ISalesChannelModuleService,
|
ISalesChannelModuleService,
|
||||||
IStoreModuleService,
|
IStoreModuleService,
|
||||||
SalesChannelDTO,
|
SalesChannelDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { MedusaError, Modules, isDefined } from "@medusajs/utils"
|
import { MedusaError, Modules, isDefined } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface FindSalesChannelStepInput {
|
export interface FindSalesChannelStepInput {
|
||||||
salesChannelId?: string | null
|
salesChannelId?: string | null
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CartDTO, IPromotionModuleService } from "@medusajs/types"
|
import { CartDTO, IPromotionModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetActionsToComputeFromPromotionsStepInput {
|
export interface GetActionsToComputeFromPromotionsStepInput {
|
||||||
cart: CartDTO
|
cart: CartDTO
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import {
|
|||||||
TaxCalculationContext,
|
TaxCalculationContext,
|
||||||
TaxableItemDTO,
|
TaxableItemDTO,
|
||||||
TaxableShippingDTO,
|
TaxableShippingDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { MedusaError, Modules } from "@medusajs/utils"
|
import { MedusaError, Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetItemTaxLinesStepInput {
|
export interface GetItemTaxLinesStepInput {
|
||||||
cart: CartWorkflowDTO
|
cart: CartWorkflowDTO
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ import {
|
|||||||
CreateLineItemForCartDTO,
|
CreateLineItemForCartDTO,
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
UpdateLineItemWithSelectorDTO,
|
UpdateLineItemWithSelectorDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { MathBN, Modules, deepEqualObj, isPresent } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
MathBN,
|
||||||
|
Modules,
|
||||||
|
deepEqualObj,
|
||||||
|
isPresent,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetLineItemActionsStepInput {
|
export interface GetLineItemActionsStepInput {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IPromotionModuleService } from "@medusajs/types"
|
import { IPromotionModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules, PromotionActions } from "@medusajs/utils"
|
import { Modules, PromotionActions } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetPromotionCodesToApplyStepInput {
|
export interface GetPromotionCodesToApplyStepInput {
|
||||||
cart: {
|
cart: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IPricingModuleService } from "@medusajs/types"
|
import { IPricingModuleService } from "@medusajs/framework/types"
|
||||||
import { MedusaError, Modules } from "@medusajs/utils"
|
import { MedusaError, Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetVariantPriceSetsStepInput {
|
export interface GetVariantPriceSetsStepInput {
|
||||||
variantIds: string[]
|
variantIds: string[]
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import {
|
|||||||
FindConfig,
|
FindConfig,
|
||||||
IProductModuleService,
|
IProductModuleService,
|
||||||
ProductVariantDTO,
|
ProductVariantDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface GetVariantsStepInput {
|
export interface GetVariantsStepInput {
|
||||||
filter?: FilterableProductVariantProps
|
filter?: FilterableProductVariantProps
|
||||||
|
|||||||
+3
-3
@@ -6,9 +6,9 @@ import {
|
|||||||
PromotionDTO,
|
PromotionDTO,
|
||||||
RemoveItemAdjustmentAction,
|
RemoveItemAdjustmentAction,
|
||||||
RemoveShippingMethodAdjustment,
|
RemoveShippingMethodAdjustment,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { ComputedActions, Modules } from "@medusajs/utils"
|
import { ComputedActions, Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface PrepareAdjustmentsFromPromotionActionsStepInput {
|
export interface PrepareAdjustmentsFromPromotionActionsStepInput {
|
||||||
actions: ComputeActions[]
|
actions: ComputeActions[]
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import {
|
|||||||
CartDTO,
|
CartDTO,
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
IFulfillmentModuleService,
|
IFulfillmentModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, arrayDifference } from "@medusajs/utils"
|
import { Modules, arrayDifference } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RefreshCartShippingMethodsStepInput {
|
export interface RefreshCartShippingMethodsStepInput {
|
||||||
cart: CartDTO
|
cart: CartDTO
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICartModuleService } from "@medusajs/types"
|
import { ICartModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RemoveLineItemAdjustmentsStepInput {
|
export interface RemoveLineItemAdjustmentsStepInput {
|
||||||
lineItemAdjustmentIdsToRemove: string[]
|
lineItemAdjustmentIdsToRemove: string[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICartModuleService } from "@medusajs/types"
|
import { ICartModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RemoveShippingMethodAdjustmentsStepInput {
|
export interface RemoveShippingMethodAdjustmentsStepInput {
|
||||||
shippingMethodAdjustmentIdsToRemove: string[]
|
shippingMethodAdjustmentIdsToRemove: string[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICartModuleService } from "@medusajs/types"
|
import { ICartModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RemoveShippingMethodFromCartStepInput {
|
export interface RemoveShippingMethodFromCartStepInput {
|
||||||
shipping_method_ids: string[]
|
shipping_method_ids: string[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IInventoryService } from "@medusajs/types"
|
import { IInventoryService } from "@medusajs/framework/types"
|
||||||
import { MathBN, Modules } from "@medusajs/utils"
|
import { MathBN, Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ReserveVariantInventoryStepInput {
|
export interface ReserveVariantInventoryStepInput {
|
||||||
items: {
|
items: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CartWorkflowDTO } from "@medusajs/types"
|
import { CartWorkflowDTO } from "@medusajs/framework/types"
|
||||||
import { ContainerRegistrationKeys, isObject } from "@medusajs/utils"
|
import { ContainerRegistrationKeys, isObject } from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RetrieveCartWithLinksStepInput {
|
export interface RetrieveCartWithLinksStepInput {
|
||||||
cart_or_cart_id: string | CartWorkflowDTO
|
cart_or_cart_id: string | CartWorkflowDTO
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { CartDTO, FindConfig, ICartModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CartDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
FindConfig,
|
||||||
|
ICartModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface RetrieveCartStepInput {
|
export interface RetrieveCartStepInput {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
ItemTaxLineDTO,
|
ItemTaxLineDTO,
|
||||||
ShippingTaxLineDTO,
|
ShippingTaxLineDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface SetTaxLinesForItemsStepInput {
|
export interface SetTaxLinesForItemsStepInput {
|
||||||
cart: CartWorkflowDTO
|
cart: CartWorkflowDTO
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { IPromotionModuleService } from "@medusajs/types"
|
import { IPromotionModuleService } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
Modules,
|
Modules,
|
||||||
PromotionActions,
|
PromotionActions,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface UpdateCartPromotionStepInput {
|
export interface UpdateCartPromotionStepInput {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ import {
|
|||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
UpdateCartDTO,
|
UpdateCartDTO,
|
||||||
UpdateCartWorkflowInputDTO,
|
UpdateCartWorkflowInputDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, getSelectsAndRelationsFromObjectArray } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
Modules,
|
||||||
|
getSelectsAndRelationsFromObjectArray,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const updateCartsStepId = "update-carts"
|
export const updateCartsStepId = "update-carts"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
ICartModuleService,
|
ICartModuleService,
|
||||||
UpdateLineItemWithSelectorDTO,
|
UpdateLineItemWithSelectorDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, getSelectsAndRelationsFromObjectArray } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
Modules,
|
||||||
|
getSelectsAndRelationsFromObjectArray,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface UpdateLineItemsStepInput {
|
export interface UpdateLineItemsStepInput {
|
||||||
id: string
|
id: string
|
||||||
@@ -17,7 +20,7 @@ export const updateLineItemsStepId = "update-line-items-step"
|
|||||||
export const updateLineItemsStep = createStep(
|
export const updateLineItemsStep = createStep(
|
||||||
updateLineItemsStepId,
|
updateLineItemsStepId,
|
||||||
async (input: UpdateLineItemsStepInput, { container }) => {
|
async (input: UpdateLineItemsStepInput, { container }) => {
|
||||||
const { id, items = [] } = input
|
const { items = [] } = input
|
||||||
|
|
||||||
if (!items?.length) {
|
if (!items?.length) {
|
||||||
return new StepResponse([], [])
|
return new StepResponse([], [])
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { CartWorkflowDTO } from "@medusajs/types"
|
import { CartWorkflowDTO } from "@medusajs/framework/types"
|
||||||
import { isPresent, MedusaError, PaymentSessionStatus } from "@medusajs/utils"
|
import {
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
isPresent,
|
||||||
|
MedusaError,
|
||||||
|
PaymentSessionStatus,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ValidateCartPaymentsStepInput {
|
export interface ValidateCartPaymentsStepInput {
|
||||||
cart: CartWorkflowDTO
|
cart: CartWorkflowDTO
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { CartDTO, IFulfillmentModuleService } from "@medusajs/types"
|
import { CartDTO, IFulfillmentModuleService } from "@medusajs/framework/types"
|
||||||
import { MedusaError, Modules, arrayDifference } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
MedusaError,
|
||||||
|
Modules,
|
||||||
|
arrayDifference,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ValidateCartShippingOptionsStepInput {
|
export interface ValidateCartShippingOptionsStepInput {
|
||||||
cart: CartDTO
|
cart: CartDTO
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { CartDTO, CartWorkflowDTO } from "@medusajs/types"
|
import { CartDTO, CartWorkflowDTO } from "@medusajs/framework/types"
|
||||||
import { MedusaError, isPresent } from "@medusajs/utils"
|
import { MedusaError, isPresent } from "@medusajs/framework/utils"
|
||||||
import { createStep } from "@medusajs/workflows-sdk"
|
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ValidateCartStepInput {
|
export interface ValidateCartStepInput {
|
||||||
cart: CartWorkflowDTO | CartDTO
|
cart: CartWorkflowDTO | CartDTO
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { BigNumberInput } from "@medusajs/types"
|
import { BigNumberInput } from "@medusajs/framework/types"
|
||||||
import { MedusaError, isPresent } from "@medusajs/utils"
|
import { MedusaError, isPresent } from "@medusajs/framework/utils"
|
||||||
import { createStep } from "@medusajs/workflows-sdk"
|
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface ValidateVariantPricesStepInput {
|
export interface ValidateVariantPricesStepInput {
|
||||||
variants: {
|
variants: {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BigNumberInput,
|
BigNumberInput,
|
||||||
ConfirmVariantInventoryWorkflowInputDTO,
|
ConfirmVariantInventoryWorkflowInputDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { MedusaError, deepFlatMap } from "@medusajs/utils"
|
import { MedusaError, deepFlatMap } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
interface ConfirmInventoryPreparationInput {
|
interface ConfirmInventoryPreparationInput {
|
||||||
product_variant_inventory_items: {
|
product_variant_inventory_items: {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import {
|
|||||||
CreateOrderLineItemTaxLineDTO,
|
CreateOrderLineItemTaxLineDTO,
|
||||||
InventoryItemDTO,
|
InventoryItemDTO,
|
||||||
ProductVariantDTO,
|
ProductVariantDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { isDefined } from "@medusajs/utils"
|
import { isDefined } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
interface Input {
|
interface Input {
|
||||||
item?: CartLineItemDTO
|
item?: CartLineItemDTO
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
WorkflowData,
|
WorkflowData,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import {
|
import {
|
||||||
addShippingMethodToCartStep,
|
addShippingMethodToCartStep,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import {
|
import {
|
||||||
AddToCartWorkflowInputDTO,
|
AddToCartWorkflowInputDTO,
|
||||||
CreateLineItemForCartDTO,
|
CreateLineItemForCartDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import {
|
import {
|
||||||
createLineItemsStep,
|
createLineItemsStep,
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ import {
|
|||||||
CartWorkflowDTO,
|
CartWorkflowDTO,
|
||||||
OrderDTO,
|
OrderDTO,
|
||||||
UsageComputedActions,
|
UsageComputedActions,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, OrderStatus, OrderWorkflowEvents } from "@medusajs/utils"
|
import {
|
||||||
|
Modules,
|
||||||
|
OrderStatus,
|
||||||
|
OrderWorkflowEvents,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
transform,
|
transform,
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import {
|
import {
|
||||||
createRemoteLinkStep,
|
createRemoteLinkStep,
|
||||||
emitEventStep,
|
emitEventStep,
|
||||||
@@ -61,28 +65,25 @@ export const completeCartWorkflow = createWorkflow(
|
|||||||
context: { cart_id: cart.id },
|
context: { cart_id: cart.id },
|
||||||
})
|
})
|
||||||
|
|
||||||
const { variants, items, sales_channel_id } = transform(
|
const { variants, sales_channel_id } = transform({ cart }, (data) => {
|
||||||
{ cart },
|
const allItems: any[] = []
|
||||||
(data) => {
|
const allVariants: any[] = []
|
||||||
const allItems: any[] = []
|
|
||||||
const allVariants: any[] = []
|
|
||||||
|
|
||||||
data.cart?.items?.forEach((item) => {
|
data.cart?.items?.forEach((item) => {
|
||||||
allItems.push({
|
allItems.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
variant_id: item.variant_id,
|
variant_id: item.variant_id,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
})
|
|
||||||
allVariants.push(item.variant)
|
|
||||||
})
|
})
|
||||||
|
allVariants.push(item.variant)
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
variants: allVariants,
|
variants: allVariants,
|
||||||
items: allItems,
|
items: allItems,
|
||||||
sales_channel_id: data.cart.sales_channel_id,
|
sales_channel_id: data.cart.sales_channel_id,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
})
|
||||||
|
|
||||||
const finalCart = useRemoteQueryStep({
|
const finalCart = useRemoteQueryStep({
|
||||||
entry_point: "cart",
|
entry_point: "cart",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { ConfirmVariantInventoryWorkflowInputDTO } from "@medusajs/types"
|
import { ConfirmVariantInventoryWorkflowInputDTO } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { confirmInventoryStep } from "../steps"
|
import { confirmInventoryStep } from "../steps"
|
||||||
import { prepareConfirmInventoryInput } from "../utils/prepare-confirm-inventory-input"
|
import { prepareConfirmInventoryInput } from "../utils/prepare-confirm-inventory-input"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { AdditionalData, CreateCartWorkflowInputDTO } from "@medusajs/types"
|
import {
|
||||||
import { MedusaError } from "@medusajs/utils"
|
AdditionalData,
|
||||||
|
CreateCartWorkflowInputDTO,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { MedusaError } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
@@ -7,7 +10,7 @@ import {
|
|||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import {
|
import {
|
||||||
createCartsStep,
|
createCartsStep,
|
||||||
@@ -126,9 +129,11 @@ export const createCartWorkflow = createWorkflow(
|
|||||||
|
|
||||||
return prepareLineItemData({
|
return prepareLineItemData({
|
||||||
variant: variant,
|
variant: variant,
|
||||||
unitPrice: item.unit_price ||
|
unitPrice:
|
||||||
|
item.unit_price ||
|
||||||
data.priceSets[item.variant_id].calculated_amount,
|
data.priceSets[item.variant_id].calculated_amount,
|
||||||
isTaxInclusive: item.is_tax_inclusive ||
|
isTaxInclusive:
|
||||||
|
item.is_tax_inclusive ||
|
||||||
data.priceSets[item.variant_id].is_calculated_price_tax_inclusive,
|
data.priceSets[item.variant_id].is_calculated_price_tax_inclusive,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
metadata: item?.metadata ?? {},
|
metadata: item?.metadata ?? {},
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import {
|
import {
|
||||||
CartDTO,
|
CartDTO,
|
||||||
CreatePaymentCollectionForCartWorkflowInputDTO,
|
CreatePaymentCollectionForCartWorkflowInputDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
createStep,
|
createStep,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { createRemoteLinkStep } from "../../common/steps/create-remote-links"
|
import { createRemoteLinkStep } from "../../common/steps/create-remote-links"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import { createPaymentCollectionsStep } from "../steps/create-payment-collection"
|
import { createPaymentCollectionsStep } from "../steps/create-payment-collection"
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { ListShippingOptionsForCartWorkflowInputDTO } from "@medusajs/types"
|
import { ListShippingOptionsForCartWorkflowInputDTO } from "@medusajs/framework/types"
|
||||||
import { deepFlatMap, isPresent, MedusaError } from "@medusajs/utils"
|
import { deepFlatMap, isPresent, MedusaError } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
|
|
||||||
export const listShippingOptionsForCartWorkflowId =
|
export const listShippingOptionsForCartWorkflowId =
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { MathBN, isPresent } from "@medusajs/utils"
|
import { MathBN, isPresent } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
transform,
|
transform,
|
||||||
when,
|
when,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import { updatePaymentCollectionStep } from "../../payment-collection"
|
import { updatePaymentCollectionStep } from "../../payment-collection"
|
||||||
import { deletePaymentSessionsWorkflow } from "../../payment-collection/workflows/delete-payment-sessions"
|
import { deletePaymentSessionsWorkflow } from "../../payment-collection/workflows/delete-payment-sessions"
|
||||||
@@ -21,7 +21,9 @@ export const refreshPaymentCollectionForCartWorkflowId =
|
|||||||
*/
|
*/
|
||||||
export const refreshPaymentCollectionForCartWorkflow = createWorkflow(
|
export const refreshPaymentCollectionForCartWorkflow = createWorkflow(
|
||||||
refreshPaymentCollectionForCartWorkflowId,
|
refreshPaymentCollectionForCartWorkflowId,
|
||||||
(input: WorkflowData<RefreshPaymentCollectionForCartWorklowInput>): WorkflowData<void> => {
|
(
|
||||||
|
input: WorkflowData<RefreshPaymentCollectionForCartWorklowInput>
|
||||||
|
): WorkflowData<void> => {
|
||||||
const cart = useRemoteQueryStep({
|
const cart = useRemoteQueryStep({
|
||||||
entry_point: "cart",
|
entry_point: "cart",
|
||||||
fields: [
|
fields: [
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { PromotionActions } from "@medusajs/utils"
|
import { PromotionActions } from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common"
|
import { useRemoteQueryStep } from "../../common"
|
||||||
import {
|
import {
|
||||||
createLineItemAdjustmentsStep,
|
createLineItemAdjustmentsStep,
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
import { AdditionalData, UpdateCartWorkflowInputDTO } from "@medusajs/types"
|
import {
|
||||||
import { MedusaError, PromotionActions, isPresent } from "@medusajs/utils"
|
AdditionalData,
|
||||||
|
UpdateCartWorkflowInputDTO,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import {
|
||||||
|
MedusaError,
|
||||||
|
PromotionActions,
|
||||||
|
isPresent,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
@@ -7,7 +14,7 @@ import {
|
|||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common"
|
import { useRemoteQueryStep } from "../../common"
|
||||||
import {
|
import {
|
||||||
findOneOrAnyRegionStep,
|
findOneOrAnyRegionStep,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { UpdateLineItemInCartWorkflowInputDTO } from "@medusajs/types"
|
import { UpdateLineItemInCartWorkflowInputDTO } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
import { useRemoteQueryStep } from "../../common/steps/use-remote-query"
|
||||||
import { updateLineItemsStepWithSelector } from "../../line-item/steps"
|
import { updateLineItemsStepWithSelector } from "../../line-item/steps"
|
||||||
import { refreshCartShippingMethodsStep } from "../steps"
|
import { refreshCartShippingMethodsStep } from "../steps"
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import {
|
|||||||
CartLineItemDTO,
|
CartLineItemDTO,
|
||||||
CartShippingMethodDTO,
|
CartShippingMethodDTO,
|
||||||
CartWorkflowDTO,
|
CartWorkflowDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
transform,
|
transform,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import {
|
import {
|
||||||
getItemTaxLinesStep,
|
getItemTaxLinesStep,
|
||||||
retrieveCartWithLinksStep,
|
retrieveCartWithLinksStep,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface CreateEntitiesStepType {
|
export interface CreateEntitiesStepType {
|
||||||
moduleRegistrationName: string
|
moduleRegistrationName: string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { RemoteLink } from "@medusajs/modules-sdk"
|
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import { ContainerRegistrationKeys } from "@medusajs/utils"
|
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const createLinksStepId = "create-remote-links"
|
export const createLinksStepId = "create-remote-links"
|
||||||
/**
|
/**
|
||||||
@@ -12,13 +12,13 @@ export const createLinksStepId = "create-remote-links"
|
|||||||
* @example
|
* @example
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* createRemoteLinkStep
|
* createRemoteLinkStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
* import {
|
* import {
|
||||||
* Modules
|
* Modules
|
||||||
* } from "@medusajs/utils"
|
* } from "@medusajs/framework/utils"
|
||||||
*
|
*
|
||||||
* const helloWorldWorkflow = createWorkflow(
|
* const helloWorldWorkflow = createWorkflow(
|
||||||
* "hello-world",
|
* "hello-world",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export interface DeleteEntitiesStepType {
|
export interface DeleteEntitiesStepType {
|
||||||
moduleRegistrationName: string
|
moduleRegistrationName: string
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { RemoteLink } from "@medusajs/modules-sdk"
|
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
import { ContainerRegistrationKeys } from "@medusajs/utils"
|
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
export type DismissRemoteLinksStepInput = LinkDefinition | LinkDefinition[]
|
export type DismissRemoteLinksStepInput = LinkDefinition | LinkDefinition[]
|
||||||
|
|
||||||
@@ -16,13 +16,13 @@ export const dismissRemoteLinkStepId = "dismiss-remote-links"
|
|||||||
* @example
|
* @example
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* dismissRemoteLinkStep
|
* dismissRemoteLinkStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
* import {
|
* import {
|
||||||
* Modules
|
* Modules
|
||||||
* } from "@medusajs/utils"
|
* } from "@medusajs/framework/utils"
|
||||||
*
|
*
|
||||||
* const helloWorldWorkflow = createWorkflow(
|
* const helloWorldWorkflow = createWorkflow(
|
||||||
* "hello-world",
|
* "hello-world",
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { EventBusTypes, IEventBusModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
EventBusTypes,
|
||||||
import { StepExecutionContext, createStep } from "@medusajs/workflows-sdk"
|
IEventBusModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import {
|
||||||
|
StepExecutionContext,
|
||||||
|
createStep,
|
||||||
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event's details.
|
* The event's details.
|
||||||
@@ -37,7 +43,7 @@ export const emitEventStepId = "emit-event-step"
|
|||||||
* @example
|
* @example
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* emitEventStep
|
* emitEventStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { createStep } from "@medusajs/workflows-sdk"
|
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const releaseEventsStepId = "release-events-step"
|
export const releaseEventsStepId = "release-events-step"
|
||||||
export const releaseEventsStep = createStep(
|
export const releaseEventsStep = createStep(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { DeleteEntityInput, RemoteLink } from "@medusajs/modules-sdk"
|
import { DeleteEntityInput, RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
import { ContainerRegistrationKeys } from "@medusajs/utils"
|
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||||
|
|
||||||
type RemoveRemoteLinksStepInput = DeleteEntityInput | DeleteEntityInput[]
|
type RemoveRemoteLinksStepInput = DeleteEntityInput | DeleteEntityInput[]
|
||||||
|
|
||||||
@@ -14,13 +14,13 @@ export const removeRemoteLinkStepId = "remove-remote-links"
|
|||||||
* @example
|
* @example
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* removeRemoteLinkStep
|
* removeRemoteLinkStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
* import {
|
* import {
|
||||||
* Modules
|
* Modules
|
||||||
* } from "@medusajs/utils"
|
* } from "@medusajs/framework/utils"
|
||||||
*
|
*
|
||||||
* const helloWorldWorkflow = createWorkflow(
|
* const helloWorldWorkflow = createWorkflow(
|
||||||
* "hello-world",
|
* "hello-world",
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { RemoteLink } from "@medusajs/modules-sdk"
|
import { RemoteLink } from "@medusajs/framework/modules-sdk"
|
||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import { ContainerRegistrationKeys, MedusaError } from "@medusajs/utils"
|
import {
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ContainerRegistrationKeys,
|
||||||
|
MedusaError,
|
||||||
|
} from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const updateRemoteLinksStepId = "update-remote-links-step"
|
export const updateRemoteLinksStepId = "update-remote-links-step"
|
||||||
export const updateRemoteLinksStep = createStep(
|
export const updateRemoteLinksStep = createStep(
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
ContainerRegistrationKeys,
|
ContainerRegistrationKeys,
|
||||||
remoteQueryObjectFromString,
|
remoteQueryObjectFromString,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The remote query's details.
|
* The remote query's details.
|
||||||
@@ -59,7 +59,7 @@ export const useRemoteQueryStepId = "use-remote-query"
|
|||||||
* ```ts
|
* ```ts
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* useRemoteQueryStep
|
* useRemoteQueryStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
@@ -83,7 +83,7 @@ export const useRemoteQueryStepId = "use-remote-query"
|
|||||||
* ```ts
|
* ```ts
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* useRemoteQueryStep
|
* useRemoteQueryStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
@@ -113,7 +113,7 @@ export const useRemoteQueryStepId = "use-remote-query"
|
|||||||
* ```ts
|
* ```ts
|
||||||
* import {
|
* import {
|
||||||
* createWorkflow
|
* createWorkflow
|
||||||
* } from "@medusajs/workflows-sdk"
|
* } from "@medusajs/framework/workflows-sdk"
|
||||||
* import {
|
* import {
|
||||||
* useRemoteQueryStep
|
* useRemoteQueryStep
|
||||||
* } from "@medusajs/core-flows"
|
* } from "@medusajs/core-flows"
|
||||||
@@ -155,8 +155,6 @@ export const useRemoteQueryStep = createStep(
|
|||||||
service: !isUsingEntryPoint ? data.service : undefined,
|
service: !isUsingEntryPoint ? data.service : undefined,
|
||||||
} as Parameters<typeof remoteQueryObjectFromString>[0]
|
} as Parameters<typeof remoteQueryObjectFromString>[0]
|
||||||
|
|
||||||
const queryObject = remoteQueryObjectFromString(queryObjectConfig)
|
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
throwIfKeyNotFound: !!data.throw_if_key_not_found,
|
throwIfKeyNotFound: !!data.throw_if_key_not_found,
|
||||||
throwIfRelationNotFound: data.throw_if_key_not_found
|
throwIfRelationNotFound: data.throw_if_key_not_found
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { BatchWorkflowInput, LinkDefinition } from "@medusajs/types"
|
import { BatchWorkflowInput, LinkDefinition } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
parallelize,
|
parallelize,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { createRemoteLinkStep } from "../steps/create-remote-links"
|
import { createRemoteLinkStep } from "../steps/create-remote-links"
|
||||||
import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links"
|
import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links"
|
||||||
import { updateRemoteLinksStep } from "../steps/update-remote-links"
|
import { updateRemoteLinksStep } from "../steps/update-remote-links"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { createRemoteLinkStep } from "../steps/create-remote-links"
|
import { createRemoteLinkStep } from "../steps/create-remote-links"
|
||||||
|
|
||||||
export const createLinksWorkflowId = "create-link"
|
export const createLinksWorkflowId = "create-link"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links"
|
import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links"
|
||||||
|
|
||||||
export const dismissLinksWorkflowId = "dismiss-link"
|
export const dismissLinksWorkflowId = "dismiss-link"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { LinkDefinition } from "@medusajs/types"
|
import { LinkDefinition } from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { updateRemoteLinksStep } from "../steps/update-remote-links"
|
import { updateRemoteLinksStep } from "../steps/update-remote-links"
|
||||||
|
|
||||||
export const updateLinksWorkflowId = "update-link"
|
export const updateLinksWorkflowId = "update-link"
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { CreateCustomerGroupDTO, ICustomerModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CreateCustomerGroupDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ICustomerModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const createCustomerGroupsStepId = "create-customer-groups"
|
export const createCustomerGroupsStepId = "create-customer-groups"
|
||||||
/**
|
/**
|
||||||
|
|||||||
+6
-3
@@ -1,6 +1,9 @@
|
|||||||
import { GroupCustomerPair, ICustomerModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
GroupCustomerPair,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ICustomerModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const deleteCustomerGroupCustomersStepId =
|
export const deleteCustomerGroupCustomersStepId =
|
||||||
"delete-customer-group-customers"
|
"delete-customer-group-customers"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICustomerModuleService } from "@medusajs/types"
|
import { ICustomerModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const deleteCustomerGroupStepId = "delete-customer-groups"
|
export const deleteCustomerGroupStepId = "delete-customer-groups"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { ICustomerModuleService, LinkWorkflowInput } from "@medusajs/types"
|
import {
|
||||||
import { Modules, promiseAll } from "@medusajs/utils"
|
ICustomerModuleService,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
LinkWorkflowInput,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules, promiseAll } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const linkCustomersToCustomerGroupStepId =
|
export const linkCustomersToCustomerGroupStepId =
|
||||||
"link-customers-to-customer-group"
|
"link-customers-to-customer-group"
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import {
|
|||||||
CustomerGroupUpdatableFields,
|
CustomerGroupUpdatableFields,
|
||||||
FilterableCustomerGroupProps,
|
FilterableCustomerGroupProps,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
Modules,
|
Modules,
|
||||||
getSelectsAndRelationsFromObjectArray,
|
getSelectsAndRelationsFromObjectArray,
|
||||||
promiseAll,
|
promiseAll,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type UpdateCustomerGroupStepInput = {
|
export type UpdateCustomerGroupStepInput = {
|
||||||
selector: FilterableCustomerGroupProps
|
selector: FilterableCustomerGroupProps
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
import { CustomerGroupDTO, CreateCustomerGroupDTO } from "@medusajs/types"
|
import {
|
||||||
|
CustomerGroupDTO,
|
||||||
|
CreateCustomerGroupDTO,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { createCustomerGroupsStep } from "../steps"
|
import { createCustomerGroupsStep } from "../steps"
|
||||||
|
|
||||||
export type CreateCustomerGroupsWorkflowInput = { customersData: CreateCustomerGroupDTO[] }
|
export type CreateCustomerGroupsWorkflowInput = {
|
||||||
|
customersData: CreateCustomerGroupDTO[]
|
||||||
|
}
|
||||||
|
|
||||||
export const createCustomerGroupsWorkflowId = "create-customer-groups"
|
export const createCustomerGroupsWorkflowId = "create-customer-groups"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
import { WorkflowData, createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||||
import { deleteCustomerGroupStep } from "../steps"
|
import { deleteCustomerGroupStep } from "../steps"
|
||||||
|
|
||||||
export type DeleteCustomerGroupsWorkflowInput = { ids: string[] }
|
export type DeleteCustomerGroupsWorkflowInput = { ids: string[] }
|
||||||
@@ -9,7 +9,9 @@ export const deleteCustomerGroupsWorkflowId = "delete-customer-groups"
|
|||||||
*/
|
*/
|
||||||
export const deleteCustomerGroupsWorkflow = createWorkflow(
|
export const deleteCustomerGroupsWorkflow = createWorkflow(
|
||||||
deleteCustomerGroupsWorkflowId,
|
deleteCustomerGroupsWorkflowId,
|
||||||
(input: WorkflowData<DeleteCustomerGroupsWorkflowInput>): WorkflowData<void> => {
|
(
|
||||||
|
input: WorkflowData<DeleteCustomerGroupsWorkflowInput>
|
||||||
|
): WorkflowData<void> => {
|
||||||
return deleteCustomerGroupStep(input.ids)
|
return deleteCustomerGroupStep(input.ids)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { LinkWorkflowInput } from "@medusajs/types"
|
import { LinkWorkflowInput } from "@medusajs/framework/types"
|
||||||
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
import { WorkflowData, createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||||
import { linkCustomersToCustomerGroupStep } from "../steps"
|
import { linkCustomersToCustomerGroupStep } from "../steps"
|
||||||
|
|
||||||
export const linkCustomersToCustomerGroupWorkflowId =
|
export const linkCustomersToCustomerGroupWorkflowId =
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import {
|
|||||||
CustomerGroupDTO,
|
CustomerGroupDTO,
|
||||||
FilterableCustomerGroupProps,
|
FilterableCustomerGroupProps,
|
||||||
CustomerGroupUpdatableFields,
|
CustomerGroupUpdatableFields,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
WorkflowData,
|
WorkflowData,
|
||||||
WorkflowResponse,
|
WorkflowResponse,
|
||||||
createWorkflow,
|
createWorkflow,
|
||||||
} from "@medusajs/workflows-sdk"
|
} from "@medusajs/framework/workflows-sdk"
|
||||||
import { updateCustomerGroupsStep } from "../steps"
|
import { updateCustomerGroupsStep } from "../steps"
|
||||||
|
|
||||||
export type UpdateCustomerGroupsWorkflowInput = {
|
export type UpdateCustomerGroupsWorkflowInput = {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
CreateCustomerAddressDTO,
|
CreateCustomerAddressDTO,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const createCustomerAddressesStepId = "create-customer-addresses"
|
export const createCustomerAddressesStepId = "create-customer-addresses"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { CreateCustomerDTO, ICustomerModuleService } from "@medusajs/types"
|
import {
|
||||||
import { Modules } from "@medusajs/utils"
|
CreateCustomerDTO,
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
ICustomerModuleService,
|
||||||
|
} from "@medusajs/framework/types"
|
||||||
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const createCustomersStepId = "create-customers"
|
export const createCustomersStepId = "create-customers"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICustomerModuleService } from "@medusajs/types"
|
import { ICustomerModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const deleteCustomerAddressesStepId = "delete-customer-addresses"
|
export const deleteCustomerAddressesStepId = "delete-customer-addresses"
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ICustomerModuleService } from "@medusajs/types"
|
import { ICustomerModuleService } from "@medusajs/framework/types"
|
||||||
import { Modules } from "@medusajs/utils"
|
import { Modules } from "@medusajs/framework/utils"
|
||||||
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
|
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export const deleteCustomersStepId = "delete-customers"
|
export const deleteCustomersStepId = "delete-customers"
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-3
@@ -3,9 +3,9 @@ import {
|
|||||||
FilterableCustomerAddressProps,
|
FilterableCustomerAddressProps,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
UpdateCustomerAddressDTO,
|
UpdateCustomerAddressDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, isDefined } from "@medusajs/utils"
|
import { Modules, isDefined } from "@medusajs/framework/utils"
|
||||||
import { createStep } from "@medusajs/workflows-sdk"
|
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
import { unsetForCreate, unsetForUpdate } from "./utils"
|
import { unsetForCreate, unsetForUpdate } from "./utils"
|
||||||
|
|
||||||
export type MaybeUnsetDefaultBillingAddressStepInput = {
|
export type MaybeUnsetDefaultBillingAddressStepInput = {
|
||||||
|
|||||||
+3
-3
@@ -3,9 +3,9 @@ import {
|
|||||||
FilterableCustomerAddressProps,
|
FilterableCustomerAddressProps,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
UpdateCustomerAddressDTO,
|
UpdateCustomerAddressDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import { Modules, isDefined } from "@medusajs/utils"
|
import { Modules, isDefined } from "@medusajs/framework/utils"
|
||||||
import { createStep } from "@medusajs/workflows-sdk"
|
import { createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
import { unsetForCreate, unsetForUpdate } from "./utils"
|
import { unsetForCreate, unsetForUpdate } from "./utils"
|
||||||
|
|
||||||
export type MaybeUnsetDefaultShippingAddressesStepInput = {
|
export type MaybeUnsetDefaultShippingAddressesStepInput = {
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import {
|
|||||||
FilterableCustomerAddressProps,
|
FilterableCustomerAddressProps,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
UpdateCustomerAddressDTO,
|
UpdateCustomerAddressDTO,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
Modules,
|
Modules,
|
||||||
getSelectsAndRelationsFromObjectArray,
|
getSelectsAndRelationsFromObjectArray,
|
||||||
promiseAll,
|
promiseAll,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type UpdateCustomerAddresseStepInput = {
|
export type UpdateCustomerAddresseStepInput = {
|
||||||
selector: FilterableCustomerAddressProps
|
selector: FilterableCustomerAddressProps
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import {
|
|||||||
CustomerUpdatableFields,
|
CustomerUpdatableFields,
|
||||||
FilterableCustomerProps,
|
FilterableCustomerProps,
|
||||||
ICustomerModuleService,
|
ICustomerModuleService,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/framework/types"
|
||||||
import {
|
import {
|
||||||
Modules,
|
Modules,
|
||||||
getSelectsAndRelationsFromObjectArray,
|
getSelectsAndRelationsFromObjectArray,
|
||||||
promiseAll,
|
promiseAll,
|
||||||
} from "@medusajs/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
|
import { StepResponse, createStep } from "@medusajs/framework/workflows-sdk"
|
||||||
|
|
||||||
export type UpdateCustomersStepInput = {
|
export type UpdateCustomersStepInput = {
|
||||||
selector: FilterableCustomerProps
|
selector: FilterableCustomerProps
|
||||||
|
|||||||
Loaded 100 of 593 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user