@ibm-cloud/cloudant
Advanced tools
Comparing version 0.0.12 to 0.0.13
{ | ||
"name": "@ibm-cloud/cloudant", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "IBM Cloudant Node.js SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
112
README.md
@@ -15,9 +15,10 @@ <!-- | ||
[![Release](https://img.shields.io/github/v/release/IBM/cloudant-node-sdk?include_prereleases&sort=semver)](https://github.com/IBM/cloudant-node-sdk/releases/latest) | ||
[![Docs](https://img.shields.io/static/v1?label=nodedoc&message=latest&color=blue)](https://ibm.github.io/cloudant-node-sdk/) | ||
# IBM Cloudant Node.js SDK Version 0.0.12 | ||
# IBM Cloudant Node.js SDK Version 0.0.13 | ||
Node.js client library to interact with the | ||
IBM Cloudant Node.js SDK is a client library that interacts with the | ||
[IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=node). | ||
Disclaimer: this SDK is being released initially as a **pre-release** version. | ||
Disclaimer: This SDK is being released initially as a **pre-release** version. | ||
Changes might occur which impact applications that use this SDK. | ||
@@ -33,4 +34,2 @@ | ||
You should regenerate the TOC after making changes to this file. | ||
npx markdown-toc -i README.md | ||
@@ -63,3 +62,3 @@ --> | ||
- [Issues](#issues) | ||
- [Open source @ IBM](#open-source--ibm) | ||
- [Open source at IBM](#open-source-at-ibm) | ||
- [Contributing](#contributing) | ||
@@ -75,3 +74,3 @@ - [License](#license) | ||
The IBM Cloudant Node.js SDK allows developers to programmatically | ||
interact with IBM [Cloudant](https://cloud.ibm.com/apidocs/cloudant) | ||
interact with [IBM Cloudant](https://cloud.ibm.com/apidocs/cloudant) | ||
with the help of the `@ibm-cloud/cloudant` package. | ||
@@ -84,3 +83,3 @@ | ||
This SDK should make life easier for programmers to do what’s really important | ||
for them: develop. | ||
to them: developing software. | ||
@@ -92,9 +91,9 @@ Reasons why you should consider using Cloudant Node.js SDK in your | ||
- Server compatibility with: | ||
- IBM Cloudant "Classic" | ||
- [Cloudant "Standard on Transaction Engine"](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te) for APIs compatible with Cloudant "Classic" (see the [Feature Parity page](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-overview-te#feature-parity-between-ibm-cloudant-on-the-transaction-engine-vs-classic-architecture) for further details). | ||
- [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations | ||
- IBM Cloudant "Classic". | ||
- [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. | ||
- [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations. | ||
- Includes all the most popular and latest supported endpoints for | ||
applications. | ||
- Handles the authentication. | ||
- Familiar user experience of IBM Cloud SDKs. | ||
- Familiar user experience with IBM Cloud SDKs. | ||
- Flexibility to use either built-in models or byte-based requests and responses for documents. | ||
@@ -149,4 +148,4 @@ - `Promise` based design with asynchronous HTTP requests. | ||
`username` and `password` credentials. | ||
1. *Noauth* authentication does not need any credentials. Note that this | ||
authentication type will only work for queries against a database with read | ||
1. *Noauth* authentication does not require credentials. Note that this | ||
authentication type only works with queries against a database with read | ||
access for everyone. | ||
@@ -165,4 +164,4 @@ 1. The service `url`. | ||
For Cloudant *IAM authentication* set the following environmental variables by | ||
replacing `<url>` and `<apikey>` with your proper | ||
For Cloudant *IAM authentication*, set the following environmental variables by | ||
replacing the `<url>` and `<apikey>` with your proper | ||
[service credentials][service-credentials]. There is no need to set | ||
@@ -178,4 +177,4 @@ `CLOUDANT_AUTH_TYPE` to `IAM` because it is the default. | ||
For `COUCHDB_SESSION` authentication set the following environmental variables | ||
by replacing `<url>`, `<username>` and `<password>` with your proper | ||
For `COUCHDB_SESSION` authentication, set the following environmental variables | ||
by replacing the `<url>`, `<username>` and `<password>` with your proper | ||
[service credentials][service-credentials]. | ||
@@ -192,4 +191,4 @@ | ||
For *Basic authentication* set the following environmental variables by | ||
replacing `<url>`, `<username>` and `<password>` with your proper | ||
For *Basic authentication*, set the following environmental variables by | ||
replacing the `<url>`, `<username>` and `<password>` with your proper | ||
[service credentials][service-credentials]. | ||
@@ -204,3 +203,3 @@ | ||
**Note**: We recommend using [IAM](#iam-authentication) for Cloudant and | ||
**Note**: We recommend that you use [IAM](#iam-authentication) for Cloudant and | ||
[Session](#session-cookie-authentication) for CouchDB authentication. | ||
@@ -222,3 +221,3 @@ | ||
or in the | ||
[Node.js SDK Core document about authentication](https://github.com/IBM/node-sdk-core/blob/master/Authentication.md). | ||
[Node.js SDK Core document](https://github.com/IBM/node-sdk-core/blob/master/Authentication.md) about authentication. | ||
@@ -232,16 +231,24 @@ ## Using the SDK | ||
The code examples below will follow the | ||
[authentication with environment variables](#authenticate-with-environment-variables). | ||
The following code examples | ||
[authenticate with the environment variables](#authenticate-with-environment-variables). | ||
#### 1. Retrieve information from an existing database | ||
**Note:** this example code assumes that `animaldb` database does not exist in your account. | ||
**Note:** This example code assumes that `animaldb` database does not exist in your account. | ||
This example code gathers some information about an existing database hosted on | ||
the https://examples.cloudant.com/ service `url`. To do this, you need to | ||
This example code gathers information about an existing database hosted on | ||
the https://examples.cloudant.com/ service `url`. To connect, you must | ||
extend your environment variables with the *service url* and *authentication | ||
type* to use `NOAUTH` authentication while reaching the `animaldb` database. | ||
type* to use `NOAUTH` authentication while you connect to the `animaldb` database. | ||
This step is necessary for the SDK to distinguish the `EXAMPLES` custom service | ||
name from the default service name which is `CLOUDANT`. | ||
Cloudant environment variable naming starts with a *service name* prefix that identifies your service. | ||
By default this is `CLOUDANT`, see the settings in the | ||
[authentication with environment variables section](#authentication-with-environment-variables). | ||
If you would like to rename your Cloudant service from `CLOUDANT`, | ||
you must use your defined service name as the prefix for all Cloudant related environment variables. | ||
The code block below provides an example of instantiating a user-defined `EXAMPLES` service name. | ||
```bash | ||
@@ -350,3 +357,3 @@ EXAMPLES_URL=https://examples.cloudant.com | ||
The result of the code is similar to the following output. | ||
When you run the code, you see a result similar to the following output. | ||
@@ -373,6 +380,5 @@ [embedmd]:# (test/examples/output/GetInfoFromExistingDatabase.txt) | ||
**Note:** this example code assumes that `orders` database does not exist in your account. | ||
**Note:** This example code assumes that `orders` database does not exist in your account. | ||
Now comes the exciting part of creating your own `orders` database and adding | ||
a document about *Bob Smith* with your own [IAM](#iam-authentication) or | ||
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 | ||
[Basic](#basic-authentication) service credentials. | ||
@@ -504,3 +510,3 @@ | ||
</details> | ||
The result of the code is similar to the following output. | ||
When you run the code, you see a result similar to the following output. | ||
@@ -521,7 +527,7 @@ [embedmd]:# (test/examples/output/CreateDbAndDoc.txt) | ||
**Note**: this example code assumes that you have created both the `orders` | ||
**Note**: This example code assumes that you have created both the `orders` | ||
database and the `example` document by | ||
[running this previous example code](#2-create-your-own-database-and-add-a-document) | ||
successfully, otherwise you get the `Cannot update document because either "orders" | ||
database or "example" document was not found.` message. | ||
[running the previous example code](#2-create-your-own-database-and-add-a-document) | ||
successfully. Otherwise, the following error message occurs, "Cannot update document because either 'orders' | ||
database or 'example' document was not found." | ||
@@ -647,3 +653,3 @@ <details> | ||
</details> | ||
The result of the code is similar to the following output. | ||
When you run the code, you see a result similar to the following output. | ||
@@ -663,7 +669,7 @@ [embedmd]:# (test/examples/output/UpdateDoc.txt) | ||
**Note**: this example code assumes that you have created both the `orders` | ||
**Note**: This example code assumes that you have created both the `orders` | ||
database and the `example` document by | ||
[running this previous example code](#2-create-your-own-database-and-add-a-document) | ||
successfully, otherwise you get the `Cannot delete document because either "orders" | ||
database or "example" document was not found.` message. | ||
[running the previous example code](#2-create-your-own-database-and-add-a-document) | ||
successfully. Otherwise, the following error message occurs, "Cannot delete document because either 'orders' | ||
database or 'example' document was not found." | ||
@@ -776,3 +782,3 @@ <details> | ||
</details> | ||
The result of the code is the following output. | ||
When you run the code, you see the following output. | ||
@@ -786,3 +792,3 @@ [embedmd]:# (test/examples/output/DeleteDoc.txt) | ||
For sample code on handling errors, please see | ||
For sample code on handling errors, see | ||
[Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node#error-handling). | ||
@@ -808,6 +814,6 @@ | ||
- [Cloudant Learning Center](https://developer.ibm.com/clouddataservices/docs/compose/cloudant/): | ||
The official learning center with several useful videos which help you to use | ||
The official learning center with several useful videos which help you use | ||
Cloudant successfully. | ||
- [Cloudant blog](https://blog.cloudant.com/): | ||
Many useful articles how to optimize Cloudant for common problems. | ||
Many useful articles about how to optimize Cloudant for common problems. | ||
@@ -817,3 +823,3 @@ ## Questions | ||
If you are having difficulties using this SDK or have a question about the | ||
IBM Cloud services, please ask a question on | ||
IBM Cloud services, ask a question on | ||
[Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-cloud). | ||
@@ -825,16 +831,14 @@ | ||
[bug report](https://github.com/IBM/cloudant-node-sdk/issues). | ||
Before that, please search for similar issues. It's possible that someone | ||
has already reported the problem. | ||
Before you submit a bug report, search for similar issues. It's possible that your issue has already been reported. | ||
## Open source @ IBM | ||
## Open source at IBM | ||
Find more open source projects on the [IBM Github Page](http://ibm.github.io/). | ||
Find more open source projects on the [IBM Github](http://ibm.github.io/) page. | ||
## Contributing | ||
See [CONTRIBUTING](CONTRIBUTING.md). | ||
For more information, see [CONTRIBUTING](CONTRIBUTING.md). | ||
## License | ||
This SDK is released under the Apache 2.0 license. | ||
The license's full text can be found in [LICENSE](LICENSE). | ||
This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](LICENSE). |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
946748
14351
821