@ibm-cloud/cloudant 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cloudant/v1.js CHANGED
@@ -290,16 +290,26 @@ var CloudantV1 = /** @class */ (function (_super) {
290
290
  /**
291
291
  * Retrieve change events for all databases.
292
292
  *
293
+ * **This endpoint is not available in IBM Cloudant.**
294
+ *
293
295
  * Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating
294
296
  * or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order
295
297
  * and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
296
- * **Note: This endpoint requires _admin or _db_updates role and is only available on dedicated clusters.**.
297
298
  *
298
299
  * @param {Object} [params] - The parameters to send to the service.
299
300
  * @param {string} [params.feed] - Query parameter to specify the changes feed type.
300
301
  * @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
301
- * line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
302
- * to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
302
+ * line is sent in the results. Off by default and only applicable for
303
+ * `continuous` and `eventsource` feeds. Overrides any timeout to keep the feed alive indefinitely. May also be `true`
304
+ * to use a value of `60000`.
305
+ *
306
+ * **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
307
+ * environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism.
308
+ * Instead, consider one of the following options:
309
+ * * Use the `timeout` parameter with a value that is compatible with your network environment.
310
+ * * Switch to scheduled usage of one of the non-continuous changes feed types
311
+ * (`normal` or `longpoll`).
312
+ * * Use TCP keepalive.
303
313
  * @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
304
314
  * change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
305
315
  * feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
@@ -308,8 +318,10 @@ var CloudantV1 = /** @class */ (function (_super) {
308
318
  * the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
309
319
  * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
310
320
  * @returns {Promise<CloudantV1.Response<CloudantV1.DbUpdates>>}
321
+ * @deprecated this method is deprecated and may be removed in a future release
311
322
  */
312
323
  CloudantV1.prototype.getDbUpdates = function (params) {
324
+ CloudantV1._logger.warn('A deprecated operation has been invoked: getDbUpdates');
313
325
  var _params = __assign({}, params);
314
326
  var _requiredParams = [];
315
327
  var _validParams = ['feed', 'heartbeat', 'timeout', 'since', 'headers'];
@@ -354,7 +366,7 @@ var CloudantV1 = /** @class */ (function (_super) {
354
366
  * @param {string} params.db - Path parameter to specify the database name.
355
367
  * @param {string[]} [params.docIds] - Schema for a list of document IDs.
356
368
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
357
- * fields of a document must be returned. If it is omitted, the entire document is returned.
369
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
358
370
  * @param {JsonObject} [params.selector] - JSON object describing criteria used to select documents. The selector
359
371
  * specifies fields in the document, and provides an expression to evaluate with the field content or other data.
360
372
  *
@@ -371,18 +383,17 @@ var CloudantV1 = /** @class */ (function (_super) {
371
383
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
372
384
  *
373
385
  * There are two core types of operators in the selector syntax:
374
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
375
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
376
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
377
- * selector, or an array of selectors.
386
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
387
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
378
388
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
379
389
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
380
- * argument.
390
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
391
+ * available combination and conditional operators.
381
392
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
382
393
  * of a query. You should include at least one of these in a selector.
383
394
  *
384
395
  * For further reference see
385
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
396
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
386
397
  * @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
387
398
  * on a previous connection. Overrides `since` query parameter.
388
399
  * @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
@@ -408,8 +419,17 @@ var CloudantV1 = /** @class */ (function (_super) {
408
419
  * * `_view` - Returns changes for documents that match an existing map
409
420
  * function in the view specified by the query parameter `view`.
410
421
  * @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
411
- * line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
412
- * to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
422
+ * line is sent in the results. Off by default and only applicable for
423
+ * `continuous` and `eventsource` feeds. Overrides any timeout to keep the feed alive indefinitely. May also be `true`
424
+ * to use a value of `60000`.
425
+ *
426
+ * **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
427
+ * environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism.
428
+ * Instead, consider one of the following options:
429
+ * * Use the `timeout` parameter with a value that is compatible with your network environment.
430
+ * * Switch to scheduled usage of one of the non-continuous changes feed types
431
+ * (`normal` or `longpoll`).
432
+ * * Use TCP keepalive.
413
433
  * @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
414
434
  * documents in the response.
415
435
  * @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
@@ -500,7 +520,7 @@ var CloudantV1 = /** @class */ (function (_super) {
500
520
  * @param {string} params.db - Path parameter to specify the database name.
501
521
  * @param {string[]} [params.docIds] - Schema for a list of document IDs.
502
522
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
503
- * fields of a document must be returned. If it is omitted, the entire document is returned.
523
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
504
524
  * @param {JsonObject} [params.selector] - JSON object describing criteria used to select documents. The selector
505
525
  * specifies fields in the document, and provides an expression to evaluate with the field content or other data.
506
526
  *
@@ -517,18 +537,17 @@ var CloudantV1 = /** @class */ (function (_super) {
517
537
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
518
538
  *
519
539
  * There are two core types of operators in the selector syntax:
520
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
521
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
522
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
523
- * selector, or an array of selectors.
540
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
541
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
524
542
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
525
543
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
526
- * argument.
544
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
545
+ * available combination and conditional operators.
527
546
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
528
547
  * of a query. You should include at least one of these in a selector.
529
548
  *
530
549
  * For further reference see
531
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
550
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
532
551
  * @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
533
552
  * on a previous connection. Overrides `since` query parameter.
534
553
  * @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
@@ -554,8 +573,17 @@ var CloudantV1 = /** @class */ (function (_super) {
554
573
  * * `_view` - Returns changes for documents that match an existing map
555
574
  * function in the view specified by the query parameter `view`.
556
575
  * @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
557
- * line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
558
- * to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
576
+ * line is sent in the results. Off by default and only applicable for
577
+ * `continuous` and `eventsource` feeds. Overrides any timeout to keep the feed alive indefinitely. May also be `true`
578
+ * to use a value of `60000`.
579
+ *
580
+ * **Note:** Delivery of heartbeats cannot be relied on at specific intervals. If your application runs in an
581
+ * environment where idle network connections may break, `heartbeat` is not suitable as a keepalive mechanism.
582
+ * Instead, consider one of the following options:
583
+ * * Use the `timeout` parameter with a value that is compatible with your network environment.
584
+ * * Switch to scheduled usage of one of the non-continuous changes feed types
585
+ * (`normal` or `longpoll`).
586
+ * * Use TCP keepalive.
559
587
  * @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
560
588
  * documents in the response.
561
589
  * @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
@@ -3209,6 +3237,113 @@ var CloudantV1 = /** @class */ (function (_super) {
3209
3237
  };
3210
3238
  return this.createRequest(parameters);
3211
3239
  };
3240
+ /**
3241
+ * Retrieve information about which partition index is used for a query.
3242
+ *
3243
+ * Shows which index is being used by the query. Parameters are the same as the
3244
+ * [`/{db}/_partition/{partition_key}/_find` endpoint](#postpartitionfind-queries).
3245
+ *
3246
+ * @param {Object} params - The parameters to send to the service.
3247
+ * @param {string} params.db - Path parameter to specify the database name.
3248
+ * @param {string} params.partitionKey - Path parameter to specify the database partition key.
3249
+ * @param {JsonObject} params.selector - JSON object describing criteria used to select documents. The selector
3250
+ * specifies fields in the document, and provides an expression to evaluate with the field content or other data.
3251
+ *
3252
+ * The selector object must:
3253
+ * * Be structured as valid JSON.
3254
+ * * Contain a valid query expression.
3255
+ *
3256
+ * Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
3257
+ * option if filtering on document attributes only.
3258
+ *
3259
+ * Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
3260
+ * those fields. You can create more complex selector expressions by combining operators.
3261
+ *
3262
+ * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3263
+ *
3264
+ * There are two core types of operators in the selector syntax:
3265
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3266
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3267
+ * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3268
+ * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3269
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3270
+ * available combination and conditional operators.
3271
+ * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3272
+ * of a query. You should include at least one of these in a selector.
3273
+ *
3274
+ * For further reference see
3275
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3276
+ * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3277
+ * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3278
+ * existing conflicts in the document.
3279
+ * @param {boolean} [params.executionStats] - Use this option to find information about the query that was run. This
3280
+ * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3281
+ * document lookups (when each document replica is fetched).
3282
+ * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3283
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3284
+ * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3285
+ * results when queried.
3286
+ * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
3287
+ * @param {JsonObject[]} [params.sort] - The sort field contains a list of pairs, each mapping a field name to a sort
3288
+ * direction (asc or desc). The first field name and direction pair is the topmost level of sort. The second pair, if
3289
+ * provided, is the next level of sort. The field can be any field, using dotted notation if desired for sub-document
3290
+ * fields.
3291
+ *
3292
+ * For example in JSON: `[{"fieldName1": "desc"}, {"fieldName2.subFieldName1": "desc"}]`
3293
+ *
3294
+ * When sorting with multiple fields, ensure that there is an index already defined with all the sort fields in the
3295
+ * same order and each object in the sort array has a single key or at least one of the sort fields is included in the
3296
+ * selector. All sorting fields must use the same sort direction, either all ascending or all descending.
3297
+ * @param {boolean} [params.stable] - Whether or not the view results should be returned from a "stable" set of
3298
+ * shards.
3299
+ * @param {string} [params.update] - Whether to update the index prior to returning the result.
3300
+ * @param {string[]} [params.useIndex] - Use this option to identify a specific index for query to run against, rather
3301
+ * than by using the IBM Cloudant Query algorithm to find the best index.
3302
+ * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
3303
+ * @returns {Promise<CloudantV1.Response<CloudantV1.ExplainResult>>}
3304
+ */
3305
+ CloudantV1.prototype.postPartitionExplain = function (params) {
3306
+ var _params = __assign({}, params);
3307
+ var _requiredParams = ['db', 'partitionKey', 'selector'];
3308
+ var _validParams = ['db', 'partitionKey', 'selector', 'bookmark', 'conflicts', 'executionStats', 'fields', 'limit', 'skip', 'sort', 'stable', 'update', 'useIndex', 'headers'];
3309
+ var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
3310
+ if (_validationErrors) {
3311
+ return Promise.reject(_validationErrors);
3312
+ }
3313
+ var body = {
3314
+ 'selector': _params.selector,
3315
+ 'bookmark': _params.bookmark,
3316
+ 'conflicts': _params.conflicts,
3317
+ 'execution_stats': _params.executionStats,
3318
+ 'fields': _params.fields,
3319
+ 'limit': _params.limit,
3320
+ 'skip': _params.skip,
3321
+ 'sort': _params.sort,
3322
+ 'stable': _params.stable,
3323
+ 'update': _params.update,
3324
+ 'use_index': _params.useIndex,
3325
+ };
3326
+ var path = {
3327
+ 'db': _params.db,
3328
+ 'partition_key': _params.partitionKey,
3329
+ };
3330
+ var sdkHeaders = (0, common_1.getSdkHeaders)(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postPartitionExplain');
3331
+ var parameters = {
3332
+ options: {
3333
+ url: '/{db}/_partition/{partition_key}/_explain',
3334
+ method: 'POST',
3335
+ body: body,
3336
+ path: path,
3337
+ },
3338
+ defaultOptions: extend(true, {}, this.baseOptions, {
3339
+ headers: extend(true, sdkHeaders, {
3340
+ 'Accept': 'application/json',
3341
+ 'Content-Type': 'application/json',
3342
+ }, _params.headers),
3343
+ }),
3344
+ };
3345
+ return this.createRequest(parameters);
3346
+ };
3212
3347
  /**
3213
3348
  * Query a database partition index by using selector syntax.
3214
3349
  *
@@ -3238,18 +3373,17 @@ var CloudantV1 = /** @class */ (function (_super) {
3238
3373
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3239
3374
  *
3240
3375
  * There are two core types of operators in the selector syntax:
3241
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
3242
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
3243
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
3244
- * selector, or an array of selectors.
3376
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3377
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3245
3378
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3246
3379
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3247
- * argument.
3380
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3381
+ * available combination and conditional operators.
3248
3382
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3249
3383
  * of a query. You should include at least one of these in a selector.
3250
3384
  *
3251
3385
  * For further reference see
3252
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
3386
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3253
3387
  * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3254
3388
  * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3255
3389
  * existing conflicts in the document.
@@ -3257,7 +3391,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3257
3391
  * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3258
3392
  * document lookups (when each document replica is fetched).
3259
3393
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3260
- * fields of a document must be returned. If it is omitted, the entire document is returned.
3394
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3261
3395
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3262
3396
  * results when queried.
3263
3397
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
@@ -3350,18 +3484,17 @@ var CloudantV1 = /** @class */ (function (_super) {
3350
3484
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3351
3485
  *
3352
3486
  * There are two core types of operators in the selector syntax:
3353
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
3354
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
3355
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
3356
- * selector, or an array of selectors.
3487
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3488
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3357
3489
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3358
3490
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3359
- * argument.
3491
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3492
+ * available combination and conditional operators.
3360
3493
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3361
3494
  * of a query. You should include at least one of these in a selector.
3362
3495
  *
3363
3496
  * For further reference see
3364
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
3497
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3365
3498
  * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3366
3499
  * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3367
3500
  * existing conflicts in the document.
@@ -3369,7 +3502,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3369
3502
  * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3370
3503
  * document lookups (when each document replica is fetched).
3371
3504
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3372
- * fields of a document must be returned. If it is omitted, the entire document is returned.
3505
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3373
3506
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3374
3507
  * results when queried.
3375
3508
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
@@ -3440,8 +3573,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3440
3573
  /**
3441
3574
  * Retrieve information about which index is used for a query.
3442
3575
  *
3443
- * Shows which index is being used by the query. Parameters are the same as the [`_find`
3444
- * endpoint](#query-an-index-by-using-selector-syntax).
3576
+ * Shows which index is being used by the query. Parameters are the same as the [`_find` endpoint](#postfind).
3445
3577
  *
3446
3578
  * @param {Object} params - The parameters to send to the service.
3447
3579
  * @param {string} params.db - Path parameter to specify the database name.
@@ -3461,18 +3593,17 @@ var CloudantV1 = /** @class */ (function (_super) {
3461
3593
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3462
3594
  *
3463
3595
  * There are two core types of operators in the selector syntax:
3464
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
3465
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
3466
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
3467
- * selector, or an array of selectors.
3596
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3597
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3468
3598
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3469
3599
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3470
- * argument.
3600
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3601
+ * available combination and conditional operators.
3471
3602
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3472
3603
  * of a query. You should include at least one of these in a selector.
3473
3604
  *
3474
3605
  * For further reference see
3475
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
3606
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3476
3607
  * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3477
3608
  * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3478
3609
  * existing conflicts in the document.
@@ -3480,7 +3611,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3480
3611
  * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3481
3612
  * document lookups (when each document replica is fetched).
3482
3613
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3483
- * fields of a document must be returned. If it is omitted, the entire document is returned.
3614
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3484
3615
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3485
3616
  * results when queried.
3486
3617
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
@@ -3576,18 +3707,17 @@ var CloudantV1 = /** @class */ (function (_super) {
3576
3707
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3577
3708
  *
3578
3709
  * There are two core types of operators in the selector syntax:
3579
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
3580
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
3581
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
3582
- * selector, or an array of selectors.
3710
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3711
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3583
3712
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3584
3713
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3585
- * argument.
3714
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3715
+ * available combination and conditional operators.
3586
3716
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3587
3717
  * of a query. You should include at least one of these in a selector.
3588
3718
  *
3589
3719
  * For further reference see
3590
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
3720
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3591
3721
  * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3592
3722
  * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3593
3723
  * existing conflicts in the document.
@@ -3595,7 +3725,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3595
3725
  * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3596
3726
  * document lookups (when each document replica is fetched).
3597
3727
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3598
- * fields of a document must be returned. If it is omitted, the entire document is returned.
3728
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3599
3729
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3600
3730
  * results when queried.
3601
3731
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
@@ -3691,18 +3821,17 @@ var CloudantV1 = /** @class */ (function (_super) {
3691
3821
  * Operators are identified by the use of a dollar sign `$` prefix in the name field.
3692
3822
  *
3693
3823
  * There are two core types of operators in the selector syntax:
3694
- * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
3695
- * to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
3696
- * `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
3697
- * selector, or an array of selectors.
3824
+ * * Combination operators: applied at the topmost level of selection. They are used to combine selectors. A
3825
+ * combination operator takes a single argument. The argument is either another selector, or an array of selectors.
3698
3826
  * * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
3699
3827
  * instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
3700
- * argument.
3828
+ * argument. See [the Cloudant Docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-operators) for a list of all
3829
+ * available combination and conditional operators.
3701
3830
  * * Only equality operators such as `$eq`, `$gt`, `$gte`, `$lt`, and `$lte` (but not `$ne`) can be used as the basis
3702
3831
  * of a query. You should include at least one of these in a selector.
3703
3832
  *
3704
3833
  * For further reference see
3705
- * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-query#selector-syntax).
3834
+ * [selector syntax](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-selector-syntax).
3706
3835
  * @param {string} [params.bookmark] - Opaque bookmark token used when paginating results.
3707
3836
  * @param {boolean} [params.conflicts] - A boolean value that indicates whether or not to include information about
3708
3837
  * existing conflicts in the document.
@@ -3710,7 +3839,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3710
3839
  * information includes total key lookups, total document lookups (when `include_docs=true` is used), and total quorum
3711
3840
  * document lookups (when each document replica is fetched).
3712
3841
  * @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
3713
- * fields of a document must be returned. If it is omitted, the entire document is returned.
3842
+ * fields of a document must be returned. If it is omitted or empty, the entire document is returned.
3714
3843
  * @param {number} [params.limit] - Maximum number of results returned. The `type: text` indexes are limited to 200
3715
3844
  * results when queried.
3716
3845
  * @param {number} [params.skip] - Skip the first 'n' results, where 'n' is the value that is specified.
@@ -3828,11 +3957,8 @@ var CloudantV1 = /** @class */ (function (_super) {
3828
3957
  * `text` have additional configuration properties that do not apply to `json` indexes, these are:
3829
3958
  * * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all
3830
3959
  * document fields and what analyzer to use for that purpose.
3831
- * @param {string} [params.ddoc] - Name of the design document in which the index will be created.
3832
- * @param {IndexDefinition} [params.def] - Schema for a `json` or `text` query index definition. Indexes of type
3833
- * `text` have additional configuration properties that do not apply to `json` indexes, these are:
3834
- * * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all
3835
- * document fields and what analyzer to use for that purpose.
3960
+ * @param {string} [params.ddoc] - Specifies the design document name in which the index will be created. The design
3961
+ * document name is the design document ID excluding the `_design/` prefix.
3836
3962
  * @param {string} [params.name] - name.
3837
3963
  * @param {boolean} [params.partitioned] - The default value is `true` for databases with `partitioned: true` and
3838
3964
  * `false` otherwise. For databases with `partitioned: false` if this option is specified the value must be `false`.
@@ -3843,7 +3969,7 @@ var CloudantV1 = /** @class */ (function (_super) {
3843
3969
  CloudantV1.prototype.postIndex = function (params) {
3844
3970
  var _params = __assign({}, params);
3845
3971
  var _requiredParams = ['db', 'index'];
3846
- var _validParams = ['db', 'index', 'ddoc', 'def', 'name', 'partitioned', 'type', 'headers'];
3972
+ var _validParams = ['db', 'index', 'ddoc', 'name', 'partitioned', 'type', 'headers'];
3847
3973
  var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
3848
3974
  if (_validationErrors) {
3849
3975
  return Promise.reject(_validationErrors);
@@ -3851,7 +3977,6 @@ var CloudantV1 = /** @class */ (function (_super) {
3851
3977
  var body = {
3852
3978
  'index': _params.index,
3853
3979
  'ddoc': _params.ddoc,
3854
- 'def': _params.def,
3855
3980
  'name': _params.name,
3856
3981
  'partitioned': _params.partitioned,
3857
3982
  'type': _params.type,
@@ -5710,6 +5835,7 @@ var CloudantV1 = /** @class */ (function (_super) {
5710
5835
  };
5711
5836
  return this.createRequest(parameters);
5712
5837
  };
5838
+ CloudantV1._logger = (0, ibm_cloud_sdk_core_1.getNewLogger)('CloudantV1');
5713
5839
  CloudantV1.DEFAULT_SERVICE_URL = 'http://localhost:5984';
5714
5840
  CloudantV1.DEFAULT_SERVICE_NAME = 'cloudant';
5715
5841
  return CloudantV1;
@@ -5897,6 +6023,23 @@ var CloudantV1 = /** @class */ (function (_super) {
5897
6023
  Update["LAZY"] = "lazy";
5898
6024
  })(Update = PostPartitionViewAsStreamConstants.Update || (PostPartitionViewAsStreamConstants.Update = {}));
5899
6025
  })(PostPartitionViewAsStreamConstants = CloudantV1.PostPartitionViewAsStreamConstants || (CloudantV1.PostPartitionViewAsStreamConstants = {}));
6026
+ /** Constants for the `postPartitionExplain` operation. */
6027
+ var PostPartitionExplainConstants;
6028
+ (function (PostPartitionExplainConstants) {
6029
+ /** Schema for a mapping of field name to sort direction. */
6030
+ var Sort;
6031
+ (function (Sort) {
6032
+ Sort["ASC"] = "asc";
6033
+ Sort["DESC"] = "desc";
6034
+ })(Sort = PostPartitionExplainConstants.Sort || (PostPartitionExplainConstants.Sort = {}));
6035
+ /** Whether to update the index prior to returning the result. */
6036
+ var Update;
6037
+ (function (Update) {
6038
+ Update["FALSE"] = "false";
6039
+ Update["TRUE"] = "true";
6040
+ Update["LAZY"] = "lazy";
6041
+ })(Update = PostPartitionExplainConstants.Update || (PostPartitionExplainConstants.Update = {}));
6042
+ })(PostPartitionExplainConstants = CloudantV1.PostPartitionExplainConstants || (CloudantV1.PostPartitionExplainConstants = {}));
5900
6043
  /** Constants for the `postPartitionFind` operation. */
5901
6044
  var PostPartitionFindConstants;
5902
6045
  (function (PostPartitionFindConstants) {