@ibm-cloud/cloudant 0.0.12 → 0.0.16
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 +277 -206
- package/auth/couchdbSessionAuthenticator.d.ts +2 -2
- package/auth/couchdbSessionAuthenticator.js +4 -2
- package/auth/couchdbSessionAuthenticator.js.map +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.js +2 -1
- package/auth/index.js.map +1 -1
- package/auth/sessionTokenManager.d.ts +2 -2
- package/auth/sessionTokenManager.js +16 -8
- package/auth/sessionTokenManager.js.map +1 -1
- package/cloudant/v1.d.ts +298 -460
- package/cloudant/v1.js +507 -608
- package/cloudant/v1.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/lib/cloudantBaseService.d.ts +10 -2
- package/lib/cloudantBaseService.js +17 -2
- package/lib/cloudantBaseService.js.map +1 -1
- package/lib/common.d.ts +1 -1
- package/lib/common.js +1 -1
- package/lib/common.js.map +1 -1
- package/lib/getAuthenticatorFromEnvCloudantExtension.d.ts +2 -2
- package/lib/getAuthenticatorFromEnvCloudantExtension.js +1 -1
- package/lib/getAuthenticatorFromEnvCloudantExtension.js.map +1 -1
- package/package.json +9 -13
package/cloudant/v1.js
CHANGED
|
@@ -18,17 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
24
|
return function (d, b) {
|
|
25
|
+
if (typeof b !== "function" && b !== null)
|
|
26
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
/**
|
|
31
|
-
* IBM OpenAPI SDK Code Generator Version: 3.
|
|
33
|
+
* IBM OpenAPI SDK Code Generator Version: 3.30.0-bd714324-20210406-200538
|
|
32
34
|
*/
|
|
33
35
|
var extend = require("extend");
|
|
34
36
|
var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
|
|
@@ -185,8 +187,8 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
185
187
|
/**
|
|
186
188
|
* Retrieve provisioned throughput capacity information.
|
|
187
189
|
*
|
|
188
|
-
* View the amount of provisioned throughput capacity allocated to an IBM Cloudant instance and what is the
|
|
189
|
-
* provisioned throughput capacity.
|
|
190
|
+
* View the amount of provisioned throughput capacity that is allocated to an IBM Cloudant instance and what is the
|
|
191
|
+
* target provisioned throughput capacity.
|
|
190
192
|
*
|
|
191
193
|
* @param {Object} [params] - The parameters to send to the service.
|
|
192
194
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -221,7 +223,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
221
223
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
222
224
|
* @returns {Promise<CloudantV1.Response<CloudantV1.CapacityThroughputInformation>>}
|
|
223
225
|
*/
|
|
224
|
-
CloudantV1.prototype.
|
|
226
|
+
CloudantV1.prototype.putCapacityThroughputConfiguration = function (params) {
|
|
225
227
|
var _params = Object.assign({}, params);
|
|
226
228
|
var requiredParams = ['blocks'];
|
|
227
229
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
@@ -231,7 +233,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
231
233
|
var body = {
|
|
232
234
|
'blocks': _params.blocks
|
|
233
235
|
};
|
|
234
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
236
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'putCapacityThroughputConfiguration');
|
|
235
237
|
var parameters = {
|
|
236
238
|
options: {
|
|
237
239
|
url: '/_api/v2/user/capacity/throughput',
|
|
@@ -249,79 +251,182 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
249
251
|
};
|
|
250
252
|
;
|
|
251
253
|
/*************************
|
|
252
|
-
*
|
|
254
|
+
* changes
|
|
253
255
|
************************/
|
|
254
256
|
/**
|
|
255
|
-
* Retrieve
|
|
257
|
+
* Retrieve change events for all databases.
|
|
256
258
|
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
+
* Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating
|
|
260
|
+
* or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order
|
|
261
|
+
* and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
|
|
262
|
+
* **Note: This endpoint requires _admin or _db_updates role and is only available on dedicated clusters.**.
|
|
259
263
|
*
|
|
260
|
-
* @param {Object} params - The parameters to send to the service.
|
|
261
|
-
* @param {string} params.
|
|
264
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
265
|
+
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
266
|
+
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
267
|
+
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
268
|
+
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
269
|
+
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
270
|
+
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
271
|
+
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
272
|
+
* the default maximum timeout to prevent undetected dead connections.
|
|
273
|
+
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
274
|
+
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
262
275
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
263
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
276
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.DbUpdates>>}
|
|
264
277
|
*/
|
|
265
|
-
CloudantV1.prototype.
|
|
278
|
+
CloudantV1.prototype.getDbUpdates = function (params) {
|
|
266
279
|
var _params = Object.assign({}, params);
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
var path = {
|
|
273
|
-
'db': _params.db
|
|
280
|
+
var query = {
|
|
281
|
+
'feed': _params.feed,
|
|
282
|
+
'heartbeat': _params.heartbeat,
|
|
283
|
+
'timeout': _params.timeout,
|
|
284
|
+
'since': _params.since
|
|
274
285
|
};
|
|
275
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
286
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getDbUpdates');
|
|
276
287
|
var parameters = {
|
|
277
288
|
options: {
|
|
278
|
-
url: '/
|
|
279
|
-
method: '
|
|
280
|
-
|
|
289
|
+
url: '/_db_updates',
|
|
290
|
+
method: 'GET',
|
|
291
|
+
qs: query,
|
|
281
292
|
},
|
|
282
293
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
283
|
-
headers: extend(true, sdkHeaders, {
|
|
294
|
+
headers: extend(true, sdkHeaders, {
|
|
295
|
+
'Accept': 'application/json',
|
|
296
|
+
}, _params.headers),
|
|
284
297
|
}),
|
|
285
298
|
};
|
|
286
299
|
return this.createRequest(parameters);
|
|
287
300
|
};
|
|
288
301
|
;
|
|
289
302
|
/**
|
|
290
|
-
* Query
|
|
303
|
+
* Query the database document changes feed.
|
|
291
304
|
*
|
|
292
|
-
*
|
|
305
|
+
* Requests the database changes feed in the same way as `GET /{db}/_changes` does. It is widely used with the
|
|
306
|
+
* `filter` query parameter because it allows one to pass more information to the filter.
|
|
307
|
+
*
|
|
308
|
+
* @param {Object} params - The parameters to send to the service.
|
|
309
|
+
* @param {string} params.db - Path parameter to specify the database name.
|
|
310
|
+
* @param {string[]} [params.docIds] - Schema for a list of document IDs.
|
|
311
|
+
* @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
|
|
312
|
+
* fields of a document must be returned. If it is omitted, the entire document is returned.
|
|
313
|
+
* @param {JsonObject} [params.selector] - JSON object describing criteria used to select documents. The selector
|
|
314
|
+
* specifies fields in the document, and provides an expression to evaluate with the field content or other data.
|
|
315
|
+
*
|
|
316
|
+
* The selector object must:
|
|
317
|
+
* * Be structured as valid JSON.
|
|
318
|
+
* * Contain a valid query expression.
|
|
319
|
+
*
|
|
320
|
+
* Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
|
|
321
|
+
* option if filtering on document attributes only.
|
|
322
|
+
*
|
|
323
|
+
* Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
|
|
324
|
+
* those fields. You can create more complex selector expressions by combining operators.
|
|
325
|
+
*
|
|
326
|
+
* Operators are identified by the use of a dollar sign `$` prefix in the name field.
|
|
327
|
+
*
|
|
328
|
+
* There are two core types of operators in the selector syntax:
|
|
329
|
+
* * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
|
|
330
|
+
* to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
|
|
331
|
+
* `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
|
|
332
|
+
* selector, or an array of selectors.
|
|
333
|
+
* * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
|
|
334
|
+
* instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
|
|
335
|
+
* argument.
|
|
336
|
+
* @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
|
|
337
|
+
* on a previous connection. Overrides `since` query parameter.
|
|
338
|
+
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
339
|
+
* in attachment stubs if the particular attachment is compressed.
|
|
340
|
+
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
341
|
+
* response.
|
|
342
|
+
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
343
|
+
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
293
344
|
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
294
345
|
* key order.
|
|
295
|
-
* @param {string} [params.
|
|
296
|
-
*
|
|
346
|
+
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
347
|
+
* @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
|
|
348
|
+
* filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
|
|
349
|
+
* - `_design`
|
|
350
|
+
* - Returns only changes to design documents.
|
|
351
|
+
* - `_doc_ids`
|
|
352
|
+
* - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
|
|
353
|
+
* - `_selector`
|
|
354
|
+
* - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
|
|
355
|
+
* as used for `_find`.
|
|
356
|
+
* - `_view`
|
|
357
|
+
* - Returns changes for documents that match an existing map function in the view specified by the query parameter
|
|
358
|
+
* `view`.
|
|
359
|
+
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
360
|
+
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
361
|
+
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
362
|
+
* @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
|
|
363
|
+
* documents in the response.
|
|
297
364
|
* @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
|
|
298
365
|
* to.
|
|
299
|
-
* @param {number} [params.
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
366
|
+
* @param {number} [params.seqInterval] - Query parameter to specify that the update seq should only be calculated
|
|
367
|
+
* with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch
|
|
368
|
+
* size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the
|
|
369
|
+
* source database as computing the seq value across many shards (especially in highly-sharded databases) is
|
|
370
|
+
* expensive.
|
|
371
|
+
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
372
|
+
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
373
|
+
* @param {string} [params.style] - Query parameter to specify how many revisions are returned in the changes array.
|
|
374
|
+
* The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf revisions
|
|
375
|
+
* (including conflicts and deleted former conflicts).
|
|
376
|
+
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
377
|
+
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
378
|
+
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
379
|
+
* the default maximum timeout to prevent undetected dead connections.
|
|
380
|
+
* @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
|
|
381
|
+
* if the view's map function emits at least one record for them.
|
|
303
382
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
304
|
-
* @returns {Promise<CloudantV1.Response<
|
|
383
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.ChangesResult>>}
|
|
305
384
|
*/
|
|
306
|
-
CloudantV1.prototype.
|
|
385
|
+
CloudantV1.prototype.postChanges = function (params) {
|
|
307
386
|
var _params = Object.assign({}, params);
|
|
387
|
+
var requiredParams = ['db'];
|
|
388
|
+
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
389
|
+
if (missingParams) {
|
|
390
|
+
return Promise.reject(missingParams);
|
|
391
|
+
}
|
|
392
|
+
var body = {
|
|
393
|
+
'doc_ids': _params.docIds,
|
|
394
|
+
'fields': _params.fields,
|
|
395
|
+
'selector': _params.selector
|
|
396
|
+
};
|
|
308
397
|
var query = {
|
|
398
|
+
'att_encoding_info': _params.attEncodingInfo,
|
|
399
|
+
'attachments': _params.attachments,
|
|
400
|
+
'conflicts': _params.conflicts,
|
|
309
401
|
'descending': _params.descending,
|
|
310
|
-
'
|
|
402
|
+
'feed': _params.feed,
|
|
403
|
+
'filter': _params.filter,
|
|
404
|
+
'heartbeat': _params.heartbeat,
|
|
405
|
+
'include_docs': _params.includeDocs,
|
|
311
406
|
'limit': _params.limit,
|
|
312
|
-
'
|
|
313
|
-
'
|
|
407
|
+
'seq_interval': _params.seqInterval,
|
|
408
|
+
'since': _params.since,
|
|
409
|
+
'style': _params.style,
|
|
410
|
+
'timeout': _params.timeout,
|
|
411
|
+
'view': _params.view
|
|
314
412
|
};
|
|
315
|
-
var
|
|
413
|
+
var path = {
|
|
414
|
+
'db': _params.db
|
|
415
|
+
};
|
|
416
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postChanges');
|
|
316
417
|
var parameters = {
|
|
317
418
|
options: {
|
|
318
|
-
url: '/
|
|
319
|
-
method: '
|
|
419
|
+
url: '/{db}/_changes',
|
|
420
|
+
method: 'POST',
|
|
421
|
+
body: body,
|
|
320
422
|
qs: query,
|
|
423
|
+
path: path,
|
|
321
424
|
},
|
|
322
425
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
323
426
|
headers: extend(true, sdkHeaders, {
|
|
324
427
|
'Accept': 'application/json',
|
|
428
|
+
'Content-Type': 'application/json',
|
|
429
|
+
'Last-Event-ID': _params.lastEventId
|
|
325
430
|
}, _params.headers),
|
|
326
431
|
}),
|
|
327
432
|
};
|
|
@@ -329,57 +434,155 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
329
434
|
};
|
|
330
435
|
;
|
|
331
436
|
/**
|
|
332
|
-
* Query
|
|
437
|
+
* Query the database document changes feed as stream.
|
|
333
438
|
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
* the request.
|
|
439
|
+
* Requests the database changes feed in the same way as `GET /{db}/_changes` does. It is widely used with the
|
|
440
|
+
* `filter` query parameter because it allows one to pass more information to the filter.
|
|
337
441
|
*
|
|
338
442
|
* @param {Object} params - The parameters to send to the service.
|
|
339
|
-
* @param {string
|
|
443
|
+
* @param {string} params.db - Path parameter to specify the database name.
|
|
444
|
+
* @param {string[]} [params.docIds] - Schema for a list of document IDs.
|
|
445
|
+
* @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
|
|
446
|
+
* fields of a document must be returned. If it is omitted, the entire document is returned.
|
|
447
|
+
* @param {JsonObject} [params.selector] - JSON object describing criteria used to select documents. The selector
|
|
448
|
+
* specifies fields in the document, and provides an expression to evaluate with the field content or other data.
|
|
449
|
+
*
|
|
450
|
+
* The selector object must:
|
|
451
|
+
* * Be structured as valid JSON.
|
|
452
|
+
* * Contain a valid query expression.
|
|
453
|
+
*
|
|
454
|
+
* Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
|
|
455
|
+
* option if filtering on document attributes only.
|
|
456
|
+
*
|
|
457
|
+
* Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
|
|
458
|
+
* those fields. You can create more complex selector expressions by combining operators.
|
|
459
|
+
*
|
|
460
|
+
* Operators are identified by the use of a dollar sign `$` prefix in the name field.
|
|
461
|
+
*
|
|
462
|
+
* There are two core types of operators in the selector syntax:
|
|
463
|
+
* * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
|
|
464
|
+
* to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
|
|
465
|
+
* `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
|
|
466
|
+
* selector, or an array of selectors.
|
|
467
|
+
* * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
|
|
468
|
+
* instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
|
|
469
|
+
* argument.
|
|
470
|
+
* @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
|
|
471
|
+
* on a previous connection. Overrides `since` query parameter.
|
|
472
|
+
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
473
|
+
* in attachment stubs if the particular attachment is compressed.
|
|
474
|
+
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
475
|
+
* response.
|
|
476
|
+
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
477
|
+
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
478
|
+
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
479
|
+
* key order.
|
|
480
|
+
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
481
|
+
* @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
|
|
482
|
+
* filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
|
|
483
|
+
* - `_design`
|
|
484
|
+
* - Returns only changes to design documents.
|
|
485
|
+
* - `_doc_ids`
|
|
486
|
+
* - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
|
|
487
|
+
* - `_selector`
|
|
488
|
+
* - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
|
|
489
|
+
* as used for `_find`.
|
|
490
|
+
* - `_view`
|
|
491
|
+
* - Returns changes for documents that match an existing map function in the view specified by the query parameter
|
|
492
|
+
* `view`.
|
|
493
|
+
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
494
|
+
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
495
|
+
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
496
|
+
* @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
|
|
497
|
+
* documents in the response.
|
|
498
|
+
* @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
|
|
499
|
+
* to.
|
|
500
|
+
* @param {number} [params.seqInterval] - Query parameter to specify that the update seq should only be calculated
|
|
501
|
+
* with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch
|
|
502
|
+
* size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the
|
|
503
|
+
* source database as computing the seq value across many shards (especially in highly-sharded databases) is
|
|
504
|
+
* expensive.
|
|
505
|
+
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
506
|
+
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
507
|
+
* @param {string} [params.style] - Query parameter to specify how many revisions are returned in the changes array.
|
|
508
|
+
* The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf revisions
|
|
509
|
+
* (including conflicts and deleted former conflicts).
|
|
510
|
+
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
511
|
+
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
512
|
+
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
513
|
+
* the default maximum timeout to prevent undetected dead connections.
|
|
514
|
+
* @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
|
|
515
|
+
* if the view's map function emits at least one record for them.
|
|
340
516
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
341
|
-
* @returns {Promise<CloudantV1.Response<
|
|
517
|
+
* @returns {Promise<CloudantV1.Response<NodeJS.ReadableStream|Buffer>>}
|
|
342
518
|
*/
|
|
343
|
-
CloudantV1.prototype.
|
|
519
|
+
CloudantV1.prototype.postChangesAsStream = function (params) {
|
|
344
520
|
var _params = Object.assign({}, params);
|
|
345
|
-
var requiredParams = ['
|
|
521
|
+
var requiredParams = ['db'];
|
|
346
522
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
347
523
|
if (missingParams) {
|
|
348
524
|
return Promise.reject(missingParams);
|
|
349
525
|
}
|
|
350
526
|
var body = {
|
|
351
|
-
'
|
|
527
|
+
'doc_ids': _params.docIds,
|
|
528
|
+
'fields': _params.fields,
|
|
529
|
+
'selector': _params.selector
|
|
352
530
|
};
|
|
353
|
-
var
|
|
531
|
+
var query = {
|
|
532
|
+
'att_encoding_info': _params.attEncodingInfo,
|
|
533
|
+
'attachments': _params.attachments,
|
|
534
|
+
'conflicts': _params.conflicts,
|
|
535
|
+
'descending': _params.descending,
|
|
536
|
+
'feed': _params.feed,
|
|
537
|
+
'filter': _params.filter,
|
|
538
|
+
'heartbeat': _params.heartbeat,
|
|
539
|
+
'include_docs': _params.includeDocs,
|
|
540
|
+
'limit': _params.limit,
|
|
541
|
+
'seq_interval': _params.seqInterval,
|
|
542
|
+
'since': _params.since,
|
|
543
|
+
'style': _params.style,
|
|
544
|
+
'timeout': _params.timeout,
|
|
545
|
+
'view': _params.view
|
|
546
|
+
};
|
|
547
|
+
var path = {
|
|
548
|
+
'db': _params.db
|
|
549
|
+
};
|
|
550
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postChangesAsStream');
|
|
354
551
|
var parameters = {
|
|
355
552
|
options: {
|
|
356
|
-
url: '/
|
|
553
|
+
url: '/{db}/_changes',
|
|
357
554
|
method: 'POST',
|
|
358
555
|
body: body,
|
|
556
|
+
qs: query,
|
|
557
|
+
path: path,
|
|
558
|
+
responseType: 'stream',
|
|
359
559
|
},
|
|
360
560
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
361
561
|
headers: extend(true, sdkHeaders, {
|
|
362
562
|
'Accept': 'application/json',
|
|
363
563
|
'Content-Type': 'application/json',
|
|
564
|
+
'Last-Event-ID': _params.lastEventId
|
|
364
565
|
}, _params.headers),
|
|
365
566
|
}),
|
|
366
567
|
};
|
|
367
568
|
return this.createRequest(parameters);
|
|
368
569
|
};
|
|
369
570
|
;
|
|
571
|
+
/*************************
|
|
572
|
+
* databases
|
|
573
|
+
************************/
|
|
370
574
|
/**
|
|
371
|
-
*
|
|
575
|
+
* Retrieve the HTTP headers for a database.
|
|
372
576
|
*
|
|
373
|
-
*
|
|
374
|
-
* the
|
|
375
|
-
* suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
|
|
577
|
+
* Returns the HTTP headers that contain a minimal amount of information about the specified database. Since the
|
|
578
|
+
* response body is empty, using the HEAD method is a lightweight way to check if the database exists or not.
|
|
376
579
|
*
|
|
377
580
|
* @param {Object} params - The parameters to send to the service.
|
|
378
581
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
379
582
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
380
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
583
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Empty>>}
|
|
381
584
|
*/
|
|
382
|
-
CloudantV1.prototype.
|
|
585
|
+
CloudantV1.prototype.headDatabase = function (params) {
|
|
383
586
|
var _params = Object.assign({}, params);
|
|
384
587
|
var requiredParams = ['db'];
|
|
385
588
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
@@ -389,46 +592,52 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
389
592
|
var path = {
|
|
390
593
|
'db': _params.db
|
|
391
594
|
};
|
|
392
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
595
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'headDatabase');
|
|
393
596
|
var parameters = {
|
|
394
597
|
options: {
|
|
395
598
|
url: '/{db}',
|
|
396
|
-
method: '
|
|
599
|
+
method: 'HEAD',
|
|
397
600
|
path: path,
|
|
398
601
|
},
|
|
399
602
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
400
|
-
headers: extend(true, sdkHeaders, {
|
|
401
|
-
'Accept': 'application/json',
|
|
402
|
-
}, _params.headers),
|
|
603
|
+
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
403
604
|
}),
|
|
404
605
|
};
|
|
405
606
|
return this.createRequest(parameters);
|
|
406
607
|
};
|
|
407
608
|
;
|
|
408
609
|
/**
|
|
409
|
-
*
|
|
610
|
+
* Query a list of all database names in the instance.
|
|
410
611
|
*
|
|
411
|
-
* @param {Object} params - The parameters to send to the service.
|
|
412
|
-
* @param {
|
|
612
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
613
|
+
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
614
|
+
* key order.
|
|
615
|
+
* @param {string} [params.endkey] - Query parameter to specify to stop returning records when the specified key is
|
|
616
|
+
* reached. String representation of any JSON type that matches the key type emitted by the view function.
|
|
617
|
+
* @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
|
|
618
|
+
* to.
|
|
619
|
+
* @param {number} [params.skip] - Query parameter to specify the number of records before starting to return the
|
|
620
|
+
* results.
|
|
621
|
+
* @param {string} [params.startkey] - Query parameter to specify to start returning records from the specified key.
|
|
622
|
+
* String representation of any JSON type that matches the key type emitted by the view function.
|
|
413
623
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
414
|
-
* @returns {Promise<CloudantV1.Response<
|
|
624
|
+
* @returns {Promise<CloudantV1.Response<string[]>>}
|
|
415
625
|
*/
|
|
416
|
-
CloudantV1.prototype.
|
|
626
|
+
CloudantV1.prototype.getAllDbs = function (params) {
|
|
417
627
|
var _params = Object.assign({}, params);
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
'db': _params.db
|
|
628
|
+
var query = {
|
|
629
|
+
'descending': _params.descending,
|
|
630
|
+
'endkey': _params.endkey,
|
|
631
|
+
'limit': _params.limit,
|
|
632
|
+
'skip': _params.skip,
|
|
633
|
+
'startkey': _params.startkey
|
|
425
634
|
};
|
|
426
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
635
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getAllDbs');
|
|
427
636
|
var parameters = {
|
|
428
637
|
options: {
|
|
429
|
-
url: '/
|
|
638
|
+
url: '/_all_dbs',
|
|
430
639
|
method: 'GET',
|
|
431
|
-
|
|
640
|
+
qs: query,
|
|
432
641
|
},
|
|
433
642
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
434
643
|
headers: extend(true, sdkHeaders, {
|
|
@@ -440,42 +649,38 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
440
649
|
};
|
|
441
650
|
;
|
|
442
651
|
/**
|
|
443
|
-
*
|
|
652
|
+
* Query information about multiple databases.
|
|
653
|
+
*
|
|
654
|
+
* This operation enables you to request information about multiple databases in a single request, instead of issuing
|
|
655
|
+
* multiple `GET /{db}` requests. It returns a list that contains an information object for each database specified in
|
|
656
|
+
* the request.
|
|
444
657
|
*
|
|
445
658
|
* @param {Object} params - The parameters to send to the service.
|
|
446
|
-
* @param {string} params.
|
|
447
|
-
* @param {boolean} [params.partitioned] - Query parameter to specify whether to enable database partitions when
|
|
448
|
-
* creating a database.
|
|
449
|
-
* @param {number} [params.q] - The number of shards in the database. Each shard is a partition of the hash value
|
|
450
|
-
* range. Default is 8, unless overridden in the `cluster config`.
|
|
659
|
+
* @param {string[]} params.keys - A list of database names.
|
|
451
660
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
452
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
661
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.DbsInfoResult[]>>}
|
|
453
662
|
*/
|
|
454
|
-
CloudantV1.prototype.
|
|
663
|
+
CloudantV1.prototype.postDbsInfo = function (params) {
|
|
455
664
|
var _params = Object.assign({}, params);
|
|
456
|
-
var requiredParams = ['
|
|
665
|
+
var requiredParams = ['keys'];
|
|
457
666
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
458
667
|
if (missingParams) {
|
|
459
668
|
return Promise.reject(missingParams);
|
|
460
669
|
}
|
|
461
|
-
var
|
|
462
|
-
'
|
|
463
|
-
'q': _params.q
|
|
464
|
-
};
|
|
465
|
-
var path = {
|
|
466
|
-
'db': _params.db
|
|
670
|
+
var body = {
|
|
671
|
+
'keys': _params.keys
|
|
467
672
|
};
|
|
468
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
673
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postDbsInfo');
|
|
469
674
|
var parameters = {
|
|
470
675
|
options: {
|
|
471
|
-
url: '/
|
|
472
|
-
method: '
|
|
473
|
-
|
|
474
|
-
path: path,
|
|
676
|
+
url: '/_dbs_info',
|
|
677
|
+
method: 'POST',
|
|
678
|
+
body: body,
|
|
475
679
|
},
|
|
476
680
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
477
681
|
headers: extend(true, sdkHeaders, {
|
|
478
682
|
'Accept': 'application/json',
|
|
683
|
+
'Content-Type': 'application/json',
|
|
479
684
|
}, _params.headers),
|
|
480
685
|
}),
|
|
481
686
|
};
|
|
@@ -483,133 +688,71 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
483
688
|
};
|
|
484
689
|
;
|
|
485
690
|
/**
|
|
486
|
-
*
|
|
691
|
+
* Delete a database.
|
|
487
692
|
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
693
|
+
* Deletes the specified database and all documents and attachments contained within it. To avoid deleting a database,
|
|
694
|
+
* the server responds with a 400 HTTP status code when the request URL includes a `?rev=` parameter. This response
|
|
695
|
+
* suggests that a user wanted to delete a document but forgot to add the document ID to the URL.
|
|
490
696
|
*
|
|
491
697
|
* @param {Object} params - The parameters to send to the service.
|
|
492
698
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
493
|
-
* @param {string[]} [params.docIds] - Schema for a list of document IDs.
|
|
494
|
-
* @param {string[]} [params.fields] - JSON array that uses the field syntax. Use this parameter to specify which
|
|
495
|
-
* fields of a document must be returned. If it is omitted, the entire document is returned.
|
|
496
|
-
* @param {JsonObject} [params.selector] - JSON object describing criteria used to select documents. The selector
|
|
497
|
-
* specifies fields in the document, and provides an expression to evaluate with the field content or other data.
|
|
498
|
-
*
|
|
499
|
-
* The selector object must:
|
|
500
|
-
* * Be structured as valid JSON.
|
|
501
|
-
* * Contain a valid query expression.
|
|
502
|
-
*
|
|
503
|
-
* Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
|
|
504
|
-
* option if filtering on document attributes only.
|
|
505
|
-
*
|
|
506
|
-
* Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
|
|
507
|
-
* those fields. You can create more complex selector expressions by combining operators.
|
|
508
|
-
*
|
|
509
|
-
* Operators are identified by the use of a dollar sign `$` prefix in the name field.
|
|
510
|
-
*
|
|
511
|
-
* There are two core types of operators in the selector syntax:
|
|
512
|
-
* * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
|
|
513
|
-
* to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
|
|
514
|
-
* `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
|
|
515
|
-
* selector, or an array of selectors.
|
|
516
|
-
* * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
|
|
517
|
-
* instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
|
|
518
|
-
* argument.
|
|
519
|
-
* @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
|
|
520
|
-
* on a previous connection. Overrides `since` query parameter.
|
|
521
|
-
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
522
|
-
* in attachment stubs if the particular attachment is compressed.
|
|
523
|
-
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
524
|
-
* response.
|
|
525
|
-
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
526
|
-
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
527
|
-
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
528
|
-
* key order.
|
|
529
|
-
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
530
|
-
* @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
|
|
531
|
-
* filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
|
|
532
|
-
* - `_design`
|
|
533
|
-
* - Returns only changes to design documents.
|
|
534
|
-
* - `_doc_ids`
|
|
535
|
-
* - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
|
|
536
|
-
* - `_selector`
|
|
537
|
-
* - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
|
|
538
|
-
* as used for `_find`.
|
|
539
|
-
* - `_view`
|
|
540
|
-
* - Returns changes for documents that match an existing map function in the view specified by the query parameter
|
|
541
|
-
* `view`.
|
|
542
|
-
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
543
|
-
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
544
|
-
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
545
|
-
* @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
|
|
546
|
-
* documents in the response.
|
|
547
|
-
* @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
|
|
548
|
-
* to.
|
|
549
|
-
* @param {number} [params.seqInterval] - Query parameter to specify that the update seq should only be calculated
|
|
550
|
-
* with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch
|
|
551
|
-
* size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the
|
|
552
|
-
* source database as computing the seq value across many shards (especially in highly-sharded databases) is
|
|
553
|
-
* expensive.
|
|
554
|
-
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
555
|
-
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
556
|
-
* @param {string} [params.style] - Query parameter to specify how many revisions are returned in the changes array.
|
|
557
|
-
* The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf revisions
|
|
558
|
-
* (including conflicts and deleted former conflicts).
|
|
559
|
-
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
560
|
-
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
561
|
-
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
562
|
-
* the default maximum timeout to prevent undetected dead connections.
|
|
563
|
-
* @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
|
|
564
|
-
* if the view's map function emits at least one record for them.
|
|
565
699
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
566
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
700
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Ok>>}
|
|
567
701
|
*/
|
|
568
|
-
CloudantV1.prototype.
|
|
702
|
+
CloudantV1.prototype.deleteDatabase = function (params) {
|
|
569
703
|
var _params = Object.assign({}, params);
|
|
570
704
|
var requiredParams = ['db'];
|
|
571
705
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
572
706
|
if (missingParams) {
|
|
573
707
|
return Promise.reject(missingParams);
|
|
574
708
|
}
|
|
575
|
-
var
|
|
576
|
-
'
|
|
577
|
-
'fields': _params.fields,
|
|
578
|
-
'selector': _params.selector
|
|
709
|
+
var path = {
|
|
710
|
+
'db': _params.db
|
|
579
711
|
};
|
|
580
|
-
var
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
'style': _params.style,
|
|
593
|
-
'timeout': _params.timeout,
|
|
594
|
-
'view': _params.view
|
|
712
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteDatabase');
|
|
713
|
+
var parameters = {
|
|
714
|
+
options: {
|
|
715
|
+
url: '/{db}',
|
|
716
|
+
method: 'DELETE',
|
|
717
|
+
path: path,
|
|
718
|
+
},
|
|
719
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
720
|
+
headers: extend(true, sdkHeaders, {
|
|
721
|
+
'Accept': 'application/json',
|
|
722
|
+
}, _params.headers),
|
|
723
|
+
}),
|
|
595
724
|
};
|
|
725
|
+
return this.createRequest(parameters);
|
|
726
|
+
};
|
|
727
|
+
;
|
|
728
|
+
/**
|
|
729
|
+
* Retrieve information about a database.
|
|
730
|
+
*
|
|
731
|
+
* @param {Object} params - The parameters to send to the service.
|
|
732
|
+
* @param {string} params.db - Path parameter to specify the database name.
|
|
733
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
734
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.DatabaseInformation>>}
|
|
735
|
+
*/
|
|
736
|
+
CloudantV1.prototype.getDatabaseInformation = function (params) {
|
|
737
|
+
var _params = Object.assign({}, params);
|
|
738
|
+
var requiredParams = ['db'];
|
|
739
|
+
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
740
|
+
if (missingParams) {
|
|
741
|
+
return Promise.reject(missingParams);
|
|
742
|
+
}
|
|
596
743
|
var path = {
|
|
597
744
|
'db': _params.db
|
|
598
745
|
};
|
|
599
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
746
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getDatabaseInformation');
|
|
600
747
|
var parameters = {
|
|
601
748
|
options: {
|
|
602
|
-
url: '/{db}
|
|
603
|
-
method: '
|
|
604
|
-
body: body,
|
|
605
|
-
qs: query,
|
|
749
|
+
url: '/{db}',
|
|
750
|
+
method: 'GET',
|
|
606
751
|
path: path,
|
|
607
752
|
},
|
|
608
753
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
609
754
|
headers: extend(true, sdkHeaders, {
|
|
610
755
|
'Accept': 'application/json',
|
|
611
|
-
'Content-Type': 'application/json',
|
|
612
|
-
'Last-Event-ID': _params.lastEventId
|
|
613
756
|
}, _params.headers),
|
|
614
757
|
}),
|
|
615
758
|
};
|
|
@@ -617,134 +760,42 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
617
760
|
};
|
|
618
761
|
;
|
|
619
762
|
/**
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
* Requests the database changes feed in the same way as `GET /{db}/_changes` does. It is widely used with the
|
|
623
|
-
* `filter` query parameter because it allows one to pass more information to the filter.
|
|
763
|
+
* Create a database.
|
|
624
764
|
*
|
|
625
765
|
* @param {Object} params - The parameters to send to the service.
|
|
626
766
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
627
|
-
* @param {
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* specifies fields in the document, and provides an expression to evaluate with the field content or other data.
|
|
632
|
-
*
|
|
633
|
-
* The selector object must:
|
|
634
|
-
* * Be structured as valid JSON.
|
|
635
|
-
* * Contain a valid query expression.
|
|
636
|
-
*
|
|
637
|
-
* Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
|
|
638
|
-
* option if filtering on document attributes only.
|
|
639
|
-
*
|
|
640
|
-
* Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
|
|
641
|
-
* those fields. You can create more complex selector expressions by combining operators.
|
|
642
|
-
*
|
|
643
|
-
* Operators are identified by the use of a dollar sign `$` prefix in the name field.
|
|
644
|
-
*
|
|
645
|
-
* There are two core types of operators in the selector syntax:
|
|
646
|
-
* * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
|
|
647
|
-
* to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
|
|
648
|
-
* `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
|
|
649
|
-
* selector, or an array of selectors.
|
|
650
|
-
* * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
|
|
651
|
-
* instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
|
|
652
|
-
* argument.
|
|
653
|
-
* @param {string} [params.lastEventId] - Header parameter to specify the ID of the last events received by the server
|
|
654
|
-
* on a previous connection. Overrides `since` query parameter.
|
|
655
|
-
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
656
|
-
* in attachment stubs if the particular attachment is compressed.
|
|
657
|
-
* @param {boolean} [params.attachments] - Query parameter to specify whether to include attachments bodies in a
|
|
658
|
-
* response.
|
|
659
|
-
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
660
|
-
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
661
|
-
* @param {boolean} [params.descending] - Query parameter to specify whether to return the documents in descending by
|
|
662
|
-
* key order.
|
|
663
|
-
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
664
|
-
* @param {string} [params.filter] - Query parameter to specify a filter function from a design document that will
|
|
665
|
-
* filter the changes stream emitting only filtered events. Additionally, several built-in filters are available:
|
|
666
|
-
* - `_design`
|
|
667
|
-
* - Returns only changes to design documents.
|
|
668
|
-
* - `_doc_ids`
|
|
669
|
-
* - Returns changes for documents whit an ID matching one specified in `doc_ids` request body parameter.
|
|
670
|
-
* - `_selector`
|
|
671
|
-
* - Returns changes for documents that match the `selector` request body parameter. The selector syntax is the same
|
|
672
|
-
* as used for `_find`.
|
|
673
|
-
* - `_view`
|
|
674
|
-
* - Returns changes for documents that match an existing map function in the view specified by the query parameter
|
|
675
|
-
* `view`.
|
|
676
|
-
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
677
|
-
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
678
|
-
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
679
|
-
* @param {boolean} [params.includeDocs] - Query parameter to specify whether to include the full content of the
|
|
680
|
-
* documents in the response.
|
|
681
|
-
* @param {number} [params.limit] - Query parameter to specify the number of returned documents to limit the result
|
|
682
|
-
* to.
|
|
683
|
-
* @param {number} [params.seqInterval] - Query parameter to specify that the update seq should only be calculated
|
|
684
|
-
* with every Nth result returned. When fetching changes in a batch, setting <code>seq_interval=<batch
|
|
685
|
-
* size></code>, where <batch size> is the number of results requested per batch, load can be reduced on the
|
|
686
|
-
* source database as computing the seq value across many shards (especially in highly-sharded databases) is
|
|
687
|
-
* expensive.
|
|
688
|
-
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
689
|
-
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
690
|
-
* @param {string} [params.style] - Query parameter to specify how many revisions are returned in the changes array.
|
|
691
|
-
* The default, `main_only`, will only return the current "winning" revision; all_docs will return all leaf revisions
|
|
692
|
-
* (including conflicts and deleted former conflicts).
|
|
693
|
-
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
694
|
-
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
695
|
-
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
696
|
-
* the default maximum timeout to prevent undetected dead connections.
|
|
697
|
-
* @param {string} [params.view] - Query parameter to specify a view function as a filter. Documents pass the filter
|
|
698
|
-
* if the view's map function emits at least one record for them.
|
|
767
|
+
* @param {boolean} [params.partitioned] - Query parameter to specify whether to enable database partitions when
|
|
768
|
+
* creating a database.
|
|
769
|
+
* @param {number} [params.q] - The number of shards in the database. Each shard is a partition of the hash value
|
|
770
|
+
* range. Default is 8, unless overridden in the `cluster config`.
|
|
699
771
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
700
|
-
* @returns {Promise<CloudantV1.Response<
|
|
772
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Ok>>}
|
|
701
773
|
*/
|
|
702
|
-
CloudantV1.prototype.
|
|
774
|
+
CloudantV1.prototype.putDatabase = function (params) {
|
|
703
775
|
var _params = Object.assign({}, params);
|
|
704
776
|
var requiredParams = ['db'];
|
|
705
777
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
706
778
|
if (missingParams) {
|
|
707
779
|
return Promise.reject(missingParams);
|
|
708
780
|
}
|
|
709
|
-
var body = {
|
|
710
|
-
'doc_ids': _params.docIds,
|
|
711
|
-
'fields': _params.fields,
|
|
712
|
-
'selector': _params.selector
|
|
713
|
-
};
|
|
714
781
|
var query = {
|
|
715
|
-
'
|
|
716
|
-
'
|
|
717
|
-
'conflicts': _params.conflicts,
|
|
718
|
-
'descending': _params.descending,
|
|
719
|
-
'feed': _params.feed,
|
|
720
|
-
'filter': _params.filter,
|
|
721
|
-
'heartbeat': _params.heartbeat,
|
|
722
|
-
'include_docs': _params.includeDocs,
|
|
723
|
-
'limit': _params.limit,
|
|
724
|
-
'seq_interval': _params.seqInterval,
|
|
725
|
-
'since': _params.since,
|
|
726
|
-
'style': _params.style,
|
|
727
|
-
'timeout': _params.timeout,
|
|
728
|
-
'view': _params.view
|
|
782
|
+
'partitioned': _params.partitioned,
|
|
783
|
+
'q': _params.q
|
|
729
784
|
};
|
|
730
785
|
var path = {
|
|
731
786
|
'db': _params.db
|
|
732
787
|
};
|
|
733
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
788
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'putDatabase');
|
|
734
789
|
var parameters = {
|
|
735
790
|
options: {
|
|
736
|
-
url: '/{db}
|
|
737
|
-
method: '
|
|
738
|
-
body: body,
|
|
791
|
+
url: '/{db}',
|
|
792
|
+
method: 'PUT',
|
|
739
793
|
qs: query,
|
|
740
794
|
path: path,
|
|
741
|
-
responseType: 'stream',
|
|
742
795
|
},
|
|
743
796
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
744
797
|
headers: extend(true, sdkHeaders, {
|
|
745
798
|
'Accept': 'application/json',
|
|
746
|
-
'Content-Type': 'application/json',
|
|
747
|
-
'Last-Event-ID': _params.lastEventId
|
|
748
799
|
}, _params.headers),
|
|
749
800
|
}),
|
|
750
801
|
};
|
|
@@ -1440,8 +1491,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1440
1491
|
* response.
|
|
1441
1492
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
1442
1493
|
* in attachment stubs if the particular attachment is compressed.
|
|
1443
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
1444
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
1445
1494
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
1446
1495
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
1447
1496
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -1452,8 +1501,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1452
1501
|
* document.
|
|
1453
1502
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
1454
1503
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
1455
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
1456
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
1457
1504
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
1458
1505
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
1459
1506
|
* revisions.
|
|
@@ -1472,13 +1519,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1472
1519
|
var query = {
|
|
1473
1520
|
'attachments': _params.attachments,
|
|
1474
1521
|
'att_encoding_info': _params.attEncodingInfo,
|
|
1475
|
-
'atts_since': _params.attsSince,
|
|
1476
1522
|
'conflicts': _params.conflicts,
|
|
1477
1523
|
'deleted_conflicts': _params.deletedConflicts,
|
|
1478
1524
|
'latest': _params.latest,
|
|
1479
1525
|
'local_seq': _params.localSeq,
|
|
1480
1526
|
'meta': _params.meta,
|
|
1481
|
-
'open_revs': _params.openRevs,
|
|
1482
1527
|
'rev': _params.rev,
|
|
1483
1528
|
'revs': _params.revs,
|
|
1484
1529
|
'revs_info': _params.revsInfo
|
|
@@ -1520,8 +1565,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1520
1565
|
* response.
|
|
1521
1566
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
1522
1567
|
* in attachment stubs if the particular attachment is compressed.
|
|
1523
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
1524
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
1525
1568
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
1526
1569
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
1527
1570
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -1532,8 +1575,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1532
1575
|
* document.
|
|
1533
1576
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
1534
1577
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
1535
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
1536
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
1537
1578
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
1538
1579
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
1539
1580
|
* revisions.
|
|
@@ -1552,13 +1593,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1552
1593
|
var query = {
|
|
1553
1594
|
'attachments': _params.attachments,
|
|
1554
1595
|
'att_encoding_info': _params.attEncodingInfo,
|
|
1555
|
-
'atts_since': _params.attsSince,
|
|
1556
1596
|
'conflicts': _params.conflicts,
|
|
1557
1597
|
'deleted_conflicts': _params.deletedConflicts,
|
|
1558
1598
|
'latest': _params.latest,
|
|
1559
1599
|
'local_seq': _params.localSeq,
|
|
1560
1600
|
'meta': _params.meta,
|
|
1561
|
-
'open_revs': _params.openRevs,
|
|
1562
1601
|
'rev': _params.rev,
|
|
1563
1602
|
'revs': _params.revs,
|
|
1564
1603
|
'revs_info': _params.revsInfo
|
|
@@ -1601,8 +1640,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1601
1640
|
* response.
|
|
1602
1641
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
1603
1642
|
* in attachment stubs if the particular attachment is compressed.
|
|
1604
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
1605
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
1606
1643
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
1607
1644
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
1608
1645
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -1613,8 +1650,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1613
1650
|
* document.
|
|
1614
1651
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
1615
1652
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
1616
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
1617
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
1618
1653
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
1619
1654
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
1620
1655
|
* revisions.
|
|
@@ -1633,13 +1668,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1633
1668
|
var query = {
|
|
1634
1669
|
'attachments': _params.attachments,
|
|
1635
1670
|
'att_encoding_info': _params.attEncodingInfo,
|
|
1636
|
-
'atts_since': _params.attsSince,
|
|
1637
1671
|
'conflicts': _params.conflicts,
|
|
1638
1672
|
'deleted_conflicts': _params.deletedConflicts,
|
|
1639
1673
|
'latest': _params.latest,
|
|
1640
1674
|
'local_seq': _params.localSeq,
|
|
1641
1675
|
'meta': _params.meta,
|
|
1642
|
-
'open_revs': _params.openRevs,
|
|
1643
1676
|
'rev': _params.rev,
|
|
1644
1677
|
'revs': _params.revs,
|
|
1645
1678
|
'revs_info': _params.revsInfo
|
|
@@ -1682,8 +1715,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1682
1715
|
* response.
|
|
1683
1716
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
1684
1717
|
* in attachment stubs if the particular attachment is compressed.
|
|
1685
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
1686
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
1687
1718
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
1688
1719
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
1689
1720
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -1694,8 +1725,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1694
1725
|
* document.
|
|
1695
1726
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
1696
1727
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
1697
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
1698
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
1699
1728
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
1700
1729
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
1701
1730
|
* revisions.
|
|
@@ -1714,13 +1743,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1714
1743
|
var query = {
|
|
1715
1744
|
'attachments': _params.attachments,
|
|
1716
1745
|
'att_encoding_info': _params.attEncodingInfo,
|
|
1717
|
-
'atts_since': _params.attsSince,
|
|
1718
1746
|
'conflicts': _params.conflicts,
|
|
1719
1747
|
'deleted_conflicts': _params.deletedConflicts,
|
|
1720
1748
|
'latest': _params.latest,
|
|
1721
1749
|
'local_seq': _params.localSeq,
|
|
1722
1750
|
'meta': _params.meta,
|
|
1723
|
-
'open_revs': _params.openRevs,
|
|
1724
1751
|
'rev': _params.rev,
|
|
1725
1752
|
'revs': _params.revs,
|
|
1726
1753
|
'revs_info': _params.revsInfo
|
|
@@ -1923,8 +1950,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1923
1950
|
* response.
|
|
1924
1951
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
1925
1952
|
* in attachment stubs if the particular attachment is compressed.
|
|
1926
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
1927
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
1928
1953
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
1929
1954
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
1930
1955
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -1935,8 +1960,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1935
1960
|
* document.
|
|
1936
1961
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
1937
1962
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
1938
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
1939
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
1940
1963
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
1941
1964
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
1942
1965
|
* revisions.
|
|
@@ -1955,13 +1978,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1955
1978
|
var query = {
|
|
1956
1979
|
'attachments': _params.attachments,
|
|
1957
1980
|
'att_encoding_info': _params.attEncodingInfo,
|
|
1958
|
-
'atts_since': _params.attsSince,
|
|
1959
1981
|
'conflicts': _params.conflicts,
|
|
1960
1982
|
'deleted_conflicts': _params.deletedConflicts,
|
|
1961
1983
|
'latest': _params.latest,
|
|
1962
1984
|
'local_seq': _params.localSeq,
|
|
1963
1985
|
'meta': _params.meta,
|
|
1964
|
-
'open_revs': _params.openRevs,
|
|
1965
1986
|
'rev': _params.rev,
|
|
1966
1987
|
'revs': _params.revs,
|
|
1967
1988
|
'revs_info': _params.revsInfo
|
|
@@ -3621,30 +3642,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
3621
3642
|
* * `default_analyzer` - the default text analyzer to use * `default_field` - whether to index the text in all
|
|
3622
3643
|
* document fields and what analyzer to use for that purpose.
|
|
3623
3644
|
* @param {string} [params.name] - name.
|
|
3624
|
-
* @param {JsonObject} [params.partialFilterSelector] - JSON object describing criteria used to select documents. The
|
|
3625
|
-
* selector specifies fields in the document, and provides an expression to evaluate with the field content or other
|
|
3626
|
-
* data.
|
|
3627
|
-
*
|
|
3628
|
-
* The selector object must:
|
|
3629
|
-
* * Be structured as valid JSON.
|
|
3630
|
-
* * Contain a valid query expression.
|
|
3631
|
-
*
|
|
3632
|
-
* Using a selector is significantly more efficient than using a JavaScript filter function, and is the recommended
|
|
3633
|
-
* option if filtering on document attributes only.
|
|
3634
|
-
*
|
|
3635
|
-
* Elementary selector syntax requires you to specify one or more fields, and the corresponding values required for
|
|
3636
|
-
* those fields. You can create more complex selector expressions by combining operators.
|
|
3637
|
-
*
|
|
3638
|
-
* Operators are identified by the use of a dollar sign `$` prefix in the name field.
|
|
3639
|
-
*
|
|
3640
|
-
* There are two core types of operators in the selector syntax:
|
|
3641
|
-
* * Combination operators: applied at the topmost level of selection. They are used to combine selectors. In addition
|
|
3642
|
-
* to the common boolean operators (`$and`, `$or`, `$not`, `$nor`) there are three combination operators: `$all`,
|
|
3643
|
-
* `$elemMatch`, and `$allMatch`. A combination operator takes a single argument. The argument is either another
|
|
3644
|
-
* selector, or an array of selectors.
|
|
3645
|
-
* * Condition operators: are specific to a field, and are used to evaluate the value stored in that field. For
|
|
3646
|
-
* instance, the basic `$eq` operator matches when the specified field contains a value that is equal to the supplied
|
|
3647
|
-
* argument.
|
|
3648
3645
|
* @param {boolean} [params.partitioned] - The default value is `true` for databases with `partitioned: true` and
|
|
3649
3646
|
* `false` otherwise. For databases with `partitioned: false` if this option is specified the value must be `false`.
|
|
3650
3647
|
* @param {string} [params.type] - Schema for the type of an index.
|
|
@@ -3663,7 +3660,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
3663
3660
|
'ddoc': _params.ddoc,
|
|
3664
3661
|
'def': _params.def,
|
|
3665
3662
|
'name': _params.name,
|
|
3666
|
-
'partial_filter_selector': _params.partialFilterSelector,
|
|
3667
3663
|
'partitioned': _params.partitioned,
|
|
3668
3664
|
'type': _params.type
|
|
3669
3665
|
};
|
|
@@ -3739,8 +3735,8 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
3739
3735
|
* analyzer tokenization.
|
|
3740
3736
|
*
|
|
3741
3737
|
* @param {Object} params - The parameters to send to the service.
|
|
3742
|
-
* @param {string} params.analyzer - analyzer.
|
|
3743
|
-
* @param {string} params.text - text.
|
|
3738
|
+
* @param {string} params.analyzer - The analyzer type that is being used at the tokenization.
|
|
3739
|
+
* @param {string} params.text - The text to tokenize with the analyzer.
|
|
3744
3740
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
3745
3741
|
* @returns {Promise<CloudantV1.Response<CloudantV1.SearchAnalyzeResult>>}
|
|
3746
3742
|
*/
|
|
@@ -4267,79 +4263,30 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4267
4263
|
*
|
|
4268
4264
|
* @param {Object} params - The parameters to send to the service.
|
|
4269
4265
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
4270
|
-
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
4271
|
-
* design document ID excluding the `_design/` prefix.
|
|
4272
|
-
* @param {string} params.index - Path parameter to specify the index name.
|
|
4273
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4274
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.GeoIndexInformation>>}
|
|
4275
|
-
*/
|
|
4276
|
-
CloudantV1.prototype.getGeoIndexInformation = function (params) {
|
|
4277
|
-
var _params = Object.assign({}, params);
|
|
4278
|
-
var requiredParams = ['db', 'ddoc', 'index'];
|
|
4279
|
-
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
4280
|
-
if (missingParams) {
|
|
4281
|
-
return Promise.reject(missingParams);
|
|
4282
|
-
}
|
|
4283
|
-
var path = {
|
|
4284
|
-
'db': _params.db,
|
|
4285
|
-
'ddoc': _params.ddoc,
|
|
4286
|
-
'index': _params.index
|
|
4287
|
-
};
|
|
4288
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getGeoIndexInformation');
|
|
4289
|
-
var parameters = {
|
|
4290
|
-
options: {
|
|
4291
|
-
url: '/{db}/_design/{ddoc}/_geo_info/{index}',
|
|
4292
|
-
method: 'GET',
|
|
4293
|
-
path: path,
|
|
4294
|
-
},
|
|
4295
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
4296
|
-
headers: extend(true, sdkHeaders, {
|
|
4297
|
-
'Accept': 'application/json',
|
|
4298
|
-
}, _params.headers),
|
|
4299
|
-
}),
|
|
4300
|
-
};
|
|
4301
|
-
return this.createRequest(parameters);
|
|
4302
|
-
};
|
|
4303
|
-
;
|
|
4304
|
-
/*************************
|
|
4305
|
-
* changes
|
|
4306
|
-
************************/
|
|
4307
|
-
/**
|
|
4308
|
-
* Retrieve change events for all databases.
|
|
4309
|
-
*
|
|
4310
|
-
* Lists changes to databases, like a global changes feed. Types of changes include updating the database and creating
|
|
4311
|
-
* or deleting a database. Like the changes feed, the feed is not guaranteed to return changes in the correct order
|
|
4312
|
-
* and might repeat changes. Polling modes for this method work like polling modes for the changes feed.
|
|
4313
|
-
* **Note: This endpoint requires _admin or _db_updates role and is only available on dedicated clusters.**.
|
|
4314
|
-
*
|
|
4315
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
4316
|
-
* @param {string} [params.feed] - Query parameter to specify the changes feed type.
|
|
4317
|
-
* @param {number} [params.heartbeat] - Query parameter to specify the period in milliseconds after which an empty
|
|
4318
|
-
* line is sent in the results. Only applicable for longpoll, continuous, and eventsource feeds. Overrides any timeout
|
|
4319
|
-
* to keep the feed alive indefinitely. May also be `true` to use default value of 60000.
|
|
4320
|
-
* @param {number} [params.timeout] - Query parameter to specify the maximum period in milliseconds to wait for a
|
|
4321
|
-
* change before the response is sent, even if there are no results. Only applicable for `longpoll` or `continuous`
|
|
4322
|
-
* feeds. Default value is specified by `httpd/changes_timeout` configuration option. Note that `60000` value is also
|
|
4323
|
-
* the default maximum timeout to prevent undetected dead connections.
|
|
4324
|
-
* @param {string} [params.since] - Query parameter to specify to start the results from the change immediately after
|
|
4325
|
-
* the given update sequence. Can be a valid update sequence or `now` value. Default is `0` i.e. all changes.
|
|
4266
|
+
* @param {string} params.ddoc - Path parameter to specify the design document name. The design document name is the
|
|
4267
|
+
* design document ID excluding the `_design/` prefix.
|
|
4268
|
+
* @param {string} params.index - Path parameter to specify the index name.
|
|
4326
4269
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4327
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
4270
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.GeoIndexInformation>>}
|
|
4328
4271
|
*/
|
|
4329
|
-
CloudantV1.prototype.
|
|
4272
|
+
CloudantV1.prototype.getGeoIndexInformation = function (params) {
|
|
4330
4273
|
var _params = Object.assign({}, params);
|
|
4331
|
-
var
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4274
|
+
var requiredParams = ['db', 'ddoc', 'index'];
|
|
4275
|
+
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
4276
|
+
if (missingParams) {
|
|
4277
|
+
return Promise.reject(missingParams);
|
|
4278
|
+
}
|
|
4279
|
+
var path = {
|
|
4280
|
+
'db': _params.db,
|
|
4281
|
+
'ddoc': _params.ddoc,
|
|
4282
|
+
'index': _params.index
|
|
4336
4283
|
};
|
|
4337
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
4284
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getGeoIndexInformation');
|
|
4338
4285
|
var parameters = {
|
|
4339
4286
|
options: {
|
|
4340
|
-
url: '/
|
|
4287
|
+
url: '/{db}/_design/{ddoc}/_geo_info/{index}',
|
|
4341
4288
|
method: 'GET',
|
|
4342
|
-
|
|
4289
|
+
path: path,
|
|
4343
4290
|
},
|
|
4344
4291
|
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
4345
4292
|
headers: extend(true, sdkHeaders, {
|
|
@@ -4356,7 +4303,9 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4356
4303
|
/**
|
|
4357
4304
|
* Retrieve the HTTP headers for a replication document.
|
|
4358
4305
|
*
|
|
4359
|
-
* Retrieves the HTTP headers
|
|
4306
|
+
* Retrieves the HTTP headers containing minimal amount of information about the specified replication document from
|
|
4307
|
+
* the `_replicator` database. The method supports the same query arguments as the `GET /_replicator/{doc_id}`
|
|
4308
|
+
* method, but only headers like content length and the revision (ETag header) are returned.
|
|
4360
4309
|
*
|
|
4361
4310
|
* @param {Object} params - The parameters to send to the service.
|
|
4362
4311
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
@@ -4391,6 +4340,42 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4391
4340
|
return this.createRequest(parameters);
|
|
4392
4341
|
};
|
|
4393
4342
|
;
|
|
4343
|
+
/**
|
|
4344
|
+
* Retrieve HTTP headers for a replication scheduler document.
|
|
4345
|
+
*
|
|
4346
|
+
* Retrieves the HTTP headers containing minimal amount of information about the specified replication scheduler
|
|
4347
|
+
* document. Since the response body is empty, using the HEAD method is a lightweight way to check if the replication
|
|
4348
|
+
* scheduler document exists or not.
|
|
4349
|
+
*
|
|
4350
|
+
* @param {Object} params - The parameters to send to the service.
|
|
4351
|
+
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4352
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4353
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Empty>>}
|
|
4354
|
+
*/
|
|
4355
|
+
CloudantV1.prototype.headSchedulerDocument = function (params) {
|
|
4356
|
+
var _params = Object.assign({}, params);
|
|
4357
|
+
var requiredParams = ['docId'];
|
|
4358
|
+
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
4359
|
+
if (missingParams) {
|
|
4360
|
+
return Promise.reject(missingParams);
|
|
4361
|
+
}
|
|
4362
|
+
var path = {
|
|
4363
|
+
'doc_id': _params.docId
|
|
4364
|
+
};
|
|
4365
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'headSchedulerDocument');
|
|
4366
|
+
var parameters = {
|
|
4367
|
+
options: {
|
|
4368
|
+
url: '/_scheduler/docs/_replicator/{doc_id}',
|
|
4369
|
+
method: 'HEAD',
|
|
4370
|
+
path: path,
|
|
4371
|
+
},
|
|
4372
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
4373
|
+
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
4374
|
+
}),
|
|
4375
|
+
};
|
|
4376
|
+
return this.createRequest(parameters);
|
|
4377
|
+
};
|
|
4378
|
+
;
|
|
4394
4379
|
/**
|
|
4395
4380
|
* Retrieve the HTTP headers for a replication scheduler job.
|
|
4396
4381
|
*
|
|
@@ -4522,8 +4507,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4522
4507
|
* response.
|
|
4523
4508
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
4524
4509
|
* in attachment stubs if the particular attachment is compressed.
|
|
4525
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
4526
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
4527
4510
|
* @param {boolean} [params.conflicts] - Query parameter to specify whether to include a list of conflicted revisions
|
|
4528
4511
|
* in the `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
4529
4512
|
* @param {boolean} [params.deletedConflicts] - Query parameter to specify whether to include a list of deleted
|
|
@@ -4534,8 +4517,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4534
4517
|
* document.
|
|
4535
4518
|
* @param {boolean} [params.meta] - Query parameter to specify whether to include document meta information. Acts the
|
|
4536
4519
|
* same as specifying all of the conflicts, deleted_conflicts and open_revs query parameters.
|
|
4537
|
-
* @param {string[]} [params.openRevs] - Query parameter to specify leaf revisions to retrieve. Additionally, it
|
|
4538
|
-
* accepts a value of `all` to return all leaf revisions.
|
|
4539
4520
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
4540
4521
|
* @param {boolean} [params.revs] - Query parameter to specify whether to include a list of all known document
|
|
4541
4522
|
* revisions.
|
|
@@ -4554,13 +4535,11 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4554
4535
|
var query = {
|
|
4555
4536
|
'attachments': _params.attachments,
|
|
4556
4537
|
'att_encoding_info': _params.attEncodingInfo,
|
|
4557
|
-
'atts_since': _params.attsSince,
|
|
4558
4538
|
'conflicts': _params.conflicts,
|
|
4559
4539
|
'deleted_conflicts': _params.deletedConflicts,
|
|
4560
4540
|
'latest': _params.latest,
|
|
4561
4541
|
'local_seq': _params.localSeq,
|
|
4562
4542
|
'meta': _params.meta,
|
|
4563
|
-
'open_revs': _params.openRevs,
|
|
4564
4543
|
'rev': _params.rev,
|
|
4565
4544
|
'revs': _params.revs,
|
|
4566
4545
|
'revs_info': _params.revsInfo
|
|
@@ -5292,6 +5271,47 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5292
5271
|
/*************************
|
|
5293
5272
|
* localDocuments
|
|
5294
5273
|
************************/
|
|
5274
|
+
/**
|
|
5275
|
+
* Retrieve HTTP headers for a local document.
|
|
5276
|
+
*
|
|
5277
|
+
* Retrieves the HTTP headers containing minimal amount of information about the specified local document. Since the
|
|
5278
|
+
* response body is empty, using the HEAD method is a lightweight way to check if the local document exists or not.
|
|
5279
|
+
*
|
|
5280
|
+
* @param {Object} params - The parameters to send to the service.
|
|
5281
|
+
* @param {string} params.db - Path parameter to specify the database name.
|
|
5282
|
+
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
5283
|
+
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
5284
|
+
* cache control.
|
|
5285
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5286
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Empty>>}
|
|
5287
|
+
*/
|
|
5288
|
+
CloudantV1.prototype.headLocalDocument = function (params) {
|
|
5289
|
+
var _params = Object.assign({}, params);
|
|
5290
|
+
var requiredParams = ['db', 'docId'];
|
|
5291
|
+
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
5292
|
+
if (missingParams) {
|
|
5293
|
+
return Promise.reject(missingParams);
|
|
5294
|
+
}
|
|
5295
|
+
var path = {
|
|
5296
|
+
'db': _params.db,
|
|
5297
|
+
'doc_id': _params.docId
|
|
5298
|
+
};
|
|
5299
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'headLocalDocument');
|
|
5300
|
+
var parameters = {
|
|
5301
|
+
options: {
|
|
5302
|
+
url: '/{db}/_local/{doc_id}',
|
|
5303
|
+
method: 'HEAD',
|
|
5304
|
+
path: path,
|
|
5305
|
+
},
|
|
5306
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
5307
|
+
headers: extend(true, sdkHeaders, {
|
|
5308
|
+
'If-None-Match': _params.ifNoneMatch
|
|
5309
|
+
}, _params.headers),
|
|
5310
|
+
}),
|
|
5311
|
+
};
|
|
5312
|
+
return this.createRequest(parameters);
|
|
5313
|
+
};
|
|
5314
|
+
;
|
|
5295
5315
|
/**
|
|
5296
5316
|
* Delete a local document.
|
|
5297
5317
|
*
|
|
@@ -5354,8 +5374,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5354
5374
|
* response.
|
|
5355
5375
|
* @param {boolean} [params.attEncodingInfo] - Query parameter to specify whether to include the encoding information
|
|
5356
5376
|
* in attachment stubs if the particular attachment is compressed.
|
|
5357
|
-
* @param {string[]} [params.attsSince] - Query parameter to specify whether to include attachments only since
|
|
5358
|
-
* specified revisions. Note this does not include the attachments for the specified revisions.
|
|
5359
5377
|
* @param {boolean} [params.localSeq] - Query parameter to specify whether to include the last update sequence for the
|
|
5360
5378
|
* document.
|
|
5361
5379
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -5371,7 +5389,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5371
5389
|
var query = {
|
|
5372
5390
|
'attachments': _params.attachments,
|
|
5373
5391
|
'att_encoding_info': _params.attEncodingInfo,
|
|
5374
|
-
'atts_since': _params.attsSince,
|
|
5375
5392
|
'local_seq': _params.localSeq
|
|
5376
5393
|
};
|
|
5377
5394
|
var path = {
|
|
@@ -5446,128 +5463,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5446
5463
|
return this.createRequest(parameters);
|
|
5447
5464
|
};
|
|
5448
5465
|
;
|
|
5449
|
-
/**
|
|
5450
|
-
* Query a list of all local documents in a database.
|
|
5451
|
-
*
|
|
5452
|
-
* Queries the list of all local document IDs. The results matching the request body parameters are returned in a JSON
|
|
5453
|
-
* object, including a list of matching local documents with basic contents, such as the ID. When no request body
|
|
5454
|
-
* parameters are specified, results for all local documents in the database are returned. Optionally, document
|
|
5455
|
-
* content or additional metadata can be included in the response.
|
|
5456
|
-
*
|
|
5457
|
-
* @param {Object} params - The parameters to send to the service.
|
|
5458
|
-
* @param {string} params.db - Path parameter to specify the database name.
|
|
5459
|
-
* @param {boolean} [params.attEncodingInfo] - Parameter to specify whether to include the encoding information in
|
|
5460
|
-
* attachment stubs if the particular attachment is compressed.
|
|
5461
|
-
* @param {boolean} [params.attachments] - Parameter to specify whether to include attachments bodies in a response.
|
|
5462
|
-
* @param {boolean} [params.conflicts] - Parameter to specify whether to include a list of conflicted revisions in the
|
|
5463
|
-
* `_conflicts` property of the returned document. Ignored if `include_docs` isn't `true`.
|
|
5464
|
-
* @param {boolean} [params.descending] - Parameter to specify whether to return the documents in descending by key
|
|
5465
|
-
* order.
|
|
5466
|
-
* @param {boolean} [params.includeDocs] - Parameter to specify whether to include the full content of the documents
|
|
5467
|
-
* in the response.
|
|
5468
|
-
* @param {boolean} [params.inclusiveEnd] - Parameter to specify whether the specified end key should be included in
|
|
5469
|
-
* the result.
|
|
5470
|
-
* @param {number} [params.limit] - Parameter to specify the number of returned documents to limit the result to.
|
|
5471
|
-
* @param {number} [params.skip] - Parameter to specify the number of records before starting to return the results.
|
|
5472
|
-
* @param {boolean} [params.updateSeq] - Parameter to specify whether to include in the response an update_seq value
|
|
5473
|
-
* indicating the sequence id of the database the view reflects.
|
|
5474
|
-
* @param {string} [params.endkey] - Schema for a document ID.
|
|
5475
|
-
* @param {string} [params.key] - Schema for a document ID.
|
|
5476
|
-
* @param {string[]} [params.keys] - Schema for a list of document IDs.
|
|
5477
|
-
* @param {string} [params.startkey] - Schema for a document ID.
|
|
5478
|
-
* @param {string} [params.accept] - The type of the response: application/json or application/octet-stream.
|
|
5479
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5480
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.AllDocsResult>>}
|
|
5481
|
-
*/
|
|
5482
|
-
CloudantV1.prototype.postLocalDocs = function (params) {
|
|
5483
|
-
var _params = Object.assign({}, params);
|
|
5484
|
-
var requiredParams = ['db'];
|
|
5485
|
-
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
5486
|
-
if (missingParams) {
|
|
5487
|
-
return Promise.reject(missingParams);
|
|
5488
|
-
}
|
|
5489
|
-
var body = {
|
|
5490
|
-
'att_encoding_info': _params.attEncodingInfo,
|
|
5491
|
-
'attachments': _params.attachments,
|
|
5492
|
-
'conflicts': _params.conflicts,
|
|
5493
|
-
'descending': _params.descending,
|
|
5494
|
-
'include_docs': _params.includeDocs,
|
|
5495
|
-
'inclusive_end': _params.inclusiveEnd,
|
|
5496
|
-
'limit': _params.limit,
|
|
5497
|
-
'skip': _params.skip,
|
|
5498
|
-
'update_seq': _params.updateSeq,
|
|
5499
|
-
'endkey': _params.endkey,
|
|
5500
|
-
'key': _params.key,
|
|
5501
|
-
'keys': _params.keys,
|
|
5502
|
-
'startkey': _params.startkey
|
|
5503
|
-
};
|
|
5504
|
-
var path = {
|
|
5505
|
-
'db': _params.db
|
|
5506
|
-
};
|
|
5507
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postLocalDocs');
|
|
5508
|
-
var parameters = {
|
|
5509
|
-
options: {
|
|
5510
|
-
url: '/{db}/_local_docs',
|
|
5511
|
-
method: 'POST',
|
|
5512
|
-
body: body,
|
|
5513
|
-
path: path,
|
|
5514
|
-
},
|
|
5515
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
5516
|
-
headers: extend(true, sdkHeaders, {
|
|
5517
|
-
'Content-Type': 'application/json',
|
|
5518
|
-
'Accept': _params.accept
|
|
5519
|
-
}, _params.headers),
|
|
5520
|
-
}),
|
|
5521
|
-
};
|
|
5522
|
-
return this.createRequest(parameters);
|
|
5523
|
-
};
|
|
5524
|
-
;
|
|
5525
|
-
/**
|
|
5526
|
-
* Multi-query the list of all local documents in a database.
|
|
5527
|
-
*
|
|
5528
|
-
* Runs multiple view queries of all local documents in this database. This operation enables you to request multiple
|
|
5529
|
-
* queries in a single request, in place of multiple `POST /{db}/_local_docs` requests.
|
|
5530
|
-
*
|
|
5531
|
-
* @param {Object} params - The parameters to send to the service.
|
|
5532
|
-
* @param {string} params.db - Path parameter to specify the database name.
|
|
5533
|
-
* @param {AllDocsQuery[]} params.queries - An array of query objects with fields for the parameters of each
|
|
5534
|
-
* individual view query to be executed. The field names and their meaning are the same as the query parameters of a
|
|
5535
|
-
* regular `/_all_docs` request.
|
|
5536
|
-
* @param {string} [params.accept] - The type of the response: application/json or application/octet-stream.
|
|
5537
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5538
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.AllDocsQueriesResult>>}
|
|
5539
|
-
*/
|
|
5540
|
-
CloudantV1.prototype.postLocalDocsQueries = function (params) {
|
|
5541
|
-
var _params = Object.assign({}, params);
|
|
5542
|
-
var requiredParams = ['db', 'queries'];
|
|
5543
|
-
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
5544
|
-
if (missingParams) {
|
|
5545
|
-
return Promise.reject(missingParams);
|
|
5546
|
-
}
|
|
5547
|
-
var body = {
|
|
5548
|
-
'queries': _params.queries
|
|
5549
|
-
};
|
|
5550
|
-
var path = {
|
|
5551
|
-
'db': _params.db
|
|
5552
|
-
};
|
|
5553
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postLocalDocsQueries');
|
|
5554
|
-
var parameters = {
|
|
5555
|
-
options: {
|
|
5556
|
-
url: '/{db}/_local_docs/queries',
|
|
5557
|
-
method: 'POST',
|
|
5558
|
-
body: body,
|
|
5559
|
-
path: path,
|
|
5560
|
-
},
|
|
5561
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
5562
|
-
headers: extend(true, sdkHeaders, {
|
|
5563
|
-
'Content-Type': 'application/json',
|
|
5564
|
-
'Accept': _params.accept
|
|
5565
|
-
}, _params.headers),
|
|
5566
|
-
}),
|
|
5567
|
-
};
|
|
5568
|
-
return this.createRequest(parameters);
|
|
5569
|
-
};
|
|
5570
|
-
;
|
|
5571
5466
|
/*************************
|
|
5572
5467
|
* databaseDetails
|
|
5573
5468
|
************************/
|
|
@@ -5731,6 +5626,30 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5731
5626
|
/*************************
|
|
5732
5627
|
* monitoring
|
|
5733
5628
|
************************/
|
|
5629
|
+
/**
|
|
5630
|
+
* Retrieve HTTP headers about whether the server is up.
|
|
5631
|
+
*
|
|
5632
|
+
* Retrieves the HTTP headers about whether the server is up.
|
|
5633
|
+
*
|
|
5634
|
+
* @param {Object} [params] - The parameters to send to the service.
|
|
5635
|
+
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5636
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.Empty>>}
|
|
5637
|
+
*/
|
|
5638
|
+
CloudantV1.prototype.headUpInformation = function (params) {
|
|
5639
|
+
var _params = Object.assign({}, params);
|
|
5640
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'headUpInformation');
|
|
5641
|
+
var parameters = {
|
|
5642
|
+
options: {
|
|
5643
|
+
url: '/_up',
|
|
5644
|
+
method: 'HEAD',
|
|
5645
|
+
},
|
|
5646
|
+
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
5647
|
+
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
5648
|
+
}),
|
|
5649
|
+
};
|
|
5650
|
+
return this.createRequest(parameters);
|
|
5651
|
+
};
|
|
5652
|
+
;
|
|
5734
5653
|
/**
|
|
5735
5654
|
* Retrieve list of running tasks.
|
|
5736
5655
|
*
|
|
@@ -5789,15 +5708,15 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5789
5708
|
/**
|
|
5790
5709
|
* Retrieve Activity Tracker events information.
|
|
5791
5710
|
*
|
|
5792
|
-
* Check event types that are being sent to IBM Cloud Activity Tracker
|
|
5711
|
+
* Check event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
|
|
5793
5712
|
*
|
|
5794
5713
|
* @param {Object} [params] - The parameters to send to the service.
|
|
5795
5714
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5796
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
5715
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.ActivityTrackerEvents>>}
|
|
5797
5716
|
*/
|
|
5798
|
-
CloudantV1.prototype.
|
|
5717
|
+
CloudantV1.prototype.getActivityTrackerEvents = function (params) {
|
|
5799
5718
|
var _params = Object.assign({}, params);
|
|
5800
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
5719
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'getActivityTrackerEvents');
|
|
5801
5720
|
var parameters = {
|
|
5802
5721
|
options: {
|
|
5803
5722
|
url: '/_api/v2/user/activity_tracker/events',
|
|
@@ -5815,15 +5734,15 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5815
5734
|
/**
|
|
5816
5735
|
* Modify Activity Tracker events configuration.
|
|
5817
5736
|
*
|
|
5818
|
-
* Configure event types that are being sent to IBM Cloud Activity Tracker
|
|
5737
|
+
* Configure event types that are being sent to IBM Cloud Activity Tracker for the IBM Cloudant instance.
|
|
5819
5738
|
*
|
|
5820
5739
|
* @param {Object} params - The parameters to send to the service.
|
|
5821
|
-
* @param {string[]} params.types - An array of event types that are being sent to IBM Cloud Activity Tracker
|
|
5822
|
-
*
|
|
5740
|
+
* @param {string[]} params.types - An array of event types that are being sent to IBM Cloud Activity Tracker for the
|
|
5741
|
+
* IBM Cloudant instance. "management" is a required element of this array.
|
|
5823
5742
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5824
5743
|
* @returns {Promise<CloudantV1.Response<CloudantV1.Ok>>}
|
|
5825
5744
|
*/
|
|
5826
|
-
CloudantV1.prototype.
|
|
5745
|
+
CloudantV1.prototype.postActivityTrackerEvents = function (params) {
|
|
5827
5746
|
var _params = Object.assign({}, params);
|
|
5828
5747
|
var requiredParams = ['types'];
|
|
5829
5748
|
var missingParams = ibm_cloud_sdk_core_1.getMissingParams(_params, requiredParams);
|
|
@@ -5833,7 +5752,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5833
5752
|
var body = {
|
|
5834
5753
|
'types': _params.types
|
|
5835
5754
|
};
|
|
5836
|
-
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', '
|
|
5755
|
+
var sdkHeaders = common_1.getSdkHeaders(CloudantV1.DEFAULT_SERVICE_NAME, 'v1', 'postActivityTrackerEvents');
|
|
5837
5756
|
var parameters = {
|
|
5838
5757
|
options: {
|
|
5839
5758
|
url: '/_api/v2/user/activity_tracker/events',
|
|
@@ -5886,6 +5805,18 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5886
5805
|
* interfaces
|
|
5887
5806
|
************************/
|
|
5888
5807
|
(function (CloudantV1) {
|
|
5808
|
+
/** Constants for the `getDbUpdates` operation. */
|
|
5809
|
+
var GetDbUpdatesConstants;
|
|
5810
|
+
(function (GetDbUpdatesConstants) {
|
|
5811
|
+
/** Query parameter to specify the changes feed type. */
|
|
5812
|
+
var Feed;
|
|
5813
|
+
(function (Feed) {
|
|
5814
|
+
Feed["CONTINUOUS"] = "continuous";
|
|
5815
|
+
Feed["EVENTSOURCE"] = "eventsource";
|
|
5816
|
+
Feed["LONGPOLL"] = "longpoll";
|
|
5817
|
+
Feed["NORMAL"] = "normal";
|
|
5818
|
+
})(Feed = GetDbUpdatesConstants.Feed || (GetDbUpdatesConstants.Feed = {}));
|
|
5819
|
+
})(GetDbUpdatesConstants = CloudantV1.GetDbUpdatesConstants || (CloudantV1.GetDbUpdatesConstants = {}));
|
|
5889
5820
|
/** Constants for the `postChanges` operation. */
|
|
5890
5821
|
var PostChangesConstants;
|
|
5891
5822
|
(function (PostChangesConstants) {
|
|
@@ -6163,7 +6094,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
6163
6094
|
/** Constants for the `postSearchAnalyze` operation. */
|
|
6164
6095
|
var PostSearchAnalyzeConstants;
|
|
6165
6096
|
(function (PostSearchAnalyzeConstants) {
|
|
6166
|
-
/** analyzer. */
|
|
6097
|
+
/** The analyzer type that is being used at the tokenization. */
|
|
6167
6098
|
var Analyzer;
|
|
6168
6099
|
(function (Analyzer) {
|
|
6169
6100
|
Analyzer["ARABIC"] = "arabic";
|
|
@@ -6288,18 +6219,6 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
6288
6219
|
Stale["OK"] = "ok";
|
|
6289
6220
|
})(Stale = GetGeoAsStreamConstants.Stale || (GetGeoAsStreamConstants.Stale = {}));
|
|
6290
6221
|
})(GetGeoAsStreamConstants = CloudantV1.GetGeoAsStreamConstants || (CloudantV1.GetGeoAsStreamConstants = {}));
|
|
6291
|
-
/** Constants for the `getDbUpdates` operation. */
|
|
6292
|
-
var GetDbUpdatesConstants;
|
|
6293
|
-
(function (GetDbUpdatesConstants) {
|
|
6294
|
-
/** Query parameter to specify the changes feed type. */
|
|
6295
|
-
var Feed;
|
|
6296
|
-
(function (Feed) {
|
|
6297
|
-
Feed["CONTINUOUS"] = "continuous";
|
|
6298
|
-
Feed["EVENTSOURCE"] = "eventsource";
|
|
6299
|
-
Feed["LONGPOLL"] = "longpoll";
|
|
6300
|
-
Feed["NORMAL"] = "normal";
|
|
6301
|
-
})(Feed = GetDbUpdatesConstants.Feed || (GetDbUpdatesConstants.Feed = {}));
|
|
6302
|
-
})(GetDbUpdatesConstants = CloudantV1.GetDbUpdatesConstants || (CloudantV1.GetDbUpdatesConstants = {}));
|
|
6303
6222
|
/** Constants for the `deleteReplicationDocument` operation. */
|
|
6304
6223
|
var DeleteReplicationDocumentConstants;
|
|
6305
6224
|
(function (DeleteReplicationDocumentConstants) {
|
|
@@ -6412,36 +6331,16 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
6412
6331
|
Batch["OK"] = "ok";
|
|
6413
6332
|
})(Batch = PutLocalDocumentConstants.Batch || (PutLocalDocumentConstants.Batch = {}));
|
|
6414
6333
|
})(PutLocalDocumentConstants = CloudantV1.PutLocalDocumentConstants || (CloudantV1.PutLocalDocumentConstants = {}));
|
|
6415
|
-
/** Constants for the `
|
|
6416
|
-
var
|
|
6417
|
-
(function (
|
|
6418
|
-
/** The type of the response: application/json or application/octet-stream. */
|
|
6419
|
-
var Accept;
|
|
6420
|
-
(function (Accept) {
|
|
6421
|
-
Accept["APPLICATION_JSON"] = "application/json";
|
|
6422
|
-
Accept["APPLICATION_OCTET_STREAM"] = "application/octet-stream";
|
|
6423
|
-
})(Accept = PostLocalDocsConstants.Accept || (PostLocalDocsConstants.Accept = {}));
|
|
6424
|
-
})(PostLocalDocsConstants = CloudantV1.PostLocalDocsConstants || (CloudantV1.PostLocalDocsConstants = {}));
|
|
6425
|
-
/** Constants for the `postLocalDocsQueries` operation. */
|
|
6426
|
-
var PostLocalDocsQueriesConstants;
|
|
6427
|
-
(function (PostLocalDocsQueriesConstants) {
|
|
6428
|
-
/** The type of the response: application/json or application/octet-stream. */
|
|
6429
|
-
var Accept;
|
|
6430
|
-
(function (Accept) {
|
|
6431
|
-
Accept["APPLICATION_JSON"] = "application/json";
|
|
6432
|
-
Accept["APPLICATION_OCTET_STREAM"] = "application/octet-stream";
|
|
6433
|
-
})(Accept = PostLocalDocsQueriesConstants.Accept || (PostLocalDocsQueriesConstants.Accept = {}));
|
|
6434
|
-
})(PostLocalDocsQueriesConstants = CloudantV1.PostLocalDocsQueriesConstants || (CloudantV1.PostLocalDocsQueriesConstants = {}));
|
|
6435
|
-
/** Constants for the `postActivityTrackerEventsConfiguration` operation. */
|
|
6436
|
-
var PostActivityTrackerEventsConfigurationConstants;
|
|
6437
|
-
(function (PostActivityTrackerEventsConfigurationConstants) {
|
|
6334
|
+
/** Constants for the `postActivityTrackerEvents` operation. */
|
|
6335
|
+
var PostActivityTrackerEventsConstants;
|
|
6336
|
+
(function (PostActivityTrackerEventsConstants) {
|
|
6438
6337
|
/** Types */
|
|
6439
6338
|
var Types;
|
|
6440
6339
|
(function (Types) {
|
|
6441
6340
|
Types["MANAGEMENT"] = "management";
|
|
6442
6341
|
Types["DATA"] = "data";
|
|
6443
|
-
})(Types =
|
|
6444
|
-
})(
|
|
6342
|
+
})(Types = PostActivityTrackerEventsConstants.Types || (PostActivityTrackerEventsConstants.Types = {}));
|
|
6343
|
+
})(PostActivityTrackerEventsConstants = CloudantV1.PostActivityTrackerEventsConstants || (CloudantV1.PostActivityTrackerEventsConstants = {}));
|
|
6445
6344
|
})(CloudantV1 || (CloudantV1 = {}));
|
|
6446
6345
|
module.exports = CloudantV1;
|
|
6447
6346
|
//# sourceMappingURL=v1.js.map
|