**What** - add support for specifying sales channel with import strategy - additional: - refactor SC service to use `retrieve_` pattern - fix: pass arguments from `startServerWithEnvironment` to setup server - fix: minio undefined resolve/reject calls - fix: csv parser - detect missing columns from schema only if the column is required **How** - extending schema to expect sales channels columns in an import CSV file RESOLVES CORE-304
37 lines
620 B
JavaScript
37 lines
620 B
JavaScript
const setupServer = require("./setup-server")
|
|
const { initDb } = require("./use-db")
|
|
|
|
const startServerWithEnvironment = async ({
|
|
cwd,
|
|
redisUrl,
|
|
uploadDir,
|
|
verbose,
|
|
env,
|
|
}) => {
|
|
if (env) {
|
|
Object.entries(env).forEach(([key, value]) => {
|
|
process.env[key] = value
|
|
})
|
|
}
|
|
|
|
const dbConnection = await initDb({
|
|
cwd,
|
|
})
|
|
|
|
Object.entries(env).forEach(([key]) => {
|
|
delete process.env[key]
|
|
})
|
|
|
|
const medusaProcess = await setupServer({
|
|
cwd,
|
|
verbose,
|
|
redisUrl,
|
|
uploadDir,
|
|
env,
|
|
})
|
|
|
|
return [medusaProcess, dbConnection]
|
|
}
|
|
|
|
export default startServerWithEnvironment
|