open-index/open-npm huggingface dataset:
npm package: @leisurelink/consul-kv-sync
Description: Command line interface that synchronizes a set of key-value pairs to consul.
Author: Jesse Hansen
Latest version: 0.1.0

# consul-kv-sync

Synchronizes a json document with key-value pairs in Consul. Will add, update, and *delete* keys as necessary.

Usage:

```bash
$ echo '{"my-api":{"global-key":"value"}' > my-api-global.json
$ echo '{"my-api":{"environment-key":"env value"}' > my-api-environment.json
$ consul-kv-sync --host http://localhost:8500 \
    my-api-global.json my-api-environment.json
```
npm package: @leisurelink/dreamcatcher-client
Description: node.js client for adaptor calls to the public api
Latest version: 0.0.5-fix-for-bdc

# dreamcatcher-client
node.js client for adaptor calls to the public api

### Package.json
` "dreamcatcher-client": "git+ssh://git@github.com/LeisureLink/dreamcatcher-client.git#master"`

### Initializing the client

Before making any calls to the dreamcatcher API using the client, it must be initialized with the API key, URL of the correct API (dev or prod) you wish to access, and an optional timeout value through the init method.

```
var dreamcatcher_client = require('dreamcatcher-client');
dreamcatcher_client.init(apiKey, baseURL, timeout);
```

### Using the client

The dreamcatcher client supports all of the calls detailed in the LeisureLink Integration Hub API and Public Distribution API documentation:

