open-index/open-npm huggingface dataset:
npm package: @quenk/dback-resource-mongodb
Description: Resource boilerplate for tendril web servers
Author: Lasana Murray
Latest version: 1.4.2

# dback-resource-mongodb

## Introduction

This module provides a CSUGR API for controllers in `@quenk/tendril` 
applications.

## Installation

```sh
npm install --save-dev @quenk/dback-resource-mongodb
```

## Usage

Extend the `BaseResource` class to create your own implementation:

```typescript
import {BaseController} from '@quenk/dback-resource-mongodb';

export class MyController extends BaseResource {

  before(r:Request) {

    this.checkBody(r);
    return value(r);

  }

  create(r:Request) {

    if(this.isValid())
     doCreate(r.body);   

  }

}

```

NOTE: `BaseResource` does not validate the values sourced from the `Request`
object, it assumes they have been validated via middleware or filters or 
will be validated in the `before*()` hooks.

It is therefore important to validate any data coming from the client before
passing it to this module.
npm package: @quenk/dfront
Description: Quenk toolkit based on @quenk/jouvert.
Author: Quenk Technologies
Latest version: 1.0.12


# Culvert

Toolkit for making data management application.

## Introduction

This is a toolkit based on [@quenk/jouvert][1] used in Quenk projects to build
single page UIs for information management systems. These APIs are even more
opinionated than the jouvert ones and are more or less designed around building
only specific kinds of apps.

These APIs are designed to be the frontend for the dback modules.

## Installation

```sh
npm install --save @quenk/dfront
```

[1] https://github.com/quenktechnologies/dfront

## License

Apache-2.0

© Quenk Technologies Limited 2021
npm package: @quenk/eric
Description: CLI tool for generating projects from templates.
Author: Quenk Technologies Limited
Latest version: 1.0.0

# Eric

CLI tool for generating projects from templates.

## Installation

```sh
npm install @quenk/eric -g

```

```Usage

In order to generate your project boilerplate, you must first create a template.

There is currently no documentation on creating templates but you can use
[this](https://github.com/quenktechnologies/eric-skeleton-tendril) template to get a rough idea.

On the CLI excecute:

```sh
eric get https://github.com/quenktechnologies/eric-skeleton-tendril
```

Provided you have git installed, that repo should be cloned and made 
available for your use.

Consider this script in early alpha. Use at your own risk.

## License

Apache-2.0
npm package: @quenk/facets-dsl
Description: Small DSL for building search filters
Author: Quenk Technologies Limited
Latest version: 1.2.0
Deprecated: Use @quenk/search-filters instead.


# facets-dsl

Provides a parser and related APIs for converting a string sequence
of filter conditions (query string) into usable search filters.

## Installation

```sh
npm install --save-dev @quenk/facets-dsl

```

## Usage

This module only provides the APIs for parsing a string into an AST.

To actually generate a query, use one of the modules for the supported platforms
below:
1. [facets-mongodb](https://github.com/quenktechnologies/facets-mongodb) 
2. [facets-mysql](https://github.com/quenktechnologies/facets-mysql) 

or implement your own using them as a guide.

## Syntax

### Query String

A valid query string consists of a sequence of one or more "filters" seperated
by the following operators:

1. "," (space) - indicates the filters are chained via a logical "AND".
2. ","         - Same as above.
4. "or"        - indicates the filters are chained via a logical "OR".
5. "|"         - Same as above.

In short, a sequence of more than one filter is either chained together via a
logical "AND" or "OR".

Example:
```js
let qs1 = 'name:"jon"';
let qs2 = 'name:"jon" or name:"jon\'s" age:>=12';
let qs3 = '(name:"jon" or name:"jon\'s") and age:>=12';

```

Filters can be grouped together via parenthesis "(" ")" to ensure precedence
is kept during parsing.

### Filters

A filter consists of a field name part, colon, optional operator and a value
part:

```bnf
<field> <colon> <operator>? <value>
```
The field name is any valid ECMAScript identifier.
The operator is one of `>,<,>=<=,=,!=`. If no operator is specified then the
special operator `default` is assumed which means it is up to the compiler
to decide which operator to apply.

This is usually set in the policy.

The value part can either be a `string` surronded by double quotes, an 
identifier which is treated as a string, a valid ECMAScript `number` literal,
one of the boolean values `true` or `false`, an "array" of values or a 
"dictionary" (object literal) of key value pairs.

A compile target may not support all the value types.

## License

Apache 2.0 (SEE LICENSE) file. (c) 2020 Quenk Technologies Limited.
npm package: @quenk/facets-mongodb
Description: search-filters compiler for mongodb targets.
Author: Quenk Technologies
Latest version: 1.0.2
Deprecated: Use @quenk/search-filters-mongodb instead.


# Search Filters MongoDB

search-filters compiler for mongodb targets

## Installation

```sh
npm install --save @quenk/search-filters-mongodb
```

## Usage

This module provides a [@quenk/search-filters][1] compiler for generating
mongodb [query operators][2]. It targets the [Node.js Driver API][3] particularly
the `Collection#find` method.

