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

@@ -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[],