Skip to content

Commit 32de957

Browse files
authored
Merge pull request #26 from dadi/feature/batch_delete
Separate filters and terminators into a separate module (WIP)
2 parents 3da4719 + 3e72133 commit 32de957

File tree

12 files changed

+161
-1041
lines changed

12 files changed

+161
-1041
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [1.3.0] (2016-11-24)
7+
## [1.4.0] - 2016-12-09
8+
9+
### Changed
10+
11+
The core functionality of API Wrapper has been extracted to form a new module [api-wrapper-core](https://github.com/dadi/api-wrapper-core). The change allows the use of the API Wrapper functionality in the browser as well as within server-side applications.
12+
13+
## [1.3.0] - 2016-11-24
814
### Added
915
* Check for invalid bearer tokens
1016
* Integrate DADI Logger to enable logging of queries

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> A high-level library for interacting with DADI API
44
55
[![npm (scoped)](https://img.shields.io/npm/v/@dadi/api-wrapper.svg?maxAge=10800&style=flat-square)](https://www.npmjs.com/package/@dadi/api-wrapper)
6-
![coverage](https://img.shields.io/badge/coverage-92%25-brightgreen.svg?style=flat-square)
6+
![coverage](https://img.shields.io/badge/coverage-93%25-brightgreen.svg?style=flat-square)
77
[![Build Status](https://travis-ci.org/dadi/api-wrapper.svg?branch=master)](https://travis-ci.org/dadi/api-wrapper)
88
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)
99

index.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict'
22

3-
const DadiAPI = function (options) {
3+
const APIWrapperCore = require('@dadi/api-wrapper-core')
4+
5+
const APIWrapper = function (options) {
46
this.options = options
57

68
this.options.appId = this.options.appId || 'DADI API wrapper'
@@ -20,18 +22,6 @@ const DadiAPI = function (options) {
2022
}
2123
}
2224

23-
this.reservedProperties = [
24-
'_id',
25-
'apiVersion',
26-
'createdBy',
27-
'createdAt',
28-
'lastModifiedAt',
29-
'lastModifiedBy',
30-
'v',
31-
'history',
32-
'composed'
33-
]
34-
3525
// Initialise logger
3626
this.logger = require('@dadi/logger')
3727
this.logger.init({
@@ -41,22 +31,18 @@ const DadiAPI = function (options) {
4131
})
4232
}
4333

44-
// -----------------------------------------
45-
// Attach helpers
46-
// -----------------------------------------
47-
48-
require('./lib/helpers')(DadiAPI)
34+
APIWrapper.prototype = new APIWrapperCore()
4935

5036
// -----------------------------------------
51-
// Attach filters
37+
// Attach helpers
5238
// -----------------------------------------
5339

54-
require('./lib/filters')(DadiAPI)
40+
require('./lib/helpers')(APIWrapper)
5541

5642
// -----------------------------------------
5743
// Attach terminators
5844
// -----------------------------------------
5945

60-
require('./lib/terminators')(DadiAPI)
46+
require('./lib/terminators')(APIWrapper)
6147

62-
module.exports = DadiAPI
48+
module.exports = APIWrapper

0 commit comments

Comments
 (0)