This project adheres to Semantic Versioning. This change log follows the format outlined at http://keepachangelog.com.
- Fix bug rendering
cards.findOne
useless
- Upgraded dependencies (
pull-fetch-iso
)
-
keepAlive
method on cursorsKeeps the stream open instead of closing it when there is no more data. Polls for new data every five seconds (configurable).
-
cursor.until
andcursor.since
convenience methodsPass a
Date
directly tosince
oruntil
to query data within a given timeframe.
-
Fix order bug when using
cursor.after
andcursor.before
simultaneously -
Switched to pull-streams
All cursors are now pull streams as opposed to classic Node.js streams. The reasons being:
- Much smaller footprint for browser bundles as classic streams are complex and require events, buffers, etc.
- Less opinionated
- Does not impose any libraries on the consumer (e.g.
readable-stream
)
The
.stream()
method has been removed as it is no longer needed.The
.toArray()
method is unaffacted and code using it will continue to work without change.Examples of migrating to pull streams with the least possible impact:
Before:
merchants .transactions .find(merchantId) .stream() .pipe(...)
After:
var toStream = require('pull-stream-to-stream'); toStream.source(merchants .transactions .find(merchantId)) .pipe(...)
If you do not already know about pull streams, I would like to encourage you to read Dominic Tarr's introduction.
-
Calling
cursor.keepAlive
without an argument is now equivalent to passingtrue
cards.findOne
method for retrieving a single card
-
cursor.skip
The method was never documented as it was deprecated when this client started. It is no longer supported by the server API.
- Removed unused function parameters
- Upgraded dependencies
- Removed unused dependencies
- Expose some low level methods
- Update version header
- optional
highWaterMark
parameter forstream
method - HTTP header to gossip about client version (for debugging)
-
default service URL is now
api.paylike.io
The new service comes with a bunch of changes, but few are relevant to the Node client:
-
replace pk with id
If you are using the Node.js client, and not relying on the response of failed requests, this is the only change affecting you.
This is the most significant change as it concerns all
GET
responses as well asPOST
andPUT
input data which references other documents through its primary key (id).The change is motivated by occasional confusion with a merchant account's "public key" (found as
key
on the merchant document). -
paginated endpoints return arrays directly in the body
Previously paginated endpoints (e.g.
/merchants/[merchantId]/transactions
) would return an object such as:{ transactions: [ .. ], pagination: { .. }, }
These endpoints will now simply return the array inside:
[ .. ]
-
all paginated endpoints returns newest documents first
A few endpoints were returning the newest document last:
/identities/[identityId]/merchants
/merchants/[merchantId]/users
/merchants/[merchantId]/apps
In the future we will introduce custom sorting and filtering.
-
remove pagination object from responses
Previously a "pagination" object was returned alongside the data, those are no longer included.
-
better HTTP status codes (see https://github.com/paylike/api-docs/blob/master/status-codes.md)
-
new error messages (for consistency)
-
DELETE
requests no longer return data -
PUT
requests no longer return data
-
-
new error type
ConflictError
Thrown when a request was unable to complete due to a constraint or conflict with existing data.
- default service URL changed (reverted)
- new cursor methods:
before
andafter
apps.merchants.find
merchants.transactions.create
merchants.transactions.find
merchants.find
(replaced byapps.merchants.find
)transactions.create
(replaced bymerchants.transactions.create
)transactions.find
(replaced bymerchants.transactions.find
)
setKey
(set key for authentication)apps.create
merchants.update
merchants.users.add
merchants.users.revoke
merchants.users.find
merchants.apps.add
merchants.apps.revoke
merchants.apps.find
merchants.lines.find
- Renamed constructor option
api
tourl
- Externalized http request logic
merchants.invite
(replaced bymerchants.users.add
)
- Upgrade dependencies (Bluebird being the most notable)
- Removed unused dependencies
- Fixed repository URL in package.json
- Remove license from package.json (we need to research a bit)