npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

facades

v1.0.12

Published

Simple abstraction of data-driven methods in a database agnostic way.

Downloads

2

Readme

BlueJayz - Facades

Technology agnostic query framework for building data-driven aplications on node.

[![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url]

Site | Docs | Wiki | Contributing

Eco-System dependencies : | Project | Status | Description | |---------|--------|-------------| | Chirp | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's | | Schemming | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's |

Eco-System : | Project | Status | Description | |---------|--------|-------------| | Chirp | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's | | Schemming | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's | | Chirp | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's | | Routes | [![bluejayz-query-status]][bluejayz-query-package] | Query syntax for data-driven API's | | Hornbill | [![hornbill-status]][hornbill-package] | Complete security layer for open API's |

Introduction

The name Bluejayz comes from the Blue-jay bird known for it's exceptional inteligence and complex social structures. During a time we were scaling our technology, a flexible way for us to oragnise our data and logic became very important and the BlueJayz bird came to mind. We built Bluejayz to handle this complexity so that we could focus on building client-centric applications. Our philosophy around our software development is simple:

  1. separate concerns.
  2. separate them well.

BlueJayz in only conerned with abstracting your complex technology setup into standard logic for API development.

Installation

Using npm:

$ npm install bluejayz --save

Quick Start

Get started with a BlueJayz node API by copying the code below:

//////////////////////////////////////////////////////////////////////////////////////////////////
//Express Example
//////////////////////////////////////////////////////////////////////////////////////////////////
import * as express from 'express';
import { BlueJayz } from 'bluejayz';

//Create Express Server
let server = express();

//configure your data model
const configuration = {
  model : {
    name : "testTable"
    ,schema : {
      columnOne : {type : "String" , trim : false , unique : false}
      ,columnTwo : {type : "String" , trim : false , unique : false}
      ,columnThree : {type : "String" , trim : false , unique : false}
    }
  }
}

let Microservice = new BlueJayz(configuration)
Microservice.installApi(server)

server.listen(3000);

//////////////////////////////////////////////////////////////////////////////////////////////////
//Restify Example
//////////////////////////////////////////////////////////////////////////////////////////////////
import * as restify from 'restify';
import { BlueJayz } from 'bluejayz';

//Create restify srver
let server = restify.createServer();

//configure your data model
const configuration = {
  engine : "restify"
  ,model : {
    name : "testTable"
    ,schema : {
      columnOne : {type : "String" , trim : false , unique : false}
      ,columnTwo : {type : "String" , trim : false , unique : false}
      ,columnThree : {type : "String" , trim : false , unique : false}
    }
  }
}

let Microservice = new BlueJayz(configuration)
Microservice.installApi(server)

server.listen(3000);

Features

  • Technology agnostic, the most common routing methods have already been abstracted and translated to multiple database technologies.
  • Build your own routing methods and customize your API solution to suit your needs.
  • Uses a single query syntax , (Chirp) for all database instances connected to BlueJayz.
  • Plays well with both Express js and Restify, two of the most popular node server engines.

Configuration

BlueJayz can be configured to work as required. A complete configuration example looks as follows:

export const configuration = {
    engine : "express"
    , api : "collection"
    , facade : "mongo"
    , connection : {
      //Either define a full connection string.
      string : "mongodb://username:********@localhost:27017/myproject"

      //Or define the connection string parameters.
      , host : "localhost"
      , port : "27017"
      , db : "myproject"
      , user : "username"
      , pass : "********"

      //For external API services
      ,token : "********"
      ,secret : "*********"
    }
    , model : {
        name : "testTable"
        , schema : {/*Database schema*/ }
    }
}

Engine

Defines the routing engine for the produced API. Using the installApi method described here, BlueJayz will mount the router to your server. Currently, there is support for two types.

  • express: The popular Express routing engine.
  • restify: The popular Restify routing engine.

API

BlueJayz has a list of predefined routing methods to quickly get your application running. You can pass a single api parameter as follows:

api : "collection"

Or an array to include more methods to your router:

api : ["collection" , "graph"]

BlueJayz supports quite a few routing methods and we are always adding more to ease your API development. To get the blueprint of the entire BlueJayz routing universe, check out the complete documentation here

  • utilities: A set of standard methods that are included with all predefined api setup.
    • :_column : Name of column in schema you would like to add an index to.
    ********************************************
              'BlueJayz Utilities API'
    ********************************************
    ____________________________________________
    |          |           Path                 |
    --------------------------------------------
    |   post   |      /api/v1/bulkimport/       |
    --------------------------------------------  
    |   post   |      /api/v1/import/           |
    --------------------------------------------
    |   post   |      /api/v1/drop/             |
    --------------------------------------------
    |   post   |      /api/v1/index?{_column}   |
    --------------------------------------------
    |   get    |      /api/v1/model/            |
    --------------------------------------------
  • collection: (Default) Produces standard CRUD (Create Read Update Delete) operations on your configured database instance.
    • :_id : Uniquely generated id using uuid for collection item.
    ********************************************
              'BlueJayz Collection API'
    ********************************************
    ____________________________________________
    |         |           Path                  |
    --------------------------------------------
    |   get   |       /api/v1/route/            |
    --------------------------------------------  
    |   get   |       /api/v1/route/:_id        |
    --------------------------------------------
    |   post   |      /api/v1/route/            |
    --------------------------------------------
    |   put   |       /api/v1/route/:_id        |
    --------------------------------------------
    |   del   |       /api/v1/route/:_id        |
    --------------------------------------------

Facade

BlueJayz creates a generic interface to facilitate interactions with a datasource through a facade. This is where we translate the api methods into standard database queries for the following technologies:

Note : The database technology selected must already be installed. BlueJayz does not install the database, it leverages a driver to connect and transact with the database.

  • mongo: Use the popular NoSql MongoDb database. Find instruction on how to install it here.
  • json: For a simple json data store. We use lodisk, a lodash powered json local store for quick prototyping.
  • arango: Use ArangoDb for optimized topological data store. Using this facade allows for methods to be unlocked when using the graph api. Find instruction on how to install it here
  • External API sources: If you would like to take advantage of an already existing API service investment. BlueJayz can integrate them as required. However Bluejayz will only bind the a sinlge "GET" method to the service. Other methods from your service can be bind using the standard addMiddleware and mountPath methods detailed below.
    • soap: For the popular xml based soap service.
    • rest: To interact with an already build RESTful service.
  • Structured Query Language: BlueJayz uses an ODBC connection to interact with an already installed driver. Please ensure that there is a driver already installed on your machine. Here is an example on how to install a Postgre-SQL driver on unix and windows.
    • pg-sql: For Postgres SQL database. See read about the technology here
    • my-sql: For MySQL database. See read about the technology here
    • ms-sql: For Microsoft SQL database. See read about the technology here
    • lite-sql: For SQLite database. See read about the technology here
    • oracle-sql: For Oracle database. See read about the technology here

Database Connection

  • string

  • host

  • port

  • db

  • user

  • pass

  • api-key

  • api-secret

Model

  • name:
  • schema
    • type
    • unique
    • trim

Methods

status

listPaths

addMiddleware

mountPath

installApi

api

Chirp

Contributing

This project is maintained by a community of developers. Contributions are welcome and appreciated. You can find TypeDoc on GitHub; feel free to start an issue or create a pull requests: https://github.com/TypeStrong/typedoc

License

Copyright (c) 2015 Sebastian Lenz. Copyright (c) 2016-2017 TypeDoc Contributors. Licensed under the Apache License 2.0. -->