
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
aurelia-seabreeze
Advanced tools
A small library to quickly get rocking with aurelia-breeze. Based on the sample northwind app: aurelia-breeze-northwind and tried to make the code more abstract/general and thus easily reusable for different entities.
npm i aurelia-seabreeze --save
You will need to create the following:
Then you can create views for your VMs as you find appropriate to display/manage your entity data
breeze settings for EntityManager
// settings.js
export default {
serviceName: "http://sampleservice.breezejs.com/api/northwind",
pageSize: 100,
};
For the EntityManager
factory method we use our settings.
// createEntityManager.js
import settings from './settings';
import { EntityManagerFactory } from 'aurelia-seabreeze';
export createEntityManager() {
return new EntityManagerFactory(settings).entityManager;
}
Note that the settings can also include a logger
entry which provides a logger function logChanges(data)
.
See src/logger.js
for the default logger provided.
The OrderSection
is the entry point for the Order entity is itself a child-router
// orders/order-sections
import { EntitySection } from 'aurelia-seabreeze';
class OrderSection extends EntitySection {
constructor() {
super('order');
}
}
It will create a router with the following routes, defined in the getter routeMap
(override if you need to).
{ route: '', moduleId: `./order-list`, nav: false, title: '' },
{ route: ':id', moduleId: `./order`, nav: false, title: '' },
You should create a (possibly paged) list
query and one or more queries to retrieve one entity (usually by id
).
Example:
// service-queries.js
import query from '../query';
const pagedList = query()
.from('Orders')
.select('OrderID, Customer.CompanyName, Employee.FirstName, Employee.LastName, OrderDate, Freight')
.orderByDesc('OrderDate')
.skip(pageIndex * settings.pageSize)
.take(settings.pageSize)
.inlineCount();
function queriesById({id}) {
return [
query().from('Orders').where('OrderID', '==', id),
query().from('OrderDetails').where('OrderID', '==', id)
]
}
export default {
order: {
list: pagedList,
oneBy: queriesById
}
}
We create an OrderService
for the Order
entity
import { EntityService } from 'aurelia-seabreeze';
import { serviceQueries } from './service-queries';
import { createEntityManager } from './entity-manager'
class OrderService extends EntityService {
constructor() {
super('order');
}
get queries() {
return serviceQueries;
}
get entityManager() {
return createEntityManager();
}
}
// lookup-queries.js
import query from './query';
const customersQuery = query()
.from('Customers')
.select('CustomerID, CompanyName')
.orderBy('CompanyName');
const productsQuery = query()
.from('Products')
.select('ProductID, ProductName, UnitPrice')
.orderBy('ProductName');
export default [
{customers: customersQuery},
{products: productsQuery}
]
We use this to create an EntityLookups
aggregator
// lookups.js
import lookupQueries from './lookup-queries';
import { Lookups } from 'aurelia-seabreeze';
export class EntityLookups extends Lookups {
get entityManager() {
return createEntityManager();
}
get lookupQueries() {
return lookupQueries;
}
}
For the Order
VM we inject OrderService
and EntityLookups
as singletons.
import { Entity } from 'aurelia-seabreeze';
import { OrderService } from './order-service';
import { EntityLookups } from './entity-lookups';
@inject(OrderService, EntityLookups)
class Order extends Entity {
constructor(service, lookups) {
super('order', service, lookups);
}
}
Then create an Order
VM injecting OrderService
and Router
.
We also pass the plural entity name as the route, ie. orders
and optionally some settings, such as pageSize
import { EntityList } from 'aurelia-seabreeze';
import {OrderService} from './order-service';
import {Router} from './aurelia-framework';
@inject(Router, OrderService)
class OrderList extends EntityList {
constructor(router, service}) {
super('orders', router, service, {pageSize: 50})
}
}
Now we are good to go!!
PS: This is still very experimental! Let me know how it works out for you ;)
The included src files: lookup-queries.js
and section/service-queries.js
are simply there to demonstrate
how these queries should be defined and exported for use.
FAQs
Aurelia breeze kickstarter
The npm package aurelia-seabreeze receives a total of 3 weekly downloads. As such, aurelia-seabreeze popularity was classified as not popular.
We found that aurelia-seabreeze demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.