Scan your whole stack
Are you using @mbc-cqrs-serverless/master?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.8.1
@mbc-cqrs-serverless/master was last scanned on 25 Nov 2026 at version 1.8.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.8.1 LATEST | 25 Nov 2026 | No rules fired |
| 1.8.0 | 15 Nov 2026 | No rules fired |
| 1.7.0 | 8 Nov 2026 | No rules fired |
| 1.6.0 | 3 Nov 2026 | Not shown |
| 1.5.0 | 24 Sep 2026 | Not shown |
Findings for v1.8.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.8.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Master data and hierarchical settings management for the MBC CQRS Serverless framework. Manage reference data, configuration settings, and multi-level overrides with automatic RDS synchronization.
npm install @mbc-cqrs-serverless/master
When enableController is true, MasterModule does not register @mbc-cqrs-serverless/task for you. Register TaskModule once in the host app (with your ITaskQueueEventFactory implementation) before or alongside MasterModule. TaskModule.register() is global, so TaskService is available to MasterSettingService, MyTaskService, and controllers without importing TaskModule into every feature module.
import { Module } from '@nestjs/common';
import { MasterModule } from '@mbc-cqrs-serverless/master';
import { TaskModule } from '@mbc-cqrs-serverless/task';
import { PrismaService } from './prisma/prisma.service';
import { MasterDataSyncHandler } from './handlers/master-data-sync.handler';
import { AppTaskQueueEventFactory } from './task/app-task-queue-event.factory';
@Module({
imports: [
TaskModule.register({
taskQueueEventFactory: AppTaskQueueEventFactory,
// enableController: true, // optional: task REST API from @mbc-cqrs-serverless/task
}),
MasterModule.register({
enableController: true, // Optional: enable REST endpoints
prismaService: PrismaService, // Required (MasterDataService/MasterSettingService inject it)
dataSyncHandlers: [MasterDataSyncHandler], // Optional: custom sync handlers
}),
],
})
export class AppModule {}
| Scenario | Action |
|---|---|
MasterModule.register({ enableController: true }) |
Required: call TaskModule.register({ taskQueueEventFactory }) in the host. MasterSettingService and CustomTaskModule (MyTaskService) inject TaskService. |
enableController omitted or false |
TaskModule is still needed if you use APIs or services that inject TaskService; otherwise follow your app’s architecture. |
Use one factory class that implements ITaskQueueEventFactory for both app-specific tasks and master Step Functions task mapping (transformTask / transformStepFunctionTask) so only one TASK_QUEUE_EVENT_FACTORY binding exists. Details: @mbc-cqrs-serverless/task README.
import { Injectable } from '@nestjs/common';
import { MasterDataService } from '@mbc-cqrs-serverless/master';
import { IInvoke } from '@mbc-cqrs-serverless/core';
@Injectable()
export class ProductService {
constructor(private readonly masterDataService: MasterDataService) {}
async createProduct(data: any, opts: { invokeContext: IInvoke }) {
return this.masterDataService.create(
{
tenantCode: 'MBC',
settingCode: 'PRODUCT',
code: 'PROD-001',
name: data.name,
attributes: { price: data.price, category: data.category },
},
opts,
);
}
}
Service for managing master data records.
| Method | Description |
|---|---|
create(dto, options) |
Create new master data |
createSetting(dto, invokeContext) |
Create with auto-generated seq |
createBulk(dto, invokeContext) |
Create multiple records |
update(key, dto, options) |
Update master data |
updateSetting(key, dto, invokeContext) |
Update with simplified params |
delete(key, options) |
Soft delete master data |
deleteSetting(key, invokeContext) |
Delete with simplified params |
get(key) |
Get single record by pk/sk |
getDetail(key) |
Get record with RDS entity format |
list(searchDto) |
List by DynamoDB query |
listByRds(searchDto, context) |
List with RDS full-text search |
checkExistCode(tenantCode, type, code) |
Check if code exists |
Service for managing hierarchical settings.
| Method | Description |
|---|---|
getSetting(dto, options) |
Get effective setting (auto-resolves hierarchy) |
createCommonTenantSetting(dto, options) |
Create common-level setting |
createTenantSetting(dto, options) |
Create tenant-level setting |
createGroupSetting(dto, options) |
Create group-level setting |
createUserSetting(dto, options) |
Create user-level setting |
updateSetting(key, dto, options) |
Update existing setting |
deleteSetting(key, options) |
Soft delete setting |
copy(dto, options) |
Copy settings to other tenants |
list(searchDto, invokeContext) |
List settings with search |
Settings are resolved in order of specificity (most specific wins):
1. User Setting (SETTING#TENANT_USER#userId#code)
↓ if not found
2. Group Setting (SETTING#TENANT_GROUP#groupId#code)
↓ if not found
3. Tenant Setting (SETTING#code)
↓ if not found
4. Common Setting (pk: SETTING#common)
// 1. Create common default (all tenants)
await masterSettingService.createCommonTenantSetting({
code: 'THEME',
name: 'UI Theme',
settingValue: { primaryColor: '#007bff', mode: 'light' },
}, opts);
// 2. Override for specific tenant
await masterSettingService.createTenantSetting({
tenantCode: 'COMPANY_A',
code: 'THEME',
name: 'UI Theme',
settingValue: { primaryColor: '#ff0000', mode: 'light' },
}, opts);
// 3. Override for admin group
await masterSettingService.createGroupSetting({
tenantCode: 'COMPANY_A',
groupId: 'ADMIN',
code: 'THEME',
name: 'UI Theme',
settingValue: { primaryColor: '#ff0000', mode: 'dark' },
}, opts);
// 4. Override for specific user
await masterSettingService.createUserSetting({
tenantCode: 'COMPANY_A',
userId: 'user-123',
code: 'THEME',
name: 'UI Theme',
settingValue: { primaryColor: '#00ff00', mode: 'dark' },
}, opts);
// Get effective setting (resolves automatically)
const theme = await masterSettingService.getSetting({ code: 'THEME' }, opts);
// Returns user setting if exists, otherwise group → tenant → common
@Injectable()
export class CategoryService {
constructor(private readonly masterDataService: MasterDataService) {}
// Create
async create(dto: CreateCategoryDto, invokeContext: IInvoke) {
return this.masterDataService.createSetting(
{
settingCode: 'CATEGORY',
name: dto.name,
attributes: { description: dto.description },
},
invokeContext,
);
}
// Update
async update(pk: string, sk: string, dto: UpdateCategoryDto, invokeContext: IInvoke) {
return this.masterDataService.updateSetting(
{ pk, sk },
{ name: dto.name, attributes: dto.attributes },
invokeContext,
);
}
// Delete (soft delete)
async delete(pk: string, sk: string, invokeContext: IInvoke) {
return this.masterDataService.deleteSetting({ pk, sk }, invokeContext);
}
// Search with RDS
async search(keyword: string, invokeContext: IInvoke) {
return this.masterDataService.listByRds(
{
keyword,
settingCode: 'CATEGORY',
page: 1,
pageSize: 20,
},
{ invokeContext },
);
}
}
async createCategories(categories: CreateCategoryDto[], invokeContext: IInvoke) {
return this.masterDataService.createBulk(
{
items: categories.map((cat) => ({
settingCode: 'CATEGORY',
name: cat.name,
attributes: cat.attributes,
})),
},
invokeContext,
);
}
async copySettingsToNewTenant(settingId: string, targetTenants: string[], opts: { invokeContext: IInvoke }) {
return this.masterSettingService.copy(
{
masterSettingId: settingId,
targetTenants,
dataCopyOption: { mode: DataCopyMode.ALL },
},
opts,
);
}
pk: MASTER#[tenantCode]
sk: DATA#[settingCode]#[code]
pk: SETTING#[tenantCode] or SETTING#common
sk: SETTING#[code] (tenant/common)
SETTING#TENANT_GROUP#[groupId]#[code] (group)
SETTING#TENANT_USER#[userId]#[code] (user)
| Package | Description |
|---|---|
| @mbc-cqrs-serverless/core | Core CQRS framework |
| @mbc-cqrs-serverless/task | Async tasks and TaskService (register once in the host when using master controllers) |
| @mbc-cqrs-serverless/sequence | Uses master data for sequence formats |
| @mbc-cqrs-serverless/tenant | Tenant management for group settings |
Full documentation available at https://mbc-cqrs-serverless.mbc-net.com/
MasterModule uses the master DynamoDB table by default. Pass tableName to
override it (backward compatible — omitting it keeps master). Both
register and registerAsync accept it:
⚠️ Renaming the master table is not fully supported. The
mastertable is a framework-wide central config store —TtlService(TTL config) and the@mbc-cqrs-serverless/sequencepackage (numbering formats) read a fixedmaster-datatable name. If you override the mastertableName, those readers keep looking atmaster-data, so TTLs are not applied and sequence formats silently fall back to defaults.MasterModule.register/registerAsynclogs a warning when a customtableNameis set. Prefer keeping the defaultmaster; only override it if you have separately addressed those readers. (Customizing the directory / survey-template / ui-setting table names has no such caveat.)
MasterModule.register({
enableController: true,
prismaService: PrismaService,
tableName: 'catalog', // default: 'master' — see the caveat above
})
MasterModule.registerAsync({
tableName: 'catalog',
imports: [PrismaModule],
inject: [PrismaService], // resolve and return the PrismaService INSTANCE
useFactory: (prisma) => ({ prismaService: prisma }),
})
Provisioning: Add only the raw base name (e.g.
"catalog") toprisma/dynamodbs/cqrs.json; the CLI creates the-command/-data/-historyphysical tables, and your IaC must define the same three. Note that@mbc-cqrs-serverless/master's postinstall auto-adds only the defaultmastername — a custom name must be added manually.Shared table: If you also use
@mbc-cqrs-serverless/ui-setting(SettingModule), both modules must use the sametableName, because they share the same physical table.MasterModuleshould own the data-sync pipeline — registerSettingModulewithregisterEventHandlerAlias: false. If both modules own the<tableName>_CommandEventHandleralias, the app boots but logs a warning and the effective owner becomes import-order dependent.
Copyright © 2024-2025, Murakami Business Consulting, Inc. https://www.mbc-net.com/
This project is under the MIT License.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.