@dadi/api-wrapper
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -111,2 +111,15 @@ 'use strict' | ||
/** | ||
* Set the search query | ||
* | ||
* @param {String} query | ||
* @return API | ||
* @api public | ||
*/ | ||
APIWrapper.prototype.setSearchQuery = function(query) { | ||
this.searchQuery = query | ||
return this | ||
} | ||
/** | ||
* Select a field to sort on and the sort direction | ||
@@ -113,0 +126,0 @@ * |
@@ -118,2 +118,6 @@ 'use strict' | ||
if (this.searchQuery) { | ||
url += '/search' | ||
} | ||
if (options.id) { | ||
@@ -154,2 +158,6 @@ url += '/' + options.id | ||
if (this.searchQuery) { | ||
params.q = this.searchQuery | ||
} | ||
if (this.sort) { | ||
@@ -156,0 +164,0 @@ params.sort = JSON.stringify(this.sort) |
{ | ||
"name": "@dadi/api-wrapper", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "A high-level library for interacting with DADI API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -255,2 +255,14 @@ # DADI API wrapper | ||
#### `.setSearchQuery(query)` | ||
Sets the query to use for a collection search. | ||
```js | ||
// Example | ||
api | ||
.in('users') | ||
.setSearchQuery('John') | ||
.find() | ||
``` | ||
#### `.sortBy(field, order)` | ||
@@ -257,0 +269,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151978
23
4233
522
4