Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ module.exports = {
},
'plugins': ['header'],
'extends': ['plugin:import/recommended'],
'settings': {
'import/resolver': {
'node': {
'extensions': ['.ts', '.js', '.mjs'],
},
},
},
'rules': {
'header/header': [
2,
Expand Down Expand Up @@ -56,6 +63,7 @@ module.exports = {
'plugins': ['node', 'prettier'],
'extends': ['airbnb-base', 'prettier'],
'rules': {
'@typescript-eslint/no-require-imports': 'error',
'camelcase': 'off',
'import/extensions': 'off',
'no-template-curly-in-string': 'off',
Expand Down Expand Up @@ -84,6 +92,7 @@ module.exports = {
'prettier',
],
'rules': {
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-param-reassign': 'off',
Expand All @@ -110,44 +119,19 @@ module.exports = {
'extends': ['plugin:jest/recommended', 'plugin:jest/style'],
},
{
'files': ['test/**/*.test.js'],
'files': ['test/**/*.test.js', 'test/**/*.test.mjs'],
'rules': {
'import/namespace': 'off',
'jest/expect-expect': 'off',
'jest/no-conditional-expect': 'off',
'jest/no-done-callback': 'off',
'jest/no-standalone-expect': 'off',
'jest/no-try-expect': 'off',
},
},
{
'files': ['test/**/cloudant.v1.test.js'],
'files': ['test/**/cloudant.*.test.js', 'test/**/auth-helper.js'],
'rules': {
'@typescript-eslint/no-require-imports': 'off',
'prettier/prettier': 'off',
'object-shorthand': 'off',
},
},
{
'files': [
'test/**/readme.integration.test.js',
'test/examples/src/ts/*.ts',
],
'rules': {
'no-console': 'off',
},
},
{
'files': ['test/examples/src/js/*.js'],
'rules': {
'dot-notation': 'off',
},
},
{
'files': [
'test/examples/src/js/CreateDbAndDoc.js',
'test/examples/src/ts/CreateDbAndDoc.ts',
],
'rules': {
'prefer-template': 'off',
},
},
],
Expand Down
170 changes: 141 additions & 29 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "stubs/.+\\.json|package-lock.json|^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-03-20T15:11:17Z",
"generated_at": "2024-09-17T19:31:39Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -77,30 +77,12 @@
}
],
"results": {
"Jenkinsfile": [
{
"hashed_secret": "dd7c0356e7bfc571546237209d7fa15319e25cfa",
"is_secret": false,
"is_verified": false,
"line_number": 32,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "eebfd4af77aec86f7ad8e41add1d782da79c6e60",
"is_secret": false,
"is_verified": false,
"line_number": 306,
"type": "NPM tokens",
"verified_result": null
}
],
"README.md": [
{
"hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
"is_secret": false,
"is_verified": false,
"line_number": 158,
"line_number": 184,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -120,28 +102,86 @@
"hashed_secret": "af142925e0da7006101954aae9d4f5753388bc3f",
"is_secret": false,
"is_verified": false,
"line_number": 6523,
"line_number": 6343,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "9010fd9ef3ce50b1d897190013c7fa86ea3f8f6f",
"is_secret": false,
"is_verified": false,
"line_number": 10955,
"line_number": 12260,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1b0252897782ba331652cc73f223b93c0559024c",
"is_secret": false,
"is_verified": false,
"line_number": 12279,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "934479b3651665aab88b6cc5281695e65ec61bdf",
"is_secret": false,
"is_verified": false,
"line_number": 12296,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "d793ee0a2ff3069299a51062681dbcf9bcbb17e1",
"is_secret": false,
"is_verified": false,
"line_number": 10957,
"line_number": 12309,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "9a54b2b063f59204777d83aaabdde75d92feef0a",
"is_secret": false,
"is_verified": false,
"line_number": 15691,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "68304a5354c1ff7b98d9d24d05dd556b59af2a62",
"is_secret": false,
"is_verified": false,
"line_number": 15738,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8f7cd1bbeb76339578a3c56bd00070e5ddb2c9e7",
"is_secret": false,
"is_verified": false,
"line_number": 15766,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "f6f3044cfc63e00926ca5e1ab18361fa0db0ddf8",
"is_secret": false,
"is_verified": false,
"line_number": 15777,
"type": "Secret Keyword",
"verified_result": null
}
],
"examples/README.md": [
{
"hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd",
"is_secret": false,
"is_verified": false,
"line_number": 377,
"type": "Secret Keyword",
"verified_result": null
}
],
"examples/putReplicationDocument/example_request.js": [
"examples/snippets/putReplicationDocument/example_request.js": [
{
"hashed_secret": "701e4e52db78a3657f5bc71fd174cf29e7868fbd",
"is_secret": false,
Expand All @@ -156,7 +196,7 @@
"hashed_secret": "fc5177639d71196391dd9f4997bc4f240eb29366",
"is_secret": false,
"is_verified": false,
"line_number": 158,
"line_number": 165,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -181,20 +221,54 @@
"verified_result": null
}
],
"test/integration/timeout.integration.test.js": [
"test/integration/cloudant.v1.test.js": [
{
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
"is_secret": false,
"is_verified": false,
"line_number": 1487,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "166b7db1d38ae47816b3840e6187b7a2631e04a8",
"is_secret": false,
"is_verified": false,
"line_number": 1534,
"type": "Base64 High Entropy String",
"verified_result": null
}
],
"test/integration/timeout.integration.test.mjs": [
{
"hashed_secret": "37fa265330ad83eaa879efb1e2db6380896cf639",
"is_secret": false,
"is_verified": false,
"line_number": 88,
"line_number": 83,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "673089c80cdcfa4702d190544ea675affacf60ab",
"is_secret": false,
"is_verified": false,
"line_number": 97,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "c2a6b03f190dfb2b4aa91f8af8d477a9bc3401dc",
"is_secret": false,
"is_verified": false,
"line_number": 136,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
"is_secret": false,
"is_verified": false,
"line_number": 142,
"line_number": 137,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -204,7 +278,45 @@
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
"is_secret": false,
"is_verified": false,
"line_number": 7821,
"line_number": 7543,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "166b7db1d38ae47816b3840e6187b7a2631e04a8",
"is_secret": false,
"is_verified": false,
"line_number": 7590,
"type": "Base64 High Entropy String",
"verified_result": null
}
],
"test/unit/cloudantBaseService.test.mjs": [
{
"hashed_secret": "c2a6b03f190dfb2b4aa91f8af8d477a9bc3401dc",
"is_secret": false,
"is_verified": false,
"line_number": 219,
"type": "Secret Keyword",
"verified_result": null
}
],
"test/unit/couchdbSessionAuthenticator.test.mjs": [
{
"hashed_secret": "c2a6b03f190dfb2b4aa91f8af8d477a9bc3401dc",
"is_secret": false,
"is_verified": false,
"line_number": 86,
"type": "Secret Keyword",
"verified_result": null
}
],
"test/unit/sessionTokenManager.test.mjs": [
{
"hashed_secret": "722db1a2bba2172a493d22f2c9f0d8d16e49c012",
"is_secret": false,
"is_verified": false,
"line_number": 69,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
2 changes: 1 addition & 1 deletion auth/sessionTokenManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { OutgoingHttpHeaders } from 'http';
import { OutgoingHttpHeaders } from 'node:http';
import {
getCurrentTime,
TokenManager,
Expand Down
9 changes: 6 additions & 3 deletions cloudant/features/changesFollower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChangesResultItem, PostChangesParams } from '../v1';
import {
default as CloudantV1,
ChangesResultItem,
PostChangesParams,
} from '../v1';
import { Stream } from './stream';
import { ChangesParamsHelper } from './changesParamsHelper';
import { ChangesResultItemStream } from './changesResultItemStream';
import { pipeline, Readable } from 'stream';
import { pipeline, Readable } from 'node:stream';
import { ChangesResultIterableIterator } from './changesResultIterator';
import CloudantV1 = require('../v1');

/** @internal */
export enum Mode {
Expand Down
4 changes: 2 additions & 2 deletions cloudant/features/changesResultItemStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import { Stream } from './stream';
import { TransformCallback } from 'stream';
import { TransformCallback } from 'node:stream';
import { validateParams } from 'ibm-cloud-sdk-core';
import CloudantV1 = require('../v1');
import CloudantV1 from '../v1';

export class ChangesResultItemStream extends Stream<CloudantV1.ChangesResultItem> {
_transform(
Expand Down
5 changes: 2 additions & 3 deletions cloudant/features/changesResultIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
import { ChangesParamsHelper } from './changesParamsHelper';
import { ChangesFollower, Mode } from './changesFollower';
import { getNewLogger } from 'ibm-cloud-sdk-core';
import { PostChangesParams } from '../v1';
import { promisify } from 'util';
import CloudantV1 = require('../v1');
import { default as CloudantV1, PostChangesParams } from '../v1';
import { promisify } from 'node:util';

enum TransientErrorSuppression {
ALWAYS,
Expand Down
2 changes: 1 addition & 1 deletion cloudant/features/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { Transform, TransformOptions } from 'stream';
import { Transform, TransformOptions } from 'node:stream';

export class Stream<T> extends Transform {
constructor(opts?: TransformOptions) {
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @module cloudant-node-sdk
*/

export import CloudantV1 = require('./cloudant/v1');
export { default as CloudantV1 } from './cloudant/v1';

export {
BasicAuthenticator,
Expand Down
Loading