@ibm-cloud/cloudant 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -154
- package/cloudant/v1.d.ts +29 -24
- package/cloudant/v1.js +12 -13
- package/cloudant/v1.js.map +1 -1
- package/lib/cloudantBaseService.js +3 -0
- package/lib/cloudantBaseService.js.map +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://github.com/IBM/cloudant-node-sdk/releases/latest)
|
|
3
3
|
[](https://ibm.github.io/cloudant-node-sdk/)
|
|
4
4
|
|
|
5
|
-
# IBM Cloudant Node.js SDK Version 0.
|
|
5
|
+
# IBM Cloudant Node.js SDK Version 0.3.0
|
|
6
6
|
|
|
7
7
|
IBM Cloudant Node.js SDK is a client library that interacts with the
|
|
8
8
|
[IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=node).
|
|
@@ -42,8 +42,8 @@ to avoid surprises.
|
|
|
42
42
|
- [Using the SDK](#using-the-sdk)
|
|
43
43
|
* [Request timeout configuration](#request-timeout-configuration)
|
|
44
44
|
* [Code examples](#code-examples)
|
|
45
|
-
+ [1.
|
|
46
|
-
+ [2.
|
|
45
|
+
+ [1. Create a database and add a document](#1-create-a-database-and-add-a-document)
|
|
46
|
+
+ [2. Retrieve information from an existing database](#2-retrieve-information-from-an-existing-database)
|
|
47
47
|
+ [3. Update your previously created document](#3-update-your-previously-created-document)
|
|
48
48
|
+ [4. Delete your previously created document](#4-delete-your-previously-created-document)
|
|
49
49
|
+ [Further code examples](#further-code-examples)
|
|
@@ -78,8 +78,7 @@ project:
|
|
|
78
78
|
|
|
79
79
|
- Supported by IBM Cloudant.
|
|
80
80
|
- Server compatibility with:
|
|
81
|
-
- IBM Cloudant
|
|
82
|
-
- [Cloudant "Standard on Transaction Engine"](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te) for APIs compatible with Cloudant "Classic". For more information, see the [Feature Parity](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te#feature-parity-between-ibm-cloudant-on-the-transaction-engine-vs-classic-architecture) page.
|
|
81
|
+
- IBM Cloudant.
|
|
83
82
|
- [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations.
|
|
84
83
|
- Includes all the most popular and latest supported endpoints for
|
|
85
84
|
applications.
|
|
@@ -97,7 +96,7 @@ project:
|
|
|
97
96
|
service instance or a
|
|
98
97
|
[CouchDB](https://docs.couchdb.org/en/latest/install/index.html)
|
|
99
98
|
server.
|
|
100
|
-
- Node.js 14 or
|
|
99
|
+
- Node.js 14, 16 or 18.
|
|
101
100
|
|
|
102
101
|
## Installation
|
|
103
102
|
|
|
@@ -220,16 +219,14 @@ The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/main/READ
|
|
|
220
219
|
The following code examples
|
|
221
220
|
[authenticate with the environment variables](#authenticate-with-environment-variables).
|
|
222
221
|
|
|
223
|
-
#### 1.
|
|
222
|
+
#### 1. Create a database and add a document
|
|
224
223
|
|
|
225
|
-
**Note:** This example code assumes that `
|
|
224
|
+
**Note:** This example code assumes that `orders` database does not exist in your account.
|
|
226
225
|
|
|
227
|
-
This example code
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
This step is necessary for the SDK to distinguish the `EXAMPLES` custom service
|
|
232
|
-
name from the default service name which is `CLOUDANT`.
|
|
226
|
+
This example code creates `orders` database and adds a new document "example"
|
|
227
|
+
into it. To connect, you must set your environment variables with
|
|
228
|
+
the *service url*, *authentication type* and *authentication credentials*
|
|
229
|
+
of your Cloudant service.
|
|
233
230
|
|
|
234
231
|
Cloudant environment variable naming starts with a *service name* prefix that identifies your service.
|
|
235
232
|
By default this is `CLOUDANT`, see the settings in the
|
|
@@ -237,148 +234,12 @@ By default this is `CLOUDANT`, see the settings in the
|
|
|
237
234
|
|
|
238
235
|
If you would like to rename your Cloudant service from `CLOUDANT`,
|
|
239
236
|
you must use your defined service name as the prefix for all Cloudant related environment variables.
|
|
240
|
-
The code block below provides an example of instantiating a user-defined `EXAMPLES` service name.
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
EXAMPLES_URL=https://examples.cloudant.com
|
|
244
|
-
EXAMPLES_AUTH_TYPE=NOAUTH
|
|
245
|
-
```
|
|
246
237
|
|
|
247
238
|
Once the environment variables are set, you can try out the code examples.
|
|
248
239
|
|
|
249
240
|
<details open>
|
|
250
241
|
<summary>TypeScript:</summary>
|
|
251
242
|
|
|
252
|
-
```ts
|
|
253
|
-
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
254
|
-
```
|
|
255
|
-
[embedmd]:# (test/examples/src/ts/GetInfoFromExistingDatabase.ts /\/\/ 1./ $)
|
|
256
|
-
```ts
|
|
257
|
-
// 1. Create a Cloudant client with "EXAMPLES" service name =====================
|
|
258
|
-
const client = CloudantV1.newInstance({ serviceName: 'EXAMPLES' });
|
|
259
|
-
|
|
260
|
-
// 2. Get server information ====================================================
|
|
261
|
-
// call service without parameters:
|
|
262
|
-
client.getServerInformation().then((serverInformation) => {
|
|
263
|
-
const { version } = serverInformation.result;
|
|
264
|
-
console.log(`Server version ${version}`);
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
// 3. Get database information for "animaldb" ===================================
|
|
268
|
-
const dbName = 'animaldb';
|
|
269
|
-
|
|
270
|
-
// call service with embedded parameters:
|
|
271
|
-
client.getDatabaseInformation({ db: dbName }).then((dbInfo) => {
|
|
272
|
-
const documentCount = dbInfo.result.doc_count;
|
|
273
|
-
const dbNameResult = dbInfo.result.db_name;
|
|
274
|
-
|
|
275
|
-
// 4. Show document count in database =========================================
|
|
276
|
-
console.log(
|
|
277
|
-
`Document count in "${dbNameResult}" database is ${documentCount}.`
|
|
278
|
-
);
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
// 5. Get zebra document out of the database by document id =====================
|
|
282
|
-
const getDocParams: CloudantV1.GetDocumentParams = {
|
|
283
|
-
db: dbName,
|
|
284
|
-
docId: 'zebra',
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
// call service with predefined parameters:
|
|
288
|
-
client.getDocument(getDocParams).then((documentAboutZebra) => {
|
|
289
|
-
// result object is defined as a Document here:
|
|
290
|
-
const { result } = documentAboutZebra;
|
|
291
|
-
console.log(
|
|
292
|
-
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
|
|
293
|
-
);
|
|
294
|
-
});
|
|
295
|
-
```
|
|
296
|
-
</details>
|
|
297
|
-
|
|
298
|
-
<details>
|
|
299
|
-
<summary>JavaScript:</summary>
|
|
300
|
-
|
|
301
|
-
```js
|
|
302
|
-
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
303
|
-
```
|
|
304
|
-
[embedmd]:# (test/examples/src/js/GetInfoFromExistingDatabase.js /const getInfoFromExistingDatabase/ /getInfoFromExistingDatabase\(\);\n\}/)
|
|
305
|
-
```js
|
|
306
|
-
const getInfoFromExistingDatabase = async () => {
|
|
307
|
-
// 1. Create a Cloudant client with "EXAMPLES" service name ===================
|
|
308
|
-
const client = CloudantV1.newInstance({ serviceName: 'EXAMPLES' });
|
|
309
|
-
|
|
310
|
-
// 2. Get server information ==================================================
|
|
311
|
-
// call service without parameters:
|
|
312
|
-
const { version } = (await client.getServerInformation()).result;
|
|
313
|
-
console.log(`Server version ${version}`);
|
|
314
|
-
|
|
315
|
-
// 3. Get database information for "animaldb" =================================
|
|
316
|
-
const dbName = 'animaldb';
|
|
317
|
-
|
|
318
|
-
// call service with embedded parameters:
|
|
319
|
-
const dbInfo = await client.getDatabaseInformation({ db: dbName });
|
|
320
|
-
const documentCount = dbInfo.result.doc_count;
|
|
321
|
-
const dbNameResult = dbInfo.result.db_name;
|
|
322
|
-
|
|
323
|
-
// 4. Show document count in database =========================================
|
|
324
|
-
console.log(
|
|
325
|
-
`Document count in "${dbNameResult}" database is ${documentCount}.`
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
// 5. Get zebra document out of the database by document id ===================
|
|
329
|
-
const getDocParams = { db: dbName, docId: 'zebra' };
|
|
330
|
-
|
|
331
|
-
// call service with predefined parameters:
|
|
332
|
-
const documentAboutZebra = await client.getDocument(getDocParams);
|
|
333
|
-
|
|
334
|
-
// result object is defined as a Document here:
|
|
335
|
-
const { result } = documentAboutZebra;
|
|
336
|
-
|
|
337
|
-
console.log(
|
|
338
|
-
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
|
|
339
|
-
);
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
if (require.main === module) {
|
|
343
|
-
getInfoFromExistingDatabase();
|
|
344
|
-
}
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
</details>
|
|
348
|
-
|
|
349
|
-
When you run the code, you see a result similar to the following output.
|
|
350
|
-
|
|
351
|
-
[embedmd]:# (test/examples/output/GetInfoFromExistingDatabase.txt)
|
|
352
|
-
```txt
|
|
353
|
-
Server version 2.1.1
|
|
354
|
-
Document count in "animaldb" database is 11.
|
|
355
|
-
Document retrieved from database:
|
|
356
|
-
{
|
|
357
|
-
"_id": "zebra",
|
|
358
|
-
"_rev": "3-750dac460a6cc41e6999f8943b8e603e",
|
|
359
|
-
"wiki_page": "http://en.wikipedia.org/wiki/Plains_zebra",
|
|
360
|
-
"min_length": 2,
|
|
361
|
-
"max_length": 2.5,
|
|
362
|
-
"min_weight": 175,
|
|
363
|
-
"max_weight": 387,
|
|
364
|
-
"class": "mammal",
|
|
365
|
-
"diet": "herbivore"
|
|
366
|
-
}
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
#### 2. Create your own database and add a document
|
|
370
|
-
|
|
371
|
-
**Note:** This example code assumes that `orders` database does not exist in your account.
|
|
372
|
-
|
|
373
|
-
Now comes the exciting part, you create your own `orders` database and add a document about *Bob Smith* with your own [IAM](#iam-authentication) or
|
|
374
|
-
[Basic](#basic-authentication) service credentials.
|
|
375
|
-
|
|
376
|
-
<details>
|
|
377
|
-
<summary>Create code example</summary>
|
|
378
|
-
|
|
379
|
-
<details open>
|
|
380
|
-
<summary>TypeScript:</summary>
|
|
381
|
-
|
|
382
243
|
```ts
|
|
383
244
|
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
384
245
|
```
|
|
@@ -532,8 +393,6 @@ if (require.main === module) {
|
|
|
532
393
|
```
|
|
533
394
|
</details>
|
|
534
395
|
|
|
535
|
-
|
|
536
|
-
</details>
|
|
537
396
|
When you run the code, you see a result similar to the following output.
|
|
538
397
|
|
|
539
398
|
[embedmd]:# (test/examples/output/CreateDbAndDoc.txt)
|
|
@@ -548,11 +407,139 @@ You have created the document:
|
|
|
548
407
|
}
|
|
549
408
|
```
|
|
550
409
|
|
|
410
|
+
#### 2. Retrieve information from an existing database
|
|
411
|
+
|
|
412
|
+
**Note**: This example code assumes that you have created both the `orders`
|
|
413
|
+
database and the `example` document by
|
|
414
|
+
[running the previous example code](#1-create-a-database-and-add-a-document)
|
|
415
|
+
successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders'
|
|
416
|
+
database or 'example' document was not found."
|
|
417
|
+
|
|
418
|
+
<details>
|
|
419
|
+
<summary>Gather database information example</summary>
|
|
420
|
+
|
|
421
|
+
<details open>
|
|
422
|
+
<summary>TypeScript:</summary>
|
|
423
|
+
|
|
424
|
+
```ts
|
|
425
|
+
import {CloudantV1} from "@ibm-cloud/cloudant";
|
|
426
|
+
```
|
|
427
|
+
[embedmd]:# (test/examples/src/ts/GetInfoFromExistingDatabase.ts /\/\/ 1./ $)
|
|
428
|
+
```ts
|
|
429
|
+
// 1. Create a client with `CLOUDANT` default service name =====================
|
|
430
|
+
const client = CloudantV1.newInstance({});
|
|
431
|
+
|
|
432
|
+
// 2. Get server information ====================================================
|
|
433
|
+
// call service without parameters:
|
|
434
|
+
client.getServerInformation().then((serverInformation) => {
|
|
435
|
+
const { version } = serverInformation.result;
|
|
436
|
+
console.log(`Server version ${version}`);
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// 3. Get database information for "orders" ===================================
|
|
440
|
+
const dbName = 'orders';
|
|
441
|
+
|
|
442
|
+
// call service with embedded parameters:
|
|
443
|
+
client.getDatabaseInformation({ db: dbName }).then((dbInfo) => {
|
|
444
|
+
const documentCount = dbInfo.result.doc_count;
|
|
445
|
+
const dbNameResult = dbInfo.result.db_name;
|
|
446
|
+
|
|
447
|
+
// 4. Show document count in database =========================================
|
|
448
|
+
console.log(
|
|
449
|
+
`Document count in "${dbNameResult}" database is ${documentCount}.`
|
|
450
|
+
);
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// 5. Get "example" document out of the database by document id =====================
|
|
454
|
+
const getDocParams: CloudantV1.GetDocumentParams = {
|
|
455
|
+
db: dbName,
|
|
456
|
+
docId: 'example',
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// call service with predefined parameters:
|
|
460
|
+
client.getDocument(getDocParams).then((documentExample) => {
|
|
461
|
+
// result object is defined as a Document here:
|
|
462
|
+
const { result } = documentExample;
|
|
463
|
+
console.log(
|
|
464
|
+
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
|
|
465
|
+
);
|
|
466
|
+
});
|
|
467
|
+
```
|
|
468
|
+
</details>
|
|
469
|
+
|
|
470
|
+
<details>
|
|
471
|
+
<summary>JavaScript:</summary>
|
|
472
|
+
|
|
473
|
+
```js
|
|
474
|
+
const { CloudantV1 } = require('@ibm-cloud/cloudant');
|
|
475
|
+
```
|
|
476
|
+
[embedmd]:# (test/examples/src/js/GetInfoFromExistingDatabase.js /const getInfoFromExistingDatabase/ /getInfoFromExistingDatabase\(\);\n\}/)
|
|
477
|
+
```js
|
|
478
|
+
const getInfoFromExistingDatabase = async () => {
|
|
479
|
+
// 1. Create a client with `CLOUDANT` default service name ===================
|
|
480
|
+
const client = CloudantV1.newInstance({});
|
|
481
|
+
|
|
482
|
+
// 2. Get server information ==================================================
|
|
483
|
+
// call service without parameters:
|
|
484
|
+
const { version } = (await client.getServerInformation()).result;
|
|
485
|
+
console.log(`Server version ${version}`);
|
|
486
|
+
|
|
487
|
+
// 3. Get database information for "orders" =================================
|
|
488
|
+
const dbName = 'orders';
|
|
489
|
+
|
|
490
|
+
// call service with embedded parameters:
|
|
491
|
+
const dbInfo = await client.getDatabaseInformation({ db: dbName });
|
|
492
|
+
const documentCount = dbInfo.result.doc_count;
|
|
493
|
+
const dbNameResult = dbInfo.result.db_name;
|
|
494
|
+
|
|
495
|
+
// 4. Show document count in database =========================================
|
|
496
|
+
console.log(
|
|
497
|
+
`Document count in "${dbNameResult}" database is ${documentCount}.`
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
// 5. Get "example" document out of the database by document id ===================
|
|
501
|
+
const getDocParams = { db: dbName, docId: 'example' };
|
|
502
|
+
|
|
503
|
+
// call service with predefined parameters:
|
|
504
|
+
const documentExample = await client.getDocument(getDocParams);
|
|
505
|
+
|
|
506
|
+
// result object is defined as a Document here:
|
|
507
|
+
const { result } = documentExample;
|
|
508
|
+
|
|
509
|
+
console.log(
|
|
510
|
+
`Document retrieved from database:\n${JSON.stringify(result, null, 2)}`
|
|
511
|
+
);
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
if (require.main === module) {
|
|
515
|
+
getInfoFromExistingDatabase();
|
|
516
|
+
}
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
</details>
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
</details>
|
|
523
|
+
When you run the code, you see a result similar to the following output.
|
|
524
|
+
|
|
525
|
+
[embedmd]:# (test/examples/output/GetInfoFromExistingDatabase.txt)
|
|
526
|
+
```txt
|
|
527
|
+
Server version 2.1.1
|
|
528
|
+
Document count in "orders" database is 1.
|
|
529
|
+
Document retrieved from database:
|
|
530
|
+
{
|
|
531
|
+
"_id": "example",
|
|
532
|
+
"_rev": "1-1b403633540686aa32d013fda9041a5d",
|
|
533
|
+
"name": "Bob Smith",
|
|
534
|
+
"joined": "2019-01-24T10:42:59.000Z"
|
|
535
|
+
}
|
|
536
|
+
```
|
|
537
|
+
|
|
551
538
|
#### 3. Update your previously created document
|
|
552
539
|
|
|
553
540
|
**Note**: This example code assumes that you have created both the `orders`
|
|
554
541
|
database and the `example` document by
|
|
555
|
-
[running the previous example code](#
|
|
542
|
+
[running the previous example code](#1-create-a-database-and-add-a-document)
|
|
556
543
|
successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders'
|
|
557
544
|
database or 'example' document was not found."
|
|
558
545
|
|
|
@@ -771,7 +758,7 @@ You have updated the document:
|
|
|
771
758
|
|
|
772
759
|
**Note**: This example code assumes that you have created both the `orders`
|
|
773
760
|
database and the `example` document by
|
|
774
|
-
[running the previous example code](#
|
|
761
|
+
[running the previous example code](#1-create-a-database-and-add-a-document)
|
|
775
762
|
successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders'
|
|
776
763
|
database or 'example' document was not found."
|
|
777
764
|
|
package/cloudant/v1.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
149
149
|
*
|
|
150
150
|
* Before using the changes feed we recommend reading the
|
|
151
151
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
152
|
-
* appropriate use cases.
|
|
152
|
+
* appropriate use cases.
|
|
153
153
|
*
|
|
154
154
|
* @param {Object} params - The parameters to send to the service.
|
|
155
155
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
@@ -245,7 +245,7 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
245
245
|
*
|
|
246
246
|
* Before using the changes feed we recommend reading the
|
|
247
247
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
248
|
-
* appropriate use cases.
|
|
248
|
+
* appropriate use cases.
|
|
249
249
|
*
|
|
250
250
|
* @param {Object} params - The parameters to send to the service.
|
|
251
251
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
@@ -343,9 +343,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
343
343
|
* @param {Object} params - The parameters to send to the service.
|
|
344
344
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
345
345
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
346
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
346
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
347
347
|
*/
|
|
348
|
-
headDatabase(params: CloudantV1.HeadDatabaseParams): Promise<CloudantV1.Response<CloudantV1.
|
|
348
|
+
headDatabase(params: CloudantV1.HeadDatabaseParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
349
349
|
/**
|
|
350
350
|
* Query a list of all database names in the instance.
|
|
351
351
|
*
|
|
@@ -433,9 +433,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
433
433
|
* matter what rev was requested.
|
|
434
434
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
435
435
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
436
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
436
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
437
437
|
*/
|
|
438
|
-
headDocument(params: CloudantV1.HeadDocumentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
438
|
+
headDocument(params: CloudantV1.HeadDocumentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
439
439
|
/**
|
|
440
440
|
* Create or modify a document in a database.
|
|
441
441
|
*
|
|
@@ -851,9 +851,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
851
851
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
852
852
|
* cache control.
|
|
853
853
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
854
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
854
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
855
855
|
*/
|
|
856
|
-
headDesignDocument(params: CloudantV1.HeadDesignDocumentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
856
|
+
headDesignDocument(params: CloudantV1.HeadDesignDocumentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
857
857
|
/**
|
|
858
858
|
* Delete a design document.
|
|
859
859
|
*
|
|
@@ -2021,9 +2021,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2021
2021
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
2022
2022
|
* cache control.
|
|
2023
2023
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2024
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2024
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2025
2025
|
*/
|
|
2026
|
-
headReplicationDocument(params: CloudantV1.HeadReplicationDocumentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2026
|
+
headReplicationDocument(params: CloudantV1.HeadReplicationDocumentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2027
2027
|
/**
|
|
2028
2028
|
* Retrieve HTTP headers for a replication scheduler document.
|
|
2029
2029
|
*
|
|
@@ -2034,9 +2034,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2034
2034
|
* @param {Object} params - The parameters to send to the service.
|
|
2035
2035
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
2036
2036
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2037
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2037
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2038
2038
|
*/
|
|
2039
|
-
headSchedulerDocument(params: CloudantV1.HeadSchedulerDocumentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2039
|
+
headSchedulerDocument(params: CloudantV1.HeadSchedulerDocumentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2040
2040
|
/**
|
|
2041
2041
|
* Retrieve the HTTP headers for a replication scheduler job.
|
|
2042
2042
|
*
|
|
@@ -2046,9 +2046,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2046
2046
|
* @param {Object} params - The parameters to send to the service.
|
|
2047
2047
|
* @param {string} params.jobId - Path parameter to specify the replication job id.
|
|
2048
2048
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2049
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2049
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2050
2050
|
*/
|
|
2051
|
-
headSchedulerJob(params: CloudantV1.HeadSchedulerJobParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2051
|
+
headSchedulerJob(params: CloudantV1.HeadSchedulerJobParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2052
2052
|
/**
|
|
2053
2053
|
* Cancel a replication.
|
|
2054
2054
|
*
|
|
@@ -2158,8 +2158,7 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2158
2158
|
* recent events, and other information.
|
|
2159
2159
|
*
|
|
2160
2160
|
* @param {Object} [params] - The parameters to send to the service.
|
|
2161
|
-
* @param {number} [params.limit] - Query parameter to specify the number of returned
|
|
2162
|
-
* to.
|
|
2161
|
+
* @param {number} [params.limit] - Query parameter to specify the number of returned jobs to limit the result to.
|
|
2163
2162
|
* @param {number} [params.skip] - Query parameter to specify the number of records before starting to return the
|
|
2164
2163
|
* results.
|
|
2165
2164
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -2314,9 +2313,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2314
2313
|
* cache control.
|
|
2315
2314
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
2316
2315
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2317
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2316
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2318
2317
|
*/
|
|
2319
|
-
headAttachment(params: CloudantV1.HeadAttachmentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2318
|
+
headAttachment(params: CloudantV1.HeadAttachmentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2320
2319
|
/**
|
|
2321
2320
|
* Delete an attachment.
|
|
2322
2321
|
*
|
|
@@ -2398,9 +2397,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2398
2397
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
2399
2398
|
* cache control.
|
|
2400
2399
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2401
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2400
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2402
2401
|
*/
|
|
2403
|
-
headLocalDocument(params: CloudantV1.HeadLocalDocumentParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2402
|
+
headLocalDocument(params: CloudantV1.HeadLocalDocumentParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2404
2403
|
/**
|
|
2405
2404
|
* Delete a local document.
|
|
2406
2405
|
*
|
|
@@ -2507,9 +2506,9 @@ declare class CloudantV1 extends CloudantBaseService {
|
|
|
2507
2506
|
*
|
|
2508
2507
|
* @param {Object} [params] - The parameters to send to the service.
|
|
2509
2508
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
2510
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
2509
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
2511
2510
|
*/
|
|
2512
|
-
headUpInformation(params?: CloudantV1.HeadUpInformationParams): Promise<CloudantV1.Response<CloudantV1.
|
|
2511
|
+
headUpInformation(params?: CloudantV1.HeadUpInformationParams): Promise<CloudantV1.Response<CloudantV1.EmptyObject>>;
|
|
2513
2512
|
/**
|
|
2514
2513
|
* Retrieve list of running tasks.
|
|
2515
2514
|
*
|
|
@@ -2582,7 +2581,7 @@ declare namespace CloudantV1 {
|
|
|
2582
2581
|
/** The callback for a service request. */
|
|
2583
2582
|
type Callback<T> = (error: any, response?: Response<T>) => void;
|
|
2584
2583
|
/** The body of a service request that returns no response data. */
|
|
2585
|
-
interface
|
|
2584
|
+
interface EmptyObject {
|
|
2586
2585
|
}
|
|
2587
2586
|
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
|
|
2588
2587
|
interface JsonObject {
|
|
@@ -5079,7 +5078,7 @@ declare namespace CloudantV1 {
|
|
|
5079
5078
|
}
|
|
5080
5079
|
/** Parameters for the `getSchedulerJobs` operation. */
|
|
5081
5080
|
interface GetSchedulerJobsParams {
|
|
5082
|
-
/** Query parameter to specify the number of returned
|
|
5081
|
+
/** Query parameter to specify the number of returned jobs to limit the result to. */
|
|
5083
5082
|
limit?: number;
|
|
5084
5083
|
/** Query parameter to specify the number of records before starting to return the results. */
|
|
5085
5084
|
skip?: number;
|
|
@@ -5913,6 +5912,8 @@ declare namespace CloudantV1 {
|
|
|
5913
5912
|
}
|
|
5914
5913
|
/** Value of built-in `/_all_docs` style view. */
|
|
5915
5914
|
interface DocsResultRowValue {
|
|
5915
|
+
/** If `true` then the document is deleted. Not present for undeleted documents. */
|
|
5916
|
+
deleted?: boolean;
|
|
5916
5917
|
/** Schema for a document revision identifier. */
|
|
5917
5918
|
rev: string;
|
|
5918
5919
|
}
|
|
@@ -6331,6 +6332,10 @@ declare namespace CloudantV1 {
|
|
|
6331
6332
|
* should occur.
|
|
6332
6333
|
*/
|
|
6333
6334
|
target_proxy?: string;
|
|
6335
|
+
/** Specify whether to use _bulk_get for fetching documents from the source. If unset, the server configured
|
|
6336
|
+
* default will be used.
|
|
6337
|
+
*/
|
|
6338
|
+
use_bulk_get?: boolean;
|
|
6334
6339
|
/** Specify if checkpoints should be saved during replication. Using checkpoints means a replication can be
|
|
6335
6340
|
* efficiently resumed.
|
|
6336
6341
|
*/
|
package/cloudant/v1.js
CHANGED
|
@@ -344,7 +344,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
344
344
|
*
|
|
345
345
|
* Before using the changes feed we recommend reading the
|
|
346
346
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
347
|
-
* appropriate use cases.
|
|
347
|
+
* appropriate use cases.
|
|
348
348
|
*
|
|
349
349
|
* @param {Object} params - The parameters to send to the service.
|
|
350
350
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
@@ -490,7 +490,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
490
490
|
*
|
|
491
491
|
* Before using the changes feed we recommend reading the
|
|
492
492
|
* [FAQs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-faq-using-changes-feed) to understand the limitations and
|
|
493
|
-
* appropriate use cases.
|
|
493
|
+
* appropriate use cases.
|
|
494
494
|
*
|
|
495
495
|
* @param {Object} params - The parameters to send to the service.
|
|
496
496
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
@@ -639,7 +639,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
639
639
|
* @param {Object} params - The parameters to send to the service.
|
|
640
640
|
* @param {string} params.db - Path parameter to specify the database name.
|
|
641
641
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
642
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
642
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
643
643
|
*/
|
|
644
644
|
CloudantV1.prototype.headDatabase = function (params) {
|
|
645
645
|
var _params = __assign({}, params);
|
|
@@ -887,7 +887,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
887
887
|
* matter what rev was requested.
|
|
888
888
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
889
889
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
890
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
890
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
891
891
|
*/
|
|
892
892
|
CloudantV1.prototype.headDocument = function (params) {
|
|
893
893
|
var _params = __assign({}, params);
|
|
@@ -1924,7 +1924,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
1924
1924
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
1925
1925
|
* cache control.
|
|
1926
1926
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1927
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
1927
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
1928
1928
|
*/
|
|
1929
1929
|
CloudantV1.prototype.headDesignDocument = function (params) {
|
|
1930
1930
|
var _params = __assign({}, params);
|
|
@@ -4249,7 +4249,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4249
4249
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
4250
4250
|
* cache control.
|
|
4251
4251
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4252
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
4252
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
4253
4253
|
*/
|
|
4254
4254
|
CloudantV1.prototype.headReplicationDocument = function (params) {
|
|
4255
4255
|
var _params = __assign({}, params);
|
|
@@ -4287,7 +4287,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4287
4287
|
* @param {Object} params - The parameters to send to the service.
|
|
4288
4288
|
* @param {string} params.docId - Path parameter to specify the document ID.
|
|
4289
4289
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4290
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
4290
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
4291
4291
|
*/
|
|
4292
4292
|
CloudantV1.prototype.headSchedulerDocument = function (params) {
|
|
4293
4293
|
var _params = __assign({}, params);
|
|
@@ -4322,7 +4322,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4322
4322
|
* @param {Object} params - The parameters to send to the service.
|
|
4323
4323
|
* @param {string} params.jobId - Path parameter to specify the replication job id.
|
|
4324
4324
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
4325
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
4325
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
4326
4326
|
*/
|
|
4327
4327
|
CloudantV1.prototype.headSchedulerJob = function (params) {
|
|
4328
4328
|
var _params = __assign({}, params);
|
|
@@ -4614,8 +4614,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
4614
4614
|
* recent events, and other information.
|
|
4615
4615
|
*
|
|
4616
4616
|
* @param {Object} [params] - The parameters to send to the service.
|
|
4617
|
-
* @param {number} [params.limit] - Query parameter to specify the number of returned
|
|
4618
|
-
* to.
|
|
4617
|
+
* @param {number} [params.limit] - Query parameter to specify the number of returned jobs to limit the result to.
|
|
4619
4618
|
* @param {number} [params.skip] - Query parameter to specify the number of records before starting to return the
|
|
4620
4619
|
* results.
|
|
4621
4620
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
@@ -5003,7 +5002,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5003
5002
|
* cache control.
|
|
5004
5003
|
* @param {string} [params.rev] - Query parameter to specify a document revision.
|
|
5005
5004
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5006
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
5005
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
5007
5006
|
*/
|
|
5008
5007
|
CloudantV1.prototype.headAttachment = function (params) {
|
|
5009
5008
|
var _params = __assign({}, params);
|
|
@@ -5222,7 +5221,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5222
5221
|
* @param {string} [params.ifNoneMatch] - Header parameter to specify a double quoted document revision token for
|
|
5223
5222
|
* cache control.
|
|
5224
5223
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5225
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
5224
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
5226
5225
|
*/
|
|
5227
5226
|
CloudantV1.prototype.headLocalDocument = function (params) {
|
|
5228
5227
|
var _params = __assign({}, params);
|
|
@@ -5532,7 +5531,7 @@ var CloudantV1 = /** @class */ (function (_super) {
|
|
|
5532
5531
|
*
|
|
5533
5532
|
* @param {Object} [params] - The parameters to send to the service.
|
|
5534
5533
|
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
5535
|
-
* @returns {Promise<CloudantV1.Response<CloudantV1.
|
|
5534
|
+
* @returns {Promise<CloudantV1.Response<CloudantV1.EmptyObject>>}
|
|
5536
5535
|
*/
|
|
5537
5536
|
CloudantV1.prototype.headUpInformation = function (params) {
|
|
5538
5537
|
var _params = __assign({}, params);
|