@ibm-cloud/cloudant 0.7.1 → 0.7.2

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.7.1
5
+ # IBM Cloudant Node.js SDK Version 0.7.2
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).
@@ -115,7 +115,7 @@ project:
115
115
  service instance or a
116
116
  [CouchDB](https://docs.couchdb.org/en/latest/install/index.html)
117
117
  server.
118
- - Node.js 18.
118
+ - Node.js 18 or 20.
119
119
 
120
120
 
121
121
  ## Installation
@@ -935,7 +935,7 @@ You have deleted the document.
935
935
 
936
936
  #### Further code examples
937
937
 
938
- For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/examples#examples-for-node).
938
+ For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/examples#examples-for-node).
939
939
 
940
940
  ### Error handling
941
941
 
@@ -1033,7 +1033,7 @@ The changes follower requires the client to have HTTP timeouts of at least 1 min
1033
1033
  instantiation if it is insufficient. The default client configuration has sufficiently long timeouts.
1034
1034
 
1035
1035
  For use-cases where these configuration limitations are deemed too restrictive then it is recommended to
1036
- write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/examples#postchanges) instead of the follower.
1036
+ write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/examples#postchanges) instead of the follower.
1037
1037
 
1038
1038
  #### Error suppression
1039
1039
 
@@ -1068,7 +1068,7 @@ The follower is not optimized for some use cases and it is not recommended to us
1068
1068
  * The volume of changes is very high (if the rate of changes in the database exceeds the follower's rate of pulling them it will never catch-up).
1069
1069
 
1070
1070
  In these cases use-case specific control over the number of change requests made and the content size of the responses
1071
- may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/examples#postchanges).
1071
+ may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/examples#postchanges).
1072
1072
 
1073
1073
  #### Checkpointing
1074
1074
 
@@ -1237,7 +1237,7 @@ const changesItemsStream = changesFollower.startOneOff();
1237
1237
  import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
1238
1238
  import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
1239
1239
  import { Writable } from 'node:stream';
1240
- import { pipeline } from 'node:stream/promises'
1240
+ import { pipeline } from 'node:stream/promises';
1241
1241
  ```
1242
1242
  [embedmd]:# (test/examples/src/features/ts/startAndProcess.ts /const client/ $)
1243
1243
  ```ts
@@ -1245,7 +1245,7 @@ const client = CloudantV1.newInstance({});
1245
1245
  // Start from a previously persisted seq
1246
1246
  // Normally this would be read by the app from persistent storage
1247
1247
  // e.g. previouslyPersistedSeq = yourAppPersistenceReadFunc()
1248
- const previouslyPersistedSeq = '3-g1AG3...'
1248
+ const previouslyPersistedSeq = '3-g1AG3...';
1249
1249
  const changesParams: PostChangesParams = {
1250
1250
  db: 'example',
1251
1251
  since: previouslyPersistedSeq
@@ -1259,10 +1259,10 @@ const destinationStream = new Writable({
1259
1259
  // do something with change item
1260
1260
  console.log(changesItem.id);
1261
1261
  for (const change of changesItem.changes) {
1262
- console.log(change.rev)
1262
+ console.log(change.rev);
1263
1263
  }
1264
1264
  // when change item processing is complete app can store seq
1265
- const seq = changesItem.seq
1265
+ const seq = changesItem.seq;
1266
1266
  // write seq to persistent storage for use as since if required to resume later
1267
1267
  // e.g. yourAppPersistenceWriteFunc()
1268
1268
  callback();
@@ -1294,7 +1294,7 @@ const client = CloudantV1.newInstance();
1294
1294
  // Start from a previously persisted seq
1295
1295
  // Normally this would be read by the app from persistent storage
1296
1296
  // e.g. previouslyPersistedSeq = yourAppPersistenceReadFunc()
1297
- const previouslyPersistedSeq = '3-g1AG3...'
1297
+ const previouslyPersistedSeq = '3-g1AG3...';
1298
1298
  const changesParams = {
1299
1299
  db: 'example',
1300
1300
  since: previouslyPersistedSeq
@@ -1308,10 +1308,10 @@ const destinationStream = new Writable({
1308
1308
  // do something with change item
1309
1309
  console.log(changesItem.id);
1310
1310
  for (const change of changesItem.changes) {
1311
- console.log(change.rev)
1311
+ console.log(change.rev);
1312
1312
  }
1313
1313
  // when change item processing is complete app can store seq
1314
- const seq = changesItem.seq
1314
+ const seq = changesItem.seq;
1315
1315
  // write seq to persistent storage for use as since if required to resume later
1316
1316
  // e.g. yourAppPersistenceWriteFunc()
1317
1317
  callback();
@@ -1338,7 +1338,7 @@ pipeline(changesItemsStream, destinationStream)
1338
1338
  import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
1339
1339
  import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
1340
1340
  import { Writable } from 'node:stream';
1341
- import { pipeline } from 'node:stream/promises'
1341
+ import { pipeline } from 'node:stream/promises';
1342
1342
  ```
1343
1343
  [embedmd]:# (test/examples/src/features/ts/startOneOffAndProcess.ts /const client/ $)
1344
1344
  ```ts
@@ -1346,7 +1346,7 @@ const client = CloudantV1.newInstance({});
1346
1346
  // Start from a previously persisted seq
1347
1347
  // Normally this would be read by the app from persistent storage
1348
1348
  // e.g. previouslyPersistedSeq = yourAppPersistenceReadFunc()
1349
- const previouslyPersistedSeq = '3-g1AG3...'
1349
+ const previouslyPersistedSeq = '3-g1AG3...';
1350
1350
  const changesParams: PostChangesParams = {
1351
1351
  db: 'example',
1352
1352
  since: previouslyPersistedSeq
@@ -1360,10 +1360,10 @@ const destinationStream = new Writable({
1360
1360
  // do something with change item
1361
1361
  console.log(changesItem.id);
1362
1362
  for (const change of changesItem.changes) {
1363
- console.log(change.rev)
1363
+ console.log(change.rev);
1364
1364
  }
1365
1365
  // when change item processing is complete app can store seq
1366
- const seq = changesItem.seq
1366
+ const seq = changesItem.seq;
1367
1367
  // write seq to persistent storage for use as since if required to resume later
1368
1368
  // e.g. yourAppPersistenceWriteFunc()
1369
1369
  callback();
@@ -1387,12 +1387,12 @@ async function getChangesFromFollower(changesItemsStream: Stream<CloudantV1.Chan
1387
1387
  // write seq to persistent storage for use as since
1388
1388
  console.log(changesItem.id);
1389
1389
  for (const change of changesItem.changes) {
1390
- console.log(change.rev)
1390
+ console.log(change.rev);
1391
1391
  }
1392
1392
  // when change item processing is complete app can store seq
1393
- seq = changesItem.seq
1393
+ seq = changesItem.seq;
1394
1394
  // write seq to persistent storage for use as since if required to resume later
1395
- // e.g. yourAppPersistenceWriteFunc()
1395
+ // e.g. yourAppPersistenceWriteFunc();
1396
1396
  }
1397
1397
  }
1398
1398
  */
@@ -1413,7 +1413,7 @@ const client = CloudantV1.newInstance();
1413
1413
  // Start from a previously persisted seq
1414
1414
  // Normally this would be read by the app from persistent storage
1415
1415
  // e.g. previouslyPersistedSeq = yourAppPersistenceReadFunc()
1416
- const previouslyPersistedSeq = '3-g1AG3...'
1416
+ const previouslyPersistedSeq = '3-g1AG3...';
1417
1417
  const changesParams = {
1418
1418
  db: 'example',
1419
1419
  since: previouslyPersistedSeq
@@ -1427,10 +1427,10 @@ const destinationStream = new Writable({
1427
1427
  // do something with change item
1428
1428
  console.log(changesItem.id);
1429
1429
  for (const change of changesItem.changes) {
1430
- console.log(change.rev)
1430
+ console.log(change.rev);
1431
1431
  }
1432
1432
  // when change item processing is complete app can store seq
1433
- const seq = changesItem.seq
1433
+ const seq = changesItem.seq;
1434
1434
  // write seq to persistent storage for use as since if required to resume later
1435
1435
  // e.g. yourAppPersistenceWriteFunc()
1436
1436
  callback();
@@ -1454,12 +1454,12 @@ async function getChangesFromFollower(changesItemsStream) {
1454
1454
  // write seq to persistent storage for use as since
1455
1455
  console.log(changesItem.id);
1456
1456
  for (const change of changesItem.changes) {
1457
- console.log(change.rev)
1457
+ console.log(change.rev);
1458
1458
  }
1459
1459
  // when change item processing is complete app can store seq
1460
- seq = changesItem.seq
1460
+ seq = changesItem.seq;
1461
1461
  // write seq to persistent storage for use as since if required to resume later
1462
- // e.g. yourAppPersistenceWriteFunc()
1462
+ // e.g. yourAppPersistenceWriteFunc();
1463
1463
  }
1464
1464
  }
1465
1465
  */
@@ -1475,7 +1475,7 @@ async function getChangesFromFollower(changesItemsStream) {
1475
1475
  import { ChangesFollower, CloudantV1, Stream } from '@ibm-cloud/cloudant';
1476
1476
  import { ChangesResultItem, PostChangesParams } from '@ibm-cloud/cloudant/cloudant/v1';
1477
1477
  import { Writable } from 'node:stream';
1478
- import { pipeline } from 'node:stream/promises'
1478
+ import { pipeline } from 'node:stream/promises';
1479
1479
  ```
1480
1480
  [embedmd]:# (test/examples/src/features/ts/stop.ts /const client/ $)
1481
1481
  ```ts
@@ -1579,7 +1579,7 @@ If you encounter an issue with the project, you are welcome to submit a
1579
1579
 
1580
1580
  Before you submit a bug report, search for
1581
1581
  [similar issues](https://github.com/IBM/cloudant-node-sdk/issues?q=is%3Aissue) and review the
1582
- [KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.
1582
+ [KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.
1583
1583
 
1584
1584
  Please consult the [security policy](https://github.com/IBM/cloudant-node-sdk/security/policy) before opening security related issues.
1585
1585
 
@@ -1609,8 +1609,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page.
1609
1609
 
1610
1610
  ## Contributing
1611
1611
 
1612
- For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/CONTRIBUTING.md).
1612
+ For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/CONTRIBUTING.md).
1613
1613
 
1614
1614
  ## License
1615
1615
 
1616
- This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.1/LICENSE).
1616
+ This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-node-sdk/tree/v0.7.2/LICENSE).
package/cloudant/v1.d.ts CHANGED
@@ -440,8 +440,9 @@ declare class CloudantV1 extends CloudantBaseService {
440
440
  * @param {boolean} [params.partitioned] - Query parameter to specify whether to enable database partitions when
441
441
  * creating a database.
442
442
  * @param {number} [params.q] - The number of shards in the database. Each shard is a partition of the hash value
443
- * range. Its value is set by the service. For more information about modifying database configuration, contact IBM
444
- * Cloudant support.
443
+ * range. Cloudant recommends using the default value for most databases. However, if your database is expected to be
444
+ * larger than 250 GB or have a lot of indexes, you may need to adjust the settings. In these cases, it's best to
445
+ * reach out to IBM Cloudant customer support for guidance on how to meet your specific needs and requirements.
445
446
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
446
447
  * @returns {Promise<CloudantV1.Response<CloudantV1.Ok>>}
447
448
  */
@@ -3036,8 +3037,10 @@ declare namespace CloudantV1 {
3036
3037
  db: string;
3037
3038
  /** Query parameter to specify whether to enable database partitions when creating a database. */
3038
3039
  partitioned?: boolean;
3039
- /** The number of shards in the database. Each shard is a partition of the hash value range. Its value is set by
3040
- * the service. For more information about modifying database configuration, contact IBM Cloudant support.
3040
+ /** The number of shards in the database. Each shard is a partition of the hash value range. Cloudant recommends
3041
+ * using the default value for most databases. However, if your database is expected to be larger than 250 GB or
3042
+ * have a lot of indexes, you may need to adjust the settings. In these cases, it's best to reach out to IBM
3043
+ * Cloudant customer support for guidance on how to meet your specific needs and requirements.
3041
3044
  */
3042
3045
  q?: number;
3043
3046
  headers?: OutgoingHttpHeaders;
@@ -5620,11 +5623,11 @@ declare namespace CloudantV1 {
5620
5623
  /** The phase the active task is in. `docid_sort`, `docid_copy`, `document_copy` phases are available for
5621
5624
  * `database_compaction`, while `ids` and `view` phases are available for `view_compaction` type tasks.
5622
5625
  */
5623
- phase?: string;
5626
+ phase?: ActiveTask.Constants.Phase | string;
5624
5627
  /** Process ID. */
5625
5628
  pid: string;
5626
5629
  /** Process status. */
5627
- process_status?: string;
5630
+ process_status?: ActiveTask.Constants.ProcessStatus | string;
5628
5631
  /** Current percentage progress. Available for `database_compaction`, `indexer`, `search_indexer`,
5629
5632
  * `view_compaction` type tasks.
5630
5633
  */
@@ -5656,7 +5659,7 @@ declare namespace CloudantV1 {
5656
5659
  */
5657
5660
  total_changes?: number;
5658
5661
  /** Operation type. */
5659
- type: string;
5662
+ type: ActiveTask.Constants.Type | string;
5660
5663
  /** Schema for a Unix epoch timestamp. */
5661
5664
  updated_on: number;
5662
5665
  /** Name of user running replication or owning the indexer. Available for `indexer`, `replication` type tasks. */
@@ -5664,12 +5667,50 @@ declare namespace CloudantV1 {
5664
5667
  /** Number of view indexes. Available for `view_compaction` type tasks. */
5665
5668
  view?: number;
5666
5669
  }
5670
+ namespace ActiveTask {
5671
+ namespace Constants {
5672
+ /** The phase the active task is in. `docid_sort`, `docid_copy`, `document_copy` phases are available for `database_compaction`, while `ids` and `view` phases are available for `view_compaction` type tasks. */
5673
+ enum Phase {
5674
+ DOCID_SORT = "docid_sort",
5675
+ DOCID_COPY = "docid_copy",
5676
+ DOCUMENT_COPY = "document_copy",
5677
+ IDS = "ids",
5678
+ VIEW = "view"
5679
+ }
5680
+ /** Process status. */
5681
+ enum ProcessStatus {
5682
+ EXITING = "exiting",
5683
+ GARBAGE_COLLECTING = "garbage_collecting",
5684
+ RUNNABLE = "runnable",
5685
+ RUNNING = "running",
5686
+ SUSPENDED = "suspended",
5687
+ WAITING = "waiting"
5688
+ }
5689
+ /** Operation type. */
5690
+ enum Type {
5691
+ DATABASE_COMPACTION = "database_compaction",
5692
+ INDEXER = "indexer",
5693
+ REPLICATION = "replication",
5694
+ SEARCH_INDEXER = "search_indexer",
5695
+ VIEW_COMPACTION = "view_compaction"
5696
+ }
5697
+ }
5698
+ }
5667
5699
  /** Schema for Activity Tracker events. */
5668
5700
  interface ActivityTrackerEvents {
5669
5701
  /** An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
5670
5702
  * "management" is a required element of this array.
5671
5703
  */
5672
- types: string[];
5704
+ types: ActivityTrackerEvents.Constants.Types | string[];
5705
+ }
5706
+ namespace ActivityTrackerEvents {
5707
+ namespace Constants {
5708
+ /** An array of event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance. "management" is a required element of this array. */
5709
+ enum Types {
5710
+ MANAGEMENT = "management",
5711
+ DATA = "data"
5712
+ }
5713
+ }
5673
5714
  }
5674
5715
  /** Schema for the result of an all documents queries operation. */
5675
5716
  interface AllDocsQueriesResult {
@@ -5729,10 +5770,58 @@ declare namespace CloudantV1 {
5729
5770
  * * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query
5730
5771
  * text index default_field the default is `standard`.
5731
5772
  */
5732
- name?: string;
5773
+ name?: Analyzer.Constants.Name | string;
5733
5774
  /** Custom stopwords to use with the named analyzer. */
5734
5775
  stopwords?: string[];
5735
5776
  }
5777
+ namespace Analyzer {
5778
+ namespace Constants {
5779
+ /** Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text index default_field the default is `standard`. */
5780
+ enum Name {
5781
+ CLASSIC = "classic",
5782
+ EMAIL = "email",
5783
+ KEYWORD = "keyword",
5784
+ SIMPLE = "simple",
5785
+ STANDARD = "standard",
5786
+ WHITESPACE = "whitespace",
5787
+ ARABIC = "arabic",
5788
+ ARMENIAN = "armenian",
5789
+ BASQUE = "basque",
5790
+ BULGARIAN = "bulgarian",
5791
+ BRAZILIAN = "brazilian",
5792
+ CATALAN = "catalan",
5793
+ CJK = "cjk",
5794
+ CHINESE = "chinese",
5795
+ CZECH = "czech",
5796
+ DANISH = "danish",
5797
+ DUTCH = "dutch",
5798
+ ENGLISH = "english",
5799
+ FINNISH = "finnish",
5800
+ FRENCH = "french",
5801
+ GERMAN = "german",
5802
+ GREEK = "greek",
5803
+ GALICIAN = "galician",
5804
+ HINDI = "hindi",
5805
+ HUNGARIAN = "hungarian",
5806
+ INDONESIAN = "indonesian",
5807
+ IRISH = "irish",
5808
+ ITALIAN = "italian",
5809
+ JAPANESE = "japanese",
5810
+ LATVIAN = "latvian",
5811
+ NORWEGIAN = "norwegian",
5812
+ PERSIAN = "persian",
5813
+ POLISH = "polish",
5814
+ PORTUGUESE = "portuguese",
5815
+ ROMANIAN = "romanian",
5816
+ RUSSIAN = "russian",
5817
+ SPANISH = "spanish",
5818
+ SWEDISH = "swedish",
5819
+ THAI = "thai",
5820
+ TURKISH = "turkish",
5821
+ PERFIELD = "perfield"
5822
+ }
5823
+ }
5824
+ }
5736
5825
  /** Schema for a search analyzer configuration. */
5737
5826
  interface AnalyzerConfiguration {
5738
5827
  /** Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies
@@ -5740,12 +5829,60 @@ declare namespace CloudantV1 {
5740
5829
  * * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query
5741
5830
  * text index default_field the default is `standard`.
5742
5831
  */
5743
- name?: string;
5832
+ name?: AnalyzerConfiguration.Constants.Name | string;
5744
5833
  /** Custom stopwords to use with the named analyzer. */
5745
5834
  stopwords?: string[];
5746
5835
  /** Schema for mapping a field name to a per field analyzer. */
5747
5836
  fields?: JsonObject;
5748
5837
  }
5838
+ namespace AnalyzerConfiguration {
5839
+ namespace Constants {
5840
+ /** Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: * For search indexes the default is `standard` * For query text indexes the default is `keyword` * For a query text index default_field the default is `standard`. */
5841
+ enum Name {
5842
+ CLASSIC = "classic",
5843
+ EMAIL = "email",
5844
+ KEYWORD = "keyword",
5845
+ SIMPLE = "simple",
5846
+ STANDARD = "standard",
5847
+ WHITESPACE = "whitespace",
5848
+ ARABIC = "arabic",
5849
+ ARMENIAN = "armenian",
5850
+ BASQUE = "basque",
5851
+ BULGARIAN = "bulgarian",
5852
+ BRAZILIAN = "brazilian",
5853
+ CATALAN = "catalan",
5854
+ CJK = "cjk",
5855
+ CHINESE = "chinese",
5856
+ CZECH = "czech",
5857
+ DANISH = "danish",
5858
+ DUTCH = "dutch",
5859
+ ENGLISH = "english",
5860
+ FINNISH = "finnish",
5861
+ FRENCH = "french",
5862
+ GERMAN = "german",
5863
+ GREEK = "greek",
5864
+ GALICIAN = "galician",
5865
+ HINDI = "hindi",
5866
+ HUNGARIAN = "hungarian",
5867
+ INDONESIAN = "indonesian",
5868
+ IRISH = "irish",
5869
+ ITALIAN = "italian",
5870
+ JAPANESE = "japanese",
5871
+ LATVIAN = "latvian",
5872
+ NORWEGIAN = "norwegian",
5873
+ PERSIAN = "persian",
5874
+ POLISH = "polish",
5875
+ PORTUGUESE = "portuguese",
5876
+ ROMANIAN = "romanian",
5877
+ RUSSIAN = "russian",
5878
+ SPANISH = "spanish",
5879
+ SWEDISH = "swedish",
5880
+ THAI = "thai",
5881
+ TURKISH = "turkish",
5882
+ PERFIELD = "perfield"
5883
+ }
5884
+ }
5885
+ }
5749
5886
  /** Schema for api keys. */
5750
5887
  interface ApiKeysResult {
5751
5888
  /** ok. */
@@ -5942,7 +6079,9 @@ declare namespace CloudantV1 {
5942
6079
  }
5943
6080
  /** Schema for database cluster information. */
5944
6081
  interface DatabaseInformationCluster {
5945
- /** Schema for the number of replicas of a database in a cluster. */
6082
+ /** Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it
6083
+ * cannot be changed by the user.
6084
+ */
5946
6085
  n: number;
5947
6086
  /** Schema for the number of shards in a database. Each shard is a partition of the hash value range. */
5948
6087
  q: number;
@@ -5963,7 +6102,17 @@ declare namespace CloudantV1 {
5963
6102
  /** Sequence number. */
5964
6103
  seq: string;
5965
6104
  /** A database event. */
5966
- type: string;
6105
+ type: DbEvent.Constants.Type | string;
6106
+ }
6107
+ namespace DbEvent {
6108
+ namespace Constants {
6109
+ /** A database event. */
6110
+ enum Type {
6111
+ CREATED = "created",
6112
+ DELETED = "deleted",
6113
+ UPDATED = "updated"
6114
+ }
6115
+ }
5967
6116
  }
5968
6117
  /** Schema for database updates. */
5969
6118
  interface DbUpdates {
@@ -6195,7 +6344,17 @@ declare namespace CloudantV1 {
6195
6344
  /** Status of the revision. May be one of: - `available`: Revision is available for retrieving with rev query
6196
6345
  * parameter - `missing`: Revision is not available - `deleted`: Revision belongs to deleted document.
6197
6346
  */
6198
- status: string;
6347
+ status: DocumentRevisionStatus.Constants.Status | string;
6348
+ }
6349
+ namespace DocumentRevisionStatus {
6350
+ namespace Constants {
6351
+ /** Status of the revision. May be one of: - `available`: Revision is available for retrieving with rev query parameter - `missing`: Revision is not available - `deleted`: Revision belongs to deleted document. */
6352
+ enum Status {
6353
+ AVAILABLE = "available",
6354
+ MISSING = "missing",
6355
+ DELETED = "deleted"
6356
+ }
6357
+ }
6199
6358
  }
6200
6359
  /** Schema for document shard information. */
6201
6360
  interface DocumentShardInfo {
@@ -6296,7 +6455,16 @@ declare namespace CloudantV1 {
6296
6455
  /** Schema for any JSON type. */
6297
6456
  update?: any;
6298
6457
  /** The type of the underlying view. */
6299
- view_type?: string;
6458
+ view_type?: ExplainResultMrArgs.Constants.ViewType | string;
6459
+ }
6460
+ namespace ExplainResultMrArgs {
6461
+ namespace Constants {
6462
+ /** The type of the underlying view. */
6463
+ enum ViewType {
6464
+ MAP = "map",
6465
+ REDUCE = "reduce"
6466
+ }
6467
+ }
6300
6468
  }
6301
6469
  /** Options used for the request. */
6302
6470
  interface ExplainResultOpts {
@@ -6400,10 +6568,20 @@ declare namespace CloudantV1 {
6400
6568
  /** Name of the field. */
6401
6569
  name?: string;
6402
6570
  /** The type of the named field. */
6403
- type?: string;
6571
+ type?: IndexField.Constants.Type | string;
6404
6572
  /** IndexField accepts additional properties. */
6405
6573
  [propName: string]: any;
6406
6574
  }
6575
+ namespace IndexField {
6576
+ namespace Constants {
6577
+ /** The type of the named field. */
6578
+ enum Type {
6579
+ BOOLEAN = "boolean",
6580
+ NUMBER = "number",
6581
+ STRING = "string"
6582
+ }
6583
+ }
6584
+ }
6407
6585
  /** Schema for information about an index. */
6408
6586
  interface IndexInformation {
6409
6587
  /** Design document ID including a `_design/` prefix. */
@@ -6419,7 +6597,17 @@ declare namespace CloudantV1 {
6419
6597
  /** Indicates if index is partitioned. */
6420
6598
  partitioned?: boolean;
6421
6599
  /** Schema for the type of an index. */
6422
- type: string;
6600
+ type: IndexInformation.Constants.Type | string;
6601
+ }
6602
+ namespace IndexInformation {
6603
+ namespace Constants {
6604
+ /** Schema for the type of an index. */
6605
+ enum Type {
6606
+ JSON = "json",
6607
+ SPECIAL = "special",
6608
+ TEXT = "text"
6609
+ }
6610
+ }
6423
6611
  }
6424
6612
  /** Schema for the result of creating an index. */
6425
6613
  interface IndexResult {
@@ -6428,7 +6616,16 @@ declare namespace CloudantV1 {
6428
6616
  /** Name of the index created. */
6429
6617
  name: string;
6430
6618
  /** Flag to show whether the index was created or one already exists. */
6431
- result: string;
6619
+ result: IndexResult.Constants.Result | string;
6620
+ }
6621
+ namespace IndexResult {
6622
+ namespace Constants {
6623
+ /** Flag to show whether the index was created or one already exists. */
6624
+ enum Result {
6625
+ CREATED = "created",
6626
+ EXISTS = "exists"
6627
+ }
6628
+ }
6432
6629
  }
6433
6630
  /** Schema for the text index default field configuration. The default field is used to index the text of all fields within a document for use with the `$text` operator. */
6434
6631
  interface IndexTextOperatorDefaultField {
@@ -6512,7 +6709,9 @@ declare namespace CloudantV1 {
6512
6709
  }
6513
6710
  /** Request parameters to use during target database creation. */
6514
6711
  interface ReplicationCreateTargetParameters {
6515
- /** Schema for the number of replicas of a database in a cluster. */
6712
+ /** Schema for the number of replicas of a database in a cluster. The cluster is using the default value and it
6713
+ * cannot be changed by the user.
6714
+ */
6516
6715
  n?: number;
6517
6716
  /** Parameter to specify whether to enable database partitions when creating the target database. */
6518
6717
  partitioned?: boolean;
@@ -6725,7 +6924,7 @@ declare namespace CloudantV1 {
6725
6924
  /** Timestamp of when the replication was started. */
6726
6925
  start_time: string;
6727
6926
  /** Schema for replication state. */
6728
- state: string;
6927
+ state: SchedulerDocument.Constants.State | string;
6729
6928
  /** Replication target. */
6730
6929
  target?: string;
6731
6930
  /** Deprecated: Forbidden in IBM Cloudant mediated replications.
@@ -6734,6 +6933,20 @@ declare namespace CloudantV1 {
6734
6933
  */
6735
6934
  target_proxy?: string;
6736
6935
  }
6936
+ namespace SchedulerDocument {
6937
+ namespace Constants {
6938
+ /** Schema for replication state. */
6939
+ enum State {
6940
+ INITIALIZING = "initializing",
6941
+ ERROR = "error",
6942
+ PENDING = "pending",
6943
+ RUNNING = "running",
6944
+ CRASHING = "crashing",
6945
+ COMPLETED = "completed",
6946
+ FAILED = "failed"
6947
+ }
6948
+ }
6949
+ }
6737
6950
  /** Schema for scheduler document information. A JSON object that may contain additional information about the state. For error states this will contain an error field and string value. */
6738
6951
  interface SchedulerInfo {
6739
6952
  /** The count of changes not yet replicated. */
@@ -6983,7 +7196,17 @@ declare namespace CloudantV1 {
6983
7196
  /** seeds. */
6984
7197
  seeds: JsonObject;
6985
7198
  /** status. */
6986
- status: string;
7199
+ status: UpInformation.Constants.Status | string;
7200
+ }
7201
+ namespace UpInformation {
7202
+ namespace Constants {
7203
+ /** status. */
7204
+ enum Status {
7205
+ MAINTENANCE_MODE = "maintenance_mode",
7206
+ NOLB = "nolb",
7207
+ OK = "ok"
7208
+ }
7209
+ }
6987
7210
  }
6988
7211
  /** Schema for an ability to tell if view is up-to-date without querying it. */
6989
7212
  interface UpdatesPending {
@@ -7003,7 +7226,22 @@ declare namespace CloudantV1 {
7003
7226
  /** User name. */
7004
7227
  name: string;
7005
7228
  /** List of user roles. */
7006
- roles: string[];
7229
+ roles: UserContext.Constants.Roles | string[];
7230
+ }
7231
+ namespace UserContext {
7232
+ namespace Constants {
7233
+ /** List of user roles. */
7234
+ enum Roles {
7235
+ READER = "_reader",
7236
+ WRITER = "_writer",
7237
+ ADMIN = "_admin",
7238
+ REPLICATOR = "_replicator",
7239
+ DB_UPDATES = "_db_updates",
7240
+ DESIGN = "_design",
7241
+ SHARDS = "_shards",
7242
+ SECURITY = "_security"
7243
+ }
7244
+ }
7007
7245
  }
7008
7246
  /** Schema for a set of uuids generated by the server. */
7009
7247
  interface UuidsResult {
@@ -7085,7 +7323,17 @@ declare namespace CloudantV1 {
7085
7323
  * * `false` - Return results without updating the view.
7086
7324
  * * `lazy` - Return the view results without waiting for an update, but update them immediately after the request.
7087
7325
  */
7088
- update?: string;
7326
+ update?: ViewQuery.Constants.Update | string;
7327
+ }
7328
+ namespace ViewQuery {
7329
+ namespace Constants {
7330
+ /** Parameter to specify whether or not the view in question should be updated prior to responding to the user. * `true` - Return results after the view is updated. * `false` - Return results without updating the view. * `lazy` - Return the view results without waiting for an update, but update them immediately after the request. */
7331
+ enum Update {
7332
+ TRUE = "true",
7333
+ FALSE = "false",
7334
+ LAZY = "lazy"
7335
+ }
7336
+ }
7089
7337
  }
7090
7338
  /** Schema for the result of a query view operation. */
7091
7339
  interface ViewResult {