feat: Payment module package setup
This commit is contained in:
1 parent
b6ac768698
commit
824bcce3dd
34 files changed
+485
-1
No files matched your search
@@ -16,6 +16,7 @@ export enum Modules {
|
|||||||
PROMOTION = "promotion",
|
PROMOTION = "promotion",
|
||||||
AUTHENTICATION = "authentication",
|
AUTHENTICATION = "authentication",
|
||||||
CART = "cart",
|
CART = "cart",
|
||||||
|
PAYMENT = "payment",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ModuleRegistrationName {
|
export enum ModuleRegistrationName {
|
||||||
@@ -28,6 +29,7 @@ export enum ModuleRegistrationName {
|
|||||||
PROMOTION = "promotionModuleService",
|
PROMOTION = "promotionModuleService",
|
||||||
AUTHENTICATION = "authenticationModuleService",
|
AUTHENTICATION = "authenticationModuleService",
|
||||||
CART = "cartModuleService",
|
CART = "cartModuleService",
|
||||||
|
PAYMENT = "paymentModuleService",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MODULE_PACKAGE_NAMES = {
|
export const MODULE_PACKAGE_NAMES = {
|
||||||
@@ -40,6 +42,7 @@ export const MODULE_PACKAGE_NAMES = {
|
|||||||
[Modules.PROMOTION]: "@medusajs/promotion",
|
[Modules.PROMOTION]: "@medusajs/promotion",
|
||||||
[Modules.AUTHENTICATION]: "@medusajs/authentication",
|
[Modules.AUTHENTICATION]: "@medusajs/authentication",
|
||||||
[Modules.CART]: "@medusajs/cart",
|
[Modules.CART]: "@medusajs/cart",
|
||||||
|
[Modules.PAYMENT]: "@medusajs/payment",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ModulesDefinition: { [key: string | Modules]: ModuleDefinition } =
|
export const ModulesDefinition: { [key: string | Modules]: ModuleDefinition } =
|
||||||
@@ -171,6 +174,20 @@ export const ModulesDefinition: { [key: string | Modules]: ModuleDefinition } =
|
|||||||
resources: MODULE_RESOURCE_TYPE.SHARED,
|
resources: MODULE_RESOURCE_TYPE.SHARED,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
[Modules.PAYMENT]: {
|
||||||
|
key: Modules.PAYMENT,
|
||||||
|
registrationName: ModuleRegistrationName.PAYMENT,
|
||||||
|
defaultPackage: false,
|
||||||
|
label: upperCaseFirst(ModuleRegistrationName.PAYMENT),
|
||||||
|
isRequired: false,
|
||||||
|
canOverride: true,
|
||||||
|
isQueryable: true,
|
||||||
|
dependencies: ["logger"],
|
||||||
|
defaultModuleDeclaration: {
|
||||||
|
scope: MODULE_SCOPE.INTERNAL,
|
||||||
|
resources: MODULE_RESOURCE_TYPE.SHARED,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MODULE_DEFINITIONS: ModuleDefinition[] =
|
export const MODULE_DEFINITIONS: ModuleDefinition[] =
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/dist
|
||||||
|
node_modules
|
||||||
|
.DS_store
|
||||||
|
.env*
|
||||||
|
.env
|
||||||
|
*.sql
|
||||||
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
|||||||
|
# Payment Module
|
||||||
|
|
||||||
|
A Payment is the result of a series of financial transactions performed as part of collecting a payment of a purchase. The Payment holds information about the payment provider as well as the state of it. You can associate a Payment with a Cart, an Order, an OrderEdit, or any other resource you’d like to have your customers pay for.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
describe("Noop test", () => {
|
||||||
|
it("noop check", async () => {
|
||||||
|
expect(true).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
if (typeof process.env.DB_TEMP_NAME === "undefined") {
|
||||||
|
const tempName = parseInt(process.env.JEST_WORKER_ID || "1")
|
||||||
|
process.env.DB_TEMP_NAME = `medusa-payment-integration-${tempName}`
|
||||||
|
}
|
||||||
|
|
||||||
|
process.env.MEDUSA_CART_DB_SCHEMA = "public"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { JestUtils } from "medusa-test-utils"
|
||||||
|
|
||||||
|
JestUtils.afterAllHookDropDatabase()
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { ModuleServiceInitializeOptions } from "@medusajs/types"
|
||||||
|
|
||||||
|
export const databaseOptions: ModuleServiceInitializeOptions["database"] = {
|
||||||
|
schema: "public",
|
||||||
|
clientUrl: "medusa-payment-test",
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { TestDatabaseUtils } from "medusa-test-utils"
|
||||||
|
|
||||||
|
import * as PaymentModules from "@models"
|
||||||
|
|
||||||
|
const pathToMigrations = "../../src/migrations"
|
||||||
|
const mikroOrmEntities = PaymentModules as unknown as any[]
|
||||||
|
|
||||||
|
export const MikroOrmWrapper = TestDatabaseUtils.getMikroOrmWrapper(
|
||||||
|
mikroOrmEntities,
|
||||||
|
pathToMigrations
|
||||||
|
)
|
||||||
|
|
||||||
|
export const MikroOrmConfig = TestDatabaseUtils.getMikroOrmConfig(
|
||||||
|
mikroOrmEntities,
|
||||||
|
pathToMigrations
|
||||||
|
)
|
||||||
|
|
||||||
|
export const DB_URL = TestDatabaseUtils.getDatabaseURL()
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./config"
|
||||||
|
export * from "./database"
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
module.exports = {
|
||||||
|
moduleNameMapper: {
|
||||||
|
"^@models": "<rootDir>/src/models",
|
||||||
|
"^@services": "<rootDir>/src/services",
|
||||||
|
"^@repositories": "<rootDir>/src/repositories",
|
||||||
|
},
|
||||||
|
transform: {
|
||||||
|
"^.+\\.[jt]s?$": [
|
||||||
|
"ts-jest",
|
||||||
|
{
|
||||||
|
tsConfig: "tsconfig.spec.json",
|
||||||
|
isolatedModules: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
testEnvironment: `node`,
|
||||||
|
moduleFileExtensions: [`js`, `ts`],
|
||||||
|
modulePathIgnorePatterns: ["dist/"],
|
||||||
|
setupFiles: ["<rootDir>/integration-tests/setup-env.js"],
|
||||||
|
setupFilesAfterEnv: ["<rootDir>/integration-tests/setup.js"],
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import * as entities from "./src/models"
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entities: Object.values(entities),
|
||||||
|
schema: "public",
|
||||||
|
clientUrl: "postgres://postgres@localhost/medusa-payment",
|
||||||
|
type: "postgresql",
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"name": "@medusajs/payment",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "Medusa Payment module",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"medusa-payment-seed": "dist/scripts/bin/run-seed.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/medusajs/medusa",
|
||||||
|
"directory": "packages/payment"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"author": "Medusa",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": {
|
||||||
|
"watch": "tsc --build --watch",
|
||||||
|
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
||||||
|
"prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json",
|
||||||
|
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
|
||||||
|
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
|
||||||
|
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts",
|
||||||
|
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
|
||||||
|
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial",
|
||||||
|
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create",
|
||||||
|
"migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:up",
|
||||||
|
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@mikro-orm/cli": "5.9.7",
|
||||||
|
"cross-env": "^5.2.1",
|
||||||
|
"jest": "^29.6.3",
|
||||||
|
"medusa-test-utils": "^1.1.40",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"ts-jest": "^29.1.1",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
|
"tsc-alias": "^1.8.6",
|
||||||
|
"typescript": "^5.1.6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@medusajs/modules-sdk": "^1.12.5",
|
||||||
|
"@medusajs/types": "^1.11.9",
|
||||||
|
"@medusajs/utils": "^1.11.2",
|
||||||
|
"@mikro-orm/core": "5.9.7",
|
||||||
|
"@mikro-orm/migrations": "5.9.7",
|
||||||
|
"@mikro-orm/postgresql": "5.9.7",
|
||||||
|
"awilix": "^8.0.0",
|
||||||
|
"dotenv": "^16.1.4",
|
||||||
|
"knex": "2.4.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { moduleDefinition } from "./module-definition"
|
||||||
|
import { Modules } from "@medusajs/modules-sdk"
|
||||||
|
import { ModulesSdkUtils } from "@medusajs/utils"
|
||||||
|
|
||||||
|
import * as PaymentModels from "@models"
|
||||||
|
|
||||||
|
export default moduleDefinition
|
||||||
|
|
||||||
|
const migrationScriptOptions = {
|
||||||
|
moduleName: Modules.PAYMENT,
|
||||||
|
models: PaymentModels,
|
||||||
|
pathToMigrations: __dirname + "/migrations",
|
||||||
|
}
|
||||||
|
|
||||||
|
export const runMigrations = ModulesSdkUtils.buildMigrationScript(
|
||||||
|
migrationScriptOptions
|
||||||
|
)
|
||||||
|
export const revertMigration = ModulesSdkUtils.buildRevertMigrationScript(
|
||||||
|
migrationScriptOptions
|
||||||
|
)
|
||||||
|
|
||||||
|
export * from "./initialize"
|
||||||
|
export * from "./loaders"
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import {
|
||||||
|
ExternalModuleDeclaration,
|
||||||
|
InternalModuleDeclaration,
|
||||||
|
MedusaModule,
|
||||||
|
MODULE_PACKAGE_NAMES,
|
||||||
|
Modules,
|
||||||
|
} from "@medusajs/modules-sdk"
|
||||||
|
import { IPaymentModuleService, ModulesSdkTypes } from "@medusajs/types"
|
||||||
|
import { moduleDefinition } from "../module-definition"
|
||||||
|
import { InitializeModuleInjectableDependencies } from "../types"
|
||||||
|
|
||||||
|
export const initialize = async (
|
||||||
|
options?: ModulesSdkTypes.ModuleBootstrapDeclaration,
|
||||||
|
injectedDependencies?: InitializeModuleInjectableDependencies
|
||||||
|
): Promise<IPaymentModuleService> => {
|
||||||
|
const loaded = await MedusaModule.bootstrap<IPaymentModuleService>({
|
||||||
|
moduleKey: Modules.PAYMENT,
|
||||||
|
defaultPath: MODULE_PACKAGE_NAMES[Modules.PAYMENT],
|
||||||
|
declaration: options as
|
||||||
|
| InternalModuleDeclaration
|
||||||
|
| ExternalModuleDeclaration,
|
||||||
|
injectedDependencies,
|
||||||
|
moduleExports: moduleDefinition,
|
||||||
|
})
|
||||||
|
|
||||||
|
return loaded[Modules.PAYMENT]
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { Modules } from "@medusajs/modules-sdk"
|
||||||
|
import { ModuleJoinerConfig } from "@medusajs/types"
|
||||||
|
import { MapToConfig } from "@medusajs/utils"
|
||||||
|
import { Payment } from "@models"
|
||||||
|
|
||||||
|
export const LinkableKeys = {
|
||||||
|
payment_id: Payment.name,
|
||||||
|
}
|
||||||
|
|
||||||
|
const entityLinkableKeysMap: MapToConfig = {}
|
||||||
|
Object.entries(LinkableKeys).forEach(([key, value]) => {
|
||||||
|
entityLinkableKeysMap[value] ??= []
|
||||||
|
entityLinkableKeysMap[value].push({
|
||||||
|
mapTo: key,
|
||||||
|
valueFrom: key.split("_").pop()!,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
export const entityNameToLinkableKeysMap: MapToConfig = entityLinkableKeysMap
|
||||||
|
|
||||||
|
export const joinerConfig: ModuleJoinerConfig = {
|
||||||
|
serviceName: Modules.PAYMENT,
|
||||||
|
primaryKeys: ["id"],
|
||||||
|
linkableKeys: LinkableKeys,
|
||||||
|
alias: {
|
||||||
|
name: ["payment", "payments"],
|
||||||
|
args: {
|
||||||
|
entity: Payment.name,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import {
|
||||||
|
InternalModuleDeclaration,
|
||||||
|
LoaderOptions,
|
||||||
|
Modules,
|
||||||
|
} from "@medusajs/modules-sdk"
|
||||||
|
import { ModulesSdkTypes } from "@medusajs/types"
|
||||||
|
import { ModulesSdkUtils } from "@medusajs/utils"
|
||||||
|
import { EntitySchema } from "@mikro-orm/core"
|
||||||
|
import * as PaymentModels from "../models"
|
||||||
|
|
||||||
|
export default async (
|
||||||
|
{
|
||||||
|
options,
|
||||||
|
container,
|
||||||
|
logger,
|
||||||
|
}: LoaderOptions<
|
||||||
|
| ModulesSdkTypes.ModuleServiceInitializeOptions
|
||||||
|
| ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions
|
||||||
|
>,
|
||||||
|
moduleDeclaration?: InternalModuleDeclaration
|
||||||
|
): Promise<void> => {
|
||||||
|
const entities = Object.values(PaymentModels) as unknown as EntitySchema[]
|
||||||
|
const pathToMigrations = __dirname + "/../migrations"
|
||||||
|
|
||||||
|
await ModulesSdkUtils.mikroOrmConnectionLoader({
|
||||||
|
moduleName: Modules.PAYMENT,
|
||||||
|
entities,
|
||||||
|
container,
|
||||||
|
options,
|
||||||
|
moduleDeclaration,
|
||||||
|
logger,
|
||||||
|
pathToMigrations,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import { LoaderOptions } from "@medusajs/modules-sdk"
|
||||||
|
import { ModulesSdkTypes } from "@medusajs/types"
|
||||||
|
import { loadCustomRepositories } from "@medusajs/utils"
|
||||||
|
import { asClass } from "awilix"
|
||||||
|
|
||||||
|
import * as defaultRepositories from "@repositories"
|
||||||
|
import * as defaultServices from "@services"
|
||||||
|
|
||||||
|
export default async ({
|
||||||
|
container,
|
||||||
|
options,
|
||||||
|
}: LoaderOptions<
|
||||||
|
| ModulesSdkTypes.ModuleServiceInitializeOptions
|
||||||
|
| ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions
|
||||||
|
>): Promise<void> => {
|
||||||
|
const customRepositories = (
|
||||||
|
options as ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions
|
||||||
|
)?.repositories
|
||||||
|
|
||||||
|
container.register({
|
||||||
|
// paymentService: asClass(defaultServices.PaymentService).singleton(),
|
||||||
|
})
|
||||||
|
|
||||||
|
if (customRepositories) {
|
||||||
|
loadCustomRepositories({
|
||||||
|
defaultRepositories,
|
||||||
|
customRepositories,
|
||||||
|
container,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
loadDefaultRepositories({ container })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadDefaultRepositories({ container }) {
|
||||||
|
container.register({
|
||||||
|
baseRepository: asClass(defaultRepositories.BaseRepository).singleton(),
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from "./connection"
|
||||||
|
export * from "./container"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as Payment } from "./payment"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { ModuleExports } from "@medusajs/types"
|
||||||
|
|
||||||
|
import { PaymentModuleService } from "@services"
|
||||||
|
|
||||||
|
import loadConnection from "./loaders/connection"
|
||||||
|
import loadContainer from "./loaders/container"
|
||||||
|
|
||||||
|
const service = PaymentModuleService
|
||||||
|
const loaders = [loadContainer, loadConnection] as any
|
||||||
|
|
||||||
|
export const moduleDefinition: ModuleExports = {
|
||||||
|
service,
|
||||||
|
loaders,
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils"
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
import { EOL } from "os"
|
||||||
|
import { ModulesSdkUtils } from "@medusajs/utils"
|
||||||
|
import { Modules } from "@medusajs/modules-sdk"
|
||||||
|
|
||||||
|
import * as PaymentModels from "@models"
|
||||||
|
|
||||||
|
import { createPayments } from "../seed-utils"
|
||||||
|
|
||||||
|
const args = process.argv
|
||||||
|
const path = args.pop() as string
|
||||||
|
|
||||||
|
export default (async () => {
|
||||||
|
const { config } = await import("dotenv")
|
||||||
|
config()
|
||||||
|
if (!path) {
|
||||||
|
throw new Error(
|
||||||
|
`filePath is required.${EOL}Example: medusa-payment-seed <filePath>`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const run = ModulesSdkUtils.buildSeedScript({
|
||||||
|
moduleName: Modules.PAYMENT,
|
||||||
|
models: PaymentModels,
|
||||||
|
pathToMigrations: __dirname + "/../../migrations",
|
||||||
|
seedHandler: async ({ manager, data }) => {
|
||||||
|
const { paymentsData } = data
|
||||||
|
await createPayments(manager, paymentsData)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
await run({ path })
|
||||||
|
})()
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||||
|
|
||||||
|
export async function createPayments(
|
||||||
|
manager: SqlEntityManager,
|
||||||
|
paymentsData: any[]
|
||||||
|
): Promise<any[]> {
|
||||||
|
return []
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
describe("Noop test", () => {
|
||||||
|
it("noop check", async () => {
|
||||||
|
expect(true).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as PaymentModuleService } from "./payment-module"
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import {
|
||||||
|
DAL,
|
||||||
|
InternalModuleDeclaration,
|
||||||
|
ModuleJoinerConfig,
|
||||||
|
} from "@medusajs/types"
|
||||||
|
|
||||||
|
import { Payment } from "@models"
|
||||||
|
|
||||||
|
import { joinerConfig } from "../joiner-config"
|
||||||
|
|
||||||
|
type InjectedDependencies = {
|
||||||
|
baseRepository: DAL.RepositoryService
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: implement IPaymentModule
|
||||||
|
export default class PaymentModule<TPayment extends Payment = Payment> {
|
||||||
|
protected baseRepository_: DAL.RepositoryService
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
{ baseRepository }: InjectedDependencies,
|
||||||
|
protected readonly moduleDeclaration: InternalModuleDeclaration
|
||||||
|
) {
|
||||||
|
this.baseRepository_ = baseRepository
|
||||||
|
}
|
||||||
|
|
||||||
|
__joinerConfig(): ModuleJoinerConfig {
|
||||||
|
return joinerConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { Logger } from "@medusajs/types"
|
||||||
|
|
||||||
|
export type InitializeModuleInjectableDependencies = {
|
||||||
|
logger?: Logger
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["es2020"],
|
||||||
|
"target": "es2020",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"declaration": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": false,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"strictFunctionTypes": true,
|
||||||
|
"noImplicitThis": true,
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"downlevelIteration": true, // to use ES5 specific tooling
|
||||||
|
"baseUrl": ".",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"paths": {
|
||||||
|
"@models": ["./src/models"],
|
||||||
|
"@services": ["./src/services"],
|
||||||
|
"@repositories": ["./src/repositories"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": [
|
||||||
|
"dist",
|
||||||
|
"./src/**/__tests__",
|
||||||
|
"./src/**/__mocks__",
|
||||||
|
"./src/**/__fixtures__",
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"include": ["src", "integration-tests"],
|
||||||
|
"exclude": ["node_modules", "dist"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ export * from "./logger"
|
|||||||
export * from "./modules-sdk"
|
export * from "./modules-sdk"
|
||||||
export * from "./pricing"
|
export * from "./pricing"
|
||||||
export * from "./product"
|
export * from "./product"
|
||||||
|
export * from "./payment"
|
||||||
export * from "./product-category"
|
export * from "./product-category"
|
||||||
export * from "./promotion"
|
export * from "./promotion"
|
||||||
export * from "./region"
|
export * from "./region"
|
||||||
@@ -25,4 +26,3 @@ export * from "./shared-context"
|
|||||||
export * from "./stock-location"
|
export * from "./stock-location"
|
||||||
export * from "./transaction-base"
|
export * from "./transaction-base"
|
||||||
export * from "./workflow"
|
export * from "./workflow"
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from "./service"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { IModuleService } from "../modules-sdk"
|
||||||
|
|
||||||
|
export interface IPaymentModuleService extends IModuleService {}
|
||||||
@@ -8358,6 +8358,33 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
|
"@medusajs/payment@workspace:packages/payment":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "@medusajs/payment@workspace:packages/payment"
|
||||||
|
dependencies:
|
||||||
|
"@medusajs/modules-sdk": ^1.12.5
|
||||||
|
"@medusajs/types": ^1.11.9
|
||||||
|
"@medusajs/utils": ^1.11.2
|
||||||
|
"@mikro-orm/cli": 5.9.7
|
||||||
|
"@mikro-orm/core": 5.9.7
|
||||||
|
"@mikro-orm/migrations": 5.9.7
|
||||||
|
"@mikro-orm/postgresql": 5.9.7
|
||||||
|
awilix: ^8.0.0
|
||||||
|
cross-env: ^5.2.1
|
||||||
|
dotenv: ^16.1.4
|
||||||
|
jest: ^29.6.3
|
||||||
|
knex: 2.4.2
|
||||||
|
medusa-test-utils: ^1.1.40
|
||||||
|
rimraf: ^3.0.2
|
||||||
|
ts-jest: ^29.1.1
|
||||||
|
ts-node: ^10.9.1
|
||||||
|
tsc-alias: ^1.8.6
|
||||||
|
typescript: ^5.1.6
|
||||||
|
bin:
|
||||||
|
medusa-payment-seed: dist/scripts/bin/run-seed.js
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@medusajs/pricing@workspace:^, @medusajs/pricing@workspace:packages/pricing":
|
"@medusajs/pricing@workspace:^, @medusajs/pricing@workspace:packages/pricing":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@medusajs/pricing@workspace:packages/pricing"
|
resolution: "@medusajs/pricing@workspace:packages/pricing"
|
||||||
|
|||||||
Reference in new issue
Block a user