Socket
Socket
Sign inDemoInstall

@ibm-cloud/cloudant

Package Overview
Dependencies
Maintainers
0
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.10.1 to 0.10.2

2

auth/sessionTokenManager.d.ts

@@ -16,3 +16,3 @@ /**

*/
import { OutgoingHttpHeaders } from 'http';
import { OutgoingHttpHeaders } from 'node:http';
import { TokenManager, UserOptions } from 'ibm-cloud-sdk-core';

@@ -19,0 +19,0 @@ /** Configuration options for CouchDB session token retrieval. */

@@ -16,5 +16,4 @@ /**

*/
import { ChangesResultItem } from '../v1';
import { default as CloudantV1, ChangesResultItem } from '../v1';
import { Stream } from './stream';
import CloudantV1 = require('../v1');
/** @internal */

@@ -21,0 +20,0 @@ export declare enum Mode {

@@ -6,3 +6,3 @@ "use strict";

const changesResultItemStream_1 = require("./changesResultItemStream");
const stream_1 = require("stream");
const node_stream_1 = require("node:stream");
const changesResultIterator_1 = require("./changesResultIterator");

@@ -182,3 +182,3 @@ /** @internal */

this.changesResultIterator = new changesResultIterator_1.ChangesResultIterableIterator(this.client, changesParamsHelper_1.ChangesParamsHelper.cloneParams(this.params), mode, this.errorTolerance);
return (0, stream_1.pipeline)(stream_1.Readable.from(this.changesResultIterator), new changesResultItemStream_1.ChangesResultItemStream(), () => { });
return (0, node_stream_1.pipeline)(node_stream_1.Readable.from(this.changesResultIterator), new changesResultItemStream_1.ChangesResultItemStream(), () => { });
}

@@ -185,0 +185,0 @@ }