[LeisureLink Integration Hub API](http://www.leisurelink.com/integration-hub/)  
[LeisureLink Public Distribution API](http://www.leisurelink.com/developers/)  

Calls follow a standard format: 

`dreamcatcher_client.*httpverbTypeOfInformation*(id, queryParams, body, callback)`

where only the relevant parameters are included. For example:

```
dreamcatcher_client.getAvailability(rentalUnitId, queryParams, callback);
```

For a full listing of available methods and their signatures, see below.

queryParams is simply an object containing key(s) for each query parameter associated with the call and their appropriate value. Continuing the getAvailability example, you might pass in the following for queryParams:

```
{
  days: 180
}
```

To see what parameters are available for each call, please refer to the API documentation linked above.

### Methods

**$.init(apiKey, baseUrl, timeout)**

**$.getRentalUnitDetail(rentalUnitId, callback)**  
**$.getRentalUnitList(queryParams, callback)**  

**$.getAvailability(rentalUnitId, queryParams, callback)**  
**$.postAvailability(rentalUnitId, body, callback)**  
**$.postCheckAvailability(rentalUnitId, body, callback)**  

**$.getBaseRates(rentalUnitId, body, callback)**  
**$.postBaseRates(rentalUnitId, body, callback)**  

**$.getStayRestrictions(rentalUnitId, callback)**  
**$.postStayRestrictions(rentalUnitId, body, callback)**  

**$.getBooking(bookingId, callback)**  
**$.postQuote(body, callback)**  
**$.postBooking(body, callback)**  
**$.postBookingCancellation(bookingId, body, callback)**  

**$.getCheckInInformation(rentalUnitId, callback)**  

**$.getHubBooking(hubBookingId, callback)**  
**$.postHubBooking(hubBookingId, callback)**  
**$.postHubBookingConfirmation(hubBookingId, body, callback)**  
**$.postHubBookingFailure(hubBookingId, body, callback)**  
**$.postHubBookingCancellation(hubBookingId, body, callback)**  
**$.postHubBookingCancellationConfirmation(hubBookingId, body, callback)**  

**$.getSpecials(rentalUnitId, callback)**  
**$.putSpecial(specialId, body, callback)**  

**$.getUpdateLog(queryParams, callback)**
npm package: @leisurelink/error-base
Description: LeisureLink error base classes and error utilities for nodejs apps.
Author: Phillip Clark
Latest version: 0.1.4

# error-base [![Circle CI](https://circleci.com/gh/LeisureLink/error-base.svg?style=svg)](https://circleci.com/gh/LeisureLink/error-base)

LeisureLink errors and error utilities for nodejs apps.

## Purpose

`error-base` is a very small library that provides specialized Error classes.
npm package: @leisurelink/feature-client
Description: LeisureLink feature toggle client library
Latest version: 0.0.2

# Feature Flags

This module enables an application to have the ability to control certain aspects of its execution based on whether or not a feature is enabled or has other specific enabling criteria, such as if the requesting user is an admin.

> Note: This module is still in progress and currently only operates inside of the quicklink-api database. This will be refactored to utilize the Consul key-value store with refreshable configuration and will then be usable by any project.

## Usage

There are two ways to test for enabled features: async invocation with enabled/disabled callbacks and as Express middleware. Either way, initialization of the backing API client must be performed beforehand.

### Initialization

To provide friendlier syntax for actually wrapping feature blocks, we take a slightly different approach and establish the backing TrustedClient with an initialization routine. 

1. Require the library: 

    ```js
    var Feature = require('feature-client');
    ```

1. Inside wireup, initialize the client:

    ```js
    Feature.init(<feature-api-url>, 
      config.get(configName, '#/trusted_endpoint/key_id'), 
      app.locals.privateKey, 
      log);
    ```

That's it! Now you're able to use one of the two following invocation methods:

### Async Invocation

Given a feature named `bookings`:

```js
Feature('bookings', req).isEnabled(function() {
  // The feature is enabled
}, function(error) {
  if (error) {
    // There was a problem checking for the feature
  }

  // The feature was disabled
});
```

Note that when we create the Feature object, we're passing along the Node.js request object. This is utilized in conjunction with a feature being marked as `adminOnly`. In this scenario, we will check that the `req.user` object has one of the claims associated with being an admin.

*Note: You _must_ provide both enabled and disabled callbacks to the isEnabled() function.

If the `req` object is not passed into the Feature constructor, features that are marked as `adminOnly` will be treated as disabled.

### Middleware Invocation

Express routes are effective a series of middleware functions, and the Feature library easily allows securing routes.

```js
Feature('bookings').isEnabled(function(req, res, next) {
  // Normal code for your middleware goes here
});
```

In the above example, if the `bookings` feature is enabled, the route (middleware) will be invoked normally.

If `bookings` was disabled, the Feature library will automatically invoke the `next` function with a message denoting the feature was disabled. By convention, when the `next` function receives an argument, Express.js will treat it as an error and halt execution of subsequent non-error-handling middleware.

## Testing

To invoke the feature-client tests, we need feature-api to be up and running. We also need a clean database. The following should get you there:

```sh
cd /path/to/feature-api
mocha
FEATURE_DB_URI=mongodb://localhost/quicklink-test node app
```

Now, in a new terminal:

```sh
cd /path/to/feature-client
mocha
```
npm package: @leisurelink/fees-client
Description: LeisureLink client library to the fees-api
Author: Eli Mumford
Latest version: 3.1.1

﻿# Fees Client Overview

The purpose of this client is to provide a layer of abstraction on top of the Fees API.

## Usage
```javascript
import FeeClient from @leisurelink/fees-client;
let client = FeeClient(keyId, key, baseUrl);
```

## Methods

* [Constructing](#constructing)
* [findByRelation](#findByRelation)

#### Constructing

* `let client = FeeClient(host, keyId, key, logger)`
* `baseUrl`: fee api base URL, usually `https://portal[-dev].leisurelink.com`
* `keyId`: trusted endpoint key id, ex: `"my-api/self"`
* `key`: trusted endpoint key as a `Buffer`
* `logger`: 

    function print(it) {
      if (typeof (it) === 'string') {
        util.log(it);
      } else {
        util.log(util.inspect(it, false, 9));
      }
    }

    var logger = {
      info: print,
      warning: print,
      error: print,
      debug: print
    };


#### removeFeeRelationsBySource

* `client.removeFeeRelationsBySource, params)`
* `lang`: the lang - typically en-US
* `feeId`: the id of the fee
* `returns`: `success: "OK"``
* May fail with `404` error if fee does not exist
npm package: @leisurelink/hapi-core
Description: Common functionality (routes, plugins, config, etc) for projects using hapi.
Latest version: 0.2.1

#hapi-core
Common functionality (routes, plugins, config, etc) for projects using hapi.

##Setup

If you use the yeoman [hapi generator](https://github.com/LeisureLink/hapi-generator) no setup outside of configuration is needed.
If not, run:
```
npm install @leisurelink/hapi-core -S
```
##API
Hapi-core provides default plugin and route registration during server startup.

###init
With this function, you can pass in your hapi server and a config object in order to automagically get common plugins, routes, etc 
added to your server.

Take a look at the serverConfig defaults [here](https://github.com/LeisureLink/hapi-core/blob/master/src/serverConfig.js)

Typical registry will look like:
```javascript
hapiCore.init(server, serverConfig)
    .then(()=>{
        server.start();
    })
    .catch(err=>{
        console.error(`error during server setup: ${err}`);
    });
```

You can take a look at the [example app here](https://github.com/LeisureLink/hapi-core/blob/master/example/app.js)

## Common Routes

### Healthcheck
Endpoint used to give status around services the app depends on (e.g. rabbit, redis, etc).
The server configuration has a generateHealthCheckResponse property for which you should define a function which checks appropriate services and returns a result.
e.g.
```
...
generateHealthCheckResponse: (req, rep)=>{
    return {
        status: 'ok',
        rabbit:{
            status: 'ok'  
        }
    };
}
```
### Ping
Endpoint used to determine if the service is still alive.  You can optionally define a config property for a custom response, but this is likely not needed.

## Common Plugins
### [Blipp](https://github.com/danielb2/blipp)
blipp is a simple hapi plugin to display the routes table to console at startup.

### [Inert](https://github.com/hapijs/inert)
inert provides new handler methods for serving static files and directories, as well as decorating the reply interface with a file method for serving file based resources.

### [Vision](https://github.com/hapijs/vision)
vision decorates the server, request, and reply interfaces with additional methods for managing view engines that can be used to render templated responses. vision also provides a built-in handler implementation for creating templated responses.

### [Hapi Swagger](https://github.com/glennjones/hapi-swagger)
Used to self document the API interface in a project.

### [Hapi Swaggered UI](https://github.com/z0mt3c/hapi-swaggered-ui)
Easy swagger-ui drop-in plugin for hapi to be used with hapi-swaggered.