To compile a source string, create an instance of `MongoDBFilterCompiler`
and apply the `compile()` method giving it an [EnabledPolicies][4] and 
a valid source string.

### Available Policies

This module ships with the following [Available Policies][5] :

| Policy Name    | Type         | Operators      | Notes                       |
|----------------|--------------|--------------- |-----------------------------|
| number         | number       | = < > >= <= != |                             |
| boolean        | boolean      | = < > >= <= != |                             |
| string         | string       | = !=           | Tests equality.             |
| match          | string       | =              | Converts value to regex.    |
| matchci        | string       | =              | Case-insensitive "match".   |
| date           | date         | = < > >= <= != | Actual value instanceof Date|    

You can specify a policy name instead of a definition in `EnabledPolicies`
and it will be subsitituted at compile time. 
Consult the [search-filters][1] docs for more information.

You can add additional `AvailablePolicies` by overriding the `policies`
argument of the `MongoDBFilterCompiler`.

### Example

```typecript
import {Value} from '@quenk/noni/lib/data/jsonx';
import {MongoDBFilterCompiler} from '@quenk/search-filters-mongodb';
import {FilterTerm} from '@quenk/search-filters-mongodb/lib/term';

const policies = {

 name: 'matchci',

 age: 'number'

 status: {

   type: 'number',
   operators: ['='],
   term: (field:string, op:string, value:Value ) => 
       new FilterTerm(field, op, value)

 }

}

const qry = '(name:"sana" or name:="Murr") and age:>20 and status:1';

let mfc = new MongoDBFilterCompiler();

let eResult = mfc.compile(qry);

/* Logs the below or throws if an error occured. 
  {"$and":
    [
       {
         "$or":[
            {"name":{"$regex":"sana", $options:"i"}},
            {"name":{"$regex":"Murr", $options:"i"}}
          ]
        },
        {"age":{"$gt":20}},
        {"status":{"$eq":1}}
    ]
   }
*/
console.log(eResult.takeRight());

```

## License

Apache 2.0 (SEE LICENSE) file. (c) Quenk Technologies Limited.

[1]: https://quenktechnologies.github.io/search-filters
[2]: https://docs.mongodb.com/manual/reference/operator/query/
[3]: https://mongodb.github.io/node-mongodb-native/3.5/api/
[4]: https://quenktechnologies.github.io/search-filters/interfaces/_compile_policy_.enabledpolicies.html
[5]: https://quenktechnologies.github.io/search-filters/interfaces/_compile_policy_.availablepolicies.html
npm package: @quenk/facets-mysql
Description: MySQL compiler for facets
Author: Lasana Murray
Latest version: 0.3.1
Deprecated: Package no longer maintained.


# Facets MySQL

> Faceted search compiler for use with node mysql.

Turns input like `type:c created_by:ffan client.name:%"Bally Valentine%"`

into

```sql
 
 -- Provides everything from the WHERE keyword
  SELECT * FROM users WHERE type = 'c' AND created_by = ffan AND client.name LIKE "Bally Valentine%"

```

## License

Apache 2.0 (SEE LICENSE) file. (c) Quenk Technologies Limited.
npm package: @quenk/facets-parser
Description: Parser for a small search filter DSL
Author: Lasana Murray
Latest version: 0.2.0


# facets-parser

>> Parser for a DSL for defining faceted search terms.

## Installation

```sh
npm install --save-dev @quenk/facets

```

## Usage