@@ -17,4 +17,4 @@ /**

import { Stream } from './stream';
import { TransformCallback } from 'stream';
import CloudantV1 = require('../v1');
import { TransformCallback } from 'node:stream';
import CloudantV1 from '../v1';
export declare class ChangesResultItemStream extends Stream<CloudantV1.ChangesResultItem> {

@@ -21,0 +21,0 @@ _transform(chunk: CloudantV1.ChangesResult, encoding: BufferEncoding, callback: TransformCallback): void;

@@ -17,4 +17,3 @@ /**

import { Mode } from './changesFollower';
import { PostChangesParams } from '../v1';
import CloudantV1 = require('../v1');
import { default as CloudantV1, PostChangesParams } from '../v1';
export declare class ChangesResultIterableIterator implements AsyncIterableIterator<CloudantV1.ChangesResult> {

@@ -21,0 +20,0 @@ private readonly timeoutPromise;

@@ -22,3 +22,3 @@ "use strict";

const ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
const util_1 = require("util");
const node_util_1 = require("node:util");
var TransientErrorSuppression;

@@ -31,3 +31,3 @@ (function (TransientErrorSuppression) {

class ChangesResultIterableIterator {
timeoutPromise = (0, util_1.promisify)(setTimeout);
timeoutPromise = (0, node_util_1.promisify)(setTimeout);
cancelToken = 'CloudantChangesIteratorCancel';

@@ -34,0 +34,0 @@ client;

@@ -16,3 +16,3 @@ /**

*/
import { Transform, TransformOptions } from 'stream';
import { Transform, TransformOptions } from 'node:stream';
export declare class Stream<T> extends Transform {

@@ -19,0 +19,0 @@ constructor(opts?: TransformOptions);

@@ -19,4 +19,4 @@ "use strict";

exports.Stream = void 0;
const stream_1 = require("stream");
class Stream extends stream_1.Transform {
const node_stream_1 = require("node:stream");
class Stream extends node_stream_1.Transform {
constructor(opts) {

@@ -23,0 +23,0 @@ super({

@@ -19,5 +19,5 @@ /**

*/
export import CloudantV1 = require('./cloudant/v1');
export { default as CloudantV1 } from './cloudant/v1';
export { BasicAuthenticator, IamAuthenticator, CouchdbSessionAuthenticator, CouchdbSessionAuthenticatorOptions, } from './auth';
export { ChangesFollower } from './cloudant/features/changesFollower';
export { Stream } from './cloudant/features/stream';

@@ -17,8 +17,12 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stream = exports.ChangesFollower = exports.CouchdbSessionAuthenticator = exports.IamAuthenticator = exports.BasicAuthenticator = void 0;
exports.Stream = exports.ChangesFollower = exports.CouchdbSessionAuthenticator = exports.IamAuthenticator = exports.BasicAuthenticator = exports.CloudantV1 = void 0;
/**
* @module cloudant-node-sdk
*/
exports.CloudantV1 = require("./cloudant/v1");
var v1_1 = require("./cloudant/v1");
Object.defineProperty(exports, "CloudantV1", { enumerable: true, get: function () { return __importDefault(v1_1).default; } });
var auth_1 = require("./auth");

@@ -25,0 +29,0 @@ Object.defineProperty(exports, "BasicAuthenticator", { enumerable: true, get: function () { return auth_1.BasicAuthenticator; } });

@@ -23,4 +23,4 @@ "use strict";

const common_1 = require("./common");
const https_1 = require("https");
const http_1 = require("http");
const node_https_1 = require("node:https");
const node_http_1 = require("node:http");
/**

@@ -201,6 +201,6 @@ * Set default timeout to 2.5 minutes (= 150 000 ms)

if (!options.httpAgent) {
options.httpAgent = new http_1.Agent(cloudantDefaultAgentOptions);
options.httpAgent = new node_http_1.Agent(cloudantDefaultAgentOptions);
}
if (!options.httpsAgent) {
options.httpsAgent = new https_1.Agent(cloudantDefaultAgentOptions);
options.httpsAgent = new node_https_1.Agent(cloudantDefaultAgentOptions);
}

@@ -207,0 +207,0 @@ }

@@ -17,30 +17,6 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSdkHeaders = getSdkHeaders;
const os = __importStar(require("os"));
// tslint:disable-next-line:no-var-requires
const pkg = require('../package.json');
const node_os_1 = require("node:os");
const package_json_1 = require("../package.json");
/**

@@ -51,6 +27,6 @@ * Get the request headers to be sent in requests by the SDK.

const sdkName = 'cloudant-node-sdk';
const sdkVersion = pkg.version;
const osName = os.platform();
const osVersion = os.release();
const osArch = os.arch();
const sdkVersion = package_json_1.version;
const osName = (0, node_os_1.platform)();
const osVersion = (0, node_os_1.release)();
const osArch = (0, node_os_1.arch)();
const nodeVersion = process.version;

@@ -57,0 +33,0 @@ const headers = {

{
"name": "@ibm-cloud/cloudant",
"version": "0.10.1",
"version": "0.10.2",
"description": "IBM Cloudant Node.js SDK",

@@ -11,4 +11,8 @@ "main": "index.js",

"keywords": [
"ibm",
"cloudant"
"IBM",
"Cloudant",
"database",
"client",
"SDK",
"official"
],

@@ -40,4 +44,4 @@ "author": "IBM Corp.",

"dependencies": {
"@types/node": "18.19.44",
"ibm-cloud-sdk-core": "5.0.1"
"@types/node": "18.19.50",
"ibm-cloud-sdk-core": "5.0.2"
},

@@ -47,3 +51,3 @@ "devDependencies": {

"@types/extend": "3.0.4",
"@types/jest": "29.5.12",
"@types/jest": "29.5.13",
"@typescript-eslint/eslint-plugin": "7.18.0",

@@ -58,3 +62,3 @@ "@typescript-eslint/parser": "7.18.0",

"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jest": "28.8.0",

@@ -67,6 +71,6 @@ "eslint-plugin-jsdoc": "50.2.0",

"prettier": "3.3.3",
"sinon": "18.0.0",
"ts-jest": "29.2.4",
"typedoc": "0.26.5",
"typescript": "5.5.4"
"sinon": "19.0.2",
"ts-jest": "29.2.5",
"typedoc": "0.26.7",
"typescript": "5.6.2"
},

@@ -73,0 +77,0 @@ "peerDependencies": {

@@ -5,3 +5,3 @@ [![Build Status](https://github.com/IBM/cloudant-node-sdk/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/IBM/cloudant-node-sdk/actions/workflows/test.yml)

# IBM Cloudant Node.js SDK Version 0.10.1
# IBM Cloudant Node.js SDK Version 0.10.2

@@ -47,2 +47,5 @@ IBM Cloudant Node.js SDK is a client library that interacts with the

* [Further resources](#further-resources)
* [Browser usage](#browser-usage)
+ [Polyfills](#polyfills)
+ [CORS](#cors)
* [Changes feed follower (beta)](#changes-feed-follower-beta)

@@ -433,3 +436,3 @@ + [Introduction](#introduction)

```txt
```text
"orders" database created.

@@ -557,3 +560,3 @@ You have created the document:

```txt
```text
Server version 3.2.1

@@ -775,3 +778,3 @@ Document count in "orders" database is 1.

```txt
```text
You have updated the document:

@@ -902,3 +905,3 @@ {

```txt
```text
You have deleted the document.

@@ -909,3 +912,3 @@ ```

For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/examples#examples-for-node).
For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/examples#examples-for-node).

@@ -959,2 +962,64 @@ ### Error handling

### Browser usage
You can use the SDK directly from JavaScript running in a browser if:
* Polyfills for required Node.js system modules are available.
* The server configuration allows cross-origin resource sharing (CORS).
#### Polyfills
Use either:
* A bundler that includes polyfills for Node.js system modules in the browser.
* Or a Node.js compatible browser-based runtime.
The Node.js system modules required are:
* `assert`
* `buffer`
* `crypto`
* `fs`
* `http`
* `https`
* `os`
* `path`
* `process`
* `querystring`
* `stream`
* `timers`
* `url`
* `util`
* `vm`
* `zlib`
Additionally the SDK or its dependencies need to be able to resolve the globals:
* `Buffer`
* `process`
* `Readable`
* `setImmediate` and `setTimeout`
Environment variables:
* `NODE_DEBUG` (must be resolvable from the `process.env` even if it is unset)
It may be possible to omit some of these requirements for specific use cases.
#### CORS
To allow CORS requests from the SDK in the browser:
1. Configure the server with a CORS origin matching the URL protocol, host and port of the JavaScript application.
2. Either
* Configure the server with a CORS headers allow list that includes the default headers plus the SDK's extra headers:
* `user-agent`
* `x-ibmcloud-sdk-analytics`
* `content-encoding` (unless SDK [request body compression is disabled](./KNOWN_ISSUES.md#Disabling-request-body-compression))
* Or configure the SDK to remove the extra headers from requests, for example:
```js
// Set a request interceptor to remove the headers from the requests
service.getHttpClient().interceptors.request.use(requestConfig => {
delete requestConfig.headers['User-Agent']
delete requestConfig.headers['X-IBMCloud-SDK-Analytics']
return requestConfig;
});
// Disable request body compression
service.setEnableGzipCompression(false);
```
### Changes feed follower (beta)

@@ -1008,3 +1073,3 @@

For use-cases where these configuration limitations are deemed too restrictive then it is recommended to
write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/examples#postchanges) instead of the follower.
write code to use the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/examples#postchanges) instead of the follower.

@@ -1044,3 +1109,3 @@ #### Error suppression

In these cases use-case specific control over the number of change requests made and the content size of the responses
may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/examples#postchanges).
may be achieved by using the SDK's [POST `_changes` API](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/examples#postchanges).

@@ -1538,3 +1603,3 @@ #### Checkpointing

[similar issues](https://github.com/IBM/cloudant-node-sdk/issues?q=is%3Aissue) and review the
[KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.
[KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.

@@ -1569,6 +1634,6 @@ Please consult the [security policy](https://github.com/IBM/cloudant-node-sdk/security/policy) before opening security related issues.

For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/CONTRIBUTING.md).
For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/CONTRIBUTING.md).
## License
This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.1/LICENSE).
This SDK is released under the Apache 2.0 license. To read the full text of the license, see [LICENSE](https://github.com/IBM/cloudant-node-sdk/tree/v0.10.2/LICENSE).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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