Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@mbc-cqrs-serverless/master

Latest version: v1.8.1

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: hai.do, koichi.murakami
30 Stars
5 Forks
5 Versions
3.3K Downloads
TypeScript Repo language

Scan summary

@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.

  • Releases: 5 versions; the latest was published on 25 Nov 2026.
  • Findings: No rules fired in version 1.8.1.
  • Downloads: 3,334 downloads.

Versions

5 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 1.8.1

Findings

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.

README

The publisher’s own README, as collected from the registry.

@mbc-cqrs-serverless/master

License: MIT

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.

Features

  • Master Data Management: CRUD operations for reference data (products, categories, etc.)
  • Hierarchical Settings: 4-level setting inheritance (Common → Tenant → Group → User)
  • RDS Integration: Automatic sync to relational database for complex queries
  • Multi-tenant: Isolated master data per tenant
  • Bulk Operations: Create multiple records in a single request
  • Copy Settings: Replicate settings across tenants

Installation

npm install @mbc-cqrs-serverless/master

Quick Start

1. Register the Module

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 {}
TaskModule requirement
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.

2. Use Master Data Service
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,
    );
  }
}

API Reference

MasterDataService

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
MasterSettingService

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

Setting Hierarchy

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)
Example: Theme Setting
// 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

Usage Examples

Master Data CRUD
@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 },
    );
  }
}
Bulk Creation
async createCategories(categories: CreateCategoryDto[], invokeContext: IInvoke) {
  return this.masterDataService.createBulk(
    {
      items: categories.map((cat) => ({
        settingCode: 'CATEGORY',
        name: cat.name,
        attributes: cat.attributes,
      })),
    },
    invokeContext,
  );
}
Copy Settings Across Tenants
async copySettingsToNewTenant(settingId: string, targetTenants: string[], opts: { invokeContext: IInvoke }) {
  return this.masterSettingService.copy(
    {
      masterSettingId: settingId,
      targetTenants,
      dataCopyOption: { mode: DataCopyMode.ALL },
    },
    opts,
  );
}

Data Model

Master Data Key Pattern
pk: MASTER#[tenantCode]
sk: DATA#[settingCode]#[code]
Master Setting Key Pattern
pk: SETTING#[tenantCode] or SETTING#common
sk: SETTING#[code]                           (tenant/common)
    SETTING#TENANT_GROUP#[groupId]#[code]    (group)
    SETTING#TENANT_USER#[userId]#[code]      (user)

Related Packages

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

Documentation

Full documentation available at https://mbc-cqrs-serverless.mbc-net.com/

Configurable table name

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 master table is a framework-wide central config store — TtlService (TTL config) and the @mbc-cqrs-serverless/sequence package (numbering formats) read a fixed master-data table name. If you override the master tableName, those readers keep looking at master-data, so TTLs are not applied and sequence formats silently fall back to defaults. MasterModule.register/registerAsync logs a warning when a custom tableName is set. Prefer keeping the default master; 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") to prisma/dynamodbs/cqrs.json; the CLI creates the -command / -data / -history physical tables, and your IaC must define the same three. Note that @mbc-cqrs-serverless/master's postinstall auto-adds only the default master name — a custom name must be added manually.

Shared table: If you also use @mbc-cqrs-serverless/ui-setting (SettingModule), both modules must use the same tableName, because they share the same physical table. MasterModule should own the data-sync pipeline — register SettingModule with registerEventHandlerAlias: false. If both modules own the <tableName>_CommandEventHandler alias, the app boots but logs a warning and the effective owner becomes import-order dependent.

License

Copyright © 2024-2025, Murakami Business Consulting, Inc. https://www.mbc-net.com/

This project is under the MIT License.

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm @mbc-cqrs-serverless/master

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229