@ibm-cloud/cloudant 0.9.0 → 0.9.1
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 +15 -8
- package/cloudant/v1.d.ts +327 -153
- package/cloudant/v1.js +347 -88
- package/cloudant/v1.js.map +1 -1
- package/package.json +7 -7
package/cloudant/v1.js
CHANGED
|
@@ -343,10 +343,14 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
343
343
|
*
|
|
344
344
|
* ### Note
|
|
345
345
|
*
|
|
346
|
-
* Before using the changes feed
|
|
346
|
+
* Before using the changes feed read the
|
|
347
347
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
348
348
|
* appropriate use cases.
|
|
349
349
|
*
|
|
350
|
+
* If you need to pass parameters to dynamically change the filtered content use the `_selector` filter type for
|
|
351
|
+
* better performance and compatibility. The SDKs have full support for change requests using selector filters, but
|
|
352
|
+
* don't support passing parameters to design document filters.
|
|
353
|
+
*
|
|
350
354
|
* @param {Object} params - The parameters to send to the service.
|
|
351
355
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
352
356
|
* @param {string[]} [params.docIds] - Schema for a list of document IDs.
|
|
@@ -390,19 +394,25 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
390
394
|
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
391
395
|
* key order.
|
|
392
396
|
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
393
|
-
* @param {string} [params.filter] - Query parameter to specify a filter
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* Additionally, some keywords are reserved for built-in filters:
|
|
397
|
+
* @param {string} [params.filter] - Query parameter to specify a filter to emit only specific events from the changes
|
|
398
|
+
* stream.
|
|
397
399
|
*
|
|
400
|
+
* The built-in filter types are:
|
|
398
401
|
* * `_design` - Returns only changes to design documents.
|
|
399
402
|
* * `_doc_ids` - Returns changes for documents with an ID matching one specified in
|
|
400
|
-
* `doc_ids` request body parameter.
|
|
403
|
+
* `doc_ids` request body parameter. (`POST` only)
|
|
401
404
|
* * `_selector` - Returns changes for documents that match the `selector`
|
|
402
405
|
* request body parameter. The selector syntax is the same as used for
|
|
403
|
-
* `_find`.
|
|
406
|
+
* `_find`. (`POST` only)
|
|
404
407
|
* * `_view` - Returns changes for documents that match an existing map
|
|
405
408
|
* function in the view specified by the query parameter `view`.
|
|
409
|
+
*
|
|
410
|
+
* Additionally, the value can be the name of a JS filter function from a design document. For example:
|
|
411
|
+
* `design_doc/filtername`.
|
|
412
|
+
*
|
|
413
|
+
* **Note:** For better performance use the built-in `_selector`, `_design` or `_doc_ids` filters rather than JS based
|
|
414
|
+
* `_view` or design document filters. If you need to pass values to change the filtered content use the `_selector`
|
|
415
|
+
* filter type.
|
|
406
416
|
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
407
417
|
* line is sent in the results. Off by default and only applicable for
|
|
408
418
|
* `continuous` and `eventsource` feeds. Overrides any timeout to keep the feed alive indefinitely. May also be `true`
|
|
@@ -497,10 +507,14 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
497
507
|
*
|
|
498
508
|
* ### Note
|
|
499
509
|
*
|
|
500
|
-
* Before using the changes feed
|
|
510
|
+
* Before using the changes feed read the
|
|
501
511
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
502
512
|
* appropriate use cases.
|
|
503
513
|
*
|
|
514
|
+
* If you need to pass parameters to dynamically change the filtered content use the `_selector` filter type for
|
|
515
|
+
* better performance and compatibility. The SDKs have full support for change requests using selector filters, but
|
|
516
|
+
* don't support passing parameters to design document filters.
|
|
517
|
+
*
|
|
504
518
|
* @param {Object} params - The parameters to send to the service.
|
|
505
519
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
506
520
|
* @param {string[]} [params.docIds] - Schema for a list of document IDs.
|
|
@@ -544,19 +558,25 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
544
558
|
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
545
559
|
* key order.
|
|
546
560
|
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
547
|
-
* @param {string} [params.filter] - Query parameter to specify a filter
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
* Additionally, some keywords are reserved for built-in filters:
|
|
561
|
+
* @param {string} [params.filter] - Query parameter to specify a filter to emit only specific events from the changes
|
|
562
|
+
* stream.
|
|
551
563
|
*
|
|
564
|
+
* The built-in filter types are:
|
|
552
565
|
* * `_design` - Returns only changes to design documents.
|
|
553
566
|
* * `_doc_ids` - Returns changes for documents with an ID matching one specified in
|
|
554
|
-
* `doc_ids` request body parameter.
|
|
567
|
+
* `doc_ids` request body parameter. (`POST` only)
|
|
555
568
|
* * `_selector` - Returns changes for documents that match the `selector`
|
|
556
569
|
* request body parameter. The selector syntax is the same as used for
|
|
557
|
-
* `_find`.
|
|
570
|
+
* `_find`. (`POST` only)
|
|
558
571
|
* * `_view` - Returns changes for documents that match an existing map
|
|
559
572
|
* function in the view specified by the query parameter `view`.
|
|
573
|
+
*
|
|
574
|
+
* Additionally, the value can be the name of a JS filter function from a design document. For example:
|
|
575
|
+
* `design_doc/filtername`.
|
|
576
|
+
*
|
|
577
|
+
* **Note:** For better performance use the built-in `_selector`, `_design` or `_doc_ids` filters rather than JS based
|
|
578
|
+
* `_view` or design document filters. If you need to pass values to change the filtered content use the `_selector`
|
|
579
|
+
* filter type.
|
|
560
580
|
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
561
581
|
* line is sent in the results. Off by default and only applicable for
|
|
562
582
|
* `continuous` and `eventsource` feeds. Overrides any timeout to keep the feed alive indefinitely. May also be `true`
|
|
@@ -685,6 +705,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
685
705
|
/**
|
|
686
706
|
* Query a list of all database names in the instance.
|
|
687
707
|
*
|
|
708
|
+
* Query to retrieve a list of database names from the instance.
|
|
709
|
+
*
|
|
688
710
|
* @param {Object} [params] - The parameters to send to the service.
|
|
689
711
|
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
690
712
|
* key order.
|
|
@@ -809,6 +831,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
809
831
|
/**
|
|
810
832
|
* Retrieve information about a database.
|
|
811
833
|
*
|
|
834
|
+
* Retrieve detailed information about the database.
|
|
835
|
+
*
|
|
812
836
|
* @param {Object} params - The parameters to send to the service.
|
|
813
837
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
814
838
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -843,6 +867,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
843
867
|
/**
|
|
844
868
|
* Create a database.
|
|
845
869
|
*
|
|
870
|
+
* Create a new database with the requested properties.
|
|
871
|
+
*
|
|
846
872
|
* @param {Object} params - The parameters to send to the service.
|
|
847
873
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
848
874
|
* @param {boolean} [params.partitioned] - Query parameter to specify whether to enable database partitions when
|
|
@@ -899,8 +925,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
899
925
|
* @param {Object} params - The parameters to send to the service.
|
|
900
926
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
901
927
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
902
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
903
|
-
* cache control.
|
|
928
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
904
929
|
* @param {boolean} [params.latest] - Query parameter to specify whether to force retrieving latest leaf revision, no
|
|
905
930
|
* matter what rev was requested.
|
|
906
931
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
@@ -1521,8 +1546,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1521
1546
|
* @param {Object} params - The parameters to send to the service.
|
|
1522
1547
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1523
1548
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1524
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
1525
|
-
* parameter.
|
|
1549
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
1526
1550
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
1527
1551
|
* with a HTTP 202 Accepted response code immediately.
|
|
1528
1552
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
@@ -1571,8 +1595,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1571
1595
|
* @param {Object} params - The parameters to send to the service.
|
|
1572
1596
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1573
1597
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1574
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
1575
|
-
* cache control.
|
|
1598
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
1576
1599
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
1577
1600
|
* response.
|
|
1578
1601
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -1645,8 +1668,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1645
1668
|
* @param {Object} params - The parameters to send to the service.
|
|
1646
1669
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1647
1670
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1648
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
1649
|
-
* cache control.
|
|
1671
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
1650
1672
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
1651
1673
|
* response.
|
|
1652
1674
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -1720,8 +1742,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1720
1742
|
* @param {Object} params - The parameters to send to the service.
|
|
1721
1743
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1722
1744
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1723
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
1724
|
-
* cache control.
|
|
1745
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
1725
1746
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
1726
1747
|
* response.
|
|
1727
1748
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -1795,8 +1816,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1795
1816
|
* @param {Object} params - The parameters to send to the service.
|
|
1796
1817
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1797
1818
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1798
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
1799
|
-
* cache control.
|
|
1819
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
1800
1820
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
1801
1821
|
* response.
|
|
1802
1822
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -1875,8 +1895,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1875
1895
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
1876
1896
|
* @param {Document | NodeJS.ReadableStream | Buffer} params.document - HTTP request body for Document operations.
|
|
1877
1897
|
* @param {string} [params.contentType] - The type of the input.
|
|
1878
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
1879
|
-
* parameter.
|
|
1898
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
1880
1899
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
1881
1900
|
* with a HTTP 202 Accepted response code immediately.
|
|
1882
1901
|
* @param {boolean} [params.newEdits] - Query parameter to specify whether to prevent insertion of conflicting
|
|
@@ -1939,8 +1958,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1939
1958
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1940
1959
|
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
1941
1960
|
* design document ID excluding the `_design/` prefix.
|
|
1942
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
1943
|
-
* cache control.
|
|
1961
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
1944
1962
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1945
1963
|
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
1946
1964
|
*/
|
|
@@ -1982,8 +2000,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
1982
2000
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
1983
2001
|
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
1984
2002
|
* design document ID excluding the `_design/` prefix.
|
|
1985
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
1986
|
-
* parameter.
|
|
2003
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
1987
2004
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
1988
2005
|
* with a HTTP 202 Accepted response code immediately.
|
|
1989
2006
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
@@ -2033,8 +2050,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
2033
2050
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
2034
2051
|
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
2035
2052
|
* design document ID excluding the `_design/` prefix.
|
|
2036
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
2037
|
-
* cache control.
|
|
2053
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
2038
2054
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
2039
2055
|
* response.
|
|
2040
2056
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -2108,8 +2124,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
2108
2124
|
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
2109
2125
|
* design document ID excluding the `_design/` prefix.
|
|
2110
2126
|
* @param {DesignDocument} params.designDocument - HTTP request body for DesignDocument operations.
|
|
2111
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
2112
|
-
* parameter.
|
|
2127
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
2113
2128
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
2114
2129
|
* with a HTTP 202 Accepted response code immediately.
|
|
2115
2130
|
* @param {boolean} [params.newEdits] - Query parameter to specify whether to prevent insertion of conflicting
|
|
@@ -2225,14 +2240,13 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
2225
2240
|
* @param {string} [params.key] - Schema for a document ID.
|
|
2226
2241
|
* @param {string[]} [params.keys] - Schema for a list of document IDs.
|
|
2227
2242
|
* @param {string} [params.startKey] - Schema for a document ID.
|
|
2228
|
-
* @param {string} [params.accept] - The type of the response: application/json or application/octet-stream.
|
|
2229
2243
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2230
2244
|
* @returns {Promise<CloudantV1.Response<CloudantV1.AllDocsResult>>}
|
|
2231
2245
|
*/
|
|
2232
2246
|
postDesignDocs(params) {
|
|
2233
2247
|
const _params = { ...params };
|
|
2234
2248
|
const _requiredParams = ['db'];
|
|
2235
|
-
const _validParams = ['db', 'attEncodingInfo', 'attachments', 'conflicts', 'descending', 'includeDocs', 'inclusiveEnd', 'limit', 'skip', 'updateSeq', 'endKey', 'key', 'keys', 'startKey', '
|
|
2249
|
+
const _validParams = ['db', 'attEncodingInfo', 'attachments', 'conflicts', 'descending', 'includeDocs', 'inclusiveEnd', 'limit', 'skip', 'updateSeq', 'endKey', 'key', 'keys', 'startKey', 'headers'];
|
|
2236
2250
|
const _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
2237
2251
|
if (_validationErrors) {
|
|
2238
2252
|
return Promise.reject(_validationErrors);
|
|
@@ -2265,8 +2279,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
2265
2279
|
},
|
|
2266
2280
|
defaultOptions: (0, extend_1.default)(true, {}, this.baseOptions, {
|
|
2267
2281
|
headers: (0, extend_1.default)(true, sdkHeaders, {
|
|
2282
|
+
'Accept': 'application/json',
|
|
2268
2283
|
'Content-Type': 'application/json',
|
|
2269
|
-
'Accept': _params.accept,
|
|
2270
2284
|
}, _params.headers),
|
|
2271
2285
|
}),
|
|
2272
2286
|
};
|
|
@@ -3283,8 +3297,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3283
3297
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3284
3298
|
* shards.
|
|
3285
3299
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3286
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3287
|
-
*
|
|
3300
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3301
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3302
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3303
|
+
*
|
|
3304
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3305
|
+
* indexes that might get added later.
|
|
3288
3306
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
3289
3307
|
* @returns {Promise<CloudantV1.Response<CloudantV1.ExplainResult>>}
|
|
3290
3308
|
*/
|
|
@@ -3394,8 +3412,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3394
3412
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3395
3413
|
* shards.
|
|
3396
3414
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3397
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3398
|
-
*
|
|
3415
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3416
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3417
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3418
|
+
*
|
|
3419
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3420
|
+
* indexes that might get added later.
|
|
3399
3421
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
3400
3422
|
* @returns {Promise<CloudantV1.Response<CloudantV1.FindResult>>}
|
|
3401
3423
|
*/
|
|
@@ -3505,8 +3527,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3505
3527
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3506
3528
|
* shards.
|
|
3507
3529
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3508
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3509
|
-
*
|
|
3530
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3531
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3532
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3533
|
+
*
|
|
3534
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3535
|
+
* indexes that might get added later.
|
|
3510
3536
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
3511
3537
|
* @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream>>}
|
|
3512
3538
|
*/
|
|
@@ -3614,8 +3640,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3614
3640
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3615
3641
|
* shards.
|
|
3616
3642
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3617
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3618
|
-
*
|
|
3643
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3644
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3645
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3646
|
+
*
|
|
3647
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3648
|
+
* indexes that might get added later.
|
|
3619
3649
|
* @param {number} [params.r] - The read quorum that is needed for the result. The value defaults to 1, in which case
|
|
3620
3650
|
* the document that was found in the index is returned. If set to a higher value, each document is read from at least
|
|
3621
3651
|
* that many replicas before it is returned in the results. The request will take more time than using only the
|
|
@@ -3728,8 +3758,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3728
3758
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3729
3759
|
* shards.
|
|
3730
3760
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3731
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3732
|
-
*
|
|
3761
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3762
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3763
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3764
|
+
*
|
|
3765
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3766
|
+
* indexes that might get added later.
|
|
3733
3767
|
* @param {number} [params.r] - The read quorum that is needed for the result. The value defaults to 1, in which case
|
|
3734
3768
|
* the document that was found in the index is returned. If set to a higher value, each document is read from at least
|
|
3735
3769
|
* that many replicas before it is returned in the results. The request will take more time than using only the
|
|
@@ -3842,8 +3876,12 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3842
3876
|
* @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
|
|
3843
3877
|
* shards.
|
|
3844
3878
|
* @param {string} [params.update] - Whether to update the index prior to returning the result.
|
|
3845
|
-
* @param {string[]} [params.useIndex] - Use this option to identify a specific index
|
|
3846
|
-
*
|
|
3879
|
+
* @param {string[]} [params.useIndex] - Use this option to identify a specific index to answer the query, rather than
|
|
3880
|
+
* letting the IBM Cloudant query planner choose an index. Specified as a two element array of design document id
|
|
3881
|
+
* followed by index name, for example `["my_design_doc", "my_index"]`.
|
|
3882
|
+
*
|
|
3883
|
+
* It’s recommended to specify indexes explicitly in your queries to prevent existing queries being affected by new
|
|
3884
|
+
* indexes that might get added later.
|
|
3847
3885
|
* @param {number} [params.r] - The read quorum that is needed for the result. The value defaults to 1, in which case
|
|
3848
3886
|
* the document that was found in the index is returned. If set to a higher value, each document is read from at least
|
|
3849
3887
|
* that many replicas before it is returned in the results. The request will take more time than using only the
|
|
@@ -3990,6 +4028,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
3990
4028
|
/**
|
|
3991
4029
|
* Delete an index.
|
|
3992
4030
|
*
|
|
4031
|
+
* Delete the index functions from the design document and index files on the server.
|
|
4032
|
+
*
|
|
3993
4033
|
* @param {Object} params - The parameters to send to the service.
|
|
3994
4034
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
3995
4035
|
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
@@ -4345,8 +4385,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
4345
4385
|
*
|
|
4346
4386
|
* @param {Object} params - The parameters to send to the service.
|
|
4347
4387
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4348
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
4349
|
-
* cache control.
|
|
4388
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
4350
4389
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4351
4390
|
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
4352
4391
|
*/
|
|
@@ -4454,8 +4493,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
4454
4493
|
*
|
|
4455
4494
|
* @param {Object} params - The parameters to send to the service.
|
|
4456
4495
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4457
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
4458
|
-
* parameter.
|
|
4496
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
4459
4497
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
4460
4498
|
* with a HTTP 202 Accepted response code immediately.
|
|
4461
4499
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
@@ -4502,8 +4540,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
4502
4540
|
*
|
|
4503
4541
|
* @param {Object} params - The parameters to send to the service.
|
|
4504
4542
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4505
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
4506
|
-
* cache control.
|
|
4543
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
4507
4544
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
4508
4545
|
* response.
|
|
4509
4546
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -4575,8 +4612,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
4575
4612
|
* @param {Object} params - The parameters to send to the service.
|
|
4576
4613
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4577
4614
|
* @param {ReplicationDocument} params.replicationDocument - HTTP request body for replication operations.
|
|
4578
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
4579
|
-
* parameter.
|
|
4615
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
4580
4616
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
4581
4617
|
* with a HTTP 202 Accepted response code immediately.
|
|
4582
4618
|
* @param {boolean} [params.newEdits] - Query parameter to specify whether to prevent insertion of conflicting
|
|
@@ -5095,10 +5131,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5095
5131
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
5096
5132
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5097
5133
|
* @param {string} params.attachmentName - Path parameter to specify the attachment name.
|
|
5098
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
5099
|
-
* parameter.
|
|
5100
|
-
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
5101
|
-
* cache control.
|
|
5134
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
5135
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
5102
5136
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
5103
5137
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5104
5138
|
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
@@ -5146,8 +5180,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5146
5180
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
5147
5181
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5148
5182
|
* @param {string} params.attachmentName - Path parameter to specify the attachment name.
|
|
5149
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
5150
|
-
* parameter.
|
|
5183
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
5151
5184
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
5152
5185
|
* @param {string} [params.batch] - Query parameter to specify whether to store in batch mode. The server will respond
|
|
5153
5186
|
* with a HTTP 202 Accepted response code immediately.
|
|
@@ -5200,10 +5233,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5200
5233
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5201
5234
|
* @param {string} params.attachmentName - Path parameter to specify the attachment name.
|
|
5202
5235
|
* @param {string} [params.accept] - The type of the response: or *_/_*.
|
|
5203
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
5204
|
-
* parameter.
|
|
5205
|
-
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
5206
|
-
* cache control.
|
|
5236
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
5237
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
5207
5238
|
* @param {string} [params.range] - Header parameter to specify the byte range for a request. This allows the
|
|
5208
5239
|
* implementation of resumable downloads and skippable streams. This is available for all attachments inside CouchDB.
|
|
5209
5240
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
@@ -5263,8 +5294,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5263
5294
|
* @param {string} params.attachmentName - Path parameter to specify the attachment name.
|
|
5264
5295
|
* @param {NodeJS.ReadableStream | Buffer} params.attachment - HTTP request body for attachment operations.
|
|
5265
5296
|
* @param {string} params.contentType - Content-Type of the attachment.
|
|
5266
|
-
* @param {string} [params.ifMatch] - Header parameter
|
|
5267
|
-
* parameter.
|
|
5297
|
+
* @param {string} [params.ifMatch] - Header parameter for a conditional HTTP request matching an ETag.
|
|
5268
5298
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
5269
5299
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5270
5300
|
* @returns {Promise<CloudantV1.Response<CloudantV1.DocumentResult>>}
|
|
@@ -5317,8 +5347,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5317
5347
|
* @param {Object} params - The parameters to send to the service.
|
|
5318
5348
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
5319
5349
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5320
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
5321
|
-
* cache control.
|
|
5350
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
5322
5351
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5323
5352
|
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
5324
5353
|
*/
|
|
@@ -5405,8 +5434,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5405
5434
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5406
5435
|
* @param {string} [params.accept] - The type of the response: application/json, multipart/mixed, multipart/related,
|
|
5407
5436
|
* or application/octet-stream.
|
|
5408
|
-
* @param {string} [params.ifNoneMatch] - Header parameter
|
|
5409
|
-
* cache control.
|
|
5437
|
+
* @param {string} [params.ifNoneMatch] - Header parameter for a conditional HTTP request not matching an ETag.
|
|
5410
5438
|
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
5411
5439
|
* response.
|
|
5412
5440
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
@@ -5929,16 +5957,6 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
5929
5957
|
Batch["OK"] = "ok";
|
|
5930
5958
|
})(Batch = PutDesignDocumentConstants.Batch || (PutDesignDocumentConstants.Batch = {}));
|
|
5931
5959
|
})(PutDesignDocumentConstants = CloudantV1.PutDesignDocumentConstants || (CloudantV1.PutDesignDocumentConstants = {}));
|
|
5932
|
-
/** Constants for the `postDesignDocs` operation. */
|
|
5933
|
-
let PostDesignDocsConstants;
|
|
5934
|
-
(function (PostDesignDocsConstants) {
|
|
5935
|
-
/** The type of the response: application/json or application/octet-stream. */
|
|
5936
|
-
let Accept;
|
|
5937
|
-
(function (Accept) {
|
|
5938
|
-
Accept["APPLICATION_JSON"] = "application/json";
|
|
5939
|
-
Accept["APPLICATION_OCTET_STREAM"] = "application/octet-stream";
|
|
5940
|
-
})(Accept = PostDesignDocsConstants.Accept || (PostDesignDocsConstants.Accept = {}));
|
|
5941
|
-
})(PostDesignDocsConstants = CloudantV1.PostDesignDocsConstants || (CloudantV1.PostDesignDocsConstants = {}));
|
|
5942
5960
|
/** Constants for the `postDesignDocsQueries` operation. */
|
|
5943
5961
|
let PostDesignDocsQueriesConstants;
|
|
5944
5962
|
(function (PostDesignDocsQueriesConstants) {
|
|
@@ -8122,7 +8140,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8122
8140
|
_deleted;
|
|
8123
8141
|
/** Schema for a list of document revision identifiers. */
|
|
8124
8142
|
_deleted_conflicts;
|
|
8125
|
-
/**
|
|
8143
|
+
/** Schema for a design document ID. */
|
|
8126
8144
|
_id;
|
|
8127
8145
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
8128
8146
|
_local_seq;
|
|
@@ -8564,6 +8582,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8564
8582
|
error;
|
|
8565
8583
|
/** The reason the error occurred (if available). */
|
|
8566
8584
|
reason;
|
|
8585
|
+
/** An internal error reference (if available). */
|
|
8586
|
+
ref;
|
|
8567
8587
|
/** Schema for a document. */
|
|
8568
8588
|
doc;
|
|
8569
8589
|
/** id. */
|
|
@@ -8586,6 +8606,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8586
8606
|
if (obj.reason !== undefined) {
|
|
8587
8607
|
copy.reason = obj.reason;
|
|
8588
8608
|
}
|
|
8609
|
+
if (obj.ref !== undefined) {
|
|
8610
|
+
copy.ref = obj.ref;
|
|
8611
|
+
}
|
|
8589
8612
|
if (obj.doc !== undefined) {
|
|
8590
8613
|
copy.doc = Document.serialize(obj.doc);
|
|
8591
8614
|
}
|
|
@@ -8614,6 +8637,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8614
8637
|
if (obj.reason !== undefined) {
|
|
8615
8638
|
copy.reason = obj.reason;
|
|
8616
8639
|
}
|
|
8640
|
+
if (obj.ref !== undefined) {
|
|
8641
|
+
copy.ref = obj.ref;
|
|
8642
|
+
}
|
|
8617
8643
|
if (obj.doc !== undefined) {
|
|
8618
8644
|
copy.doc = Document.deserialize(obj.doc);
|
|
8619
8645
|
}
|
|
@@ -8674,7 +8700,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8674
8700
|
_deleted;
|
|
8675
8701
|
/** Schema for a list of document revision identifiers. */
|
|
8676
8702
|
_deleted_conflicts;
|
|
8677
|
-
/**
|
|
8703
|
+
/** Schema for a document ID. */
|
|
8678
8704
|
_id;
|
|
8679
8705
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
8680
8706
|
_local_seq;
|
|
@@ -8800,6 +8826,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8800
8826
|
error;
|
|
8801
8827
|
/** The reason the error occurred (if available). */
|
|
8802
8828
|
reason;
|
|
8829
|
+
/** An internal error reference (if available). */
|
|
8830
|
+
ref;
|
|
8803
8831
|
static serialize(obj) {
|
|
8804
8832
|
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
8805
8833
|
return obj;
|
|
@@ -8823,6 +8851,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8823
8851
|
if (obj.reason !== undefined) {
|
|
8824
8852
|
copy.reason = obj.reason;
|
|
8825
8853
|
}
|
|
8854
|
+
if (obj.ref !== undefined) {
|
|
8855
|
+
copy.ref = obj.ref;
|
|
8856
|
+
}
|
|
8826
8857
|
return copy;
|
|
8827
8858
|
}
|
|
8828
8859
|
static deserialize(obj) {
|
|
@@ -8848,6 +8879,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8848
8879
|
if (obj.reason !== undefined) {
|
|
8849
8880
|
copy.reason = obj.reason;
|
|
8850
8881
|
}
|
|
8882
|
+
if (obj.ref !== undefined) {
|
|
8883
|
+
copy.ref = obj.ref;
|
|
8884
|
+
}
|
|
8851
8885
|
return copy;
|
|
8852
8886
|
}
|
|
8853
8887
|
}
|
|
@@ -9004,6 +9038,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9004
9038
|
fields;
|
|
9005
9039
|
/** Schema for information about an index. */
|
|
9006
9040
|
index;
|
|
9041
|
+
/** Schema for the list of all the other indexes that were not chosen for serving the query. */
|
|
9042
|
+
indexCandidates;
|
|
9007
9043
|
/** The used maximum number of results returned. */
|
|
9008
9044
|
limit;
|
|
9009
9045
|
/** Arguments passed to the underlying view. */
|
|
@@ -9041,6 +9077,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9041
9077
|
* [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
|
|
9042
9078
|
*/
|
|
9043
9079
|
selector;
|
|
9080
|
+
/** Schema for a list of objects with extra information on the selector to provide insights about its usability. */
|
|
9081
|
+
selectorHints;
|
|
9044
9082
|
/** Skip parameter used. */
|
|
9045
9083
|
skip;
|
|
9046
9084
|
static serialize(obj) {
|
|
@@ -9060,6 +9098,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9060
9098
|
if (obj.index !== undefined) {
|
|
9061
9099
|
copy.index = IndexInformation.serialize(obj.index);
|
|
9062
9100
|
}
|
|
9101
|
+
if (obj.indexCandidates !== undefined) {
|
|
9102
|
+
copy.index_candidates = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.indexCandidates, IndexCandidate.serialize);
|
|
9103
|
+
}
|
|
9063
9104
|
if (obj.limit !== undefined) {
|
|
9064
9105
|
copy.limit = obj.limit;
|
|
9065
9106
|
}
|
|
@@ -9075,6 +9116,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9075
9116
|
if (obj.selector !== undefined) {
|
|
9076
9117
|
copy.selector = obj.selector;
|
|
9077
9118
|
}
|
|
9119
|
+
if (obj.selectorHints !== undefined) {
|
|
9120
|
+
copy.selector_hints = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.selectorHints, SelectorHint.serialize);
|
|
9121
|
+
}
|
|
9078
9122
|
if (obj.skip !== undefined) {
|
|
9079
9123
|
copy.skip = obj.skip;
|
|
9080
9124
|
}
|
|
@@ -9097,6 +9141,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9097
9141
|
if (obj.index !== undefined) {
|
|
9098
9142
|
copy.index = IndexInformation.deserialize(obj.index);
|
|
9099
9143
|
}
|
|
9144
|
+
if (obj.index_candidates !== undefined) {
|
|
9145
|
+
copy.indexCandidates = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.index_candidates, IndexCandidate.deserialize);
|
|
9146
|
+
}
|
|
9100
9147
|
if (obj.limit !== undefined) {
|
|
9101
9148
|
copy.limit = obj.limit;
|
|
9102
9149
|
}
|
|
@@ -9112,6 +9159,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9112
9159
|
if (obj.selector !== undefined) {
|
|
9113
9160
|
copy.selector = obj.selector;
|
|
9114
9161
|
}
|
|
9162
|
+
if (obj.selector_hints !== undefined) {
|
|
9163
|
+
copy.selectorHints = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.selector_hints, SelectorHint.deserialize);
|
|
9164
|
+
}
|
|
9115
9165
|
if (obj.skip !== undefined) {
|
|
9116
9166
|
copy.skip = obj.skip;
|
|
9117
9167
|
}
|
|
@@ -9410,6 +9460,154 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9410
9460
|
}
|
|
9411
9461
|
}
|
|
9412
9462
|
CloudantV1.FindResult = FindResult;
|
|
9463
|
+
/** Schema for detailed explanation of why the specific index was excluded by the query planner. */
|
|
9464
|
+
class IndexAnalysis {
|
|
9465
|
+
/** When `true`, the query is answered using the index only and no documents are fetched. */
|
|
9466
|
+
covering;
|
|
9467
|
+
/** A position of the unused index based on its potential relevance to the query. */
|
|
9468
|
+
ranking;
|
|
9469
|
+
/** A list of reasons explaining why index was not chosen for the query. */
|
|
9470
|
+
reasons;
|
|
9471
|
+
/** Indicates whether an index can still be used for the query. */
|
|
9472
|
+
usable;
|
|
9473
|
+
static serialize(obj) {
|
|
9474
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9475
|
+
return obj;
|
|
9476
|
+
}
|
|
9477
|
+
let copy = {};
|
|
9478
|
+
if (obj.covering !== undefined) {
|
|
9479
|
+
copy.covering = obj.covering;
|
|
9480
|
+
}
|
|
9481
|
+
if (obj.ranking !== undefined) {
|
|
9482
|
+
copy.ranking = obj.ranking;
|
|
9483
|
+
}
|
|
9484
|
+
if (obj.reasons !== undefined) {
|
|
9485
|
+
copy.reasons = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.reasons, IndexAnalysisExclusionReason.serialize);
|
|
9486
|
+
}
|
|
9487
|
+
if (obj.usable !== undefined) {
|
|
9488
|
+
copy.usable = obj.usable;
|
|
9489
|
+
}
|
|
9490
|
+
return copy;
|
|
9491
|
+
}
|
|
9492
|
+
static deserialize(obj) {
|
|
9493
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9494
|
+
return obj;
|
|
9495
|
+
}
|
|
9496
|
+
let copy = {};
|
|
9497
|
+
if (obj.covering !== undefined) {
|
|
9498
|
+
copy.covering = obj.covering;
|
|
9499
|
+
}
|
|
9500
|
+
if (obj.ranking !== undefined) {
|
|
9501
|
+
copy.ranking = obj.ranking;
|
|
9502
|
+
}
|
|
9503
|
+
if (obj.reasons !== undefined) {
|
|
9504
|
+
copy.reasons = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.reasons, IndexAnalysisExclusionReason.deserialize);
|
|
9505
|
+
}
|
|
9506
|
+
if (obj.usable !== undefined) {
|
|
9507
|
+
copy.usable = obj.usable;
|
|
9508
|
+
}
|
|
9509
|
+
return copy;
|
|
9510
|
+
}
|
|
9511
|
+
}
|
|
9512
|
+
CloudantV1.IndexAnalysis = IndexAnalysis;
|
|
9513
|
+
/** A reason for index's exclusion. */
|
|
9514
|
+
class IndexAnalysisExclusionReason {
|
|
9515
|
+
/** A reason code for index's exclusion.
|
|
9516
|
+
*
|
|
9517
|
+
* The full list of possible reason codes is following:
|
|
9518
|
+
*
|
|
9519
|
+
* * alphabetically_comes_after: json
|
|
9520
|
+
* There is another suitable index whose name comes before that of this index.
|
|
9521
|
+
* * empty_selector: text
|
|
9522
|
+
* "text" indexes do not support queries with empty selectors.
|
|
9523
|
+
* * excluded_by_user: any use_index was used to manually specify the index.
|
|
9524
|
+
* * field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
|
|
9525
|
+
* * is_partial: json, text Partial indexes can be selected only manually.
|
|
9526
|
+
* * less_overlap: json There is a better match of fields available within the indexes for the query.
|
|
9527
|
+
* * needs_text_search: json The use of the $text operator requires a "text" index.
|
|
9528
|
+
* * scope_mismatch: json The scope of the query and the index is not the same.
|
|
9529
|
+
* * sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the
|
|
9530
|
+
* index.
|
|
9531
|
+
* * too_many_fields: json The index has more fields than the chosen one.
|
|
9532
|
+
* * unfavored_type: any The type of the index is not preferred.
|
|
9533
|
+
*/
|
|
9534
|
+
name;
|
|
9535
|
+
static serialize(obj) {
|
|
9536
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9537
|
+
return obj;
|
|
9538
|
+
}
|
|
9539
|
+
let copy = {};
|
|
9540
|
+
if (obj.name !== undefined) {
|
|
9541
|
+
copy.name = obj.name;
|
|
9542
|
+
}
|
|
9543
|
+
return copy;
|
|
9544
|
+
}
|
|
9545
|
+
static deserialize(obj) {
|
|
9546
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9547
|
+
return obj;
|
|
9548
|
+
}
|
|
9549
|
+
let copy = {};
|
|
9550
|
+
if (obj.name !== undefined) {
|
|
9551
|
+
copy.name = obj.name;
|
|
9552
|
+
}
|
|
9553
|
+
return copy;
|
|
9554
|
+
}
|
|
9555
|
+
}
|
|
9556
|
+
CloudantV1.IndexAnalysisExclusionReason = IndexAnalysisExclusionReason;
|
|
9557
|
+
(function (IndexAnalysisExclusionReason) {
|
|
9558
|
+
let Constants;
|
|
9559
|
+
(function (Constants) {
|
|
9560
|
+
/** A reason code for index's exclusion. The full list of possible reason codes is following: * alphabetically_comes_after: json There is another suitable index whose name comes before that of this index. * empty_selector: text "text" indexes do not support queries with empty selectors. * excluded_by_user: any use_index was used to manually specify the index. * field_mismatch: any Fields in "selector" of the query do match with the fields available in the index. * is_partial: json, text Partial indexes can be selected only manually. * less_overlap: json There is a better match of fields available within the indexes for the query. * needs_text_search: json The use of the $text operator requires a "text" index. * scope_mismatch: json The scope of the query and the index is not the same. * sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the index. * too_many_fields: json The index has more fields than the chosen one. * unfavored_type: any The type of the index is not preferred. */
|
|
9561
|
+
let Name;
|
|
9562
|
+
(function (Name) {
|
|
9563
|
+
Name["ALPHABETICALLY_COMES_AFTER"] = "alphabetically_comes_after";
|
|
9564
|
+
Name["EMPTY_SELECTOR"] = "empty_selector";
|
|
9565
|
+
Name["EXCLUDED_BY_USER"] = "excluded_by_user";
|
|
9566
|
+
Name["FIELD_MISMATCH"] = "field_mismatch";
|
|
9567
|
+
Name["IS_PARTIAL"] = "is_partial";
|
|
9568
|
+
Name["LESS_OVERLAP"] = "less_overlap";
|
|
9569
|
+
Name["NEEDS_TEXT_SEARCH"] = "needs_text_search";
|
|
9570
|
+
Name["SCOPE_MISMATCH"] = "scope_mismatch";
|
|
9571
|
+
Name["SORT_ORDER_MISMATCH"] = "sort_order_mismatch";
|
|
9572
|
+
Name["TOO_MANY_FIELDS"] = "too_many_fields";
|
|
9573
|
+
Name["UNFAVORED_TYPE"] = "unfavored_type";
|
|
9574
|
+
})(Name = Constants.Name || (Constants.Name = {}));
|
|
9575
|
+
})(Constants = IndexAnalysisExclusionReason.Constants || (IndexAnalysisExclusionReason.Constants = {}));
|
|
9576
|
+
})(IndexAnalysisExclusionReason = CloudantV1.IndexAnalysisExclusionReason || (CloudantV1.IndexAnalysisExclusionReason = {}));
|
|
9577
|
+
/** Schema for an index that was not chosen for serving the query with the reason for the exclusion. */
|
|
9578
|
+
class IndexCandidate {
|
|
9579
|
+
/** Schema for detailed explanation of why the specific index was excluded by the query planner. */
|
|
9580
|
+
analysis;
|
|
9581
|
+
/** Schema for information about an index. */
|
|
9582
|
+
index;
|
|
9583
|
+
static serialize(obj) {
|
|
9584
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9585
|
+
return obj;
|
|
9586
|
+
}
|
|
9587
|
+
let copy = {};
|
|
9588
|
+
if (obj.analysis !== undefined) {
|
|
9589
|
+
copy.analysis = IndexAnalysis.serialize(obj.analysis);
|
|
9590
|
+
}
|
|
9591
|
+
if (obj.index !== undefined) {
|
|
9592
|
+
copy.index = IndexInformation.serialize(obj.index);
|
|
9593
|
+
}
|
|
9594
|
+
return copy;
|
|
9595
|
+
}
|
|
9596
|
+
static deserialize(obj) {
|
|
9597
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9598
|
+
return obj;
|
|
9599
|
+
}
|
|
9600
|
+
let copy = {};
|
|
9601
|
+
if (obj.analysis !== undefined) {
|
|
9602
|
+
copy.analysis = IndexAnalysis.deserialize(obj.analysis);
|
|
9603
|
+
}
|
|
9604
|
+
if (obj.index !== undefined) {
|
|
9605
|
+
copy.index = IndexInformation.deserialize(obj.index);
|
|
9606
|
+
}
|
|
9607
|
+
return copy;
|
|
9608
|
+
}
|
|
9609
|
+
}
|
|
9610
|
+
CloudantV1.IndexCandidate = IndexCandidate;
|
|
9413
9611
|
/** Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties that do not apply to `json` indexes, these are: * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all document fields and what analyzer to use for that purpose. */
|
|
9414
9612
|
class IndexDefinition {
|
|
9415
9613
|
/** Schema for a full text search analyzer. */
|
|
@@ -10269,7 +10467,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
10269
10467
|
_deleted;
|
|
10270
10468
|
/** Schema for a list of document revision identifiers. */
|
|
10271
10469
|
_deleted_conflicts;
|
|
10272
|
-
/**
|
|
10470
|
+
/** Schema for a document ID. */
|
|
10273
10471
|
_id;
|
|
10274
10472
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
10275
10473
|
_local_seq;
|
|
@@ -11668,6 +11866,59 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
11668
11866
|
}
|
|
11669
11867
|
}
|
|
11670
11868
|
CloudantV1.SecurityObject = SecurityObject;
|
|
11869
|
+
/** Schema for extra information on the selector. */
|
|
11870
|
+
class SelectorHint {
|
|
11871
|
+
/** A list of fields in the given selector that can be used to restrict the query. */
|
|
11872
|
+
indexableFields;
|
|
11873
|
+
/** A type of the index. */
|
|
11874
|
+
type;
|
|
11875
|
+
/** A list of fields in the given selector that can't be used to restrict the query. */
|
|
11876
|
+
unindexableFields;
|
|
11877
|
+
static serialize(obj) {
|
|
11878
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
11879
|
+
return obj;
|
|
11880
|
+
}
|
|
11881
|
+
let copy = {};
|
|
11882
|
+
if (obj.indexableFields !== undefined) {
|
|
11883
|
+
copy.indexable_fields = obj.indexableFields;
|
|
11884
|
+
}
|
|
11885
|
+
if (obj.type !== undefined) {
|
|
11886
|
+
copy.type = obj.type;
|
|
11887
|
+
}
|
|
11888
|
+
if (obj.unindexableFields !== undefined) {
|
|
11889
|
+
copy.unindexable_fields = obj.unindexableFields;
|
|
11890
|
+
}
|
|
11891
|
+
return copy;
|
|
11892
|
+
}
|
|
11893
|
+
static deserialize(obj) {
|
|
11894
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
11895
|
+
return obj;
|
|
11896
|
+
}
|
|
11897
|
+
let copy = {};
|
|
11898
|
+
if (obj.indexable_fields !== undefined) {
|
|
11899
|
+
copy.indexableFields = obj.indexable_fields;
|
|
11900
|
+
}
|
|
11901
|
+
if (obj.type !== undefined) {
|
|
11902
|
+
copy.type = obj.type;
|
|
11903
|
+
}
|
|
11904
|
+
if (obj.unindexable_fields !== undefined) {
|
|
11905
|
+
copy.unindexableFields = obj.unindexable_fields;
|
|
11906
|
+
}
|
|
11907
|
+
return copy;
|
|
11908
|
+
}
|
|
11909
|
+
}
|
|
11910
|
+
CloudantV1.SelectorHint = SelectorHint;
|
|
11911
|
+
(function (SelectorHint) {
|
|
11912
|
+
let Constants;
|
|
11913
|
+
(function (Constants) {
|
|
11914
|
+
/** A type of the index. */
|
|
11915
|
+
let Type;
|
|
11916
|
+
(function (Type) {
|
|
11917
|
+
Type["JSON"] = "json";
|
|
11918
|
+
Type["TEXT"] = "text";
|
|
11919
|
+
})(Type = Constants.Type || (Constants.Type = {}));
|
|
11920
|
+
})(Constants = SelectorHint.Constants || (SelectorHint.Constants = {}));
|
|
11921
|
+
})(SelectorHint = CloudantV1.SelectorHint || (CloudantV1.SelectorHint = {}));
|
|
11671
11922
|
/** Schema for information about the server instance. */
|
|
11672
11923
|
class ServerInformation {
|
|
11673
11924
|
/** Welcome message. */
|
|
@@ -12400,6 +12651,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12400
12651
|
error;
|
|
12401
12652
|
/** The reason the error occurred (if available). */
|
|
12402
12653
|
reason;
|
|
12654
|
+
/** An internal error reference (if available). */
|
|
12655
|
+
ref;
|
|
12403
12656
|
/** Schema for a document. */
|
|
12404
12657
|
doc;
|
|
12405
12658
|
/** Schema for a document ID. */
|
|
@@ -12422,6 +12675,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12422
12675
|
if (obj.reason !== undefined) {
|
|
12423
12676
|
copy.reason = obj.reason;
|
|
12424
12677
|
}
|
|
12678
|
+
if (obj.ref !== undefined) {
|
|
12679
|
+
copy.ref = obj.ref;
|
|
12680
|
+
}
|
|
12425
12681
|
if (obj.doc !== undefined) {
|
|
12426
12682
|
copy.doc = Document.serialize(obj.doc);
|
|
12427
12683
|
}
|
|
@@ -12450,6 +12706,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12450
12706
|
if (obj.reason !== undefined) {
|
|
12451
12707
|
copy.reason = obj.reason;
|
|
12452
12708
|
}
|
|
12709
|
+
if (obj.ref !== undefined) {
|
|
12710
|
+
copy.ref = obj.ref;
|
|
12711
|
+
}
|
|
12453
12712
|
if (obj.doc !== undefined) {
|
|
12454
12713
|
copy.doc = Document.deserialize(obj.doc);
|
|
12455
12714
|
}
|