@ibm-cloud/cloudant 0.0.21 → 0.0.25

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.21
5
+ # IBM Cloudant Node.js SDK Version 0.0.25
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).
@@ -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
  }
@@ -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)
@@ -125,6 +136,7 @@ var CouchdbSessionAuthenticator = /** @class */ (function (_super) {
125
136
  *
126
137
  * @returns a string that indicates the authenticator's type
127
138
  */
139
+ // eslint-disable-next-line class-methods-use-this
128
140
  CouchdbSessionAuthenticator.prototype.authenticationType = function () {
129
141
  return CouchdbSessionAuthenticator.AUTHTYPE_COUCHDB_SESSION;
130
142
  };
@@ -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;IAM5D;;;;;;;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,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,+CAAS,GAAhB,UAAiB,WAAwB;QACvC,oBAAoB;QACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAE9C,+EAA+E;QAC/E,yCAAyC;QACzC,IAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;QACxC,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE;YACzC,wBAAwB;YACxB,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;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AAC,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,OAA4B;QAC5C,IAAM,MAAM,GACV,iFAAiF,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACO,0CAAY,GAAtB;QACE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;SAC3B;QACD,8BAA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AAW;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,7 +16,7 @@
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
22
  *
@@ -384,7 +384,8 @@ declare class CloudantV1 extends CloudantBaseService {
384
384
  * @param {boolean} [params.partitioned] - Query parameter to specify whether to enable database partitions when
385
385
  * creating a database.
386
386
  * @param {number} [params.q] - The number of shards in the database. Each shard is a partition of the hash value
387
- * range. Default is 8, unless overridden in the `cluster config`.
387
+ * range. Its value is set by the service. For more information about modifying database configuration, contact IBM
388
+ * Cloudant support.
388
389
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
389
390
  * @returns {Promise<CloudantV1.Response<CloudantV1.Ok>>}
390
391
  */
@@ -1402,8 +1403,14 @@ declare class CloudantV1 extends CloudantBaseService {
1402
1403
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
1403
1404
  * results when queried.
1404
1405
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
1405
- * @param {JsonObject[]} [params.sort] - JSON array of sort syntax elements to determine the sort order of the
1406
- * results.
1406
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
1407
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
1408
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
1409
+ * fields.
1410
+ *
1411
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
1412
+ *
1413
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
1407
1414
  * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
1408
1415
  * shards.
1409
1416
  * @param {string} [params.update] - Whether to update the index prior to returning the result.
@@ -1456,8 +1463,14 @@ declare class CloudantV1 extends CloudantBaseService {
1456
1463
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
1457
1464
  * results when queried.
1458
1465
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
1459
- * @param {JsonObject[]} [params.sort] - JSON array of sort syntax elements to determine the sort order of the
1460
- * results.
1466
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
1467
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
1468
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
1469
+ * fields.
1470
+ *
1471
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
1472
+ *
1473
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
1461
1474
  * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
1462
1475
  * shards.
1463
1476
  * @param {string} [params.update] - Whether to update the index prior to returning the result.
@@ -1512,8 +1525,14 @@ declare class CloudantV1 extends CloudantBaseService {
1512
1525
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
1513
1526
  * results when queried.
1514
1527
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
1515
- * @param {JsonObject[]} [params.sort] - JSON array of sort syntax elements to determine the sort order of the
1516
- * results.
1528
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
1529
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
1530
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
1531
+ * fields.
1532
+ *
1533
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
1534
+ *
1535
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
1517
1536
  * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
1518
1537
  * shards.
1519
1538
  * @param {string} [params.update] - Whether to update the index prior to returning the result.
@@ -1569,8 +1588,14 @@ declare class CloudantV1 extends CloudantBaseService {
1569
1588
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
1570
1589
  * results when queried.
1571
1590
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
1572
- * @param {JsonObject[]} [params.sort] - JSON array of sort syntax elements to determine the sort order of the
1573
- * results.
1591
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
1592
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
1593
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
1594
+ * fields.
1595
+ *
1596
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
1597
+ *
1598
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
1574
1599
  * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
1575
1600
  * shards.
1576
1601
  * @param {string} [params.update] - Whether to update the index prior to returning the result.
@@ -1626,8 +1651,14 @@ declare class CloudantV1 extends CloudantBaseService {
1626
1651
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
1627
1652
  * results when queried.
1628
1653
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
1629
- * @param {JsonObject[]} [params.sort] - JSON array of sort syntax elements to determine the sort order of the
1630
- * results.
1654
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
1655
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
1656
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
1657
+ * fields.
1658
+ *
1659
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
1660
+ *
1661
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
1631
1662
  * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
1632
1663
  * shards.
1633
1664
  * @param {string} [params.update] - Whether to update the index prior to returning the result.
@@ -2174,6 +2205,12 @@ declare class CloudantV1 extends CloudantBaseService {
2174
2205
  * and CouchDB related permissions. Be careful: by removing a Cloudant API key, a member or an admin from the list of
2175
2206
  * users that have access permissions, you remove it from the list of users that have access to the database.
2176
2207
  *
2208
+ * ### Note about nobody role
2209
+ *
2210
+ * The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to
2211
+ * read data from a database, but did not identify itself, the task can continue only if the `nobody` user has the
2212
+ * role `_reader`.
2213
+ *
2177
2214
  * @param {Object} params - The parameters to send to the service.
2178
2215
  * @param {string} params.db - Path parameter to specify the database name.
2179
2216
  * @param {SecurityObject} [params.admins] - Schema for names and roles to map to a database permission.
@@ -2202,6 +2239,12 @@ declare class CloudantV1 extends CloudantBaseService {
2202
2239
  * Modify only Cloudant related permissions to database. Be careful: by removing an API key from the list, you remove
2203
2240
  * the API key from the list of users that have access to the database.
2204
2241
  *
2242
+ * ### Note about nobody role
2243
+ *
2244
+ * The `nobody` username applies to all unauthenticated connection attempts. For example, if an application tries to
2245
+ * read data from a database, but did not identify itself, the task can continue only if the `nobody` user has the
2246
+ * role `_reader`.
2247
+ *
2205
2248
  * @param {Object} params - The parameters to send to the service.
2206
2249
  * @param {string} params.db - Path parameter to specify the database name.
2207
2250
  * @param {JsonObject} params.cloudant - Database permissions for Cloudant users and/or API keys.
@@ -2417,7 +2460,7 @@ declare class CloudantV1 extends CloudantBaseService {
2417
2460
  *
2418
2461
  * @param {Object} params - The parameters to send to the service.
2419
2462
  * @param {string} params.db - Path parameter to specify the database name.
2420
- * @param {JsonObject} params.documentRevisions - HTTP request body for postMissingRevs and postRevsDiff.
2463
+ * @param {JsonObject} params.documentRevisions - HTTP request body for operations with Document revisions.
2421
2464
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2422
2465
  * @returns {Promise<CloudantV1.Response<CloudantV1.JsonObject>>}
2423
2466
  */
@@ -2873,8 +2916,8 @@ declare namespace CloudantV1 {
2873
2916
  db: string;
2874
2917
  /** Query parameter to specify whether to enable database partitions when creating a database. */
2875
2918
  partitioned?: boolean;
2876
- /** The number of shards in the database. Each shard is a partition of the hash value range. Default is 8,
2877
- * unless overridden in the `cluster config`.
2919
+ /** The number of shards in the database. Each shard is a partition of the hash value range. Its value is set by
2920
+ * the service. For more information about modifying database configuration, contact IBM Cloudant support.
2878
2921
  */
2879
2922
  q?: number;
2880
2923
  headers?: OutgoingHttpHeaders;
@@ -4100,7 +4143,14 @@ declare namespace CloudantV1 {
4100
4143
  limit?: number;
4101
4144
  /** Skip the first 'n' results, where 'n' is the value that is specified. */
4102
4145
  skip?: number;
4103
- /** JSON array of sort syntax elements to determine the sort order of the results. */
4146
+ /** The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The
4147
+ * first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next
4148
+ * level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
4149
+ *
4150
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
4151
+ *
4152
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
4153
+ */
4104
4154
  sort?: JsonObject[];
4105
4155
  /** Whether or not the view results should be returned from a "stable" set of shards. */
4106
4156
  stable?: boolean;
@@ -4176,7 +4226,14 @@ declare namespace CloudantV1 {
4176
4226
  limit?: number;
4177
4227
  /** Skip the first 'n' results, where 'n' is the value that is specified. */
4178
4228
  skip?: number;
4179
- /** JSON array of sort syntax elements to determine the sort order of the results. */
4229
+ /** The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The
4230
+ * first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next
4231
+ * level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
4232
+ *
4233
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
4234
+ *
4235
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
4236
+ */
4180
4237
  sort?: JsonObject[];
4181
4238
  /** Whether or not the view results should be returned from a "stable" set of shards. */
4182
4239
  stable?: boolean;
@@ -4250,7 +4307,14 @@ declare namespace CloudantV1 {
4250
4307
  limit?: number;
4251
4308
  /** Skip the first 'n' results, where 'n' is the value that is specified. */
4252
4309
  skip?: number;
4253
- /** JSON array of sort syntax elements to determine the sort order of the results. */
4310
+ /** The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The
4311
+ * first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next
4312
+ * level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
4313
+ *
4314
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
4315
+ *
4316
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
4317
+ */
4254
4318
  sort?: JsonObject[];
4255
4319
  /** Whether or not the view results should be returned from a "stable" set of shards. */
4256
4320
  stable?: boolean;
@@ -4330,7 +4394,14 @@ declare namespace CloudantV1 {
4330
4394
  limit?: number;
4331
4395
  /** Skip the first 'n' results, where 'n' is the value that is specified. */
4332
4396
  skip?: number;
4333
- /** JSON array of sort syntax elements to determine the sort order of the results. */
4397
+ /** The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The
4398
+ * first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next
4399
+ * level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
4400
+ *
4401
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
4402
+ *
4403
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
4404
+ */
4334
4405
  sort?: JsonObject[];
4335
4406
  /** Whether or not the view results should be returned from a "stable" set of shards. */
4336
4407
  stable?: boolean;
@@ -4410,7 +4481,14 @@ declare namespace CloudantV1 {
4410
4481
  limit?: number;
4411
4482
  /** Skip the first 'n' results, where 'n' is the value that is specified. */
4412
4483
  skip?: number;
4413
- /** JSON array of sort syntax elements to determine the sort order of the results. */
4484
+ /** The sort field contains a list of pairs, each mapping a field name to a sort direction (asc or desc). The
4485
+ * first field name and direction pair is the topmost level of sort. The second pair, if provided, is the next
4486
+ * level of sort. The field can be any field, using dotted notation if desired for sub-document fields.
4487
+ *
4488
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
4489
+ *
4490
+ * When sorting with multiple fields they must use the same sort direction, either all ascending or all descending.
4491
+ */
4414
4492
  sort?: JsonObject[];
4415
4493
  /** Whether or not the view results should be returned from a "stable" set of shards. */
4416
4494
  stable?: boolean;
@@ -5359,7 +5437,7 @@ declare namespace CloudantV1 {
5359
5437
  interface PostRevsDiffParams {
5360
5438
  /** Path parameter to specify the database name. */
5361
5439
  db: string;
5362
- /** HTTP request body for postMissingRevs and postRevsDiff. */
5440
+ /** HTTP request body for operations with Document revisions. */
5363
5441
  documentRevisions: JsonObject;
5364
5442
  headers?: OutgoingHttpHeaders;
5365
5443
  }
@@ -5782,6 +5860,45 @@ declare namespace CloudantV1 {
5782
5860
  autoupdate?: boolean;
5783
5861
  /** Schema for filter functions definition. This schema is a map where keys are the names of the filter
5784
5862
  * functions and values are the function definition in string format.
5863
+ *
5864
+ * Filter function formats, or filters the changes feed that pass filter rules. The function takes 2 parameters:
5865
+ *
5866
+ * * `doc`: The document that is being processed.
5867
+ * * `req`: A Request JavaScript object with these properties:
5868
+ *
5869
+ * * `body` - string, Request body data as string.
5870
+ * If the request method is GET this field contains the value
5871
+ * `"undefined"`.
5872
+ * If the method is DELETE or HEAD the value is `""` (empty string).
5873
+ * * `cookie` - Cookies object.
5874
+ * * `form` - Form Data object, contains the decoded body as key-value
5875
+ * pairs if the Content-Type header was
5876
+ * application/x-www-form-urlencoded.
5877
+ * * `headers` - Request Headers object.
5878
+ * * `id` - string, requested document id if it was specified
5879
+ * or null otherwise.
5880
+ * * `info` - Database Information object,
5881
+ * see `DatabaseInformation`.
5882
+ * * `method` - string or an array of chars, request method.
5883
+ * String value is a method as one of: HEAD, GET, POST, PUT,
5884
+ * DELETE, OPTIONS, TRACE, COPY. For not supported methods
5885
+ * it will be represented as an array of char codes e.g. for VIEW
5886
+ * it will be 86,73,69,87.
5887
+ * * `path` - array of strings, requested path sections.
5888
+ * * `peer` - string, request source IP address.
5889
+ * * `query` - string, URL query parameters object. Note that multiple
5890
+ * keys are not supported and the last key value suppresses others.
5891
+ * * `requested_path` - array of strings,
5892
+ * actual requested path section.
5893
+ * * `raw_path` - string, raw requested path.
5894
+ * * `userCtx`: User Context Object, containing information about the
5895
+ * user writing the document (if present), see the `UserContext`.
5896
+ * * `secObj`: Security Object, with lists of database security roles,
5897
+ * see the `SecurityObject`.
5898
+ * * `uuid` - string, generated UUID by a specified algorithm in the
5899
+ * config file.
5900
+ *
5901
+ * Filter functions must return true if a document passed all the rules.
5785
5902
  */
5786
5903
  filters?: JsonObject;
5787
5904
  /** Search (text) index function definitions. */
@@ -6083,7 +6200,13 @@ declare namespace CloudantV1 {
6083
6200
  * fields within a document for use with the `$text` operator.
6084
6201
  */
6085
6202
  default_field?: IndexTextOperatorDefaultField;
6086
- /** List of fields to index. */
6203
+ /** List of field objects to index. Nested fields are also allowed, e.g. `person.name`.
6204
+ *
6205
+ * For "json" type indexes each object is a mapping of field name to sort direction (asc or desc).
6206
+ *
6207
+ * For "text" type indexes each object has a `name` property of the field name and a `type` property of the field
6208
+ * type (string, number, or boolean).
6209
+ */
6087
6210
  fields?: IndexField[];
6088
6211
  /** Whether to scan every document for arrays and store the length for each array found. Set the
6089
6212
  * index_array_lengths field to false if: