chore: dependecies reorg (#8535)

This commit is contained in:
Carlos R. L. Rodrigues
2024-08-23 07:16:04 -03:00
committed by GitHub
parent 59599ac237
commit 058378970a
126 changed files with 958 additions and 1266 deletions

View File

@@ -88,7 +88,6 @@ module.exports = {
"./packages/cli/create-medusa-app/tsconfig.json",
"./packages/cli/medusa-cli/tsconfig.spec.json",
"./packages/cli/medusa-dev-cli/tsconfig.spec.json",
"./packages/cli/oas/medusa-oas-cli/tsconfig.spec.json",
"./packages/core/orchestration/tsconfig.json",

View File

@@ -1,5 +1,6 @@
import { getMigrationPlanner, initialize } from "@medusajs/link-modules"
import { MedusaModule, ModuleJoinerConfig } from "@medusajs/modules-sdk"
import { MedusaModule } from "@medusajs/modules-sdk"
import { ModuleJoinerConfig } from "@medusajs/types"
import { medusaIntegrationTestRunner } from "medusa-test-utils"
jest.setTimeout(5000000)

View File

@@ -1,7 +1,7 @@
import { MedusaContainer } from "@medusajs/modules-sdk"
import {
CreatePriceSetDTO,
IPricingModuleService,
MedusaContainer,
PriceSetDTO,
} from "@medusajs/types"
import { Modules } from "@medusajs/utils"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env node
try {
require("ts-node").register({})
} catch {}

View File

@@ -39,12 +39,10 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@medusajs/utils": "^1.11.2",
"@medusajs/utils": "^1.11.9",
"axios": "^0.21.4",
"chalk": "^4.0.0",
"configstore": "5.0.1",
"core-js": "^3.6.5",
"dotenv": "^16.4.5",
"execa": "^5.1.1",
"fs-exists-cached": "^1.0.0",
"fs-extra": "^10.0.0",
@@ -59,13 +57,15 @@
"pg": "^8.11.3",
"pg-god": "^1.0.12",
"prompts": "^2.4.2",
"regenerator-runtime": "^0.13.11",
"resolve-cwd": "^3.0.0",
"semver": "^7.3.8",
"stack-trace": "^0.0.10",
"ulid": "^2.3.0",
"winston": "^3.8.2",
"yargs": "^15.3.1"
},
"peerDependencies": {
"dotenv": "*",
"ulid": "*"
},
"gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
}

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env node
import "core-js/stable"
import "regenerator-runtime/runtime"
import os from "os"
import util from "util"
import createCli from "./create-cli"

View File

