@ibm-cloud/cloudant 0.5.5 → 0.7.0
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 +729 -72
- package/auth/couchdbSessionAuthenticator.js +2 -1
- package/auth/couchdbSessionAuthenticator.js.map +1 -1
- package/cloudant/features/changesFollower.d.ts +148 -0
- package/cloudant/features/changesFollower.js +178 -0
- package/cloudant/features/changesFollower.js.map +1 -0
- package/cloudant/features/changesParamsHelper.d.ts +32 -0
- package/cloudant/features/changesParamsHelper.js +99 -0
- package/cloudant/features/changesParamsHelper.js.map +1 -0
- package/cloudant/features/changesResultItemStream.d.ts +24 -0
- package/cloudant/features/changesResultItemStream.js +61 -0
- package/cloudant/features/changesResultItemStream.js.map +1 -0
- package/cloudant/features/changesResultIterator.d.ts +46 -0
- package/cloudant/features/changesResultIterator.js +296 -0
- package/cloudant/features/changesResultIterator.js.map +1 -0
- package/cloudant/features/stream.d.ts +23 -0
- package/cloudant/features/stream.js +60 -0
- package/cloudant/features/stream.js.map +1 -0
- package/cloudant/v1.d.ts +442 -168
- package/cloudant/v1.js +208 -65
- package/cloudant/v1.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/lib/cloudantBaseService.d.ts +3 -2
- package/lib/cloudantBaseService.js +7 -6
- package/lib/cloudantBaseService.js.map +1 -1
- package/package.json +24 -23
|
@@ -21,14 +21,15 @@ import { BaseService, UserOptions } from 'ibm-cloud-sdk-core';
|
|
|
21
21
|
* during service requests.
|
|
22
22
|
*/
|
|
23
23
|
export default abstract class CloudantBaseService extends BaseService {
|
|
24
|
+
timeout: number;
|
|
24
25
|
/**
|
|
25
26
|
* Configuration values to use Cloudant service.
|
|
26
27
|
* @param {Authenticator} userOptions.authenticator CouchdbSessionAuthenticator object can be used
|
|
27
28
|
* to authenticate requests to the service.
|
|
28
|
-
* @param {string} [userOptions.jar]
|
|
29
|
-
* must be in use. So a new jar will be created, if there is no custom one.
|
|
29
|
+
* @param {string} [userOptions.jar] A Cookie Jar. Enabled by default if there is no custom one.
|
|
30
30
|
*/
|
|
31
31
|
constructor(userOptions: UserOptions);
|
|
32
|
+
getTimeout(): number;
|
|
32
33
|
/**
|
|
33
34
|
* Set the service URL to send requests to and
|
|
34
35
|
* use the new service URL for CouchDB Session Authentication
|
|
@@ -38,7 +38,7 @@ var common_1 = require("./common");
|
|
|
38
38
|
var https_1 = require("https");
|
|
39
39
|
var http_1 = require("http");
|
|
40
40
|
/**
|
|
41
|
-
* Set default timeout to 2.5 minutes (=
|
|
41
|
+
* Set default timeout to 2.5 minutes (= 150 000 ms)
|
|
42
42
|
*/
|
|
43
43
|
var READ_TIMEOUT = 150000;
|
|
44
44
|
/**
|
|
@@ -109,22 +109,23 @@ var CloudantBaseService = /** @class */ (function (_super) {
|
|
|
109
109
|
* Configuration values to use Cloudant service.
|
|
110
110
|
* @param {Authenticator} userOptions.authenticator CouchdbSessionAuthenticator object can be used
|
|
111
111
|
* to authenticate requests to the service.
|
|
112
|
-
* @param {string} [userOptions.jar]
|
|
113
|
-
* must be in use. So a new jar will be created, if there is no custom one.
|
|
112
|
+
* @param {string} [userOptions.jar] A Cookie Jar. Enabled by default if there is no custom one.
|
|
114
113
|
*/
|
|
115
114
|
function CloudantBaseService(userOptions) {
|
|
116
115
|
var _this = this;
|
|
117
|
-
|
|
118
|
-
userOptions.jar = userOptions.jar || new tough_cookie_1.CookieJar();
|
|
119
|
-
}
|
|
116
|
+
userOptions.jar = userOptions.jar || new tough_cookie_1.CookieJar();
|
|
120
117
|
if (!('timeout' in userOptions)) {
|
|
121
118
|
userOptions.timeout = READ_TIMEOUT;
|
|
122
119
|
}
|
|
123
120
|
CloudantBaseService.setDefaultAgentsIfUnset(userOptions);
|
|
124
121
|
_this = _super.call(this, userOptions) || this;
|
|
122
|
+
_this.timeout = userOptions.timeout;
|
|
125
123
|
_this.configureSessionAuthenticator();
|
|
126
124
|
return _this;
|
|
127
125
|
}
|
|
126
|
+
CloudantBaseService.prototype.getTimeout = function () {
|
|
127
|
+
return this.timeout;
|
|
128
|
+
};
|
|
128
129
|
/**
|
|
129
130
|
* Set the service URL to send requests to and
|
|
130
131
|
* use the new service URL for CouchDB Session Authentication
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudantBaseService.js","sourceRoot":"","sources":["../../lib/cloudantBaseService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;AAEH,gDAAgD;AAChD,yDAA6E;AAC7E,6CAAyC;AACzC,gCAAsD;AACtD,mCAAyC;AACzC,+BAA4C;AAC5C,6BAA0C;AAE1C;;GAEG;AACH,IAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"cloudantBaseService.js","sourceRoot":"","sources":["../../lib/cloudantBaseService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;AAEH,gDAAgD;AAChD,yDAA6E;AAC7E,6CAAyC;AACzC,gCAAsD;AACtD,mCAAyC;AACzC,+BAA4C;AAC5C,6BAA0C;AAE1C;;GAEG;AACH,IAAM,YAAY,GAAG,MAAO,CAAC;AAE7B;;GAEG;AACH,IAAM,kBAAkB,GAAG;IACzB,gBAAgB;IAChB,aAAa;IACb,oBAAoB;IACpB,sBAAsB;IACtB,qBAAqB;IACrB,cAAc;IACd,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,eAAe;CAChB,CAAC;AAEF,IAAM,oBAAoB,GAAG;IAC3B,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,eAAe;CAChB,CAAC;AAEF,IAAM,SAAS,GAAG;IAChB,WAAW,EAAE,QAAQ;IACrB,kBAAkB,EAAE,aAAa;IACjC,YAAY,EAAE,kBAAkB;CACjC,CAAC;AAEF,IAAM,SAAS,GAAG;IAChB,WAAW,EAAE,iBAAiB;IAC9B,kBAAkB,EAAE,iBAAiB;IACrC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D,IAAM,2BAA2B,GAAG;YAClC,SAAS,EAAE,IAAI;SAChB,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACtB,OAAO,CAAC,SAAS,GAAG,IAAI,YAAS,CAAC,2BAA2B,CAAC,CAAC;SAChE;QACD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,OAAO,CAAC,UAAU,GAAG,IAAI,aAAU,CAAC,2BAA2B,CAAC,CAAC;SAClE;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AA7ID,CAA0D,gCAAW,GA6IpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibm-cloud/cloudant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "IBM Cloudant Node.js SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -26,41 +26,42 @@
|
|
|
26
26
|
"test": "npm run build && npm run lint && jest --runInBand test/",
|
|
27
27
|
"test-unit": "npm run build && jest --runInBand test/unit/",
|
|
28
28
|
"test-integration": "npm run build && jest --runInBand test/integration",
|
|
29
|
-
"test-
|
|
30
|
-
"test-unit-
|
|
31
|
-
"test-integration-
|
|
29
|
+
"test-ci": "jest --runInBand --testNamePattern='^((?!@slow).)*$' test/",
|
|
30
|
+
"test-unit-ci": "jest --runInBand test/unit/",
|
|
31
|
+
"test-integration-ci": "jest --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' --json test/integration > test-output.log",
|
|
32
|
+
"typedoc": "typedoc --theme default --entryPointStrategy expand --excludeExternals --tsconfig tsconfig.json --out apidocs auth cloudant --includeVersion"
|
|
32
33
|
},
|
|
33
34
|
"license": "Apache-2.0",
|
|
34
35
|
"engines": {
|
|
35
|
-
"node": "^
|
|
36
|
+
"node": "^18"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@types/node": "
|
|
39
|
-
"ibm-cloud-sdk-core": "4.1.
|
|
39
|
+
"@types/node": "18.17.18",
|
|
40
|
+
"ibm-cloud-sdk-core": "4.1.1"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@types/jest": "29.5.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "
|
|
44
|
-
"@typescript-eslint/parser": "
|
|
43
|
+
"@types/jest": "29.5.5",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "6.7.0",
|
|
45
|
+
"@typescript-eslint/parser": "6.7.0",
|
|
45
46
|
"dotenv": "16.3.1",
|
|
46
|
-
"eslint": "8.
|
|
47
|
+
"eslint": "8.49.0",
|
|
47
48
|
"eslint-config-airbnb-base": "15.0.0",
|
|
48
|
-
"eslint-config-airbnb-typescript": "17.
|
|
49
|
-
"eslint-config-prettier": "
|
|
50
|
-
"eslint-import-resolver-typescript": "3.
|
|
49
|
+
"eslint-config-airbnb-typescript": "17.1.0",
|
|
50
|
+
"eslint-config-prettier": "9.0.0",
|
|
51
|
+
"eslint-import-resolver-typescript": "3.6.0",
|
|
51
52
|
"eslint-plugin-header": "3.1.1",
|
|
52
|
-
"eslint-plugin-import": "2.
|
|
53
|
-
"eslint-plugin-jest": "27.
|
|
54
|
-
"eslint-plugin-jsdoc": "46.
|
|
53
|
+
"eslint-plugin-import": "2.28.0",
|
|
54
|
+
"eslint-plugin-jest": "27.4.0",
|
|
55
|
+
"eslint-plugin-jsdoc": "46.8.0",
|
|
55
56
|
"eslint-plugin-node": "11.1.0",
|
|
56
|
-
"eslint-plugin-prettier": "
|
|
57
|
-
"jest": "29.
|
|
57
|
+
"eslint-plugin-prettier": "5.0.0",
|
|
58
|
+
"jest": "29.7.0",
|
|
58
59
|
"jest-junit": "16.0.0",
|
|
59
|
-
"prettier": "
|
|
60
|
-
"sinon": "
|
|
60
|
+
"prettier": "3.0.3",
|
|
61
|
+
"sinon": "16.0.0",
|
|
61
62
|
"ts-jest": "29.1.1",
|
|
62
|
-
"typedoc": "0.
|
|
63
|
-
"typescript": "5.
|
|
63
|
+
"typedoc": "0.25.1",
|
|
64
|
+
"typescript": "5.2.2"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"@types/tough-cookie": "^4.0.0",
|