
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@praxisui/specification-core
Advanced tools
Core types and base class for the Specification pattern used across Praxis UI packages.
Para ver esta biblioteca em funcionamento em uma aplicação completa, utilize o projeto de exemplo (Quickstart):
@praxisui/* em um app Angular, incluindo instalação, configuração e uso em telas reais.Tipos e classe base do padrão Specification, compartilhados entre os pacotes Praxis.
A biblioteca @praxisui/specification-core fornece a fundação do padrão Specification no ecossistema Praxis:
Specification<T> com ciclo de vida e utilitários (metadata, clone, serialização/DSL).SpecificationMetadata, SpecificationOptions) para enriquecer validações e integrações de UI.@praxisui/specification para composições lógicas (and/or/not/xor/implies).Este pacote não contém componentes Angular nem composições; ele expõe apenas os contratos (core) e a classe base.
npm i @praxisui/specification-core
Peer dependencies (Angular v20):
@angular/core ^20.0.0@angular/common ^20.0.0Dependências em runtime:
tslib (instalada automaticamente)Crie uma especificação concreta estendendo Specification<T> e implemente os métodos abstratos.
import { Specification, SpecificationMetadata } from '@praxisui/specification-core';
interface Person { age: number }
export class AdultSpecification extends Specification<Person> {
constructor(private minAge = 18, metadata?: SpecificationMetadata) {
super(metadata);
}
isSatisfiedBy(person: Person): boolean {
return person.age >= this.minAge;
}
toJSON() {
return { kind: 'adult', minAge: this.minAge, metadata: this.getMetadata() };
}
static fromJSON(json: any): AdultSpecification {
return new AdultSpecification(json.minAge, json.metadata);
}
toDSL(): string {
return `age >= ${this.minAge}`;
}
clone(): AdultSpecification {
return new AdultSpecification(this.minAge, this.getMetadata());
}
}
// Uso
const spec = new AdultSpecification(21, { code: 'ADULT_ONLY', message: 'Somente maiores de 21' });
const ok = spec.isSatisfiedBy({ age: 25 }); // true
// Metadata helper
const withUi = spec.withMetadata({ uiConfig: { severity: 'warning' } });
Observação: métodos de composição (and, or, not, xor, implies) existem como stubs que lançam erro — use as fábricas em @praxisui/specification para composições lógicas.
Exports principais:
Specification<T extends object>SpecificationMetadataSpecificationOptionsMétodos de Specification<T>:
isSatisfiedBy(obj: T): boolean — verifica se o objeto satisfaz a regra.toJSON(): any e static fromJSON(json: any) — serialização customizável.toDSL(): string — representação textual para logs/editores.getMetadata() | setMetadata(m) | withMetadata(m) — metadata de validação/UI.clone(): Specification<T> — cópia profunda.getOperatorKind() — para precedência (usado por composições em @praxisui/specification).Para operações lógicas e coleções de specifications, utilize @praxisui/specification.
FAQs
Core types and base class for the Specification pattern used across Praxis UI packages.
The npm package @praxisui/specification-core receives a total of 728 weekly downloads. As such, @praxisui/specification-core popularity was classified as not popular.
We found that @praxisui/specification-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.