
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.
aom - it is meta-framework made of typescript-decorators, which allows to fast and comfortable
create safe api-services, using the principle of accumulation data layers, enriched with abstractions.
npm i -s aom
or
yarn add aom
To check out the documentation, visit aom.js.org (en and ru available)
The main idea sounds like: "don't duplicate the code, link the code". aom allows to use data
proccessing, made to cover most cases you need. At the same time aom do not limit the developer
in frames of the only framework, but gives the ability to use third-party libraries and packages.
aom is not a "thing in itself "- a framework that operates exclusively on its own codebase and only
works in its own environment. Its important feature is the ability to combine with the "classic" code
on koa, which makes it useful when migrating functionality already existing projects.
aom does not run code in an isolated environment, but generates structures that are compatible with
popular libraries: koa-router, koa-session and others, which allows, if necessary,
keep the existing code-stack, and comfortably extend it in the aom +typescript methodology.
Code sample
@Bridge("/auth", Auth)
@Bridge("/shop", Shop)
@Bridge("/account", Account)
@Controller()
class Root {
@Get()
static Index() {
return models.Settings.findOne({ enabled: true });
}
}
// ...
@Controller()
class Auth {
user: models.Users;
login: models.UserLogins;
token: models.AuthTokens;
@Middleware()
static async Required(
@Headers("authorization") token,
@This() _this: Auth,
@Next() next,
@Err() err
) {
const authToken = await models.AuthTokens.checkToken(token);
if (authData) {
_this.token = authToken;
_this.user = await models.Users.findById(authToken.userId);
_this.login = await models.UserLogins.findById(authToken.loginId);
return next();
} else {
return err("access denied", 403);
}
}
@Post()
static async Login(@Body() { login, password }, @Err() err) {
const authLogin = await models.UserLogins.authLogin(login, password);
if (checkLogin) {
return models.AuthTokens.generateToken(authLogin);
} else {
return err("wrong login", 403);
}
}
}
// ...
@Controller()
class Shop {
@Get()
static Index(@Query() query) {
return models.Products.find({ ...query });
}
@Get("/categories")
static Categories(@Query() query) {
return models.Categories.find({ ...query });
}
@Get("/brands")
static Brands(@Query() query) {
return models.Brands.find({ ...query });
}
@Post("/add_to_cart")
@Use(Auth.Required)
static AddToCart(@Body() { productId, quantity }, @StateMap(Auth) { user }: Auth) {
const addUserCart = await user.addProductToCart(productId, quantity);
return user.getProductsCart();
}
}
// ...
@Controller()
@Use(Auth.Required)
class Account {
@Get()
static async Index(@StateMap(Auth) { user, login }: Auth) {
const orders = await user.getOrders();
return { user, login, orders };
}
@Post("/logout")
static async Logout(@StateMap(Auth) { token }: Auth) {
await token.remove();
return { message: "success logout" };
}
}
Use Github issues to ask your question or report about problem.
AOM is MIT licensed.
aom is in open beta and will be expanded with new features. Errors are not excluded, as well
as replacement and renaming of a number of functions and decorators.
FAQs
API Over Models: typescript-decorators meta-framework
The npm package aom receives a total of 7 weekly downloads. As such, aom popularity was classified as not popular.
We found that aom 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.