Comparing version 8.2.2 to 8.2.3
@@ -36,5 +36,5 @@ // Type definitions for nano 6.4 | ||
scope<D>(db: string): DocumentScope<D>; | ||
request: Promise<any>; | ||
relax: Promise<any>; | ||
dinosaur: Promise<any>; | ||
request(opts: RequestOptions | string, callback?: Callback<any>): Promise<any>; | ||
relax(opts: RequestOptions | string, callback?: Callback<any>): Promise<any>; | ||
dinosaur(opts: RequestOptions | string, callback?: Callback<any>): Promise<any>; | ||
// http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication | ||
@@ -52,2 +52,4 @@ auth(username: string, userpass: string, callback?: Callback<DatabaseAuthResponse>): Promise<DatabaseAuthResponse>; | ||
uuids(num: number, callback?: Callback<any>): Promise<UUIDObject>; | ||
// https://docs.couchdb.org/en/stable/api/server/common.html#api-server-root | ||
info(callback?: Callback<InfoResponse>): Promise<InfoResponse>; | ||
} | ||
@@ -57,8 +59,19 @@ | ||
follow(): void; | ||
stop(): void; | ||
} | ||
interface UUIDObject { | ||
uuids: string[] | ||
uuids: string[]; | ||
} | ||
// https://docs.couchdb.org/en/stable/api/server/common.html#api-server-root | ||
interface InfoResponse { | ||
couchdb: string; | ||
version: string; | ||
git_sha: string; | ||
uuid: string; | ||
features: string[]; | ||
vendor: { name: string } | ||
} | ||
interface DatabaseCreateParams { | ||
@@ -314,2 +327,17 @@ n?: number; | ||
): Promise<any>; | ||
// http://docs.couchdb.org/en/latest/api/ddoc/render.html#db-design-design-doc-list-list-name-view-name | ||
viewWithListAsStream( | ||
designname: string, | ||
viewname: string, | ||
listname: string, | ||
callback?: Callback<any> | ||
): Promise<any>; | ||
// http://docs.couchdb.org/en/latest/api/ddoc/render.html#db-design-design-doc-list-list-name-view-name | ||
viewWithListAsStream( | ||
designname: string, | ||
viewname: string, | ||
listname: string, | ||
params: DocumentViewParams, | ||
callback?: Callback<any> | ||
): Promise<any>; | ||
// http://docs.couchdb.org/en/latest/api/database/find.html#db-find | ||
@@ -420,7 +448,2 @@ find(query: MangoQuery, callback?: Callback<MangoResponse<D>>): Promise <MangoResponse<D>>; | ||
type RequestFunction = ( | ||
options?: RequestOptions | string, | ||
callback?: Callback<any> | ||
) => void; | ||
interface RequestOptions { | ||
@@ -509,5 +532,5 @@ db?: string; | ||
interface View<D> { | ||
map?:DocumentInfer<D>; | ||
map?: string | DocumentInfer<D>; | ||
reduce?: string | DocumentInfer<D> | ||
} | ||
@@ -816,2 +839,3 @@ | ||
}; | ||
error?: string; | ||
} | ||
@@ -1175,3 +1199,3 @@ | ||
// Do not wait for the index to finish building to return results. | ||
stale?: boolean | ||
stale?: boolean; | ||
} | ||
@@ -1291,7 +1315,7 @@ | ||
type MangoOperator = '$lt' | '$lte' | '$eq' | '$ne' | '$gte' | '$gt' | | ||
'$exists' | '$type' | | ||
'$exists' | '$type' | | ||
'$in' | '$nin' | '$size' | '$mod' | '$regex' | | ||
'$or' | '$and' | '$nor' | '$not' | '$all' | '$allMatch' | '$elemMatch'; | ||
type MangoSelector = { | ||
[K in MangoOperator | string]: MangoSelector | MangoValue | MangoValue[]; | ||
[K in MangoOperator | string]: MangoSelector| MangoSelector[] | MangoValue | MangoValue[]; | ||
} | ||
@@ -1298,0 +1322,0 @@ |
@@ -334,2 +334,7 @@ // Licensed under the Apache License, Version 2.0 (the 'License'); you may not | ||
// https://docs.couchdb.org/en/latest/api/server/common.html#api-server-root | ||
function info (callback) { | ||
return relax({ path: '' }, callback) | ||
} | ||
// http://docs.couchdb.org/en/latest/api/server/common.html#get--_db_updates | ||
@@ -794,2 +799,8 @@ function updates (qs0, callback0) { | ||
function viewWithListAsStream (ddoc, viewName, listName, qs, callback) { | ||
return view(ddoc, listName + '/' + viewName, { | ||
type: 'list', stream: true | ||
}, qs, callback) | ||
} | ||
// http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_bulksDoc | ||
@@ -1130,2 +1141,3 @@ function bulksDoc (docs, qs0, callback0) { | ||
viewWithList: viewWithList, | ||
viewWithListAsStream: viewWithListAsStream, | ||
server: serverScope, | ||
@@ -1192,3 +1204,4 @@ replication: { | ||
followUpdates: followUpdates, | ||
uuids: uuids | ||
uuids: uuids, | ||
info: info | ||
}) | ||
@@ -1195,0 +1208,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"repository": "http://github.com/apache/couchdb-nano", | ||
"version": "8.2.2", | ||
"version": "8.2.3", | ||
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
@@ -55,2 +55,3 @@ [![Build Status](https://travis-ci.org/apache/couchdb-nano.svg?branch=master)](https://travis-ci.org/apache/couchdb-nano)![Coverage](https://img.shields.io/badge/coverage-100%-ff69b4.svg)[![dependencies Status](https://david-dm.org/apache/couchdb-nano/status.svg)](https://david-dm.org/apache/couchdb-nano)[![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](https://www.npmjs.com/package/nano) | ||
- [nano.followUpdates([params], [callback])](#nanofollowupdatesparams-callback) | ||
- [nano.info([callback])](#nanoinfocallback) | ||
- [Document functions](#document-functions) | ||
@@ -90,2 +91,4 @@ - [db.insert(doc, [params], [callback])](#dbinsertdoc-params-callback) | ||
- [db.viewAsStream(designname, viewname, [params])](#dbviewasstreamdesignname-viewname-params) | ||
- [db.viewWithList(designname, viewname, listname, [params])](#dbviewwithlistdesignname-viewname-params) | ||
- [db.viewWithListAsStream(designname__viewname, listname, [params])](#dbviewwithlistasstreamdesignname-viewname-params) | ||
- [db.show(designname, showname, doc_id, [params], [callback])](#dbshowdesignname-showname-doc_id-params-callback) | ||
@@ -551,2 +554,6 @@ - [db.atomic(designname, updatename, docname, [body], [callback])](#dbatomicdesignname-updatename-docname-body-callback) | ||
### nano.info([callback]) | ||
Get meta information about database instance. | ||
## Document functions | ||
@@ -1078,2 +1085,12 @@ | ||
### db.viewWithListAsStream(designname, viewname, listname, [params], [callback]) | ||
Calls a list function fed by the given view from the specified design document as a stream. | ||
```js | ||
alice.viewWithListAsStream('characters', 'happy_ones', 'my_list').then((body) => { | ||
console.log(body); | ||
}); | ||
``` | ||
### db.show(designname, showname, doc_id, [params], [callback]) | ||
@@ -1080,0 +1097,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
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
146646
2251
1353