New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tc-libs/message

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tc-libs/message

Servizio di messaggistica applicativa e normalizzazione errori validazione.

latest
npmnpm
Version
3.9.0
Version published
Weekly downloads
37
-52.56%
Maintainers
1
Weekly downloads
 
Created
Source

@tc-libs/message

Servizio di messaggistica applicativa e normalizzazione errori validazione.

Il package non contiene ancora un motore i18n attivo: setMessage() al momento ritorna null, ma l'API e gia pronta e viene usata dagli altri package per costruire risposte multilingua o fallback.

Registrazione

MessageModule.register(
  {
    appDefaultLanguage: 'it',
    availableLanguages: ['it', 'en'],
    i18nEnabled: false,
  },
  true,
);

Il modulo applica anche il middleware MessageCustomLanguageMiddleware per leggere la lingua custom dalla request.

Servizio

MessageService espone:

  • getAvailableLanguages()
  • get(key, options?)
  • getRequestErrorsMessage(validationErrors, customLanguages?)
  • getImportErrorsMessage(importErrors, customLanguages?)

Esempio:

const msg = await this.messageService.get('user.created', {
  customLanguages: ['it'],
  properties: { name: 'Mario' },
});

Uso con validation errors

const errors = await this.messageService.getRequestErrorsMessage(
  validationErrors,
  ['it'],
);

Questo e il punto di integrazione usato da @tc-libs/error-handler.

Export pubblici

import {
  IMessage,
  IMessageOptions,
  MessageModule,
  MessageService,
} from '@tc-libs/message';

Nota importante

Lo strato di API e pronto, ma la traduzione vera e propria e da completare. Nei package che lo usano, trattalo come message resolver/pluggable facade piu che come i18n engine finito.

Sviluppo

nx build message
nx test message

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts