Socket
Socket
Sign inDemoInstall

@ibm-cloud/cloudant

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibm-cloud/cloudant - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

10

package.json
{
"name": "@ibm-cloud/cloudant",
"version": "0.0.15",
"version": "0.0.16",
"description": "IBM Cloudant Node.js SDK",

@@ -29,9 +29,7 @@ "main": "index.js",

"test-unit-travis": "jest --runInBand test/unit/",
"test-integration-travis": "jest --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' --json test/integration > test-output.log",
"report-coverage": "codecov",
"check-packages": "installed-check -e -d -v"
"test-integration-travis": "jest --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' --json test/integration > test-output.log"
},
"license": "Apache-2.0",
"engines": {
"node": ">=10.0.0"
"node": "^12 || ^14 || ^16"
},

@@ -41,3 +39,3 @@ "dependencies": {

"extend": "^3.0.2",
"ibm-cloud-sdk-core": "~2.10.0"
"ibm-cloud-sdk-core": "~2.11.0"
},

@@ -44,0 +42,0 @@ "jest": {

98

README.md

@@ -1,13 +0,1 @@

<!--
The example codes and outputs below are generated using the `embedmd` go
package.
https://github.com/campoy/embedmd
You should regenerate the example codes after making any changes to
examples in the test/examples/ folder.
embedmd -w README.md
-->
[![Build Status](https://travis-ci.com/IBM/cloudant-node-sdk.svg?branch=master)](https://travis-ci.com/IBM/cloudant-node-sdk)

@@ -17,3 +5,3 @@ [![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)

# IBM Cloudant Node.js SDK Version 0.0.15
# IBM Cloudant Node.js SDK Version 0.0.16

@@ -106,3 +94,3 @@ IBM Cloudant Node.js SDK is a client library that interacts with the

server.
- Node.js 10, 12 or 14.
- Node.js 12, 14 or 16.

@@ -563,2 +551,11 @@ ## Installation

// Note: for response byte stream use:
// const getdocAsStreamParam: CloudantV1.GetDocumentAsStreamParams = {
// docId: 'example',
// db: exampleDbName,
// };
// client
// .getDocumentAsStream(getdocAsStreamParam)
// .then((documentAsByteStream) => {});
client

@@ -577,9 +574,15 @@ .getDocument(getDocParams)

// Update the document in the database
client.postDocument({ db: exampleDbName, document }).then((res) => {
// Keeping track with the revision number of the document object:
document._rev = res.result.rev;
console.log(
'You have updated the document:\n' + JSON.stringify(document, null, 2)
);
});
client
.postDocument({ db: exampleDbName, document: document })
// Note: for request byte stream use:
// .postDocument(
// {db: exampleDbName, document: documentAsByteStream}
// )
.then((res) => {
// Keeping track with the revision number of the document object:
document._rev = res.result.rev;
console.log(
'You have updated the document:\n' + JSON.stringify(document, null, 2)
);
});
})

@@ -623,2 +626,10 @@ .catch((err) => {

// Note: for response byte stream use:
// const documentAsByteStream = (
// await client.getDocumentAsStream({
// docId: 'example',
// db: exampleDbName,
// })
// ).result;
// Add Bob Smith's address to the document

@@ -638,2 +649,10 @@ document.address = '19 Front Street, Darlington, DL5 1TY';

// Note: for request byte stream use:
// document._rev = (
// await client.postDocument({
// db: exampleDbName,
// document: documentAsByteStream,
// })
// ).result.rev;
console.log(

@@ -811,10 +830,30 @@ 'You have updated the document:\n' + JSON.stringify(document, null, 2)

For endpoints that read or write document content it is possible to bypass
usage of the built-in models and send or receive a bytes response.
For examples of using byte streams, see the API reference documentation
("Example request as a stream" section).
usage of the built-in interface with byte streams.
- [Bulk modify multiple documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postbulkdocs)
- [Query a list of all documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postalldocs)
- [Query the database document changes feed](https://cloud.ibm.com/apidocs/cloudant?code=node#postchanges)
Depending on the specific SDK operation it may be possible to:
* accept a user-provided byte stream to send to the server as a request body
* return a byte stream of the server response body to the user
Request byte stream can be supplied for `NodeJS.ReadableStream` or `Buffer` type parameters
.
For these cases you can pass this byte stream directly to the HTTP request body.
Response byte stream is supported in functions with the suffix of `AsStream`.
The returned byte stream allows the response body to be consumed
without triggering JSON unmarshalling that is typically performed by the SDK.
The [update document](#3-update-your-previously-created-document) section
contains examples for both request and response byte stream cases.
The API reference contains further examples of using byte streams.
They are titled "Example request as stream" and are initially collapsed.
Expand them to see examples of:
- Byte requests:
- [Bulk modify multiple documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postbulkdocs)
- Byte responses:
- [Query a list of all documents in a database](https://cloud.ibm.com/apidocs/cloudant?code=node#postalldocs)
- [Query the database document changes feed](https://cloud.ibm.com/apidocs/cloudant?code=node#postchanges)
### Further resources

@@ -826,7 +865,4 @@

Cloudant Node.js SDK API Documentation.
- [Cloudant docs](https://cloud.ibm.com/docs/services/Cloudant?topic=cloudant-overview#overview):
- [Cloudant docs](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant):
The official documentation page for Cloudant.
- [Cloudant Learning Center](https://developer.ibm.com/clouddataservices/docs/compose/cloudant/):
The official learning center with several useful videos which help you use
Cloudant successfully.
- [Cloudant blog](https://blog.cloudant.com/):

@@ -833,0 +869,0 @@ Many useful articles about how to optimize Cloudant for common problems.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc