@amplication/plugin-db-mongo
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -1,2 +0,2 @@ | ||
import { DsgContext, AmplicationPlugin, CreateServerDockerComposeDBParams, CreateServerDockerComposeParams, CreateServerDotEnvParams, CreatePrismaSchemaParams, Events, Entity, CreateServerPackageJsonParams, CreateServerParams, LoadStaticFilesParams, Module } from "@amplication/code-gen-types"; | ||
import { DsgContext, AmplicationPlugin, CreateServerDockerComposeDBParams, CreateServerDockerComposeParams, CreateServerDotEnvParams, CreatePrismaSchemaParams, Events, Entity, CreateServerPackageJsonParams, CreateServerParams } from "@amplication/code-gen-types"; | ||
declare class MongoPlugin implements AmplicationPlugin { | ||
@@ -9,4 +9,3 @@ register(): Events; | ||
beforeCreateServerDockerComposeDB(context: DsgContext, eventParams: CreateServerDockerComposeDBParams): CreateServerDockerComposeDBParams; | ||
afterCreateServerDockerComposeDB(context: DsgContext): Promise<Module[]>; | ||
afterCreateServerStaticFiles(context: DsgContext, eventParams: LoadStaticFilesParams, modules: Module[]): Promise<Module[]>; | ||
afterCreateServerDockerComposeDB(context: DsgContext): Promise<import("@amplication/code-gen-types").Module[]>; | ||
beforeCreatePrismaSchema(context: DsgContext, eventParams: CreatePrismaSchemaParams): { | ||
@@ -13,0 +12,0 @@ dataSource: import("prisma-schema-dsl-types").DataSource; |
{ | ||
"name": "@amplication/plugin-db-mongo", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Use a Mongo database in a service generated by Amplication", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@amplication/code-gen-types": "^1.1.25", | ||
"@amplication/code-gen-types": "^1.1.21", | ||
"@babel/parser": "^7.18.11", | ||
@@ -28,4 +28,4 @@ "@babel/types": "^7.18.10", | ||
"prettier": "^2.7.1", | ||
"prisma-schema-dsl": "^2.0.3", | ||
"prisma-schema-dsl-types": "^1.0.5", | ||
"prisma-schema-dsl": "^2.0.7", | ||
"prisma-schema-dsl-types": "^1.0.8", | ||
"ts-loader": "^9.4.2", | ||
@@ -36,2 +36,2 @@ "typescript": "4.6.2", | ||
} | ||
} | ||
} |
@@ -5,7 +5,3 @@ import { | ||
} from "@amplication/code-gen-types"; | ||
import { | ||
DataSource, | ||
DataSourceProvider, | ||
DataSourceURLEnv, | ||
} from "prisma-schema-dsl-types"; | ||
import { DataSource, DataSourceProvider } from "prisma-schema-dsl-types"; | ||
@@ -17,3 +13,4 @@ export const envVariables: VariableDictionary = [ | ||
{ | ||
DB_URL: "mongodb://${dbUser}:${dbPassword}@${dbHost}:27017/dbName?authSource=admin", | ||
DB_URL: | ||
"mongodb://${dbUser}:${dbPassword}@${dbHost}:27017/dbName?authSource=admin", | ||
}, | ||
@@ -64,4 +61,5 @@ ]; | ||
provider: DataSourceProvider.MongoDB, | ||
url: new DataSourceURLEnv("DB_URL"), | ||
url: { | ||
name: "DB_URL", | ||
}, | ||
}; |
@@ -23,4 +23,2 @@ import { resolve } from "path"; | ||
types, | ||
LoadStaticFilesParams, | ||
Module, | ||
} from "@amplication/code-gen-types"; | ||
@@ -31,3 +29,2 @@ import { ScalarType, ReferentialActions } from "prisma-schema-dsl-types"; | ||
import { pascalCase } from "pascal-case"; | ||
import { merge } from "lodash"; | ||
@@ -56,5 +53,2 @@ class MongoPlugin implements AmplicationPlugin { | ||
}, | ||
LoadStaticFiles: { | ||
after: this.afterCreateServerStaticFiles, | ||
}, | ||
}; | ||
@@ -139,20 +133,2 @@ } | ||
async afterCreateServerStaticFiles( | ||
context: DsgContext, | ||
eventParams: LoadStaticFilesParams, | ||
modules: Module[] | ||
) { | ||
const staticPath = resolve(__dirname, "./static/health"); | ||
const staticsFiles = await context.utils.importStaticModules( | ||
staticPath, | ||
`${context.serverDirectories.srcDirectory}/health/base` | ||
); | ||
const updateModules = modules.filter( | ||
(x) => !x.path.includes("health.service.base") | ||
); | ||
return [...staticsFiles, ...updateModules]; | ||
} | ||
beforeCreatePrismaSchema( | ||
@@ -159,0 +135,0 @@ context: DsgContext, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168496
13
1830