@ibm-cloud/cloudant 0.0.18 → 0.0.22

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/cloudant/v1.d.ts CHANGED
@@ -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;
@@ -182,17 +184,18 @@ declare class CloudantV1 extends CloudantBaseService {
182
184
  * key order.
183
185
  * @param {string} [params.feed] - Query parameter to specify the changes feed type.
184
186
  * @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
185
- * filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
186
- * - `_design`
187
- * - Returns only changes to design documents.
188
- * - `_doc_ids`
189
- * - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
190
- * - `_selector`
191
- * - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
192
- * as used for `_find`.
193
- * - `_view`
194
- * - Returns changes for documents that match an existing map function in the view specified by the query parameter
195
- * `view`.
187
+ * filter the changes stream emitting only filtered events. For example: `design_doc/filtername`.
188
+ *
189
+ * Additionally, some keywords are reserved for built-in filters:
190
+ *
191
+ * * `_design` - Returns only changes to design documents.
192
+ * * `_doc_ids` - Returns changes for documents with an ID matching one specified in
193
+ * `doc_ids` request body parameter.
194
+ * * `_selector` - Returns changes for documents that match the `selector`
195
+ * request body parameter. The selector syntax is the same as used for
196
+ * `_find`.
197
+ * * `_view` - Returns changes for documents that match an existing map
198
+ * function in the view specified by the query parameter `view`.
196
199
  * @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
197
200
  * line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
198
201
  * to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
@@ -266,17 +269,18 @@ declare class CloudantV1 extends CloudantBaseService {
266
269
  * key order.
267
270
  * @param {string} [params.feed] - Query parameter to specify the changes feed type.
268
271
  * @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
269
- * filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
270
- * - `_design`
271
- * - Returns only changes to design documents.
272
- * - `_doc_ids`
273
- * - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
274
- * - `_selector`
275
- * - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
276
- * as used for `_find`.
277
- * - `_view`
278
- * - Returns changes for documents that match an existing map function in the view specified by the query parameter
279
- * `view`.
272
+ * filter the changes stream emitting only filtered events. For example: `design_doc/filtername`.
273
+ *
274
+ * Additionally, some keywords are reserved for built-in filters:
275
+ *
276
+ * * `_design` - Returns only changes to design documents.
277
+ * * `_doc_ids` - Returns changes for documents with an ID matching one specified in
278
+ * `doc_ids` request body parameter.
279
+ * * `_selector` - Returns changes for documents that match the `selector`
280
+ * request body parameter. The selector syntax is the same as used for
281
+ * `_find`.
282
+ * * `_view` - Returns changes for documents that match an existing map
283
+ * function in the view specified by the query parameter `view`.
280
284
  * @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
281
285
  * line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
282
286
  * to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
@@ -301,9 +305,9 @@ declare class CloudantV1 extends CloudantBaseService {
301
305
  * @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
302
306
  * if the view's map function emits at least one record for them.
303
307
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
304
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
308
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
305
309
  */
306
- postChangesAsStream(params: CloudantV1.PostChangesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
310
+ postChangesAsStream(params: CloudantV1.PostChangesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
307
311
  /*************************
308
312
  * databases
309
313
  ************************/
@@ -420,7 +424,7 @@ declare class CloudantV1 extends CloudantBaseService {
420
424
  *
421
425
  * @param {Object} params - The parameters to send to the service.
422
426
  * @param {string} params.db - Path parameter to specify the database name.
423
- * @param {Document|NodeJS.ReadableStream|Buffer} params.document - HTTP request body for Document operations.
427
+ * @param {Document | NodeJS.ReadableStream | Buffer} params.document - HTTP request body for Document operations.
424
428
  * @param {string} [params.contentType] - The type of the input.
425
429
  * @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
426
430
  * with a HTTP 202 Accepted response code immediately.
@@ -491,9 +495,9 @@ declare class CloudantV1 extends CloudantBaseService {
491
495
  * @param {string[]} [params.keys] - Schema for a list of document IDs.
492
496
  * @param {string} [params.startkey] - Schema for a document ID.
493
497
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
494
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
498
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
495
499
  */
496
- postAllDocsAsStream(params: CloudantV1.PostAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
500
+ postAllDocsAsStream(params: CloudantV1.PostAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
497
501
  /**
498
502
  * Multi-query the list of all documents in a database.
499
503
  *
@@ -523,9 +527,9 @@ declare class CloudantV1 extends CloudantBaseService {
523
527
  * individual view query to be executed. The field names and their meaning are the same as the query parameters of a
524
528
  * regular `/_all_docs` request.
525
529
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
526
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
530
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
527
531
  */
528
- postAllDocsQueriesAsStream(params: CloudantV1.PostAllDocsQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
532
+ postAllDocsQueriesAsStream(params: CloudantV1.PostAllDocsQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
529
533
  /**
530
534
  * Bulk modify multiple documents in a database.
531
535
  *
@@ -535,7 +539,7 @@ declare class CloudantV1 extends CloudantBaseService {
535
539
  *
536
540
  * @param {Object} params - The parameters to send to the service.
537
541
  * @param {string} params.db - Path parameter to specify the database name.
538
- * @param {BulkDocs|NodeJS.ReadableStream|Buffer} params.bulkDocs - HTTP request body for postBulkDocs.
542
+ * @param {BulkDocs | NodeJS.ReadableStream | Buffer} params.bulkDocs - HTTP request body for postBulkDocs.
539
543
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
540
544
  * @returns {Promise<CloudantV1.Response<CloudantV1.DocumentResult[]>>}
541
545
  */
@@ -577,9 +581,9 @@ declare class CloudantV1 extends CloudantBaseService {
577
581
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
578
582
  * revisions.
579
583
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
580
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
584
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
581
585
  */
582
- postBulkGetAsMixed(params: CloudantV1.PostBulkGetAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
586
+ postBulkGetAsMixed(params: CloudantV1.PostBulkGetAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
583
587
  /**
584
588
  * Bulk query revision information for multiple documents as related.
585
589
  *
@@ -597,9 +601,9 @@ declare class CloudantV1 extends CloudantBaseService {
597
601
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
598
602
  * revisions.
599
603
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
600
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
604
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
601
605
  */
602
- postBulkGetAsRelated(params: CloudantV1.PostBulkGetAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
606
+ postBulkGetAsRelated(params: CloudantV1.PostBulkGetAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
603
607
  /**
604
608
  * Bulk query revision information for multiple documents as stream.
605
609
  *
@@ -617,9 +621,9 @@ declare class CloudantV1 extends CloudantBaseService {
617
621
  * @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
618
622
  * revisions.
619
623
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
620
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
624
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
621
625
  */
622
- postBulkGetAsStream(params: CloudantV1.PostBulkGetAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
626
+ postBulkGetAsStream(params: CloudantV1.PostBulkGetAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
623
627
  /**
624
628
  * Delete a document.
625
629
  *
@@ -704,9 +708,9 @@ declare class CloudantV1 extends CloudantBaseService {
704
708
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
705
709
  * known document revisions.
706
710
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
707
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
711
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
708
712
  */
709
- getDocumentAsMixed(params: CloudantV1.GetDocumentAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
713
+ getDocumentAsMixed(params: CloudantV1.GetDocumentAsMixedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
710
714
  /**
711
715
  * Retrieve a document as related.
712
716
  *
@@ -738,9 +742,9 @@ declare class CloudantV1 extends CloudantBaseService {
738
742
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
739
743
  * known document revisions.
740
744
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
741
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
745
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
742
746
  */
743
- getDocumentAsRelated(params: CloudantV1.GetDocumentAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
747
+ getDocumentAsRelated(params: CloudantV1.GetDocumentAsRelatedParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
744
748
  /**
745
749
  * Retrieve a document as stream.
746
750
  *
@@ -772,9 +776,9 @@ declare class CloudantV1 extends CloudantBaseService {
772
776
  * @param {boolean} [params.revsInfo] - Query parameter to specify whether to includes detailed information for all
773
777
  * known document revisions.
774
778
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
775
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
779
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
776
780
  */
777
- getDocumentAsStream(params: CloudantV1.GetDocumentAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
781
+ getDocumentAsStream(params: CloudantV1.GetDocumentAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
778
782
  /**
779
783
  * Create or modify a document.
780
784
  *
@@ -784,7 +788,7 @@ declare class CloudantV1 extends CloudantBaseService {
784
788
  * @param {Object} params - The parameters to send to the service.
785
789
  * @param {string} params.db - Path parameter to specify the database name.
786
790
  * @param {string} params.docId - Path parameter to specify the document ID.
787
- * @param {Document|NodeJS.ReadableStream|Buffer} params.document - HTTP request body for Document operations.
791
+ * @param {Document | NodeJS.ReadableStream | Buffer} params.document - HTTP request body for Document operations.
788
792
  * @param {string} [params.contentType] - The type of the input.
789
793
  * @param {string} [params.ifMatch] - Header parameter to specify the document revision. Alternative to rev query
790
794
  * parameter.
@@ -1057,9 +1061,9 @@ declare class CloudantV1 extends CloudantBaseService {
1057
1061
  * @param {string} [params.update] - Parameter to specify whether or not the view in question should be updated prior
1058
1062
  * to responding to the user.
1059
1063
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1060
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1064
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1061
1065
  */
1062
- postViewAsStream(params: CloudantV1.PostViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1066
+ postViewAsStream(params: CloudantV1.PostViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1063
1067
  /**
1064
1068
  * Multi-query a MapReduce view.
1065
1069
  *
@@ -1091,9 +1095,9 @@ declare class CloudantV1 extends CloudantBaseService {
1091
1095
  * view query to be executed. The field names and their meaning are the same as the query parameters of a regular view
1092
1096
  * request.
1093
1097
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1094
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1098
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1095
1099
  */
1096
- postViewQueriesAsStream(params: CloudantV1.PostViewQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1100
+ postViewQueriesAsStream(params: CloudantV1.PostViewQueriesAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1097
1101
  /*************************
1098
1102
  * partitionedDatabases
1099
1103
  ************************/
@@ -1174,9 +1178,9 @@ declare class CloudantV1 extends CloudantBaseService {
1174
1178
  * @param {string[]} [params.keys] - Schema for a list of document IDs.
1175
1179
  * @param {string} [params.startkey] - Schema for a document ID.
1176
1180
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1177
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1181
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1178
1182
  */
1179
- postPartitionAllDocsAsStream(params: CloudantV1.PostPartitionAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1183
+ postPartitionAllDocsAsStream(params: CloudantV1.PostPartitionAllDocsAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1180
1184
  /**
1181
1185
  * Query a database partition search index.
1182
1186
  *
@@ -1254,9 +1258,9 @@ declare class CloudantV1 extends CloudantBaseService {
1254
1258
  * Fields that are used for sorting must be indexed by the same indexer that is used for the search query.
1255
1259
  * @param {string} [params.stale] - Do not wait for the index to finish building to return results.
1256
1260
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1257
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1261
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1258
1262
  */
1259
- postPartitionSearchAsStream(params: CloudantV1.PostPartitionSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1263
+ postPartitionSearchAsStream(params: CloudantV1.PostPartitionSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1260
1264
  /**
1261
1265
  * Query a database partition MapReduce view function.
1262
1266
  *
@@ -1352,9 +1356,9 @@ declare class CloudantV1 extends CloudantBaseService {
1352
1356
  * @param {string} [params.update] - Parameter to specify whether or not the view in question should be updated prior
1353
1357
  * to responding to the user.
1354
1358
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1355
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1359
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1356
1360
  */
1357
- postPartitionViewAsStream(params: CloudantV1.PostPartitionViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1361
+ postPartitionViewAsStream(params: CloudantV1.PostPartitionViewAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1358
1362
  /**
1359
1363
  * Query a database partition index by using selector syntax (POST).
1360
1364
  *
@@ -1460,9 +1464,9 @@ declare class CloudantV1 extends CloudantBaseService {
1460
1464
  * @param {string[]} [params.useIndex] - Use this option to identify a specific index for query to run against, rather
1461
1465
  * than by using the IBM Cloudant Query algorithm to find the best index.
1462
1466
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1463
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1467
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1464
1468
  */
1465
- postPartitionFindAsStream(params: CloudantV1.PostPartitionFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1469
+ postPartitionFindAsStream(params: CloudantV1.PostPartitionFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1466
1470
  /*************************
1467
1471
  * queries
1468
1472
  ************************/
@@ -1634,9 +1638,9 @@ declare class CloudantV1 extends CloudantBaseService {
1634
1638
  * that many replicas before it is returned in the results. The request will take more time than using only the
1635
1639
  * document that is stored locally with the index.
1636
1640
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1637
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1641
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1638
1642
  */
1639
- postFindAsStream(params: CloudantV1.PostFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1643
+ postFindAsStream(params: CloudantV1.PostFindAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1640
1644
  /**
1641
1645
  * Retrieve information about all indexes.
1642
1646
  *
@@ -1822,9 +1826,9 @@ declare class CloudantV1 extends CloudantBaseService {
1822
1826
  * objects. The field names of the JSON objects are names for ranges. The values are strings that describe the range,
1823
1827
  * for example "[0 TO 10]". This option is only available when making global queries.
1824
1828
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1825
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1829
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1826
1830
  */
1827
- postSearchAsStream(params: CloudantV1.PostSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1831
+ postSearchAsStream(params: CloudantV1.PostSearchAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1828
1832
  /**
1829
1833
  * Retrieve information about a search index.
1830
1834
  *
@@ -1937,9 +1941,9 @@ declare class CloudantV1 extends CloudantBaseService {
1937
1941
  * @param {string} [params.stale] - Query parameter to specify to not wait for the index to finish building before
1938
1942
  * returning results.
1939
1943
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
1940
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
1944
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
1941
1945
  */
1942
- getGeoAsStream(params: CloudantV1.GetGeoAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
1946
+ getGeoAsStream(params: CloudantV1.GetGeoAsStreamParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
1943
1947
  /**
1944
1948
  * Cleanup old geospatial indexes.
1945
1949
  *
@@ -2301,9 +2305,9 @@ declare class CloudantV1 extends CloudantBaseService {
2301
2305
  * implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
2302
2306
  * @param {string} [params.rev] - Query parameter to specify a document revision.
2303
2307
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2304
- * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
2308
+ * @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
2305
2309
  */
2306
- getAttachment(params: CloudantV1.GetAttachmentParams): Promise<CloudantV1.Response<NodeJS.ReadableStream | Buffer>>;
2310
+ getAttachment(params: CloudantV1.GetAttachmentParams): Promise<CloudantV1.Response<NodeJS.ReadableStream>>;
2307
2311
  /**
2308
2312
  * Create or modify an attachment.
2309
2313
  *
@@ -2319,7 +2323,7 @@ declare class CloudantV1 extends CloudantBaseService {
2319
2323
  * @param {string} params.db - Path parameter to specify the database name.
2320
2324
  * @param {string} params.docId - Path parameter to specify the document ID.
2321
2325
  * @param {string} params.attachmentName - Path parameter to specify the attachment name.
2322
- * @param {NodeJS.ReadableStream|Buffer} params.attachment - HTTP request body for attachment operations.
2326
+ * @param {NodeJS.ReadableStream | Buffer} params.attachment - HTTP request body for attachment operations.
2323
2327
  * @param {string} params.contentType - Content-Type of the attachment.
2324
2328
  * @param {string} [params.ifMatch] - Header parameter to specify the document revision. Alternative to rev query
2325
2329
  * parameter.
@@ -2393,7 +2397,7 @@ declare class CloudantV1 extends CloudantBaseService {
2393
2397
  * @param {Object} params - The parameters to send to the service.
2394
2398
  * @param {string} params.db - Path parameter to specify the database name.
2395
2399
  * @param {string} params.docId - Path parameter to specify the document ID.
2396
- * @param {Document|NodeJS.ReadableStream|Buffer} params.document - HTTP request body for Document operations.
2400
+ * @param {Document | NodeJS.ReadableStream | Buffer} params.document - HTTP request body for Document operations.
2397
2401
  * @param {string} [params.contentType] - The type of the input.
2398
2402
  * @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
2399
2403
  * with a HTTP 202 Accepted response code immediately.
@@ -2404,18 +2408,6 @@ declare class CloudantV1 extends CloudantBaseService {
2404
2408
  /*************************
2405
2409
  * databaseDetails
2406
2410
  ************************/
2407
- /**
2408
- * Query which document revisions are missing from the database.
2409
- *
2410
- * Given a list of document revisions, returns the document revisions that do not exist in the database.
2411
- *
2412
- * @param {Object} params - The parameters to send to the service.
2413
- * @param {string} params.db - Path parameter to specify the database name.
2414
- * @param {JsonObject} params.documentRevisions - HTTP request body for postMissingRevs and postRevsDiff.
2415
- * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2416
- * @returns {Promise<CloudantV1.Response<CloudantV1.MissingRevsResult>>}
2417
- */
2418
- postMissingRevs(params: CloudantV1.PostMissingRevsParams): Promise<CloudantV1.Response<CloudantV1.MissingRevsResult>>;
2419
2411
  /**
2420
2412
  * Query the document revisions and possible ancestors missing from the database.
2421
2413
  *
@@ -2425,7 +2417,7 @@ declare class CloudantV1 extends CloudantBaseService {
2425
2417
  *
2426
2418
  * @param {Object} params - The parameters to send to the service.
2427
2419
  * @param {string} params.db - Path parameter to specify the database name.
2428
- * @param {JsonObject} params.documentRevisions - HTTP request body for postMissingRevs and postRevsDiff.
2420
+ * @param {JsonObject} params.documentRevisions - HTTP request body for operations with Document revisions.
2429
2421
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
2430
2422
  * @returns {Promise<CloudantV1.Response<CloudantV1.JsonObject>>}
2431
2423
  */
@@ -2659,17 +2651,18 @@ declare namespace CloudantV1 {
2659
2651
  /** Query parameter to specify the changes feed type. */
2660
2652
  feed?: PostChangesConstants.Feed | string;
2661
2653
  /** Query parameter to specify a filter function from a design document that will filter the changes stream
2662
- * emitting only filtered events. Additionally, several built-in filters are available:
2663
- * - `_design`
2664
- * - Returns only changes to design documents.
2665
- * - `_doc_ids`
2666
- * - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
2667
- * - `_selector`
2668
- * - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the
2669
- * same as used for `_find`.
2670
- * - `_view`
2671
- * - Returns changes for documents that match an existing map function in the view specified by the query parameter
2672
- * `view`.
2654
+ * emitting only filtered events. For example: `design_doc/filtername`.
2655
+ *
2656
+ * Additionally, some keywords are reserved for built-in filters:
2657
+ *
2658
+ * * `_design` - Returns only changes to design documents.
2659
+ * * `_doc_ids` - Returns changes for documents with an ID matching one specified in
2660
+ * `doc_ids` request body parameter.
2661
+ * * `_selector` - Returns changes for documents that match the `selector`
2662
+ * request body parameter. The selector syntax is the same as used for
2663
+ * `_find`.
2664
+ * * `_view` - Returns changes for documents that match an existing map
2665
+ * function in the view specified by the query parameter `view`.
2673
2666
  */
2674
2667
  filter?: string;
2675
2668
  /** Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Only
@@ -2772,17 +2765,18 @@ declare namespace CloudantV1 {
2772
2765
  /** Query parameter to specify the changes feed type. */
2773
2766
  feed?: PostChangesAsStreamConstants.Feed | string;
2774
2767
  /** Query parameter to specify a filter function from a design document that will filter the changes stream
2775
- * emitting only filtered events. Additionally, several built-in filters are available:
2776
- * - `_design`
2777
- * - Returns only changes to design documents.
2778
- * - `_doc_ids`
2779
- * - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
2780
- * - `_selector`
2781
- * - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the
2782
- * same as used for `_find`.
2783
- * - `_view`
2784
- * - Returns changes for documents that match an existing map function in the view specified by the query parameter
2785
- * `view`.
2768
+ * emitting only filtered events. For example: `design_doc/filtername`.
2769
+ *
2770
+ * Additionally, some keywords are reserved for built-in filters:
2771
+ *
2772
+ * * `_design` - Returns only changes to design documents.
2773
+ * * `_doc_ids` - Returns changes for documents with an ID matching one specified in
2774
+ * `doc_ids` request body parameter.
2775
+ * * `_selector` - Returns changes for documents that match the `selector`
2776
+ * request body parameter. The selector syntax is the same as used for
2777
+ * `_find`.
2778
+ * * `_view` - Returns changes for documents that match an existing map
2779
+ * function in the view specified by the query parameter `view`.
2786
2780
  */
2787
2781
  filter?: string;
2788
2782
  /** Query parameter to specify the period in milliseconds after which an empty line is sent in the results. Only
@@ -5361,19 +5355,11 @@ declare namespace CloudantV1 {
5361
5355
  OK = "ok"
5362
5356
  }
5363
5357
  }
5364
- /** Parameters for the `postMissingRevs` operation. */
5365
- interface PostMissingRevsParams {
5366
- /** Path parameter to specify the database name. */
5367
- db: string;
5368
- /** HTTP request body for postMissingRevs and postRevsDiff. */
5369
- documentRevisions: JsonObject;
5370
- headers?: OutgoingHttpHeaders;
5371
- }
5372
5358
  /** Parameters for the `postRevsDiff` operation. */
5373
5359
  interface PostRevsDiffParams {
5374
5360
  /** Path parameter to specify the database name. */
5375
5361
  db: string;
5376
- /** HTTP request body for postMissingRevs and postRevsDiff. */
5362
+ /** HTTP request body for operations with Document revisions. */
5377
5363
  documentRevisions: JsonObject;
5378
5364
  headers?: OutgoingHttpHeaders;
5379
5365
  }
@@ -5765,6 +5751,8 @@ declare namespace CloudantV1 {
5765
5751
  }
5766
5752
  /** Schema for database information keyed by database name. */
5767
5753
  interface DbsInfoResult {
5754
+ /** The name of the error. */
5755
+ error?: string;
5768
5756
  /** Schema for information about a database. */
5769
5757
  info?: DatabaseInformation;
5770
5758
  /** Database name. */
@@ -5794,6 +5782,45 @@ declare namespace CloudantV1 {
5794
5782
  autoupdate?: boolean;
5795
5783
  /** Schema for filter functions definition. This schema is a map where keys are the names of the filter
5796
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.
5797
5824
  */
5798
5825
  filters?: JsonObject;
5799
5826
  /** Search (text) index function definitions. */
@@ -5802,10 +5829,33 @@ declare namespace CloudantV1 {
5802
5829
  language?: string;
5803
5830
  /** Schema for design document options. */
5804
5831
  options?: DesignDocumentOptions;
5805
- /** Schema for update function definitions. */
5806
- updates?: JsonObject;
5807
- /** Schema for validate document update functions definition. */
5808
- validate_doc_update?: JsonObject;
5832
+ /** Validate document update function can be used to prevent invalid or unauthorized document update requests
5833
+ * from being stored. Validation functions typically examine the structure of the new document to ensure that
5834
+ * required fields are present and to verify that the requesting user should be allowed to make changes to the
5835
+ * document properties. When a write request is received for a given database, the validation function in each
5836
+ * design document in that database is called in an unspecified order. If any of the validation functions throw an
5837
+ * error, the write will not succeed.
5838
+ *
5839
+ * The validation function can abort the pending document write by throwing one of two error objects:
5840
+ *
5841
+ * ```
5842
+ * // user is not authorized to make the change but may re-authenticate throw({ unauthorized: 'Error message here.'
5843
+ * });
5844
+ *
5845
+ * // change is not allowed throw({ forbidden: 'Error message here.' });
5846
+ * ```
5847
+ *
5848
+ * The function takes 4 parameters:
5849
+ *
5850
+ * * `newDoc` - New version of document that will be stored
5851
+ * from the update request.
5852
+ * * `oldDoc` - Previous version of document that is already stored.
5853
+ * * `userCtx` - User Context Object, containing information about the
5854
+ * user writing the document (if present), see the `UserContext`.
5855
+ * * `secObj` - Security Object, with lists of database security roles,
5856
+ * see the `SecurityObject`.
5857
+ */
5858
+ validate_doc_update?: string;
5809
5859
  /** Schema for design document views. */
5810
5860
  views?: JsonObject;
5811
5861
  /** Schema for geospatial index function definitions. */
@@ -5835,8 +5885,6 @@ declare namespace CloudantV1 {
5835
5885
  signature: string;
5836
5886
  /** Schema for size information of content. */
5837
5887
  sizes: ContentInformationSizes;
5838
- /** The update sequence of the corresponding database that has been indexed. */
5839
- update_seq: string;
5840
5888
  /** Indicates if the view is currently being updated. */
5841
5889
  updater_running: boolean;
5842
5890
  /** Number of clients waiting on views from this design document. */
@@ -6163,11 +6211,6 @@ declare namespace CloudantV1 {
6163
6211
  /** All cluster nodes. */
6164
6212
  cluster_nodes: string[];
6165
6213
  }
6166
- /** Schema for mapping document IDs to lists of missing revisions. */
6167
- interface MissingRevsResult {
6168
- /** Schema for mapping document IDs to lists of revisions. */
6169
- missing_revs: JsonObject;
6170
- }
6171
6214
  /** Schema for an OK result. */
6172
6215
  interface Ok {
6173
6216
  /** ok. */
@@ -6231,9 +6274,18 @@ declare namespace CloudantV1 {
6231
6274
  }
6232
6275
  /** Schema for replication source or target database authentication. */
6233
6276
  interface ReplicationDatabaseAuth {
6277
+ /** Schema for basic authentication of replication source or target database. */
6278
+ basic?: ReplicationDatabaseAuthBasic;
6234
6279
  /** Schema for an IAM API key for replication database authentication. */
6235
6280
  iam?: ReplicationDatabaseAuthIam;
6236
6281
  }
6282
+ /** Schema for basic authentication of replication source or target database. */
6283
+ interface ReplicationDatabaseAuthBasic {
6284
+ /** The password associated with the username. */
6285
+ password: string;
6286
+ /** The username. */
6287
+ username: string;
6288
+ }
6237
6289
  /** Schema for an IAM API key for replication database authentication. */
6238
6290
  interface ReplicationDatabaseAuthIam {
6239
6291
  /** IAM API key. */
@@ -6457,6 +6509,8 @@ declare namespace CloudantV1 {
6457
6509
  }
6458
6510
  /** Schema for a replication scheduler job event. */
6459
6511
  interface SchedulerJobEvent {
6512
+ /** Reason for current state of event. */
6513
+ reason?: string;
6460
6514
  /** Timestamp of the event. */
6461
6515
  timestamp: string;
6462
6516
  /** Type of the event. */