@@ -37,7 +37,7 @@
},
"dependencies": {
"@medusajs/medusa": "^1.20.4",
"@medusajs/utils": "^1.11.8",
"@medusajs/utils": "^1.11.9",
"@readme/json-schema-ref-parser": "^1.2.0",
"@readme/openapi-parser": "^2.4.0",
"@redocly/cli": "^1.7.0",

View File

@@ -34,8 +34,11 @@
"@medusajs/orchestration": "^0.5.7",
"@medusajs/utils": "^1.11.9",
"@medusajs/workflows-sdk": "^0.1.6",
"awilix": "^8.0.1",
"ulid": "^2.3.0"
"json-2-csv": "^5.5.4"
},
"peerDependencies": {
"awilix": "*",
"ulid": "*"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",

View File

@@ -1,15 +1,16 @@
import { LinkDefinition, RemoteLink } from "@medusajs/modules-sdk"
import { RemoteLink } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import { ContainerRegistrationKeys } from "@medusajs/utils"
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
export const createLinksStepId = "create-remote-links"
/**
* This step creates remote links between two records of linked data models.
*
*
* Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#create-link).
*
*
* @example
* import {
* import {
* createWorkflow
* } from "@medusajs/workflows-sdk"
* import {
@@ -18,7 +19,7 @@ export const createLinksStepId = "create-remote-links"
* import {
* Modules
* } from "@medusajs/utils"
*
*
* const helloWorldWorkflow = createWorkflow(
* "hello-world",
* () => {

View File

@@ -1,4 +1,5 @@
import { LinkDefinition, RemoteLink } from "@medusajs/modules-sdk"
import { RemoteLink } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
import { ContainerRegistrationKeys } from "@medusajs/utils"
@@ -9,11 +10,11 @@ export type DismissRemoteLinksStepInput = LinkDefinition | LinkDefinition[]
export const dismissRemoteLinkStepId = "dismiss-remote-links"
/**
* This step removes remote links between two records of linked data models.
*
*
* Learn more in the [Remote Link documentation.](https://docs.medusajs.com/v2/advanced-development/modules/remote-link#dismiss-link).
*
*
* @example
* import {
* import {
* createWorkflow
* } from "@medusajs/workflows-sdk"
* import {
@@ -22,7 +23,7 @@ export const dismissRemoteLinkStepId = "dismiss-remote-links"
* import {
* Modules
* } from "@medusajs/utils"
*
*
* const helloWorldWorkflow = createWorkflow(
* "hello-world",
* () => {

View File

@@ -1,6 +1,7 @@
import { LinkDefinition, RemoteLink } from "@medusajs/modules-sdk"
import { RemoteLink } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import { ContainerRegistrationKeys, MedusaError } from "@medusajs/utils"
import { createStep, StepResponse } from "@medusajs/workflows-sdk"
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
export const updateRemoteLinksStepId = "update-remote-links-step"
export const updateRemoteLinksStep = createStep(

View File

@@ -1,5 +1,4 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import { BatchWorkflowInput } from "@medusajs/types"
import { BatchWorkflowInput, LinkDefinition } from "@medusajs/types"
import {
WorkflowData,
WorkflowResponse,

View File

@@ -1,4 +1,4 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import {
WorkflowData,
WorkflowResponse,

View File

@@ -1,4 +1,4 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import {
WorkflowData,
WorkflowResponse,

View File

@@ -1,4 +1,4 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import { LinkDefinition } from "@medusajs/types"
import {
WorkflowData,
WorkflowResponse,

View File

@@ -1,11 +1,12 @@
import {
IFileModuleService,
HttpTypes,
IFileModuleService,
IRegionModuleService,
} from "@medusajs/types"
import { ModuleRegistrationName, convertJsonToCsv } from "@medusajs/utils"
import { ModuleRegistrationName } from "@medusajs/utils"
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
import { normalizeForExport } from "../helpers/normalize-for-export"
import { convertJsonToCsv } from "../utlils"
const prodColumnPositions = new Map([
["Product Id", 0],

View File

@@ -1,16 +1,13 @@
import {
MedusaError,
ModuleRegistrationName,
convertCsvToJson,
} from "@medusajs/utils"
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
import { normalizeForImport } from "../helpers/normalize-for-import"
import {
IProductModuleService,
IRegionModuleService,
ISalesChannelModuleService,
} from "@medusajs/types"
import { MedusaError, ModuleRegistrationName } from "@medusajs/utils"
import { StepResponse, createStep } from "@medusajs/workflows-sdk"
import { normalizeForImport } from "../helpers/normalize-for-import"
import { normalizeV1Products } from "../helpers/normalize-v1-import"
import { convertCsvToJson } from "../utlils"
export const parseProductCsvStepId = "parse-product-csv"
/**

View File

@@ -1,10 +1,11 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import {
AdditionalData,
InventoryTypes,
LinkDefinition,
PricingTypes,
ProductTypes,
} from "@medusajs/types"
import { Modules } from "@medusajs/utils"
import {
WorkflowData,
WorkflowResponse,
@@ -18,7 +19,6 @@ import { createInventoryItemsWorkflow } from "../../inventory/workflows/create-i
import { createPriceSetsStep } from "../../pricing"
import { createProductVariantsStep } from "../steps/create-product-variants"
import { createVariantPricingLinkStep } from "../steps/create-variant-pricing-link"
import { Modules } from "@medusajs/utils"
/**
* @privateRemarks

View File

@@ -1,8 +1,8 @@
export * as TestDatabaseUtils from "./database"
export * as TestEventUtils from "./events"
export * as JestUtils from "./jest"
export { default as IdMap } from "./id-map"
export * from "./init-modules"
export * as JestUtils from "./jest"
export * from "./medusa-test-runner"
export { default as MockEventBusService } from "./mock-event-bus-service"
export * from "./module-test-runner"
export * from "./medusa-test-runner"

View File

@@ -3,9 +3,9 @@ import {
ModulesSdkUtils,
toMikroOrmEntities,
} from "@medusajs/utils"
import { MockEventBusService } from "."
import { getDatabaseURL, getMikroOrmWrapper, TestDatabase } from "./database"
import { initModules, InitModulesOptions } from "./init-modules"
import { TestDatabase, getDatabaseURL, getMikroOrmWrapper } from "./database"
import { InitModulesOptions, initModules } from "./init-modules"
import { default as MockEventBusService } from "./mock-event-bus-service"
export interface SuiteOptions<TService = unknown> {
MikroOrmWrapper: TestDatabase

View File

@@ -32,11 +32,12 @@
"@graphql-tools/schema": "^10.0.0",
"@medusajs/orchestration": "^0.5.7",
"@medusajs/utils": "^1.11.9",
"awilix": "^8.0.0",
"graphql": "^16.6.0",
"knex": "2.4.2",
"resolve-cwd": "^3.0.0"
},
"peerDependencies": {
"awilix": "*"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",

View File

@@ -1,4 +1,3 @@
export * from "@medusajs/types/dist/modules-sdk"
export * from "./definitions"
export * from "./loaders"
export * from "./medusa-app"

View File

@@ -20,17 +20,17 @@ import {
} from "@medusajs/types"
import {
ContainerRegistrationKeys,
createMedusaContainer,
isObject,
isString,
MedusaError,
ModuleRegistrationName,
Modules,
ModulesSdkUtils,
createMedusaContainer,
isObject,
isString,
promiseAll,
} from "@medusajs/utils"
import type { Knex } from "@mikro-orm/knex"
import { asValue } from "awilix"
import type { Knex } from "knex"
import { MODULE_PACKAGE_NAMES } from "./definitions"
import {
MedusaModule,
@@ -39,8 +39,8 @@ import {
} from "./medusa-module"
import { RemoteLink } from "./remote-link"
import { RemoteQuery } from "./remote-query"
import { cleanGraphQLSchema } from "./utils"
import { MODULE_RESOURCE_TYPE, MODULE_SCOPE } from "./types"
import { cleanGraphQLSchema } from "./utils"
const LinkModulePackage = MODULE_PACKAGE_NAMES[Modules.LINK]

View File

@@ -1,5 +1,6 @@
import {
ILinkModule,
LinkDefinition,
LoadedModule,
ModuleJoinerRelationship,
} from "@medusajs/types"
@@ -12,7 +13,7 @@ import { linkingErrorMessage } from "./utils/linking-error"
/**
* The details of a data model's record whose linked records should be deleted. Usually used after the
* data model's record is deleted.
*
*
* The key is the data model's name. Its value is an object that has the ID of the data model's record.
*/
export type DeleteEntityInput = {
@@ -20,20 +21,6 @@ export type DeleteEntityInput = {
}
export type RestoreEntityInput = DeleteEntityInput
/**
* A link for two records of linked data models.
*
* The keys are the names of each module, and their value is an object that holds the ID of the linked data model's record.
*/
export type LinkDefinition = {
[moduleName: string]: {
// TODO: changing this to any temporarily as the "data" attribute is not being picked up correctly
[fieldName: string]: any
}
} & {
data?: Record<string, unknown>
}
type RemoteRelationship = ModuleJoinerRelationship & {
isPrimary: boolean
isForeign: boolean

View File

@@ -1,6 +1,5 @@
import { LoadedModule } from "@medusajs/types"
import { LinkDefinition, LoadedModule } from "@medusajs/types"
import { isPresent } from "@medusajs/utils"
import { LinkDefinition } from "../remote-link"
export const convertRecordsToLinkDefinition = (
links: object[],

View File

@@ -20,17 +20,19 @@
"author": "Medusa",
"license": "MIT",
"devDependencies": {
"@medusajs/types": "^1.11.16",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/types": "^1.11.16",
"@medusajs/utils": "^1.11.9",
"awilix": "^8.0.0",
"graphql": "^16.6.0"
},
"peerDependencies": {
"awilix": "*"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"build": "rimraf dist && tsc --build",

View File

@@ -2,12 +2,13 @@ import { isDefined } from "@medusajs/utils"
import { EventEmitter } from "events"
import { IDistributedTransactionStorage } from "./datastore/abstract-storage"
import { BaseInMemoryDistributedTransactionStorage } from "./datastore/base-in-memory-storage"
import { TransactionOrchestrator } from "./transaction-orchestrator"
import { TransactionStep, TransactionStepHandler } from "./transaction-step"
import {
TransactionFlow,
TransactionOrchestrator,
} from "./transaction-orchestrator"
import { TransactionStep, TransactionStepHandler } from "./transaction-step"
import { TransactionHandlerType, TransactionState } from "./types"
TransactionHandlerType,
TransactionState,
} from "./types"
/**
* @typedef TransactionMetadata

View File

@@ -8,6 +8,7 @@ import { TransactionStep, TransactionStepHandler } from "./transaction-step"
import {
DistributedTransactionEvent,
StepFeatures,
TransactionFlow,
TransactionHandlerType,
TransactionModelOptions,
TransactionOptions,
@@ -27,29 +28,6 @@ import {
TransactionTimeoutError,
} from "./errors"
export type TransactionFlow = {
modelId: string
options?: TransactionModelOptions
definition: TransactionStepsDefinition
transactionId: string
metadata?: {
eventGroupId?: string
[key: string]: unknown
}
hasAsyncSteps: boolean
hasFailedSteps: boolean
hasSkippedOnFailureSteps: boolean
hasWaitingSteps: boolean
hasSkippedSteps: boolean
hasRevertedSteps: boolean
timedOutAt: number | null
startedAt?: number
state: TransactionState
steps: {
[key: string]: TransactionStep
}
}
/**
* @class TransactionOrchestrator is responsible for managing and executing distributed transactions.
* It is based on a single transaction definition, which is used to execute all the transaction steps

View File

@@ -1,3 +1,4 @@
import { TransactionState } from "@medusajs/utils"
import { DistributedTransactionType } from "./distributed-transaction"
import { TransactionStep } from "./transaction-step"
export {
@@ -228,3 +229,26 @@ export type StepFeatures = {
}
export type TransactionOptions = TransactionModelOptions & StepFeatures
export type TransactionFlow = {
modelId: string
options?: TransactionModelOptions
definition: TransactionStepsDefinition
transactionId: string
metadata?: {
eventGroupId?: string
[key: string]: unknown
}
hasAsyncSteps: boolean
hasFailedSteps: boolean
hasSkippedOnFailureSteps: boolean
hasWaitingSteps: boolean
hasSkippedSteps: boolean
hasRevertedSteps: boolean
timedOutAt: number | null
startedAt?: number
state: TransactionState
steps: {
[key: string]: TransactionStep
}
}

View File

@@ -21,7 +21,7 @@
"author": "Medusa",
"license": "MIT",
"devDependencies": {
"awilix": "^8.0.0",
"awilix": "^8.0.1",
"bignumber.js": "^9.1.2",
"cross-env": "^5.2.1",
"ioredis": "^5.4.1",

View File

@@ -1,10 +1,5 @@
import { CamelCase, Prettify } from "../common"
/**
* Symbol to identify a DML entity from an object
*/
export const IsDmlEntity = Symbol.for("isDmlEntity")
/**
* Representation of DML schema. It must be a key-value pair
* with string based keys and properties/relationships
@@ -33,7 +28,6 @@ export interface IDmlEntity<
Schema extends DMLSchema,
Config extends IDmlEntityConfig
> {
[IsDmlEntity]: true
name: InferDmlEntityNameFromConfig<Config>
schema: Schema
}

View File

@@ -165,6 +165,20 @@ export type LinkModulesExtraFields = Record<
}
>
/**
* A link for two records of linked data models.
*
* The keys are the names of each module, and their value is an object that holds the ID of the linked data model's record.
*/
export type LinkDefinition = {
[moduleName: string]: {
// TODO: changing this to any temporarily as the "data" attribute is not being picked up correctly
[fieldName: string]: any
}
} & {
data?: Record<string, unknown>
}
export type ModuleJoinerConfig = Omit<
JoinerServiceConfig,
"serviceName" | "primaryKeys" | "relationships" | "extends"

View File

@@ -39,9 +39,7 @@
"bignumber.js": "^9.1.2",
"dotenv": "^16.4.5",
"dotenv-expand": "^11.0.6",
"json-2-csv": "^5.5.4",
"jsonwebtoken": "^9.0.2",
"knex": "2.4.2",
"pluralize": "^8.0.0",
"ulid": "^2.3.0"
},

View File

@@ -1,14 +0,0 @@
import { join } from "path"
export const getMedusaVersion = (): string => {
try {
return require(join(
process.cwd(),
`node_modules`,
`@medusajs/medusa`,
`package.json`
)).version
} catch (e) {
return ``
}
}

View File

@@ -25,12 +25,12 @@ import {
} from "@mikro-orm/core/typings"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import {
MedusaError,
arrayDifference,
isString,
MedusaError,
promiseAll,
} from "../../common"
import { buildQuery } from "../../modules-sdk"
import { buildQuery } from "../../modules-sdk/build-query"
import {
getSoftDeletedCascadedEntitiesIdsMappedBy,
transactionWrapper,

View File

@@ -1,6 +1,6 @@
import { EntityMetadata, FindOptions, wrap } from "@mikro-orm/core"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { buildQuery } from "../../modules-sdk"
import { buildQuery } from "../../modules-sdk/build-query"
function detectCircularDependency(
manager: SqlEntityManager,

View File

@@ -6,13 +6,14 @@ import {
IDmlEntity,
IDmlEntityConfig,
InferDmlEntityNameFromConfig,
IsDmlEntity,
QueryCondition,
} from "@medusajs/types"
import { isObject, isString, toCamelCase } from "../common"
import { transformIndexWhere } from "./helpers/entity-builder/build-indexes"
import { BelongsTo } from "./relations/belongs-to"
const IsDmlEntity = Symbol.for("isDmlEntity")
function extractNameAndTableName<const Config extends IDmlEntityConfig>(
nameOrConfig: Config
) {
@@ -59,7 +60,7 @@ export class DmlEntity<
const TConfig extends IDmlEntityConfig
> implements IDmlEntity<Schema, TConfig>
{
[IsDmlEntity]: true = true
[IsDmlEntity] = true
name: InferDmlEntityNameFromConfig<TConfig>
schema: Schema

View File

@@ -1,7 +1,7 @@
export * from "./common"
export * from "./api-key"
export * from "./auth"
export * from "./bundles"
export * from "./common"
export * from "./dal"
export * from "./decorators"
export * from "./defaults"
@@ -26,6 +26,5 @@ export * from "./shipping"
export * from "./totals"
export * from "./totals/big-number"
export * from "./user"
export * from "./csv"
export const MedusaModuleType = Symbol.for("MedusaModule")

View File

@@ -1,4 +1,4 @@
import { Modules } from "../modules-sdk"
import { Modules } from "../modules-sdk/definition"
import { composeLinkName } from "./compose-link-name"
export const LINKS = {

View File

@@ -1,13 +1,13 @@
import { EventEmitter } from "events"
import { MikroORM, MikroORMOptions } from "@mikro-orm/core"
import {
MigrateOptions,
MigrationResult,
UmzugMigration,
} from "@mikro-orm/migrations"
import { MikroORM, MikroORMOptions } from "@mikro-orm/core"
import { PostgreSqlDriver } from "@mikro-orm/postgresql"
import { dirname } from "path"
import { EventEmitter } from "events"
import { access, mkdir, writeFile } from "fs/promises"
import { dirname } from "path"
/**
* Events emitted by the migrations class

View File

@@ -1,7 +1,7 @@
import { DAL, FindConfig } from "@medusajs/types"
import { deduplicate, isDefined, isObject } from "../common"
import { SoftDeletableFilterKey } from "../dal"
import { SoftDeletableFilterKey } from "../dal/mikro-orm/mikro-orm-soft-deletable-filter"
// Following convention here is fine, we can make it configurable if needed.
const DELETED_AT_FIELD_NAME = "deleted_at"

View File

@@ -1,6 +1,6 @@
import { LinkModulesExtraFields, ModuleJoinerConfig } from "@medusajs/types"
import { camelToSnakeCase, isObject, pluralize, toPascalCase } from "../common"
import { composeLinkName } from "../link"
import { composeLinkName } from "../link/compose-link-name"
export const DefineLinkSymbol = Symbol.for("DefineLink")

View File

@@ -11,16 +11,18 @@ import {
SoftDeleteReturn,
} from "@medusajs/types"
import {
MapToConfig,
isString,
kebabCase,
lowerCaseFirst,
mapObjectTo,
MapToConfig,
pluralize,
upperCaseFirst,
} from "../common"
import { DmlEntity } from "../dml"
import { InjectManager, MedusaContext } from "./decorators"
import { ModuleRegistrationName } from "./definition"
import { buildModelsNameToLinkableKeysMap } from "./joiner-config-builder"
import {
BaseMethods,
ExtractKeysFromConfig,
@@ -29,8 +31,6 @@ import {
ModelEntries,
ModelsConfigTemplate,
} from "./types/medusa-service"
import { buildModelsNameToLinkableKeysMap } from "./joiner-config-builder"
import { DmlEntity } from "../dml"
const readMethods = ["retrieve", "list", "listAndCount"] as BaseMethods[]
const writeMethods = [
@@ -55,12 +55,12 @@ function buildMethodNamesFromModel(
if (method === "retrieve") {
normalizedModelName =
"singular" in model && model.singular
model && "singular" in model && model.singular
? model.singular
: defaultMethodName
} else {
normalizedModelName =
"plural" in model && model.plural
model && "plural" in model && model.plural
? model.plural
: pluralize(defaultMethodName)
}

View File

@@ -30,9 +30,11 @@
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/orchestration": "^0.5.7",
"@medusajs/utils": "^1.11.9",
"awilix": "^8.0.1",
"ulid": "^2.3.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"awilix": "*",
"ulid": "*"
},
"scripts": {
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",

View File

@@ -16,7 +16,7 @@ import {
import { EOL } from "os"
import { ulid } from "ulid"
import { MedusaWorkflow } from "../medusa-workflow"
import { resolveValue } from "../utils/composer"
import { resolveValue } from "../utils/composer/helpers/resolve-value"
import {
ExportedWorkflow,
FlowCancelOptions,

View File

@@ -4,19 +4,19 @@ import {
WorkflowManager,
} from "@medusajs/orchestration"
import { LoadedModule, MedusaContainer } from "@medusajs/types"
import { isString, OrchestrationUtils } from "@medusajs/utils"
import { OrchestrationUtils, isString } from "@medusajs/utils"
import { exportWorkflow } from "../../helper"
import { createStep } from "./create-step"
import { StepResponse } from "./helpers"
import { proxify } from "./helpers/proxy"
import { StepResponse } from "./helpers/step-response"
import { WorkflowResponse } from "./helpers/workflow-response"
import {
CreateWorkflowComposerContext,
HookHandler,
ReturnWorkflow,
StepFunction,
WorkflowData,
HookHandler,
} from "./type"
import { WorkflowResponse } from "./helpers/workflow-response"
global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null

View File

@@ -39,6 +39,7 @@
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts"
},
"devDependencies": {
"@medusajs/orchestration": "^0.5.7",
"@medusajs/types": "^1.11.16",
"@types/express": "^4.17.17",
"@types/jsonwebtoken": "^8.5.9",
@@ -52,10 +53,8 @@
"dependencies": {
"@medusajs/medusa-cli": "^1.3.22",
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/orchestration": "^0.5.7",
"@medusajs/utils": "^1.11.9",
"@medusajs/workflows-sdk": "^0.1.6",
"awilix": "^8.0.0",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"express": "^4.18.2",
@@ -66,5 +65,8 @@
"medusa-telemetry": "^0.0.17",
"morgan": "^1.9.1",
"zod": "3.22.4"
},
"peerDependencies": {
"awilix": "*"
}
}

View File

@@ -1,11 +1,13 @@
export * from "./config"
export * from "./logger"
export * from "./http"
export * from "./database"
export * from "./container"
export * from "./subscribers"
export * from "./links"
export * from "./jobs"
export * from "./database"
export * from "./feature-flags"
export * from "./workflows"
export * from "./http"
export * from "./jobs"
export * from "./links"
export * from "./logger"
export * from "./medusa-app-loader"
export * from "./subscribers"
export * from "./workflows"
export const MEDUSA_CLI_PATH = require.resolve("@medusajs/medusa-cli")

View File

@@ -1,4 +1,4 @@
import {
import type {
IDistributedSchedulerStorage,
SchedulerOptions,
} from "@medusajs/orchestration"

View File

@@ -1,14 +1,14 @@
import type { SchedulerOptions } from "@medusajs/orchestration"
import { MedusaContainer } from "@medusajs/types"
import { isObject, MedusaError, promiseAll } from "@medusajs/utils"
import {
createStep,
createWorkflow,
StepResponse,
} from "@medusajs/workflows-sdk"
import { isObject, MedusaError, promiseAll } from "@medusajs/utils"
import { SchedulerOptions } from "@medusajs/orchestration"
import { MedusaContainer } from "@medusajs/types"
import { logger } from "../logger"
import { access, readdir } from "fs/promises"
import { join } from "path"
import { logger } from "../logger"
type CronJobConfig = {
name: string

View File

@@ -41,20 +41,19 @@
"serve": "node dist/app.js",
"test": "jest --silent --bail --maxWorkers=50% --forceExit"
},
"peerDependencies": {
"awilix": "*"
},
"dependencies": {
"@inquirer/checkbox": "^2.3.11",
"@medusajs/admin-sdk": "0.0.1",
"@medusajs/core-flows": "^0.0.9",
"@medusajs/framework": "^0.0.1",
"@medusajs/link-modules": "^0.2.11",
"@medusajs/medusa-cli": "^1.3.22",
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/orchestration": "^0.5.7",
"@medusajs/utils": "^1.11.9",
"@medusajs/workflows-sdk": "^0.1.6",
"@swc/core": "1.5.7",
"@swc/helpers": "^0.5.11",
"awilix": "^8.0.0",
"body-parser": "^1.19.0",
"boxen": "^5.0.1",
"chalk": "^4.0.0",
@@ -62,9 +61,7 @@
"compression": "^1.7.4",
"connect-redis": "^5.0.0",
"cookie-parser": "^1.4.6",
"core-js": "^3.6.5",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"express-session": "^1.17.3",
"fs-exists-cached": "^1.0.0",
@@ -76,13 +73,7 @@
"morgan": "^1.9.1",
"multer": "^1.4.5-lts.1",
"node-schedule": "^2.1.1",
"passport": "^0.6.0",
"passport-custom": "^1.1.1",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"qs": "^6.11.2",
"reflect-metadata": "^0.1.13",
"regenerator-runtime": "^0.13.11",
"request-ip": "^3.3.0",
"uuid": "^9.0.0",
"zod": "3.22.4"

View File

@@ -1,7 +1,7 @@
import { LinkDefinition } from "@medusajs/modules-sdk"
import {
BatchMethodResponse,
HttpTypes,
LinkDefinition,
MedusaContainer,
PriceDTO,
ProductDTO,

View File

@@ -1,24 +1,23 @@
import {
AuthenticatedMedusaRequest,
MedusaResponse,
} from "../../../../../../types/routing"
import {
deleteCustomerAddressesWorkflow,
updateCustomerAddressesWorkflow,
} from "@medusajs/core-flows"
import {
AuthenticatedMedusaRequest,
MedusaResponse,
} from "../../../../../../types/routing"
import { DeleteResponse, HttpTypes, MedusaContainer } from "@medusajs/types"
import {
ContainerRegistrationKeys,
MedusaError,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { MedusaContainer } from "@medusajs/modules-sdk"
import { refetchCustomer } from "../../../helpers"
import {
StoreGetCustomerAddressParamsType,
StoreUpdateCustomerAddressType,
} from "../../../validators"
import { refetchCustomer } from "../../../helpers"
import { DeleteResponse, HttpTypes } from "@medusajs/types"
export const GET = async (
req: AuthenticatedMedusaRequest<StoreGetCustomerAddressParamsType>,

View File

@@ -5,7 +5,7 @@ import Store from "medusa-telemetry/dist/store"
import { EOL } from "os"
import path from "path"
import { logger } from "@medusajs/framework"
import { logger, MEDUSA_CLI_PATH } from "@medusajs/framework"
const defaultConfig = {
padding: 5,
@@ -27,12 +27,7 @@ export default async function ({ port, directory }) {
* Re-constructing the path to Medusa CLI to execute the
* start command.
*/
const cliPath = path.resolve(
require.resolve("@medusajs/medusa-cli"),
"..",
"..",
"cli.js"
)
const cliPath = path.resolve(MEDUSA_CLI_PATH, "..", "..", "cli.js")
const devServer = {
childProcess: null as ChildProcess | null,

View File

@@ -1,15 +1,12 @@
import "core-js/stable"
import "regenerator-runtime/runtime"
import cluster from "cluster"
import express from "express"
import { track } from "medusa-telemetry"
import { scheduleJob } from "node-schedule"
import os from "os"
import loaders from "../loaders"
import { logger } from "@medusajs/framework"
import { GracefulShutdownServer, isPresent } from "@medusajs/utils"
import loaders from "../loaders"
const EVERY_SIXTH_HOUR = "0 */6 * * *"
const CRON_SCHEDULE = EVERY_SIXTH_HOUR

View File

@@ -1,13 +1,10 @@
import "core-js/stable"
import "regenerator-runtime/runtime"
import express from "express"
import { track } from "medusa-telemetry"
import { scheduleJob } from "node-schedule"
import loaders from "../loaders"
import { logger } from "@medusajs/framework"
import { GracefulShutdownServer } from "@medusajs/utils"
import loaders from "../loaders"
const EVERY_SIXTH_HOUR = "0 */6 * * *"
const CRON_SCHEDULE = EVERY_SIXTH_HOUR

View File

@@ -1,12 +1,9 @@
import "core-js/stable"
import "regenerator-runtime/runtime"
import express from "express"
import { track } from "medusa-telemetry"
import { logger } from "@medusajs/framework"
import { ModuleRegistrationName } from "@medusajs/utils"
import loaders from "../loaders"
import { logger } from "@medusajs/framework"
export default async function ({
directory,

View File

@@ -1,160 +0,0 @@
import { MedusaModule, registerMedusaModule } from "@medusajs/modules-sdk"
import glob from "glob"
import { isDefined } from "@medusajs/utils"
export function getInternalModules(configModule) {
const modules = []
const moduleResolutions = {}
Object.entries(configModule.modules ?? {}).forEach(([moduleKey, module]) => {
moduleResolutions[moduleKey] = registerMedusaModule(moduleKey, module)[
moduleKey
]
})
for (const moduleResolution of Object.values(moduleResolutions)) {
if (
!moduleResolution.resolutionPath ||
moduleResolution.moduleDeclaration.scope !== "internal"
) {
continue
}
let loadedModule = null
try {
loadedModule = require(moduleResolution.resolutionPath).default
} catch (error) {
console.log("Error loading Module", error)
continue
}
modules.push({
moduleDeclaration: moduleResolution.moduleDeclaration,
loadedModule,
})
}
return modules
}
export const getEnabledMigrations = (migrationDirs, isFlagEnabled) => {
const allMigrations = migrationDirs.flatMap((dir) => {
return glob.sync(dir)
})
return allMigrations
.map((file) => {
const loaded = require(file)
if (!isDefined(loaded.featureFlag) || isFlagEnabled(loaded.featureFlag)) {
delete loaded.featureFlag
return Object.values(loaded)
}
})
.flat()
.filter(Boolean)
}
export const getModuleMigrations = (configModule, isFlagEnabled) => {
const loadedModules = getInternalModules(configModule)
const allModules = []
for (const loadedModule of loadedModules) {
const mod = loadedModule.loadedModule
const moduleMigrations = (mod.migrations ?? [])
.map((migration) => {
if (
!isDefined(migration.featureFlag) ||
isFlagEnabled(migration.featureFlag)
) {
delete migration.featureFlag
return Object.values(migration)
}
})
.flat()
.filter(Boolean)
allModules.push({
moduleDeclaration: loadedModule.moduleDeclaration,
models: mod.models ?? [],
migrations: moduleMigrations,
})
}
return allModules
}
export const getModuleSharedResources = (configModule, featureFlagsRouter) => {
const isFlagEnabled = (flag) =>
featureFlagsRouter && featureFlagsRouter.isFeatureEnabled(flag)
const loadedModules = getModuleMigrations(configModule, isFlagEnabled)
let migrations = []
let models = []
for (const mod of loadedModules) {
if (mod.moduleDeclaration.resources !== "shared") {
continue
}
migrations = migrations.concat(mod.migrations)
models = models.concat(mod.models ?? [])
}
return {
models,
migrations,
}
}
export const runIsolatedModulesMigration = async (configModule) => {
const moduleResolutions = {}
Object.entries(configModule.modules ?? {}).forEach(([moduleKey, module]) => {
moduleResolutions[moduleKey] = registerMedusaModule(moduleKey, module)[
moduleKey
]
})
for (const moduleResolution of Object.values(moduleResolutions)) {
if (
!moduleResolution.resolutionPath ||
moduleResolution.moduleDeclaration.scope !== "internal" ||
moduleResolution.moduleDeclaration.resources !== "isolated"
) {
continue
}
await MedusaModule.migrateUp({
moduleKey: moduleResolution.definition.key,
modulePath: moduleResolution.resolutionPath,
options: moduleResolution.options,
})
}
}
export const revertIsolatedModulesMigration = async (configModule) => {
const moduleResolutions = {}
Object.entries(configModule.modules ?? {}).forEach(([moduleKey, module]) => {
moduleResolutions[moduleKey] = registerMedusaModule(moduleKey, module)[
moduleKey
]
})
for (const moduleResolution of Object.values(moduleResolutions)) {
if (
!moduleResolution.resolutionPath ||
moduleResolution.moduleDeclaration.scope !== "internal" ||
moduleResolution.moduleDeclaration.resources !== "isolated"
) {
continue
}
await MedusaModule.migrateDown({
moduleKey: moduleResolution.definition.key,
modulePath: moduleResolution.resolutionPath,
options: moduleResolution.options,
})
}
}

View File

@@ -1,5 +1,3 @@
import "reflect-metadata"
export interface FindConfig<Entity> {
select?: (keyof Entity)[]
skip?: number

View File

@@ -34,7 +34,6 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
@@ -46,10 +45,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -45,13 +45,15 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.9",
"@medusajs/utils": "^1.11.7",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0",
"@medusajs/utils": "^1.11.9",
"jsonwebtoken": "^9.0.2",
"scrypt-kdf": "^2.0.1",
"simple-oauth2": "^5.0.0"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -20,7 +20,7 @@
"author": "Medusa",
"license": "MIT",
"devDependencies": {
"@medusajs/types": "^1.11.6",
"@medusajs/types": "^1.11.9",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"rimraf": "^5.0.1",

View File

@@ -1,4 +1,4 @@
import { ModuleExports } from "@medusajs/modules-sdk"
import { ModuleExports } from "@medusajs/types"
import InMemoryCacheService from "./services/inmemory-cache"
const service = InMemoryCacheService

View File

@@ -1,11 +1,11 @@
import { MedusaModule } from "@medusajs/modules-sdk"
import {
ExternalModuleDeclaration,
ICacheService,
InternalModuleDeclaration,
MedusaModule,
} from "@medusajs/modules-sdk"
import { ICacheService } from "@medusajs/types"
import { InMemoryCacheModuleOptions } from "../types"
} from "@medusajs/types"
import { Modules } from "@medusajs/utils"
import { InMemoryCacheModuleOptions } from "../types"
export const initialize = async (
options?: InMemoryCacheModuleOptions | ExternalModuleDeclaration

View File

@@ -35,7 +35,9 @@
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"awilix": "^8.0.0",
"ioredis": "^5.4.1"
},
"peerDependencies": {
"awilix": "*"
}
}

View File

@@ -1,4 +1,4 @@
import { ModuleExports } from "@medusajs/modules-sdk"
import { ModuleExports } from "@medusajs/types"
import Loader from "./loaders"
import { RedisCacheService } from "./services"

View File

@@ -1,11 +1,11 @@
import { MedusaModule } from "@medusajs/modules-sdk"
import {
ExternalModuleDeclaration,
ICacheService,
InternalModuleDeclaration,
MedusaModule,
} from "@medusajs/modules-sdk"
import { ICacheService } from "@medusajs/types"
import { RedisCacheModuleOptions } from "../types"
} from "@medusajs/types"
import { Modules } from "@medusajs/utils"
import { RedisCacheModuleOptions } from "../types"
export const initialize = async (
options?: RedisCacheModuleOptions | ExternalModuleDeclaration

View File

@@ -1,4 +1,4 @@
import { LoaderOptions } from "@medusajs/modules-sdk"
import { LoaderOptions } from "@medusajs/types"
import { asValue } from "awilix"
import Redis from "ioredis"
import { RedisCacheModuleOptions } from "../types"

View File

@@ -34,8 +34,7 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "workspace:^",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
@@ -46,10 +45,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -34,22 +34,23 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"medusa-test-utils": "workspace:^",
"medusa-test-utils": "^1.1.44",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -34,7 +34,7 @@
"orm:cache:clear": "MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/types": "workspace:^",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
@@ -45,11 +45,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -34,7 +34,7 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.8",
"@medusajs/utils": "^1.11.5",
"@medusajs/utils": "^1.11.9",
"ulid": "^2.3.0"
}
}

View File

@@ -1,4 +1,4 @@
import { ModuleExports } from "@medusajs/modules-sdk"
import { ModuleExports } from "@medusajs/types"
import Loader from "./loaders"
import LocalEventBus from "./services/event-bus-local"

View File

@@ -1,4 +1,4 @@
import { LoaderOptions } from "@medusajs/modules-sdk"
import { LoaderOptions } from "@medusajs/types"
export default async ({ logger }: LoaderOptions): Promise<void> => {
logger?.warn(

View File

@@ -1,9 +1,9 @@
import { MedusaContainer } from "@medusajs/modules-sdk"
import {
Event,
EventBusTypes,
Logger,
MedusaContainer,
Message,
Event,
Subscriber,
} from "@medusajs/types"
import { AbstractEventBusModuleService } from "@medusajs/utils"

View File

@@ -36,8 +36,10 @@
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"awilix": "^8.0.0",
"bullmq": "5.12.0",
"ioredis": "^5.4.1"
},
"peerDependencies": {
"awilix": "*"
}
}

View File

@@ -1,4 +1,4 @@
import { ModuleExports } from "@medusajs/modules-sdk"
import { ModuleExports } from "@medusajs/types"
import Loader from "./loaders"
import RedisEventBusService from "./services/event-bus-redis"

View File

@@ -1,11 +1,11 @@
import { MedusaModule } from "@medusajs/modules-sdk"
import {
ExternalModuleDeclaration,
IEventBusService,
InternalModuleDeclaration,
MedusaModule,
} from "@medusajs/modules-sdk"
import { IEventBusService } from "@medusajs/types"
import { EventBusRedisModuleOptions } from "../types"
} from "@medusajs/types"
import { Modules } from "@medusajs/utils"
import { EventBusRedisModuleOptions } from "../types"
export const initialize = async (
options?: EventBusRedisModuleOptions | ExternalModuleDeclaration

View File

@@ -1,4 +1,4 @@
import { LoaderOptions } from "@medusajs/modules-sdk"
import { LoaderOptions } from "@medusajs/types"
import { asValue } from "awilix"
import Redis from "ioredis"
import { EOL } from "os"

View File

@@ -1,5 +1,9 @@
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import { Event, Logger, Message } from "@medusajs/types"
import {
Event,
InternalModuleDeclaration,
Logger,
Message,
} from "@medusajs/types"
import {
AbstractEventBusModuleService,
isPresent,

View File

@@ -48,10 +48,12 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.8",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -35,6 +35,7 @@
},
"devDependencies": {
"@medusajs/fulfillment-manual": "workspace:*",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
@@ -46,11 +47,12 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -31,12 +31,13 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.10",
"@medusajs/utils": "^1.11.8",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
},
"scripts": {
"watch": "tsc --build --watch",

View File

@@ -1,8 +1,8 @@
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import {
BigNumberInput,
Context,
DAL,
InternalModuleDeclaration,
InventoryTypes,
ModuleJoinerConfig,
ModulesSdkTypes,

View File

@@ -1,5 +1,8 @@
import { MedusaModule } from "@medusajs/modules-sdk"
import { ILinkModule, ModuleJoinerConfig } from "@medusajs/types"
import { defineLink, isObject, Modules } from "@medusajs/utils"
import { moduleIntegrationTestRunner } from "medusa-test-utils"
import { MigrationsExecutionPlanner } from "../../src"
import { MedusaModule, ModuleJoinerConfig } from "@medusajs/modules-sdk"
import {
Car,
carJoinerConfig,
@@ -8,9 +11,6 @@ import {
userJoinerConfig,
UserModule,
} from "../__fixtures__/migrations"
import { defineLink, isObject, Modules } from "@medusajs/utils"
import { moduleIntegrationTestRunner } from "medusa-test-utils"
import { ILinkModule } from "@medusajs/types"
jest.setTimeout(30000)

View File

@@ -41,9 +41,12 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -1,5 +1,4 @@
import {
InternalModuleDeclaration,
MedusaModule,
MODULE_RESOURCE_TYPE,
MODULE_SCOPE,
@@ -7,6 +6,7 @@ import {
import {
ExternalModuleDeclaration,
ILinkModule,
InternalModuleDeclaration,
LinkModuleDefinition,
ModuleExports,
ModuleJoinerConfig,

View File

@@ -3,7 +3,7 @@ import {
LoaderOptions,
ModuleServiceInitializeCustomDataLayerOptions,
ModuleServiceInitializeOptions,
} from "@medusajs/modules-sdk"
} from "@medusajs/types"
import { ModulesSdkUtils } from "@medusajs/utils"
import { EntitySchema } from "@mikro-orm/core"

View File

@@ -1,9 +1,9 @@
import { BaseRepository, getLinkRepository } from "@repositories"
import { LinkService, getModuleService } from "@services"
import { LoaderOptions } from "@medusajs/modules-sdk"
import {
InternalModuleDeclaration,
LoaderOptions,
ModuleJoinerConfig,
ModulesSdkTypes,
} from "@medusajs/types"

View File

@@ -46,10 +46,12 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -34,7 +34,6 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
@@ -46,10 +45,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -47,11 +47,13 @@
},
"dependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0",
"bignumber.js": "^9.1.2"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*",
"bignumber.js": "*"
}
}

View File

@@ -34,7 +34,6 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
@@ -47,10 +46,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -1,7 +1,6 @@
import * as entities from "./src/models"
import { defineMikroOrmCliConfig, Modules } from "@medusajs/utils"
import * as entities from "./src/models"
export default defineMikroOrmCliConfig(Modules.PRODUCT, {
entities: Object.values(entities),
databaseName: "medusa-products",
})

View File

@@ -34,7 +34,6 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
@@ -48,10 +47,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "^1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "^1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -34,7 +34,6 @@
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
},
"devDependencies": {
"@medusajs/modules-sdk": "^1.12.11",
"@medusajs/types": "^1.11.16",
"@mikro-orm/cli": "5.9.7",
"cross-env": "^5.2.1",
@@ -47,10 +46,12 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@medusajs/utils": "1.11.9",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.0"
"@medusajs/utils": "1.11.9"
},
"peerDependencies": {
"@mikro-orm/core": "*",
"@mikro-orm/migrations": "*",
"@mikro-orm/postgresql": "*",
"awilix": "*"
}
}

View File

@@ -30,7 +30,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@medusajs/utils": "^1.11.7",
"@medusajs/utils": "^1.11.9",
"scrypt-kdf": "^2.0.1"
},
"keywords": [

Some files were not shown because too many files have changed in this diff Show More