Skip to content

Releases: dadi/api

Version 1.3.0

21 Mar 12:14
Compare
Choose a tag to compare

Fix #13: Removed auto-creation of API docs path (should only happen if api-doc module is installed)
Close #14: Load domain-specific configuration if matching file exists
Close #16: Check that generated auth token doesn't already exist, generate new one if it does
Close #18: Validate skip & page parameters before calling model.find()
Close #19: Database replicaSet property should be a String, not a Boolean
Cache: add Redis caching ability and extend config to allow switching between filesystem and Redis caches
Cache: locate endpoint matching the request URL using path-to-regex so we can be certain of a match

Version 1.2.0

13 Jan 04:34
Compare
Choose a tag to compare

Exports

config, connection, log and model modules are all exported, and can be accessed as follows:

var config = require('dadi-api').Config;
var connection = require('dadi-api').Connection;
var model = require('dadi-api').Model;
var log = require('dadi-api').Log;

Model.find()

  • collection setting defaultFilters now used when performing a GET request, in addition to filters passed in the querystring
  • collection setting fieldLimiters now used when performing a GET request, in addition to fields passed in the querystring
  • skip can be passed in the querystring to explicitly set an offset. The skip value is normally calculated using the count and page values, so if count = 10 and page = 2 then skip becomes 10 (i.e. (page-1)*count). If skip is specified in the querystring, this value is added to the calculated value to avoid overlapping records on subsequent pages.

Validation

the limt and validationRule schema properties have been deprecated in favour of the below. Not all rules are required, of course:

  validation: {
    minLength: 1,
    maxLength: 20,
    regex: {
      pattern: /^abc/
    }
  }

First Public Release

31 Dec 06:13
Compare
Choose a tag to compare
v1.1.3

Version 1.1.3

Beta Version 0.2.0

18 Dec 14:34
Compare
Choose a tag to compare
Beta Version 0.2.0 Pre-release
Pre-release

This release is the first for the reconfigured API application, now able to be installed as a node module.

It includes:

  • config exposed from the main module var config = require('dadi-api').Config
  • Document compose made more robust
  • New global route to retrieve all collection endpoints: /api/collections
  • New collection route to retrieve MongoDB stats: /1.0/databaseName/collectionName/stats