Get Started
Lifecycle & Coding Details
Developing a Plugin
Plugin Event Reference
- Blueprint Plugin Events
- Node.js Plugin Events
- .NET Plugin Events
Blueprint Plugin Events
Create Module
This event run for each module in the list of modules of the blueprint
async beforeCreateModule(
context: blueprintTypes.DsgContext,
eventParams: blueprint.CreateModuleParams,
): Promise<blueprint.CreateModuleParams> {
const { logger } = context;
logger.info(`Creating module ${eventParams.moduleName}`);
const serviceName = pascalCase(
context.resourceInfo?.name || "Service Name",
);
const modulesFiles = await createModulesFiles(context, serviceName);
for (const file of modulesFiles.getAll()) {
context.files.set(file);
}
return eventParams;
}
Event Name
createModule
Event Parameters
The name of the current module
The list of Actions and DTOs for the current module
async beforeCreateModule(
context: blueprintTypes.DsgContext,
eventParams: blueprint.CreateModuleParams,
): Promise<blueprint.CreateModuleParams> {
const { logger } = context;
logger.info(`Creating module ${eventParams.moduleName}`);
const serviceName = pascalCase(
context.resourceInfo?.name || "Service Name",
);
const modulesFiles = await createModulesFiles(context, serviceName);
for (const file of modulesFiles.getAll()) {
context.files.set(file);
}
return eventParams;
}
Was this page helpful?
async beforeCreateModule(
context: blueprintTypes.DsgContext,
eventParams: blueprint.CreateModuleParams,
): Promise<blueprint.CreateModuleParams> {
const { logger } = context;
logger.info(`Creating module ${eventParams.moduleName}`);
const serviceName = pascalCase(
context.resourceInfo?.name || "Service Name",
);
const modulesFiles = await createModulesFiles(context, serviceName);
for (const file of modulesFiles.getAll()) {
context.files.set(file);
}
return eventParams;
}