@ibm-cloud/cloudant 0.0.20 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Release](https://img.shields.io/github/v/release/IBM/cloudant-node-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-node-sdk/releases/latest)
3
3
  [![Docs](https://img.shields.io/static/v1?label=TypeDoc&message=latest&color=blue)](https://ibm.github.io/cloudant-node-sdk/)
4
4
 
5
- # IBM Cloudant Node.js SDK Version 0.0.20
5
+ # IBM Cloudant Node.js SDK Version 0.0.24
6
6
 
7
7
  IBM Cloudant Node.js SDK is a client library that interacts with the
8
8
  [IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=node).
@@ -106,12 +106,12 @@ npm install @ibm-cloud/cloudant
106
106
 
107
107
  ## Authentication
108
108
 
109
- [service-credentials]: https://cloud.ibm.com/docs/Cloudant?topic=cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud#locating-your-service-credentials
110
- [cloud-IAM-mgmt]: https://cloud.ibm.com/docs/Cloudant?topic=cloudant-ibm-cloud-identity-and-access-management-iam-
109
+ [service-credentials]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials
110
+ [cloud-IAM-mgmt]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant#introduction-iam-ai
111
111
  [couch-cookie-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#cookie-authentication
112
- [cloudant-cookie-auth]: https://cloud.ibm.com/docs/Cloudant?topic=cloudant-authentication#cookie-authentication
112
+ [cloudant-cookie-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#cookie-authentication
113
113
  [couch-basic-auth]: https://docs.couchdb.org/en/stable/api/server/authn.html#basic-authentication
114
- [cloudant-basic-auth]: https://cloud.ibm.com/docs/services/Cloudant/api?topic=cloudant-authentication#basic-authentication
114
+ [cloudant-basic-auth]: https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-work-with-your-account#basic-authentication
115
115
 
116
116
  This library requires some of your
117
117
  [Cloudant service credentials][service-credentials] to authenticate with your
@@ -258,7 +258,7 @@ const client = CloudantV1.newInstance({ serviceName: 'EXAMPLES' });
258
258
  // 2. Get server information ==================================================
259
259
  // call service without parameters:
260
260
  client.getServerInformation().then((serverInformation) => {
261
- const version = serverInformation.result.version;
261
+ const { version } = serverInformation.result;
262
262
  console.log(`Server version ${version}`);
263
263
  });
264
264
 
@@ -272,7 +272,7 @@ client.getDatabaseInformation({ db: dbName }).then((dbInfo) => {
272
272
 
273
273
  // 4. Show document count in database =================================
274
274
  console.log(
275
- `Document count in "${dbNameResult}" database is ` + documentCount + '.'
275
+ `Document count in "${dbNameResult}" database is ${documentCount}.`
276
276
  );
277
277
  });
278
278
 
@@ -285,9 +285,9 @@ const getDocParams: CloudantV1.GetDocumentParams = {
285
285
  // call service with predefined parameters:
286
286
  client.getDocument(getDocParams).then((documentAboutZebra) => {
287
287
  // result object is defined as a Document here:
288
- const result: CloudantV1.Document = documentAboutZebra.result;
288
+ const { result } = documentAboutZebra;
289
289
  console.log(
290
- 'Document retrieved from database:\n' + JSON.stringify(result, null, 2)
290
+ `Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
291
291
  );
292
292
  });
293
293
  ```
@@ -307,7 +307,7 @@ const getInfoFromExistingDatabase = async () => {
307
307
 
308
308
  // 2. Get server information ==================================================
309
309
  // call service without parameters:
310
- const version = (await client.getServerInformation()).result.version;
310
+ const { version } = (await client.getServerInformation()).result;
311
311
  console.log(`Server version ${version}`);
312
312
 
313
313
  // 3. Get database information for "animaldb" =================================
@@ -320,7 +320,7 @@ const getInfoFromExistingDatabase = async () => {
320
320
 
321
321
  // 4. Show document count in database =================================
322
322
  console.log(
323
- `Document count in "${dbNameResult}" database is ` + documentCount + '.'
323
+ `Document count in "${dbNameResult}" database is ${documentCount}.`
324
324
  );
325
325
 
326
326
  // 5. Get zebra document out of the database by document id ===================
@@ -330,10 +330,10 @@ const getInfoFromExistingDatabase = async () => {
330
330
  const documentAboutZebra = await client.getDocument(getDocParams);
331
331
 
332
332
  // result object is defined as a Document here:
333
- const result = documentAboutZebra.result;
333
+ const { result } = documentAboutZebra;
334
334
 
335
335
  console.log(
336
- 'Document retrieved from database:\n' + JSON.stringify(result, null, 2)
336
+ `Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
337
337
  );
338
338
  };
339
339
 
@@ -406,7 +406,7 @@ const createDb = client
406
406
  .catch((err) => {
407
407
  if (err.code === 412) {
408
408
  console.log(
409
- 'Cannot create "' + exampleDbName + '" database, it already exists.'
409
+ `Cannot create "${exampleDbName}" database, it already exists.`
410
410
  );
411
411
  }
412
412
  });
@@ -469,7 +469,7 @@ const createDbAndDoc = async () => {
469
469
  } catch (err) {
470
470
  if (err.code === 412) {
471
471
  console.log(
472
- 'Cannot create "' + exampleDbName + '" database, it already exists.'
472
+ `Cannot create "${exampleDbName}" database, it already exists.`
473
473
  );
474
474
  }
475
475
  }
@@ -581,7 +581,7 @@ client
581
581
 
582
582
  // Update the document in the database
583
583
  client
584
- .postDocument({ db: exampleDbName, document: document })
584
+ .postDocument({ db: exampleDbName, document })
585
585
  // Note: for request byte stream use:
586
586
  // .postDocument(
587
587
  // {db: exampleDbName, document: documentAsByteStream}
@@ -590,17 +590,15 @@ client
590
590
  // Keeping track with the revision number of the document object:
591
591
  document._rev = res.result.rev;
592
592
  console.log(
593
- 'You have updated the document:\n' + JSON.stringify(document, null, 2)
593
+ `You have updated the document:\n${JSON.stringify(document, null, 2)}`
594
594
  );
595
595
  });
596
596
  })
597
597
  .catch((err) => {
598
598
  if (err.code === 404) {
599
599
  console.log(
600
- 'Cannot update document because either "' +
601
- exampleDbName +
602
- '" database or the "example" ' +
603
- 'document was not found.'
600
+ `Cannot update document because either "${exampleDbName}" database or the "example" ` +
601
+ `document was not found.`
604
602
  );
605
603
  }
606
604
  });
@@ -649,7 +647,7 @@ const updateDoc = async () => {
649
647
  document._rev = (
650
648
  await client.postDocument({
651
649
  db: exampleDbName,
652
- document: document,
650
+ document,
653
651
  })
654
652
  ).result.rev;
655
653
 
@@ -662,15 +660,13 @@ const updateDoc = async () => {
662
660
  // ).result.rev;
663
661
 
664
662
  console.log(
665
- 'You have updated the document:\n' + JSON.stringify(document, null, 2)
663
+ `You have updated the document:\n${JSON.stringify(document, null, 2)}`
666
664
  );
667
665
  } catch (err) {
668
666
  if (err.code === 404) {
669
667
  console.log(
670
- 'Cannot update document because either "' +
671
- exampleDbName +
672
- '" database or the "example" ' +
673
- 'document was not found.'
668
+ `Cannot update document because either "${exampleDbName}" database or the "example" ` +
669
+ `document was not found.`
674
670
  );
675
671
  }
676
672
  }
@@ -756,10 +752,8 @@ client
756
752
  .catch((err) => {
757
753
  if (err.code === 404) {
758
754
  console.log(
759
- 'Cannot delete document because either "' +
760
- exampleDbName +
761
- '" database or the "example" ' +
762
- 'document was not found.'
755
+ `Cannot delete document because either "${exampleDbName}" database or the "example" ` +
756
+ `document was not found.`
763
757
  );
764
758
  }
765
759
  });
@@ -801,10 +795,8 @@ const deleteDoc = async () => {
801
795
  } catch (err) {
802
796
  if (err.code === 404) {
803
797
  console.log(
804
- 'Cannot delete document because either "' +
805
- exampleDbName +
806
- '" database or the "example" ' +
807
- 'document was not found.'
798
+ `Cannot delete document because either "${exampleDbName}" database or the "example" ` +
799
+ `document was not found.`
808
800
  );
809
801
  }
810
802
  }
@@ -38,6 +38,7 @@ export declare class CouchdbSessionAuthenticator extends Authenticator {
38
38
  protected tokenManager: SessionTokenManager;
39
39
  protected requiredOptions: ['username', 'password'];
40
40
  private tokenOptions;
41
+ static readonly AUTHTYPE_COUCHDB_SESSION = "COUCHDB_SESSION";
41
42
  /**
42
43
  * Create a new CouchdbSessionAuthenticator instance.
43
44
  *
@@ -64,4 +65,10 @@ export declare class CouchdbSessionAuthenticator extends Authenticator {
64
65
  * @param {object} userOptions - Configuration values for a `request` service.
65
66
  */
66
67
  configure(userOptions: UserOptions): void;
68
+ /**
69
+ * Returns the authenticator's type ('COUCHDB_SESSION').
70
+ *
71
+ * @returns a string that indicates the authenticator's type
72
+ */
73
+ authenticationType(): string;
67
74
  }
@@ -29,6 +29,17 @@ var __extends = (this && this.__extends) || (function () {
29
29
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
30
  };
31
31
  })();
32
+ var __assign = (this && this.__assign) || function () {
33
+ __assign = Object.assign || function(t) {
34
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
35
+ s = arguments[i];
36
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
37
+ t[p] = s[p];
38
+ }
39
+ return t;
40
+ };
41
+ return __assign.apply(this, arguments);
42
+ };
32
43
  Object.defineProperty(exports, "__esModule", { value: true });
33
44
  exports.CouchdbSessionAuthenticator = void 0;
34
45
  var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
@@ -58,7 +69,7 @@ var CouchdbSessionAuthenticator = /** @class */ (function (_super) {
58
69
  function CouchdbSessionAuthenticator(options) {
59
70
  var _this = _super.call(this) || this;
60
71
  (0, ibm_cloud_sdk_core_1.validateInput)(options, _this.requiredOptions);
61
- _this.tokenOptions = Object.assign({}, options);
72
+ _this.tokenOptions = __assign({}, options);
62
73
  return _this;
63
74
  }
64
75
  /**
@@ -90,13 +101,13 @@ var CouchdbSessionAuthenticator = /** @class */ (function (_super) {
90
101
  cookieJar.cloudantPatch = true;
91
102
  // Replace the store's updateCookie function with one that applies a patch to newCookie
92
103
  var originalUpdateCookieFn_1 = cookieJar.store.updateCookie;
93
- cookieJar.store.updateCookie = function (oldCookie, newCookie, cb) {
104
+ cookieJar.store.updateCookie = function updateCookie(oldCookie, newCookie, cb) {
94
105
  // Add current time as an update timestamp to the newCookie
95
106
  newCookie.cloudantPatchUpdateTime = new Date();
96
107
  // Replace the cookie's expiryTime function with one that uses cloudantPatchUpdateTime
97
108
  // in place of creation time to check the expiry.
98
109
  var originalExpiryTimeFn = newCookie.expiryTime;
99
- newCookie.expiryTime = function (now) {
110
+ newCookie.expiryTime = function expiryTime(now) {
100
111
  // The original expiryTime check is relative to a time in this order:
101
112
  // 1. supplied now argument
102
113
  // 2. this.creation (original cookie creation time)
@@ -120,6 +131,16 @@ var CouchdbSessionAuthenticator = /** @class */ (function (_super) {
120
131
  // Set the token manager
121
132
  this.tokenManager = new sessionTokenManager_1.SessionTokenManager(this.tokenOptions);
122
133
  };
134
+ /**
135
+ * Returns the authenticator's type ('COUCHDB_SESSION').
136
+ *
137
+ * @returns a string that indicates the authenticator's type
138
+ */
139
+ // eslint-disable-next-line class-methods-use-this
140
+ CouchdbSessionAuthenticator.prototype.authenticationType = function () {
141
+ return CouchdbSessionAuthenticator.AUTHTYPE_COUCHDB_SESSION;
142
+ };
143
+ CouchdbSessionAuthenticator.AUTHTYPE_COUCHDB_SESSION = 'COUCHDB_SESSION';
123
144
  return CouchdbSessionAuthenticator;
124
145
  }(ibm_cloud_sdk_core_1.Authenticator));
125
146
  exports.CouchdbSessionAuthenticator = CouchdbSessionAuthenticator;
@@ -1 +1 @@
1
- {"version":3,"file":"couchdbSessionAuthenticator.js","sourceRoot":"","sources":["../../auth/couchdbSessionAuthenticator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;AAEH,yDAA+E;AAC/E,6DAG+B;AAU/B;;;;;;;;;;;GAWG;AACH;IAAiD,+CAAa;IAK5D;;;;;;;OAOG;IACH,qCAAY,OAA2C;QAAvD,YACE,iBAAO,SAGR;QAFC,IAAA,kCAAa,EAAC,OAAO,EAAE,KAAI,CAAC,eAAe,CAAC,CAAC;QAC7C,KAAI,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;;IACjD,CAAC;IAED;;;;;;;;OAQG;IACI,kDAAY,GAAnB,UAAoB,cAAsB;QACxC,OAAO,IAAI,CA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,YAAY,GAAG,SAAS,YAAY,CAClD,SAAS,EACT,SAAS,EACT,EAAE;gBAEF,2DAA2D;gBAC3D,SAAS,CAAC,uBAAuB,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC/C,sFAAsF;gBACtF,iDAAiD;gBACjD,IAAM,oBAAoB,GAAG,SAAS,CAAC,UAAU,CAAC;gBAClD,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,GAAG;oBAC5C,qEAAqE;oBACrE,2BAA2B;oBAC3B,mDAAmD;oBACnD,kBAAkB;oBAClB,uGAAuG;oBACvG,uDAAuD;oBACvD,OAAO,oBAAoB,CAAC,IAAI,CAC9B,SAAS,EACT,SAAS,CAAC,uBAAuB,IAAI,GAAG,CACzC,CAAC;gBACJ,CAAC,CAAC;gBACF,oGAAoG;gBACpG,uGAAuG;gBACvG,+CAA+C;gBAC/C,IAAI,wBAAsB,EAAE;oBAC1B,wBAAsB,CAAC,IAAI,CACzB,SAAS,CAAC,KAAK,EACf,SAAS,EACT,SAAS,EACT,EAAE,CACH,CAAC;iBACH;qBAAM;oBACL,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;iBAChE;YACH,CAAC,CAAC;SACH;QACD,8BAA8B;QAE9B,wBAAwB;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,kDAAkD;IAC3C,wDAAkB,GAAzB;QACE,OAAO,2BAA2B,CAAC,wBAAwB,CAAC;IAC9D,CAAC;IAlGe,oDAAwB,GAAG,iBAAiB,CAAC;IAmG/D,kCAAC;CAAA,AA1GD,CAAiD,kCAAa,GA0G7D;AA1GY,kEAA2B"}
@@ -75,6 +75,7 @@ var SessionTokenManager = /** @class */ (function (_super) {
75
75
  * @param {OutgoingHttpHeaders} headers - the new set of headers as an object
76
76
  * @returns {Error}
77
77
  */
78
+ // eslint-disable-next-line class-methods-use-this
78
79
  SessionTokenManager.prototype.setHeaders = function (headers) {
79
80
  var errMsg = 'During CouchDB Session Authentication only `request` service headers are in use';
80
81
  throw new Error(errMsg);
@@ -92,7 +93,7 @@ var SessionTokenManager = /** @class */ (function (_super) {
92
93
  var parameters = {
93
94
  options: {
94
95
  headers: this.options.headers,
95
- url: this.options.serviceUrl + '/_session',
96
+ url: "".concat(this.options.serviceUrl, "/_session"),
96
97
  method: 'POST',
97
98
  body: {
98
99
  username: this.options.username,
@@ -120,7 +121,7 @@ var SessionTokenManager = /** @class */ (function (_super) {
120
121
  var sessionToken = null;
121
122
  var expireTime = null;
122
123
  var refreshTime = null;
123
- for (var i = 0; i < sessionCookie.length && sessionToken == null; i++) {
124
+ for (var i = 0; i < sessionCookie.length && sessionToken == null; i += 1) {
124
125
  sessionToken = new RegExp('AuthSession=([^;]*);').exec(sessionCookie[i]);
125
126
  if (sessionToken != null) {
126
127
  expireTime = new RegExp('.*Expires=([^;]*);').exec(sessionCookie[i]);
@@ -1 +1 @@
1
- {"version":3,"file":"sessionTokenManager.js","sourceRoot":"","sources":["../../auth/sessionTokenManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;AAGH,yDAK4B;AAU5B;;;;;GAKG;AACH;IAAyC,uCAAY;IAUnD;;;;;;;;;;;;;;;OAeG;IACH,6BAAY,OAAmC;QAA/C,YACE,kBAAM,OAAO,CAAC,SAMf;QAhCS,qBAAe,GAAa;YACpC,UAAU;YACV,UAAU;YACV,YAAY;YACZ,KAAK;SACN,CAAC;QAuBA,IAAA,kCAAa,EAAC,OAAO,EAAE,KAAI,CAAC,eAAe,CAAC,CAAC;QAE7C,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,SAAS,GAAG,aAAa,CAAC;;IACjC,CAAC;IAED;;;;;OAKG;IACI,wCAAU,GAAjB,UAAkB,OA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;YACtB,IAAI,WAAW,IAAI,IAAI,EAAE;gBACvB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;gBACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;aACtB;iBAAM;gBACL,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAA,mCAAc,GAAE,CAAC;gBAC5D,IAAI,CAAC,WAAW;oBACd,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,IAAA,mCAAc,GAAE,CAAC;aAC7D;SACF;aAAM;YACL,+BAA+B;YAC/B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;YACnD,wCAAwC;YACxC,IAAM,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,IAAA,mCAAc,GAAE,CAAC;YACtD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,GAAG,UAAU,GAAG,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC;SACzE;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AA1HD,CAAyC,iCAAY,GA0HpD;AA1HY,kDAAmB"}
package/cloudant/v1.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2021.
2
+ * (C) Copyright IBM Corp. 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,9 +16,11 @@
16
16
  /// <reference types="node" />
17
17
  import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
18
18
  import { UserOptions } from 'ibm-cloud-sdk-core';
19
- import { CloudantBaseService } from '../lib/cloudantBaseService';
19
+ import CloudantBaseService from '../lib/cloudantBaseService';
20
20
  /**
21
21
  * NoSQL database based on Apache CouchDB
22
+ *
23
+ * See: https://cloud.ibm.com/docs/services/Cloudant/
22
24
  */
23
25
  declare class CloudantV1 extends CloudantBaseService {
24
26
  static DEFAULT_SERVICE_URL: string;
@@ -303,9 +305,9 @@ declare class CloudantV1 extends CloudantBaseService {
303
305
  * @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
304
306
  * if the view's map function emits at least one record for them.
305
307
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
306
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
308
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
307
309
  */
308
- postChangesAsStream(params: CloudantV1.PostChangesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
310
+ postChangesAsStream(params: CloudantV1.PostChangesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
309
311
  /*************************
310
312
  * databases
311
313
  ************************/
@@ -493,9 +495,9 @@ declare class CloudantV1 extends CloudantBaseService {
493
495
  * @param {string[]} [params.keys] - Schema for a list of document IDs.
494
496
  * @param {string} [params.startkey] - Schema for a document ID.
495
497
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
496
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
498
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
497
499
  */
498
- postAllDocsAsStream(params: CloudantV1.PostAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
500
+ postAllDocsAsStream(params: CloudantV1.PostAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
499
501
  /**
500
502
  * Multi-query the list of all documents in a database.
501
503
  *
@@ -525,9 +527,9 @@ declare class CloudantV1 extends CloudantBaseService {
525
527
  * individual view query to be executed. The field names and their meaning are the same as the query parameters of a
526
528
  * regular `/_all_docs` request.
527
529
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
528
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
530
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
529
531
  */
530
- postAllDocsQueriesAsStream(params: CloudantV1.PostAllDocsQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
532
+ postAllDocsQueriesAsStream(params: CloudantV1.PostAllDocsQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
531
533
  /**
532
534
  * Bulk modify multiple documents in a database.
533
535
  *
@@ -579,9 +581,9 @@ declare class CloudantV1 extends CloudantBaseService {
579
581
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
580
582
  * revisions.
581
583
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
582
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
584
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
583
585
  */
584
- postBulkGetAsMixed(params: CloudantV1.PostBulkGetAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
586
+ postBulkGetAsMixed(params: CloudantV1.PostBulkGetAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
585
587
  /**
586
588
  * Bulk query revision information for multiple documents as related.
587
589
  *
@@ -599,9 +601,9 @@ declare class CloudantV1 extends CloudantBaseService {
599
601
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
600
602
  * revisions.
601
603
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
602
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
604
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
603
605
  */
604
- postBulkGetAsRelated(params: CloudantV1.PostBulkGetAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
606
+ postBulkGetAsRelated(params: CloudantV1.PostBulkGetAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
605
607
  /**
606
608
  * Bulk query revision information for multiple documents as stream.
607
609
  *
@@ -619,9 +621,9 @@ declare class CloudantV1 extends CloudantBaseService {
619
621
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
620
622
  * revisions.
621
623
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
622
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
624
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
623
625
  */
624
- postBulkGetAsStream(params: CloudantV1.PostBulkGetAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
626
+ postBulkGetAsStream(params: CloudantV1.PostBulkGetAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
625
627
  /**
626
628
  * Delete a document.
627
629
  *
@@ -706,9 +708,9 @@ declare class CloudantV1 extends CloudantBaseService {
706
708
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
707
709
  * known document revisions.
708
710
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
709
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
711
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
710
712
  */
711
- getDocumentAsMixed(params: CloudantV1.GetDocumentAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
713
+ getDocumentAsMixed(params: CloudantV1.GetDocumentAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
712
714
  /**
713
715
  * Retrieve a document as related.
714
716
  *
@@ -740,9 +742,9 @@ declare class CloudantV1 extends CloudantBaseService {
740
742
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
741
743
  * known document revisions.
742
744
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
743
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
745
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
744
746
  */
745
- getDocumentAsRelated(params: CloudantV1.GetDocumentAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
747
+ getDocumentAsRelated(params: CloudantV1.GetDocumentAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
746
748
  /**
747
749
  * Retrieve a document as stream.
748
750
  *
@@ -774,9 +776,9 @@ declare class CloudantV1 extends CloudantBaseService {
774
776
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
775
777
  * known document revisions.
776
778
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
777
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
779
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
778
780
  */
779
- getDocumentAsStream(params: CloudantV1.GetDocumentAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
781
+ getDocumentAsStream(params: CloudantV1.GetDocumentAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
780
782
  /**
781
783
  * Create or modify a document.
782
784
  *
@@ -1059,9 +1061,9 @@ declare class CloudantV1 extends CloudantBaseService {
1059
1061
  * @param {string} [params.update] - Parameter to specify whether or not the view in question should be updated prior
1060
1062
  * to responding to the user.
1061
1063
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1062
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1064
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1063
1065
  */
1064
- postViewAsStream(params: CloudantV1.PostViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1066
+ postViewAsStream(params: CloudantV1.PostViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1065
1067
  /**
1066
1068
  * Multi-query a MapReduce view.
1067
1069
  *
@@ -1093,9 +1095,9 @@ declare class CloudantV1 extends CloudantBaseService {
1093
1095
  * view query to be executed. The field names and their meaning are the same as the query parameters of a regular view
1094
1096
  * request.
1095
1097
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1096
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1098
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1097
1099
  */
1098
- postViewQueriesAsStream(params: CloudantV1.PostViewQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1100
+ postViewQueriesAsStream(params: CloudantV1.PostViewQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1099
1101
  /*************************
1100
1102
  * partitionedDatabases
1101
1103
  ************************/
@@ -1176,9 +1178,9 @@ declare class CloudantV1 extends CloudantBaseService {
1176
1178
  * @param {string[]} [params.keys] - Schema for a list of document IDs.
1177
1179
  * @param {string} [params.startkey] - Schema for a document ID.
1178
1180
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1179
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1181
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1180
1182
  */
1181
- postPartitionAllDocsAsStream(params: CloudantV1.PostPartitionAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1183
+ postPartitionAllDocsAsStream(params: CloudantV1.PostPartitionAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1182
1184
  /**
1183
1185
  * Query a database partition search index.
1184
1186
  *
@@ -1256,9 +1258,9 @@ declare class CloudantV1 extends CloudantBaseService {
1256
1258
  * Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
1257
1259
  * @param {string} [params.stale] - Do not wait for the index to finish building to return results.
1258
1260
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1259
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1261
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1260
1262
  */
1261
- postPartitionSearchAsStream(params: CloudantV1.PostPartitionSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1263
+ postPartitionSearchAsStream(params: CloudantV1.PostPartitionSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1262
1264
  /**
1263
1265
  * Query a database partition MapReduce view function.
1264
1266
  *
@@ -1354,9 +1356,9 @@ declare class CloudantV1 extends CloudantBaseService {
1354
1356
  * @param {string} [params.update] - Parameter to specify whether or not the view in question should be updated prior
1355
1357
  * to responding to the user.
1356
1358
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1357
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1359
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1358
1360
  */
1359
- postPartitionViewAsStream(params: CloudantV1.PostPartitionViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1361
+ postPartitionViewAsStream(params: CloudantV1.PostPartitionViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1360
1362
  /**
1361
1363
  * Query a database partition index by using selector syntax (POST).
1362
1364
  *
@@ -1462,9 +1464,9 @@ declare class CloudantV1 extends CloudantBaseService {
1462
1464
  * @param {string[]} [params.useIndex] - Use this option to identify a specific index for query to run against, rather
1463
1465
  * than by using the IBM Cloudant Query algorithm to find the best index.
1464
1466
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1465
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1467
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1466
1468
  */
1467
- postPartitionFindAsStream(params: CloudantV1.PostPartitionFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1469
+ postPartitionFindAsStream(params: CloudantV1.PostPartitionFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1468
1470
  /*************************
1469
1471
  * queries
1470
1472
  ************************/
@@ -1636,9 +1638,9 @@ declare class CloudantV1 extends CloudantBaseService {
1636
1638
  * that many replicas before it is returned in the results. The request will take more time than using only the
1637
1639
  * document that is stored locally with the index.
1638
1640
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1639
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1641
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1640
1642
  */
1641
- postFindAsStream(params: CloudantV1.PostFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1643
+ postFindAsStream(params: CloudantV1.PostFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1642
1644
  /**
1643
1645
  * Retrieve information about all indexes.
1644
1646
  *
@@ -1824,9 +1826,9 @@ declare class CloudantV1 extends CloudantBaseService {
1824
1826
  * objects. The field names of the JSON objects are names for ranges. The values are strings that describe the range,
1825
1827
  * for example "[0 TO 10]". This option is only available when making global queries.
1826
1828
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1827
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1829
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1828
1830
  */
1829
- postSearchAsStream(params: CloudantV1.PostSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1831
+ postSearchAsStream(params: CloudantV1.PostSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1830
1832
  /**
1831
1833
  * Retrieve information about a search index.
1832
1834
  *
@@ -1939,9 +1941,9 @@ declare class CloudantV1 extends CloudantBaseService {
1939
1941
  * @param {string} [params.stale] - Query parameter to specify to not wait for the index to finish building before
1940
1942
  * returning results.
1941
1943
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1942
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
1944
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1943
1945
  */
1944
- getGeoAsStream(params: CloudantV1.GetGeoAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1946
+ getGeoAsStream(params: CloudantV1.GetGeoAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1945
1947
  /**
1946
1948
  * Cleanup old geospatial indexes.
1947
1949
  *
@@ -2303,9 +2305,9 @@ declare class CloudantV1 extends CloudantBaseService {
2303
2305
  * implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
2304
2306
  * @param {string} [params.rev] - Query parameter to specify a document revision.
2305
2307
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2306
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>}
2308
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
2307
2309
  */
2308
- getAttachment(params: CloudantV1.GetAttachmentParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
2310
+ getAttachment(params: CloudantV1.GetAttachmentParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
2309
2311
  /**
2310
2312
  * Create or modify an attachment.
2311
2313
  *
@@ -2415,7 +2417,7 @@ declare class CloudantV1 extends CloudantBaseService {
2415
2417
  *
2416
2418
  * @param {Object} params - The parameters to send to the service.
2417
2419
  * @param {string} params.db - Path parameter to specify the database name.
2418
- * @param {JsonObject} params.documentRevisions - HTTP request body for postMissingRevs and postRevsDiff.
2420
+ * @param {JsonObject} params.documentRevisions - HTTP request body for operations with Document revisions.
2419
2421
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2420
2422
  * @returns {Promise<CloudantV1.Response<CloudantV1.JsonObject>>}
2421
2423
  */
@@ -5357,7 +5359,7 @@ declare namespace CloudantV1 {
5357
5359
  interface PostRevsDiffParams {
5358
5360
  /** Path parameter to specify the database name. */
5359
5361
  db: string;
5360
- /** HTTP request body for postMissingRevs and postRevsDiff. */
5362
+ /** HTTP request body for operations with Document revisions. */
5361
5363
  documentRevisions: JsonObject;
5362
5364
  headers?: OutgoingHttpHeaders;
5363
5365
  }
@@ -5780,6 +5782,45 @@ declare namespace CloudantV1 {
5780
5782
  autoupdate?: boolean;
5781
5783
  /** Schema for filter functions definition. This schema is a map where keys are the names of the filter
5782
5784
  * functions and values are the function definition in string format.
5785
+ *
5786
+ * Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
5787
+ *
5788
+ * * `doc`: The document that is being processed.
5789
+ * * `req`: A Request JavaScript object with these properties:
5790
+ *
5791
+ * * `body` - string, Request body data as string.
5792
+ * If the request method is GET this field contains the value
5793
+ * `"undefined"`.
5794
+ * If the method is DELETE or HEAD the value is `""` (empty string).
5795
+ * * `cookie` - Cookies object.
5796
+ * * `form` - Form Data object, contains the decoded body as key-value
5797
+ * pairs if the Content-Type header was
5798
+ * application/x-www-form-urlencoded.
5799
+ * * `headers` - Request Headers object.
5800
+ * * `id` - string, requested document id if it was specified
5801
+ * or null otherwise.
5802
+ * * `info` - Database Information object,
5803
+ * see `DatabaseInformation`.
5804
+ * * `method` - string or an array of chars, request method.
5805
+ * String value is a method as one of: HEAD, GET, POST, PUT,
5806
+ * DELETE, OPTIONS, TRACE, COPY. For not supported methods
5807
+ * it will be represented as an array of char codes e.g. for VIEW
5808
+ * it will be 86,73,69,87.
5809
+ * * `path` - array of strings, requested path sections.
5810
+ * * `peer` - string, request source IP address.
5811
+ * * `query` - string, URL query parameters object. Note that multiple
5812
+ * keys are not supported and the last key value suppresses others.
5813
+ * * `requested_path` - array of strings,
5814
+ * actual requested path section.
5815
+ * * `raw_path` - string, raw requested path.
5816
+ * * `userCtx`: User Context Object, containing information about the
5817
+ * user writing the document (if present), see the `UserContext`.
5818
+ * * `secObj`: Security Object, with lists of database security roles,
5819
+ * see the `SecurityObject`.
5820
+ * * `uuid` - string, generated UUID by a specified algorithm in the
5821
+ * config file.
5822
+ *
5823
+ * Filter functions must return true if a document passed all the rules.
5783
5824
  */
5784
5825
  filters?: JsonObject;
5785
5826
  /** Search (text) index function definitions. */