@ibm-cloud/cloudant 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/cloudant/v1.d.ts +332 -153
- package/cloudant/v1.js +357 -88
- package/cloudant/v1.js.map +1 -1
- package/package.json +10 -10
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) {
|
|
@@ -7792,6 +7810,10 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
7792
7810
|
docDelCount;
|
|
7793
7811
|
/** The engine used for the database. */
|
|
7794
7812
|
engine;
|
|
7813
|
+
/** An opaque string to detect whether a database has been recreated. The field name is for compatibility with
|
|
7814
|
+
* old replicator versions. Do not use the value to infer timing infromation. Typically only used by replicators.
|
|
7815
|
+
*/
|
|
7816
|
+
instanceStartTime;
|
|
7795
7817
|
/** Schema for database properties. */
|
|
7796
7818
|
props;
|
|
7797
7819
|
/** Schema for size information of content. */
|
|
@@ -7836,6 +7858,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
7836
7858
|
if (obj.engine !== undefined) {
|
|
7837
7859
|
copy.engine = obj.engine;
|
|
7838
7860
|
}
|
|
7861
|
+
if (obj.instanceStartTime !== undefined) {
|
|
7862
|
+
copy.instance_start_time = obj.instanceStartTime;
|
|
7863
|
+
}
|
|
7839
7864
|
if (obj.props !== undefined) {
|
|
7840
7865
|
copy.props = DatabaseInformationProps.serialize(obj.props);
|
|
7841
7866
|
}
|
|
@@ -7885,6 +7910,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
7885
7910
|
if (obj.engine !== undefined) {
|
|
7886
7911
|
copy.engine = obj.engine;
|
|
7887
7912
|
}
|
|
7913
|
+
if (obj.instance_start_time !== undefined) {
|
|
7914
|
+
copy.instanceStartTime = obj.instance_start_time;
|
|
7915
|
+
}
|
|
7888
7916
|
if (obj.props !== undefined) {
|
|
7889
7917
|
copy.props = DatabaseInformationProps.deserialize(obj.props);
|
|
7890
7918
|
}
|
|
@@ -8122,7 +8150,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8122
8150
|
_deleted;
|
|
8123
8151
|
/** Schema for a list of document revision identifiers. */
|
|
8124
8152
|
_deleted_conflicts;
|
|
8125
|
-
/**
|
|
8153
|
+
/** Schema for a design document ID. */
|
|
8126
8154
|
_id;
|
|
8127
8155
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
8128
8156
|
_local_seq;
|
|
@@ -8564,6 +8592,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8564
8592
|
error;
|
|
8565
8593
|
/** The reason the error occurred (if available). */
|
|
8566
8594
|
reason;
|
|
8595
|
+
/** An internal error reference (if available). */
|
|
8596
|
+
ref;
|
|
8567
8597
|
/** Schema for a document. */
|
|
8568
8598
|
doc;
|
|
8569
8599
|
/** id. */
|
|
@@ -8586,6 +8616,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8586
8616
|
if (obj.reason !== undefined) {
|
|
8587
8617
|
copy.reason = obj.reason;
|
|
8588
8618
|
}
|
|
8619
|
+
if (obj.ref !== undefined) {
|
|
8620
|
+
copy.ref = obj.ref;
|
|
8621
|
+
}
|
|
8589
8622
|
if (obj.doc !== undefined) {
|
|
8590
8623
|
copy.doc = Document.serialize(obj.doc);
|
|
8591
8624
|
}
|
|
@@ -8614,6 +8647,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8614
8647
|
if (obj.reason !== undefined) {
|
|
8615
8648
|
copy.reason = obj.reason;
|
|
8616
8649
|
}
|
|
8650
|
+
if (obj.ref !== undefined) {
|
|
8651
|
+
copy.ref = obj.ref;
|
|
8652
|
+
}
|
|
8617
8653
|
if (obj.doc !== undefined) {
|
|
8618
8654
|
copy.doc = Document.deserialize(obj.doc);
|
|
8619
8655
|
}
|
|
@@ -8674,7 +8710,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8674
8710
|
_deleted;
|
|
8675
8711
|
/** Schema for a list of document revision identifiers. */
|
|
8676
8712
|
_deleted_conflicts;
|
|
8677
|
-
/**
|
|
8713
|
+
/** Schema for a document ID. */
|
|
8678
8714
|
_id;
|
|
8679
8715
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
8680
8716
|
_local_seq;
|
|
@@ -8800,6 +8836,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8800
8836
|
error;
|
|
8801
8837
|
/** The reason the error occurred (if available). */
|
|
8802
8838
|
reason;
|
|
8839
|
+
/** An internal error reference (if available). */
|
|
8840
|
+
ref;
|
|
8803
8841
|
static serialize(obj) {
|
|
8804
8842
|
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
8805
8843
|
return obj;
|
|
@@ -8823,6 +8861,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8823
8861
|
if (obj.reason !== undefined) {
|
|
8824
8862
|
copy.reason = obj.reason;
|
|
8825
8863
|
}
|
|
8864
|
+
if (obj.ref !== undefined) {
|
|
8865
|
+
copy.ref = obj.ref;
|
|
8866
|
+
}
|
|
8826
8867
|
return copy;
|
|
8827
8868
|
}
|
|
8828
8869
|
static deserialize(obj) {
|
|
@@ -8848,6 +8889,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
8848
8889
|
if (obj.reason !== undefined) {
|
|
8849
8890
|
copy.reason = obj.reason;
|
|
8850
8891
|
}
|
|
8892
|
+
if (obj.ref !== undefined) {
|
|
8893
|
+
copy.ref = obj.ref;
|
|
8894
|
+
}
|
|
8851
8895
|
return copy;
|
|
8852
8896
|
}
|
|
8853
8897
|
}
|
|
@@ -9004,6 +9048,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9004
9048
|
fields;
|
|
9005
9049
|
/** Schema for information about an index. */
|
|
9006
9050
|
index;
|
|
9051
|
+
/** Schema for the list of all the other indexes that were not chosen for serving the query. */
|
|
9052
|
+
indexCandidates;
|
|
9007
9053
|
/** The used maximum number of results returned. */
|
|
9008
9054
|
limit;
|
|
9009
9055
|
/** Arguments passed to the underlying view. */
|
|
@@ -9041,6 +9087,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9041
9087
|
* [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
|
|
9042
9088
|
*/
|
|
9043
9089
|
selector;
|
|
9090
|
+
/** Schema for a list of objects with extra information on the selector to provide insights about its usability. */
|
|
9091
|
+
selectorHints;
|
|
9044
9092
|
/** Skip parameter used. */
|
|
9045
9093
|
skip;
|
|
9046
9094
|
static serialize(obj) {
|
|
@@ -9060,6 +9108,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9060
9108
|
if (obj.index !== undefined) {
|
|
9061
9109
|
copy.index = IndexInformation.serialize(obj.index);
|
|
9062
9110
|
}
|
|
9111
|
+
if (obj.indexCandidates !== undefined) {
|
|
9112
|
+
copy.index_candidates = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.indexCandidates, IndexCandidate.serialize);
|
|
9113
|
+
}
|
|
9063
9114
|
if (obj.limit !== undefined) {
|
|
9064
9115
|
copy.limit = obj.limit;
|
|
9065
9116
|
}
|
|
@@ -9075,6 +9126,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9075
9126
|
if (obj.selector !== undefined) {
|
|
9076
9127
|
copy.selector = obj.selector;
|
|
9077
9128
|
}
|
|
9129
|
+
if (obj.selectorHints !== undefined) {
|
|
9130
|
+
copy.selector_hints = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.selectorHints, SelectorHint.serialize);
|
|
9131
|
+
}
|
|
9078
9132
|
if (obj.skip !== undefined) {
|
|
9079
9133
|
copy.skip = obj.skip;
|
|
9080
9134
|
}
|
|
@@ -9097,6 +9151,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9097
9151
|
if (obj.index !== undefined) {
|
|
9098
9152
|
copy.index = IndexInformation.deserialize(obj.index);
|
|
9099
9153
|
}
|
|
9154
|
+
if (obj.index_candidates !== undefined) {
|
|
9155
|
+
copy.indexCandidates = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.index_candidates, IndexCandidate.deserialize);
|
|
9156
|
+
}
|
|
9100
9157
|
if (obj.limit !== undefined) {
|
|
9101
9158
|
copy.limit = obj.limit;
|
|
9102
9159
|
}
|
|
@@ -9112,6 +9169,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9112
9169
|
if (obj.selector !== undefined) {
|
|
9113
9170
|
copy.selector = obj.selector;
|
|
9114
9171
|
}
|
|
9172
|
+
if (obj.selector_hints !== undefined) {
|
|
9173
|
+
copy.selectorHints = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.selector_hints, SelectorHint.deserialize);
|
|
9174
|
+
}
|
|
9115
9175
|
if (obj.skip !== undefined) {
|
|
9116
9176
|
copy.skip = obj.skip;
|
|
9117
9177
|
}
|
|
@@ -9410,6 +9470,154 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
9410
9470
|
}
|
|
9411
9471
|
}
|
|
9412
9472
|
CloudantV1.FindResult = FindResult;
|
|
9473
|
+
/** Schema for detailed explanation of why the specific index was excluded by the query planner. */
|
|
9474
|
+
class IndexAnalysis {
|
|
9475
|
+
/** When `true`, the query is answered using the index only and no documents are fetched. */
|
|
9476
|
+
covering;
|
|
9477
|
+
/** A position of the unused index based on its potential relevance to the query. */
|
|
9478
|
+
ranking;
|
|
9479
|
+
/** A list of reasons explaining why index was not chosen for the query. */
|
|
9480
|
+
reasons;
|
|
9481
|
+
/** Indicates whether an index can still be used for the query. */
|
|
9482
|
+
usable;
|
|
9483
|
+
static serialize(obj) {
|
|
9484
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9485
|
+
return obj;
|
|
9486
|
+
}
|
|
9487
|
+
let copy = {};
|
|
9488
|
+
if (obj.covering !== undefined) {
|
|
9489
|
+
copy.covering = obj.covering;
|
|
9490
|
+
}
|
|
9491
|
+
if (obj.ranking !== undefined) {
|
|
9492
|
+
copy.ranking = obj.ranking;
|
|
9493
|
+
}
|
|
9494
|
+
if (obj.reasons !== undefined) {
|
|
9495
|
+
copy.reasons = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.reasons, IndexAnalysisExclusionReason.serialize);
|
|
9496
|
+
}
|
|
9497
|
+
if (obj.usable !== undefined) {
|
|
9498
|
+
copy.usable = obj.usable;
|
|
9499
|
+
}
|
|
9500
|
+
return copy;
|
|
9501
|
+
}
|
|
9502
|
+
static deserialize(obj) {
|
|
9503
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9504
|
+
return obj;
|
|
9505
|
+
}
|
|
9506
|
+
let copy = {};
|
|
9507
|
+
if (obj.covering !== undefined) {
|
|
9508
|
+
copy.covering = obj.covering;
|
|
9509
|
+
}
|
|
9510
|
+
if (obj.ranking !== undefined) {
|
|
9511
|
+
copy.ranking = obj.ranking;
|
|
9512
|
+
}
|
|
9513
|
+
if (obj.reasons !== undefined) {
|
|
9514
|
+
copy.reasons = ibm_cloud_sdk_core_1.BaseService.convertModel(obj.reasons, IndexAnalysisExclusionReason.deserialize);
|
|
9515
|
+
}
|
|
9516
|
+
if (obj.usable !== undefined) {
|
|
9517
|
+
copy.usable = obj.usable;
|
|
9518
|
+
}
|
|
9519
|
+
return copy;
|
|
9520
|
+
}
|
|
9521
|
+
}
|
|
9522
|
+
CloudantV1.IndexAnalysis = IndexAnalysis;
|
|
9523
|
+
/** A reason for index's exclusion. */
|
|
9524
|
+
class IndexAnalysisExclusionReason {
|
|
9525
|
+
/** A reason code for index's exclusion.
|
|
9526
|
+
*
|
|
9527
|
+
* The full list of possible reason codes is following:
|
|
9528
|
+
*
|
|
9529
|
+
* * alphabetically_comes_after: json
|
|
9530
|
+
* There is another suitable index whose name comes before that of this index.
|
|
9531
|
+
* * empty_selector: text
|
|
9532
|
+
* "text" indexes do not support queries with empty selectors.
|
|
9533
|
+
* * excluded_by_user: any use_index was used to manually specify the index.
|
|
9534
|
+
* * field_mismatch: any Fields in "selector" of the query do match with the fields available in the index.
|
|
9535
|
+
* * is_partial: json, text Partial indexes can be selected only manually.
|
|
9536
|
+
* * less_overlap: json There is a better match of fields available within the indexes for the query.
|
|
9537
|
+
* * needs_text_search: json The use of the $text operator requires a "text" index.
|
|
9538
|
+
* * scope_mismatch: json The scope of the query and the index is not the same.
|
|
9539
|
+
* * sort_order_mismatch: json, special Fields in "sort" of the query do not match with the fields available in the
|
|
9540
|
+
* index.
|
|
9541
|
+
* * too_many_fields: json The index has more fields than the chosen one.
|
|
9542
|
+
* * unfavored_type: any The type of the index is not preferred.
|
|
9543
|
+
*/
|
|
9544
|
+
name;
|
|
9545
|
+
static serialize(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
|
+
static deserialize(obj) {
|
|
9556
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9557
|
+
return obj;
|
|
9558
|
+
}
|
|
9559
|
+
let copy = {};
|
|
9560
|
+
if (obj.name !== undefined) {
|
|
9561
|
+
copy.name = obj.name;
|
|
9562
|
+
}
|
|
9563
|
+
return copy;
|
|
9564
|
+
}
|
|
9565
|
+
}
|
|
9566
|
+
CloudantV1.IndexAnalysisExclusionReason = IndexAnalysisExclusionReason;
|
|
9567
|
+
(function (IndexAnalysisExclusionReason) {
|
|
9568
|
+
let Constants;
|
|
9569
|
+
(function (Constants) {
|
|
9570
|
+
/** 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. */
|
|
9571
|
+
let Name;
|
|
9572
|
+
(function (Name) {
|
|
9573
|
+
Name["ALPHABETICALLY_COMES_AFTER"] = "alphabetically_comes_after";
|
|
9574
|
+
Name["EMPTY_SELECTOR"] = "empty_selector";
|
|
9575
|
+
Name["EXCLUDED_BY_USER"] = "excluded_by_user";
|
|
9576
|
+
Name["FIELD_MISMATCH"] = "field_mismatch";
|
|
9577
|
+
Name["IS_PARTIAL"] = "is_partial";
|
|
9578
|
+
Name["LESS_OVERLAP"] = "less_overlap";
|
|
9579
|
+
Name["NEEDS_TEXT_SEARCH"] = "needs_text_search";
|
|
9580
|
+
Name["SCOPE_MISMATCH"] = "scope_mismatch";
|
|
9581
|
+
Name["SORT_ORDER_MISMATCH"] = "sort_order_mismatch";
|
|
9582
|
+
Name["TOO_MANY_FIELDS"] = "too_many_fields";
|
|
9583
|
+
Name["UNFAVORED_TYPE"] = "unfavored_type";
|
|
9584
|
+
})(Name = Constants.Name || (Constants.Name = {}));
|
|
9585
|
+
})(Constants = IndexAnalysisExclusionReason.Constants || (IndexAnalysisExclusionReason.Constants = {}));
|
|
9586
|
+
})(IndexAnalysisExclusionReason = CloudantV1.IndexAnalysisExclusionReason || (CloudantV1.IndexAnalysisExclusionReason = {}));
|
|
9587
|
+
/** Schema for an index that was not chosen for serving the query with the reason for the exclusion. */
|
|
9588
|
+
class IndexCandidate {
|
|
9589
|
+
/** Schema for detailed explanation of why the specific index was excluded by the query planner. */
|
|
9590
|
+
analysis;
|
|
9591
|
+
/** Schema for information about an index. */
|
|
9592
|
+
index;
|
|
9593
|
+
static serialize(obj) {
|
|
9594
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9595
|
+
return obj;
|
|
9596
|
+
}
|
|
9597
|
+
let copy = {};
|
|
9598
|
+
if (obj.analysis !== undefined) {
|
|
9599
|
+
copy.analysis = IndexAnalysis.serialize(obj.analysis);
|
|
9600
|
+
}
|
|
9601
|
+
if (obj.index !== undefined) {
|
|
9602
|
+
copy.index = IndexInformation.serialize(obj.index);
|
|
9603
|
+
}
|
|
9604
|
+
return copy;
|
|
9605
|
+
}
|
|
9606
|
+
static deserialize(obj) {
|
|
9607
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
9608
|
+
return obj;
|
|
9609
|
+
}
|
|
9610
|
+
let copy = {};
|
|
9611
|
+
if (obj.analysis !== undefined) {
|
|
9612
|
+
copy.analysis = IndexAnalysis.deserialize(obj.analysis);
|
|
9613
|
+
}
|
|
9614
|
+
if (obj.index !== undefined) {
|
|
9615
|
+
copy.index = IndexInformation.deserialize(obj.index);
|
|
9616
|
+
}
|
|
9617
|
+
return copy;
|
|
9618
|
+
}
|
|
9619
|
+
}
|
|
9620
|
+
CloudantV1.IndexCandidate = IndexCandidate;
|
|
9413
9621
|
/** 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
9622
|
class IndexDefinition {
|
|
9415
9623
|
/** Schema for a full text search analyzer. */
|
|
@@ -10269,7 +10477,7 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
10269
10477
|
_deleted;
|
|
10270
10478
|
/** Schema for a list of document revision identifiers. */
|
|
10271
10479
|
_deleted_conflicts;
|
|
10272
|
-
/**
|
|
10480
|
+
/** Schema for a document ID. */
|
|
10273
10481
|
_id;
|
|
10274
10482
|
/** Document's update sequence in current database. Available if requested with local_seq=true query parameter. */
|
|
10275
10483
|
_local_seq;
|
|
@@ -11668,6 +11876,59 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
11668
11876
|
}
|
|
11669
11877
|
}
|
|
11670
11878
|
CloudantV1.SecurityObject = SecurityObject;
|
|
11879
|
+
/** Schema for extra information on the selector. */
|
|
11880
|
+
class SelectorHint {
|
|
11881
|
+
/** A list of fields in the given selector that can be used to restrict the query. */
|
|
11882
|
+
indexableFields;
|
|
11883
|
+
/** A type of the index. */
|
|
11884
|
+
type;
|
|
11885
|
+
/** A list of fields in the given selector that can't be used to restrict the query. */
|
|
11886
|
+
unindexableFields;
|
|
11887
|
+
static serialize(obj) {
|
|
11888
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
11889
|
+
return obj;
|
|
11890
|
+
}
|
|
11891
|
+
let copy = {};
|
|
11892
|
+
if (obj.indexableFields !== undefined) {
|
|
11893
|
+
copy.indexable_fields = obj.indexableFields;
|
|
11894
|
+
}
|
|
11895
|
+
if (obj.type !== undefined) {
|
|
11896
|
+
copy.type = obj.type;
|
|
11897
|
+
}
|
|
11898
|
+
if (obj.unindexableFields !== undefined) {
|
|
11899
|
+
copy.unindexable_fields = obj.unindexableFields;
|
|
11900
|
+
}
|
|
11901
|
+
return copy;
|
|
11902
|
+
}
|
|
11903
|
+
static deserialize(obj) {
|
|
11904
|
+
if (obj === undefined || obj === null || typeof obj === 'string') {
|
|
11905
|
+
return obj;
|
|
11906
|
+
}
|
|
11907
|
+
let copy = {};
|
|
11908
|
+
if (obj.indexable_fields !== undefined) {
|
|
11909
|
+
copy.indexableFields = obj.indexable_fields;
|
|
11910
|
+
}
|
|
11911
|
+
if (obj.type !== undefined) {
|
|
11912
|
+
copy.type = obj.type;
|
|
11913
|
+
}
|
|
11914
|
+
if (obj.unindexable_fields !== undefined) {
|
|
11915
|
+
copy.unindexableFields = obj.unindexable_fields;
|
|
11916
|
+
}
|
|
11917
|
+
return copy;
|
|
11918
|
+
}
|
|
11919
|
+
}
|
|
11920
|
+
CloudantV1.SelectorHint = SelectorHint;
|
|
11921
|
+
(function (SelectorHint) {
|
|
11922
|
+
let Constants;
|
|
11923
|
+
(function (Constants) {
|
|
11924
|
+
/** A type of the index. */
|
|
11925
|
+
let Type;
|
|
11926
|
+
(function (Type) {
|
|
11927
|
+
Type["JSON"] = "json";
|
|
11928
|
+
Type["TEXT"] = "text";
|
|
11929
|
+
})(Type = Constants.Type || (Constants.Type = {}));
|
|
11930
|
+
})(Constants = SelectorHint.Constants || (SelectorHint.Constants = {}));
|
|
11931
|
+
})(SelectorHint = CloudantV1.SelectorHint || (CloudantV1.SelectorHint = {}));
|
|
11671
11932
|
/** Schema for information about the server instance. */
|
|
11672
11933
|
class ServerInformation {
|
|
11673
11934
|
/** Welcome message. */
|
|
@@ -12400,6 +12661,8 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12400
12661
|
error;
|
|
12401
12662
|
/** The reason the error occurred (if available). */
|
|
12402
12663
|
reason;
|
|
12664
|
+
/** An internal error reference (if available). */
|
|
12665
|
+
ref;
|
|
12403
12666
|
/** Schema for a document. */
|
|
12404
12667
|
doc;
|
|
12405
12668
|
/** Schema for a document ID. */
|
|
@@ -12422,6 +12685,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12422
12685
|
if (obj.reason !== undefined) {
|
|
12423
12686
|
copy.reason = obj.reason;
|
|
12424
12687
|
}
|
|
12688
|
+
if (obj.ref !== undefined) {
|
|
12689
|
+
copy.ref = obj.ref;
|
|
12690
|
+
}
|
|
12425
12691
|
if (obj.doc !== undefined) {
|
|
12426
12692
|
copy.doc = Document.serialize(obj.doc);
|
|
12427
12693
|
}
|
|
@@ -12450,6 +12716,9 @@ class CloudantV1 extends cloudantBaseService_1.default {
|
|
|
12450
12716
|
if (obj.reason !== undefined) {
|
|
12451
12717
|
copy.reason = obj.reason;
|
|
12452
12718
|
}
|
|
12719
|
+
if (obj.ref !== undefined) {
|
|
12720
|
+
copy.ref = obj.ref;
|
|
12721
|
+
}
|
|
12453
12722
|
if (obj.doc !== undefined) {
|
|
12454
12723
|
copy.doc = Document.deserialize(obj.doc);
|
|
12455
12724
|
}
|