Skip to content

Onion Name

The system will automatically assign an Onion name to each bean class as the following format:

bash
{moduleName}:{beanName}

For Example

  • The module home-base provides a Service bean: ServiceMenu
Class NameScene NameBean IdentifierOnion NameService Name
ServiceMenuservicehome-base.service.menuhome-base:menuhome-base:menu
  • The module demo-student provides a Model bean: ModelStudent
Class NameScene NameBean IdentifierOnion NameModel Name
ModelStudentmodeldemo-student.model.studentdemo-student:studentdemo-student:student

App Config

With a common Onion name, you can modify the parameters of all bean classes in App Config

src/backend/config/config/config.ts

typescript
// onions
config.onions = {
  middleware: {
    'a-core:gate': {
      enable: false,
    },
  },
  model: {
    'demo-student:student': {
      cache: {
        query: false,
        entity: false,
      },
    },
  },
  schedule: {
    'a-orm:softDeletionPrune': {
      repeat: { every: 24 * 3600 * 1000 },
    },
  },
};

All configurations have type hints, as shown below:

  • All Scene names type hints

  • All Onion names type hints

  • All parameters type hints

Released under the MIT License.