By itself, this module only provides functions and primitives for creating a compiler for the DSL.
(See [facets-mysql](https://github.com/quenktechnologies/facets-mysql) for an implementation example.)

### The Language

The parser recognizes filters in a string that look like:

```bnf
<field> <colon> <operator>? <value>
```

Example:
```js

var source = 'name:"jon" or name:"jon\'s" age:>=12';

```
Where operator is `<optional>` and if not specified defaults to 'default'. 
The `<field>` part roughly matches the javascript syntax for variable identifiers,
operators are currently one of `>,<,>=,<=,=,!=` and values are one of 
`string`, `number`, `boolean`, `list` (array) or a `dictionary` (object).

Strings are specified using double quotes `"`. Strings that are also valid Javascript
identifiers can be specified without double quotes.o

### Parsing

There is a curried function exported called `parse` that takes an object of key Node constructor mappings
followed by the source text that produces an abstract syntax tree. The partially applied `parse$` can 
be used instead for parsing with defaults.

`parse` returns an `Either` with the left hand side representing an error and the right the AST.

### Compiling

Once you have an AST, (see [src/ast](src/ast/index.ts) for nodes) it can be compiled using the
curried function `compile`. `compile` takes a `Context` followed by a record of `Policy` descriptions.

The Context provides needed functions for compile `and` and `or` expressions as well as other options.
`Policy` descriptions are used during compilation to determine what fields are excepted and how to treat them.

You can supply the whole policy in the record or use a string to indicate it should be retrieved from 
the Context's `policies` property. 

## Todo

Improve documentation.

## License

Apache 2.0 (SEE LICENSE) file. (c) Quenk Technologies Limited.
npm package: @quenk/frontend
Description: Actor oriented client side toolkit for Quenk Technologies.
Latest version: 0.22.3

# J'ouvert

##

J'ouvert is a client-side web framework developed and used by
[Quenk Technologies](https://quenk.com).

It is based mainly on the [potoo](https://github.com/quenktechnologies/potoo)
framework and uses other elements of the Quenk JavaScript platform.

## Installation

```sh
npm install --save-dev @quenk/jouvert
```

## License

Apache-2.0 (c) Quenk Technologies Ltd 2019
npm package: @quenk/frontend-routers
Description: Routing implementations for single page web apps.
Author: Lasana Murray
Latest version: 1.0.1

# Frontend Routers

Routing implementations for single page web apps.

## Installation

```sh
npm install --save-dev @quenk/frontend-routers
```

## License

Apache-2.0 (c) Quenk Technologies Ltd 2020
npm package: @quenk/jcon
Description: JavaScript Configuration Object Notation
Author: Quenk Technologies Limited
Latest version: 0.14.10


# JCON

JavaScript Configuration Object Notation (JCON) is a JSON inspired syntax for
configuration files in ECMAScript programs. 

This module provides a parser and interpreter for the language.

## Syntax

See [spec.md](https://github.com/quenktechnologies/jcon/blob/master/spec.md). 

## License

Apache 2.0 Quenk Technologies Limited © 2019.
npm package: @quenk/jhr
Description: HTTP agent library.
Author: Quenk Technologies
Latest version: 2.7.9

# JHR

## Introduction

This is library for making XHR/HTTP requests from web applications and Node.js
It's APIs are designed around the [Quenk Noni][2] library.

## Installation

```sh
npm install --save @quenk/jhr

```

## Usage

```ts
import {doFuture} from '@quenk/noni/lib/control/monad/future';
import {createAgent} from '@quenk/jhr/lib/browser';

let agent = createAgent();

doFuture(function *() {

  let res1 = yield agent.get('/');
  let res2 = yield agent.post('/', {name:'User', token: res1.body.token});

  if(res2.status === 200)
    return pure(undefined);
  else
    return raise(new Error('Request failed!'));

}).fork(console.error, ()=>{});

```
See the [API documentation][2] for more information.

## License

This module contains parts licensed under the BSD 3 clause license as well as
the Apache-2.0 license. Please see the LICENSE file for more details.

© Quenk Technologies Limited and respective authors.

[1]: https://github.com/quenktechnologies
[2]: https://quenktechnologies.github.io/jhr
npm package: @quenk/jouvert
Description: Actor oriented client side toolkit.
Latest version: 0.20.0

# J'ouvert

## 
J'ouvert is a client-side web framework developed and used by 
[Quenk Technologies](https://quenk.com).

It is based mainly on the [potoo](https://github.com/quenktechnologies/potoo)
framework and uses other elements of the Quenk JavaScript platform.

## Installation

```sh
npm install --save-dev @quenk/jouvert
```

## License

Apache-2.0 (c) Quenk Technologies Ltd 2019
npm package: @quenk/json
Description: Typescript JSON interfaces.
Author: Lasana Murray
Latest version: 1.2.0


JSON
====

This module provides typescript interfaces for working with JSON and exports the following:

* Value 
* Object
* Array
* String
* Boolean
* Number
* Null

## Installation
```sh
 npm install --save-dev @quenk/json
```

### Usage

See [test/types_test.ts](test/types_test.ts)

## License
Apache-2.0 (C) Quenk Technologies Limited.
npm package: @quenk/kindof
Description: Test whether a value is simillar to another.
Author: Lasana Murray
Latest version: 1.2.0
Deprecated: Use @quenk/noni instead.


KindOf
=======

Provides a function that tests whether a value matches a given pattern.

## Installation

```sh

  npm install --save @quenk/kindof

```

## Usage

`kindOf` takes two parameters, the first is the value to test and the second the pattern.

```typescript

  import {kindOf} from '@quenk/kindof';

  class T {
  
    name: 'King T'

  }

  const t = new T();

  if(kindOf(1, 1))
    console.log('yes');

  if(kindOf(1, Number))
    console.log('yes');

  if(kindOf('one', 'one'))
    console.log('yes')

  if(kindOf('one', String))
    console.log('yes')

  if(kindOf(t, T))
    console.log('yes')

  if(kindOf(t, {name:String}))
    console.log('yes')

```

## Description

Currently pattern matches are carried out like this:

| Pattern   | Description   | Example  |
| --------- | ------------- | -------- |
| string  | Matches the string exactly. | kindOf('somestring', 'somestring') |
| number  | Matches the number exactly. | kindOf(1, 1) |
| boolean | Matches the boolean literal exactly. | kindOf(true, true); kindOf(false, false) |
| object  | Treated as a shape, each key is treated as a pattern. | kindOf({one:1, two:'two'}, {one:1, two:String}) |
| function| Treated as a constructor and results in an instanceof check. | kindOf(new Point(), Point) |
| String  | Matches any string value. | kindOf('foo', String) |
| Boolean | Matches any boolean value. | kindOf(false, Boolean) |
| Number  | Matches any number value. | kindOf(12, Number) |
| Array   | Matches an array regardless of content. | kindOf([12], Array) | 


# License

Apache-2.0 (c) Quenk Technologies Limited.
npm package: @quenk/match
Description: Runtime pattern matching for JavaScript.
Author: Lasana Murray
Latest version: 1.3.2
Deprecated: Use @quenk/noni instead.


Match
=======

Runtime pattern matching for ECMAScript.

## Installation

```sh

  npm install --save @quenk/match

```

## Usage

`match` exports a single function `match` as well as two classes `UnMatchedResult` and `MatchedResult`
(See typescript for interface).

`match` constructs a new `UnMatchedResult` with the value provided, use the `caseOf` to test the shape
of the value or the `orElse` method for the default case.

Complete the pattern matching by calling the `end()` method which will return the final value
(after applying any matching functions).

If none of the matches succeed an error will be thrown.

### Example

```typescript

  import {match} from '@quenk/match';

  class CLA {}
  class CLB {}
  class CLC {}

  // result is 3
  let result = 
    match(new CLC())
      .caseOf(CLA, (v:CLA)=> 1)
      .caseOf(CLB, (v:CLB)=> 2)
      .caseOf(CLC, (v:CLC)=> 3)
      .end();

  // result is 24
  let result = 
    match(12)
      .caseOf(CLA, (v:CLA)=> 1)
      .caseOf(CLB, (v:CLB)=> 2)
      .caseOf(CLC, (v:CLC)=> 3)
      .orElse((n:number)=> n * 2)
      .end();

  // throws an error
  let result =
    match(new Date())
      .caseOf(Array, (n:Array)=> n.length)
      .end();

```

For more information on the pattern matching process see the 
[kindof](https://github.com/quenktechnologies/kindof#description) library.

# License

Apache-2.0 (C) Quenk Technologies Limited.
npm package: @quenk/noni
Description: Commons library used by Quenk Technologies everywhere.
Author: Quenk Technologies Limited
Latest version: 1.52.20


# Noni

TypeScript commons library used by Quenk Technologies.

## Introduction

This library provides functions, types and classes commonly used
by [Quenk Technologies Limited](http://quenk.com) during software development.

Quenk Technologies is an application engineering company located in 
Trinidad and Tobago focused mainly on applications for data and information
management.

## Links

This project structure complies with the style-guide
[here](https://github.com/quenktechnologies/quenk-typescript-javascript-style-guide).

API documentation can be found [here](https://quenktechnologies.github.io/noni).

## License

Apache-2.0 (C) Quenk Technologies Limited