@ibm-cloud/cloudant 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -9
- package/cloudant/v1.d.ts +259 -131
- package/cloudant/v1.js +110 -58
- package/cloudant/v1.js.map +1 -1
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[](https://github.com/IBM/cloudant-node-sdk/actions/workflows/test.yml)
|
|
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.1.
|
|
5
|
+
# IBM Cloudant Node.js SDK Version 0.1.5
|
|
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).
|
|
@@ -46,6 +46,7 @@ to avoid surprises.
|
|
|
46
46
|
+ [2. Create your own database and add a document](#2-create-your-own-database-and-add-a-document)
|
|
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
|
+
+ [Further code examples](#further-code-examples)
|
|
49
50
|
* [Error handling](#error-handling)
|
|
50
51
|
* [Raw IO](#raw-io)
|
|
51
52
|
* [Further resources](#further-resources)
|
|
@@ -96,7 +97,7 @@ project:
|
|
|
96
97
|
service instance or a
|
|
97
98
|
[CouchDB](https://docs.couchdb.org/en/latest/install/index.html)
|
|
98
99
|
server.
|
|
99
|
-
- Node.js
|
|
100
|
+
- Node.js 14 or 16.
|
|
100
101
|
|
|
101
102
|
## Installation
|
|
102
103
|
|
|
@@ -183,7 +184,8 @@ CLOUDANT_USERNAME=<username>
|
|
|
183
184
|
CLOUDANT_PASSWORD=<password>
|
|
184
185
|
```
|
|
185
186
|
|
|
186
|
-
**Note**:
|
|
187
|
+
**Note**: There are also additional [*Bearer token*](https://github.com/IBM/node-sdk-core/blob/main/Authentication.md#bearer-token-authentication), [*Container*](https://github.com/IBM/node-sdk-core/blob/main/Authentication.md#container-authentication) and [*VPC Instance*](https://github.com/IBM/node-sdk-core/blob/main/Authentication.md#vpc-instance-authentication) authentication methods. For more details, please follow the provided links.
|
|
188
|
+
We recommend that you use [IAM](#iam-authentication) for Cloudant and
|
|
187
189
|
[Session](#session-cookie-authentication) for CouchDB authentication.
|
|
188
190
|
|
|
189
191
|
### Authentication with external configuration
|
|
@@ -204,11 +206,11 @@ or in the
|
|
|
204
206
|
|
|
205
207
|
## Using the SDK
|
|
206
208
|
|
|
207
|
-
For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md) documentation.
|
|
209
|
+
For fundamental SDK usage information and config options, please see the common [IBM Cloud SDK](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md) documentation.
|
|
208
210
|
|
|
209
211
|
### Request timeout configuration
|
|
210
212
|
|
|
211
|
-
No request timeout is defined, but a 2.5m connect and 2.5m read timeout is set by default. Be sure to set a request timeout appropriate to your application usage and environment.
|
|
213
|
+
No request timeout is defined, but a 2.5m connect and 2.5m read timeout is set by default. Be sure to set a request timeout appropriate to your application usage and environment.
|
|
212
214
|
The [request timeout](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md) section contains details on how to change the value.
|
|
213
215
|
|
|
214
216
|
**Note:** System settings may take precedence over configured timeout values.
|
|
@@ -889,6 +891,10 @@ When you run the code, you see the following output.
|
|
|
889
891
|
You have deleted the document.
|
|
890
892
|
```
|
|
891
893
|
|
|
894
|
+
#### Further code examples
|
|
895
|
+
|
|
896
|
+
For a complete list of code examples, see the [examples directory](examples#examples-for-node).
|
|
897
|
+
|
|
892
898
|
### Error handling
|
|
893
899
|
|
|
894
900
|
For sample code on handling errors, see
|
|
@@ -897,7 +903,7 @@ For sample code on handling errors, see
|
|
|
897
903
|
### Raw IO
|
|
898
904
|
|
|
899
905
|
For endpoints that read or write document content it is possible to bypass
|
|
900
|
-
usage of the built-in interface with byte streams.
|
|
906
|
+
usage of the built-in interface with byte streams.
|
|
901
907
|
|
|
902
908
|
Depending on the specific SDK operation it may be possible to:
|
|
903
909
|
* accept a user-provided byte stream to send to the server as a request body
|
|
@@ -914,8 +920,8 @@ without triggering JSON unmarshalling that is typically performed by the SDK.
|
|
|
914
920
|
The [update document](#3-update-your-previously-created-document) section
|
|
915
921
|
contains examples for both request and response byte stream cases.
|
|
916
922
|
|
|
917
|
-
The API reference contains further examples of using byte streams.
|
|
918
|
-
They are titled "Example request as stream" and are initially collapsed.
|
|
923
|
+
The API reference contains further examples of using byte streams.
|
|
924
|
+
They are titled "Example request as stream" and are initially collapsed.
|
|
919
925
|
Expand them to see examples of:
|
|
920
926
|
|
|
921
927
|
- Byte requests:
|