@ibm-cloud/cloudant 0.12.24 → 0.12.26
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 +15 -15
- package/auth/couchdbSessionAuthenticator.js +0 -35
- package/auth/couchdbSessionAuthenticator.js.map +1 -1
- package/cloudant/features/changesFollower.d.ts +25 -0
- package/cloudant/features/changesFollower.js +33 -0
- package/cloudant/features/changesFollower.js.map +1 -1
- package/cloudant/features/changesResultIterator.d.ts +4 -0
- package/cloudant/features/changesResultIterator.js +42 -0
- package/cloudant/features/changesResultIterator.js.map +1 -1
- package/package.json +21 -34
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
[](https://github.com/IBM/cloudant-node-sdk/releases/latest)
|
|
3
3
|
[](https://ibm.github.io/cloudant-node-sdk/)
|
|
4
4
|
|
|
5
|
-
# IBM Cloudant Node.js SDK Version 0.12.
|
|
5
|
+
# IBM Cloudant Node.js SDK Version 0.12.26
|
|
6
6
|
|
|
7
7
|
IBM Cloudant Node.js SDK is a client library that interacts with the
|
|
8
8
|
[IBM Cloudant APIs](https://cloud.ibm.com/apidocs/cloudant?code=node).
|
|
@@ -62,15 +62,15 @@ project:
|
|
|
62
62
|
- Supported by IBM Cloudant.
|
|
63
63
|
- Server compatibility with:
|
|
64
64
|
- IBM Cloudant (Gen 1).
|
|
65
|
-
- IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
65
|
+
- IBM Cloudant (Gen 2) - see [compatibility notes](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/KNOWN_ISSUES.md#cloudant-gen-2-compatibility).
|
|
66
66
|
- [Apache CouchDB 3.x](https://docs.couchdb.org/en/stable/) for data operations.
|
|
67
67
|
- Includes all the most popular and latest supported endpoints for
|
|
68
68
|
applications.
|
|
69
69
|
- Handles the authentication.
|
|
70
70
|
- Familiar user experience with IBM Cloud SDKs.
|
|
71
71
|
- Flexibility to use either built-in models or byte-based requests and responses for documents.
|
|
72
|
-
- Built-in [Changes feed follower](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
73
|
-
- Built-in [Pagination](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
72
|
+
- Built-in [Changes feed follower](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Changes_Follower.md)
|
|
73
|
+
- Built-in [Pagination](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Pagination.md)
|
|
74
74
|
- `Promise` based design with asynchronous HTTP requests.
|
|
75
75
|
- Use either as native JavaScript or take advantage of TypeScript models.
|
|
76
76
|
- Transparently compresses request and response bodies.
|
|
@@ -100,16 +100,16 @@ account.
|
|
|
100
100
|
|
|
101
101
|
There are several ways to **set** these authentication properties:
|
|
102
102
|
|
|
103
|
-
1. As [environment variables](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
104
|
-
2. The [programmatic approach](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
105
|
-
3. With an [external credentials file](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
103
|
+
1. As [environment variables](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Authentication.md#authentication-with-environment-variables)
|
|
104
|
+
2. The [programmatic approach](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Authentication.md#programmatic-authentication)
|
|
105
|
+
3. With an [external credentials file](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Authentication.md#authentication-with-external-configuration)
|
|
106
106
|
|
|
107
107
|
The following section describes the different authentication types and provides environment variable examples.
|
|
108
108
|
Examples for other configuration methods are available by following the provided links.
|
|
109
109
|
|
|
110
110
|
### Authentication
|
|
111
111
|
|
|
112
|
-
Consult the [authentication document](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
112
|
+
Consult the [authentication document](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Authentication.md)
|
|
113
113
|
for comprehensive details of all the available authentication methods and how to configure them with environment settings
|
|
114
114
|
or programmatically.
|
|
115
115
|
|
|
@@ -155,10 +155,10 @@ service.getAllDbs().then(response => {
|
|
|
155
155
|
});
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
[More tutorial examples](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
158
|
+
[More tutorial examples](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Examples.md) for creating a database
|
|
159
159
|
and document create, read, update and delete operations.
|
|
160
160
|
|
|
161
|
-
For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
161
|
+
For a complete list of code examples, see the [examples directory](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/examples#examples-for-node).
|
|
162
162
|
|
|
163
163
|
### Error handling
|
|
164
164
|
|
|
@@ -182,7 +182,7 @@ Response byte stream is supported in functions with the suffix of `AsStream`.
|
|
|
182
182
|
The returned byte stream allows the response body to be consumed
|
|
183
183
|
without triggering JSON unmarshalling that is typically performed by the SDK.
|
|
184
184
|
|
|
185
|
-
The [update document](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
185
|
+
The [update document](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs/Examples.md#3-update-your-previously-created-document) section
|
|
186
186
|
contains examples for both request and response byte stream cases.
|
|
187
187
|
|
|
188
188
|
The API reference contains further examples of using byte streams.
|
|
@@ -198,7 +198,7 @@ Expand them to see examples of:
|
|
|
198
198
|
|
|
199
199
|
### Further resources
|
|
200
200
|
|
|
201
|
-
- [Cloudant Node.js SDK feature docs](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
201
|
+
- [Cloudant Node.js SDK feature docs](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/docs)
|
|
202
202
|
- [Cloudant API docs](https://cloud.ibm.com/apidocs/cloudant?code=node):
|
|
203
203
|
API reference including usage examples for Cloudant Node.js SDK API.
|
|
204
204
|
- [TypeDoc](https://ibm.github.io/cloudant-node-sdk/):
|
|
@@ -283,7 +283,7 @@ If you encounter an issue with the project, you are welcome to submit a
|
|
|
283
283
|
|
|
284
284
|
Before you submit a bug report, search for
|
|
285
285
|
[similar issues](https://github.com/IBM/cloudant-node-sdk/issues?q=is%3Aissue) and review the
|
|
286
|
-
[KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
286
|
+
[KNOWN_ISSUES file](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/KNOWN_ISSUES.md) to verify that your issue hasn't been reported yet.
|
|
287
287
|
|
|
288
288
|
Please consult the [security policy](https://github.com/IBM/cloudant-node-sdk/security/policy) before opening security related issues.
|
|
289
289
|
|
|
@@ -313,8 +313,8 @@ Find more open source projects on the [IBM GitHub](http://ibm.github.io/) page.
|
|
|
313
313
|
|
|
314
314
|
## Contributing
|
|
315
315
|
|
|
316
|
-
For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.
|
|
316
|
+
For more information, see [CONTRIBUTING](https://github.com/IBM/cloudant-node-sdk/tree/v0.12.26/CONTRIBUTING.md).
|
|
317
317
|
|
|
318
318
|
## License
|
|
319
319
|
|
|
320
|
-
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.12.
|
|
320
|
+
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.12.26/LICENSE).
|
|
@@ -69,41 +69,6 @@ class CouchdbSessionAuthenticator extends ibm_cloud_sdk_core_1.Authenticator {
|
|
|
69
69
|
configure(userOptions) {
|
|
70
70
|
// Merge the options
|
|
71
71
|
Object.assign(this.tokenOptions, userOptions);
|
|
72
|
-
// START monkey patch for https://github.com/salesforce/tough-cookie/issues/154
|
|
73
|
-
// Check if we've already patched the jar
|
|
74
|
-
const cookieJar = this.tokenOptions.jar;
|
|
75
|
-
if (cookieJar && !cookieJar.cloudantPatch) {
|
|
76
|
-
// Set the patching flag
|
|
77
|
-
cookieJar.cloudantPatch = true;
|
|
78
|
-
// Replace the store's updateCookie function with one that applies a patch to newCookie
|
|
79
|
-
const originalUpdateCookieFn = cookieJar.store.updateCookie;
|
|
80
|
-
cookieJar.store.updateCookie = function updateCookie(oldCookie, newCookie, cb) {
|
|
81
|
-
// Add current time as an update timestamp to the newCookie
|
|
82
|
-
newCookie.cloudantPatchUpdateTime = new Date();
|
|
83
|
-
// Replace the cookie's expiryTime function with one that uses cloudantPatchUpdateTime
|
|
84
|
-
// in place of creation time to check the expiry.
|
|
85
|
-
const originalExpiryTimeFn = newCookie.expiryTime;
|
|
86
|
-
newCookie.expiryTime = function expiryTime(now) {
|
|
87
|
-
// The original expiryTime check is relative to a time in this order:
|
|
88
|
-
// 1. supplied now argument
|
|
89
|
-
// 2. this.creation (original cookie creation time)
|
|
90
|
-
// 3. current time
|
|
91
|
-
// This patch replaces 2 with an expiry check relative to the cloudantPatchUpdateTime if set instead of
|
|
92
|
-
// the creation time by passing it as the now argument.
|
|
93
|
-
return originalExpiryTimeFn.call(newCookie, newCookie.cloudantPatchUpdateTime || now);
|
|
94
|
-
};
|
|
95
|
-
// Finally, delegate back to the original update function or the fallback put (which is set by Cookie
|
|
96
|
-
// when an update function is not present on the store). Since we always set an update function for our
|
|
97
|
-
// patch we need to also provide that fallback.
|
|
98
|
-
if (originalUpdateCookieFn) {
|
|
99
|
-
originalUpdateCookieFn.call(cookieJar.store, oldCookie, newCookie, cb);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
cookieJar.store.putCookie.call(cookieJar.store, newCookie, cb);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
// END cookie jar monkey patch
|
|
107
72
|
// Set the token manager
|
|
108
73
|
this.tokenManager = new sessionTokenManager_1.SessionTokenManager(this.tokenOptions);
|
|
109
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"couchdbSessionAuthenticator.js","sourceRoot":"","sources":["../../auth/couchdbSessionAuthenticator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAA+E;
|
|
1
|
+
{"version":3,"file":"couchdbSessionAuthenticator.js","sourceRoot":"","sources":["../../auth/couchdbSessionAuthenticator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAA+E;AAC/E,+DAG+B;AAU/B;;;;;;;;;;;GAWG;AACH,MAAa,2BAA4B,SAAQ,kCAAa;IAClD,YAAY,CAAsB;IAClC,eAAe,CAA2B;IAC5C,YAAY,CAA6B;IACjD,MAAM,CAAU,wBAAwB,GAAG,iBAAiB,CAAC;IAE7D;;;;;;;OAOG;IACH,YAAY,OAA2C;QACrD,KAAK,EAAE,CAAC;QACR,IAAA,kCAAa,EAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;;OAQG;IACI,YAAY,CAAC,cAAsB;QACxC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,WAAwB;QACvC,oBAAoB;QACpB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAE9C,wBAAwB;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACa,kBAAkB;QAChC,OAAO,2BAA2B,CAAC,wBAAwB,CAAC;IAC9D,CAAC;;AAtDH,kEAuDC"}
|
|
@@ -117,6 +117,31 @@ export declare class ChangesFollower {
|
|
|
117
117
|
* or {@link startOneOff} was not called first
|
|
118
118
|
*/
|
|
119
119
|
stop(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the most recent sequence ID that is safe to use as a checkpoint,
|
|
122
|
+
* advancing beyond the supplied checkpoint sequence ID where possible.
|
|
123
|
+
*
|
|
124
|
+
* With highly filtered changes feeds, multiple pages can pass through the
|
|
125
|
+
* follower without returning any changes. Using only the `seq` of the last
|
|
126
|
+
* processed {@link ChangesResultItem} in those cases causes a long changes
|
|
127
|
+
* feed rewind on the next run. To avoid this, call this method after fully
|
|
128
|
+
* processing each {@link ChangesResultItem} with a non-null `seq` and
|
|
129
|
+
* persist the returned value to use as the `since` parameter for the next
|
|
130
|
+
* run.
|
|
131
|
+
*
|
|
132
|
+
* Note: the follower retains a bounded window of recent sequence IDs.
|
|
133
|
+
* If subsequent page fetches displace the supplied checkpointSequenceId from
|
|
134
|
+
* that window, this method returns the supplied value unchanged.
|
|
135
|
+
* Call this method and persist its result regularly to obtain a fresh sequence ID.
|
|
136
|
+
*
|
|
137
|
+
* @param checkpointSequenceId - the last checkpoint sequence ID — either the
|
|
138
|
+
* non-null `seq` of the last {@link ChangesResultItem} fully processed, or
|
|
139
|
+
* a value previously returned by this method.
|
|
140
|
+
* @throws {Error} if `checkpointSequenceId` is null or empty
|
|
141
|
+
* @return {string} the most recent safe sequence ID to use as a checkpoint,
|
|
142
|
+
* or the supplied value if no newer sequence is available
|
|
143
|
+
*/
|
|
144
|
+
latestSequenceFrom(checkpointSequenceId: string): string;
|
|
120
145
|
/**
|
|
121
146
|
*
|
|
122
147
|
* @param mode the mode in which to run the ChangesFollower
|
|
@@ -172,6 +172,39 @@ class ChangesFollower {
|
|
|
172
172
|
throw new Error('Cannot stop a feed that is not running.');
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns the most recent sequence ID that is safe to use as a checkpoint,
|
|
177
|
+
* advancing beyond the supplied checkpoint sequence ID where possible.
|
|
178
|
+
*
|
|
179
|
+
* With highly filtered changes feeds, multiple pages can pass through the
|
|
180
|
+
* follower without returning any changes. Using only the `seq` of the last
|
|
181
|
+
* processed {@link ChangesResultItem} in those cases causes a long changes
|
|
182
|
+
* feed rewind on the next run. To avoid this, call this method after fully
|
|
183
|
+
* processing each {@link ChangesResultItem} with a non-null `seq` and
|
|
184
|
+
* persist the returned value to use as the `since` parameter for the next
|
|
185
|
+
* run.
|
|
186
|
+
*
|
|
187
|
+
* Note: the follower retains a bounded window of recent sequence IDs.
|
|
188
|
+
* If subsequent page fetches displace the supplied checkpointSequenceId from
|
|
189
|
+
* that window, this method returns the supplied value unchanged.
|
|
190
|
+
* Call this method and persist its result regularly to obtain a fresh sequence ID.
|
|
191
|
+
*
|
|
192
|
+
* @param checkpointSequenceId - the last checkpoint sequence ID — either the
|
|
193
|
+
* non-null `seq` of the last {@link ChangesResultItem} fully processed, or
|
|
194
|
+
* a value previously returned by this method.
|
|
195
|
+
* @throws {Error} if `checkpointSequenceId` is null or empty
|
|
196
|
+
* @return {string} the most recent safe sequence ID to use as a checkpoint,
|
|
197
|
+
* or the supplied value if no newer sequence is available
|
|
198
|
+
*/
|
|
199
|
+
latestSequenceFrom(checkpointSequenceId) {
|
|
200
|
+
if (!checkpointSequenceId) {
|
|
201
|
+
throw new Error('Provided sequence ID must be a non-empty string.');
|
|
202
|
+
}
|
|
203
|
+
if (!this.changesResultIterator) {
|
|
204
|
+
return checkpointSequenceId;
|
|
205
|
+
}
|
|
206
|
+
return this.changesResultIterator.lastSeqSince(checkpointSequenceId);
|
|
207
|
+
}
|
|
175
208
|
/**
|
|
176
209
|
*
|
|
177
210
|
* @param mode the mode in which to run the ChangesFollower
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changesFollower.js","sourceRoot":"","sources":["../../../cloudant/features/changesFollower.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,6CAAiD;AAOjD,qCAAkC;AAClC,+DAAkE;AAClE,mEAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAAA,sBAAQ,EACN,sBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACzC,IAAI,eAAM,EAA4B,EACtC,GAAG,EAAE,GAAE,CAAC,CACT,CACF,CAAC,OAAO,CAAC,CAAC,IAAmB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO,IAAA,sBAAQ,EAAC,eAAe,EAAE,IAAI,eAAM,EAAqB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF;AA7KD,0CA6KC"}
|
|
@@ -27,6 +27,9 @@ export declare class ChangesResultIterableIterator implements AsyncIterableItera
|
|
|
27
27
|
private readonly transientErrorSuppression;
|
|
28
28
|
private readonly baseDelay;
|
|
29
29
|
private readonly expRetryGate;
|
|
30
|
+
private readonly seqMarkers;
|
|
31
|
+
private static readonly RETAINED_SIZE;
|
|
32
|
+
private static readonly EVICTION_COUNT;
|
|
30
33
|
private cancel;
|
|
31
34
|
private countDown;
|
|
32
35
|
private inflight;
|
|
@@ -41,6 +44,7 @@ export declare class ChangesResultIterableIterator implements AsyncIterableItera
|
|
|
41
44
|
constructor(client: CloudantV1, params: PostChangesParams, mode: Mode, errorTolerance?: number);
|
|
42
45
|
configure(): Promise<void>;
|
|
43
46
|
[Symbol.asyncIterator](): AsyncIterableIterator<CloudantV1.ChangesResult>;
|
|
47
|
+
lastSeqSince(lastPersistedSeq: string): string;
|
|
44
48
|
return(value?: any): Promise<IteratorResult<CloudantV1.ChangesResult>>;
|
|
45
49
|
next(value?: any): Promise<IteratorResult<CloudantV1.ChangesResult>>;
|
|
46
50
|
}
|
|
@@ -25,6 +25,11 @@ var TransientErrorSuppression;
|
|
|
25
25
|
TransientErrorSuppression[TransientErrorSuppression["NEVER"] = 1] = "NEVER";
|
|
26
26
|
TransientErrorSuppression[TransientErrorSuppression["TIMER"] = 2] = "TIMER";
|
|
27
27
|
})(TransientErrorSuppression || (TransientErrorSuppression = {}));
|
|
28
|
+
var SeqMarkerType;
|
|
29
|
+
(function (SeqMarkerType) {
|
|
30
|
+
SeqMarkerType[SeqMarkerType["LAST"] = 0] = "LAST";
|
|
31
|
+
SeqMarkerType[SeqMarkerType["ROW"] = 1] = "ROW";
|
|
32
|
+
})(SeqMarkerType || (SeqMarkerType = {}));
|
|
28
33
|
class ChangesResultIterableIterator {
|
|
29
34
|
timeoutPromise = (0, node_util_1.promisify)(setTimeout);
|
|
30
35
|
cancelToken = 'CloudantChangesIteratorCancel';
|
|
@@ -40,6 +45,9 @@ class ChangesResultIterableIterator {
|
|
|
40
45
|
transientErrorSuppression;
|
|
41
46
|
baseDelay = 100;
|
|
42
47
|
expRetryGate = Math.floor(Math.log2(changesParamsHelper_1.ChangesParamsHelper.LONGPOLL_TIMEOUT / this.baseDelay));
|
|
48
|
+
seqMarkers = [];
|
|
49
|
+
static RETAINED_SIZE = 2048;
|
|
50
|
+
static EVICTION_COUNT = ChangesResultIterableIterator.RETAINED_SIZE / 2;
|
|
43
51
|
cancel;
|
|
44
52
|
countDown;
|
|
45
53
|
inflight = null;
|
|
@@ -109,6 +117,24 @@ class ChangesResultIterableIterator {
|
|
|
109
117
|
[Symbol.asyncIterator]() {
|
|
110
118
|
return this;
|
|
111
119
|
}
|
|
120
|
+
lastSeqSince(lastPersistedSeq) {
|
|
121
|
+
let found = false;
|
|
122
|
+
let result = null;
|
|
123
|
+
this.seqMarkers.every((entry) => {
|
|
124
|
+
if (found) {
|
|
125
|
+
if (entry.seqMarkerType === SeqMarkerType.ROW)
|
|
126
|
+
return false;
|
|
127
|
+
if (entry.seq != null)
|
|
128
|
+
result = entry.seq;
|
|
129
|
+
}
|
|
130
|
+
if (!found && entry.seq === lastPersistedSeq) {
|
|
131
|
+
found = true;
|
|
132
|
+
result = entry.seq;
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
135
|
+
});
|
|
136
|
+
return found ? result : lastPersistedSeq;
|
|
137
|
+
}
|
|
112
138
|
async return(value) {
|
|
113
139
|
this.logger.debug('Iterator return entry.');
|
|
114
140
|
if (!this.stopped) {
|
|
@@ -164,6 +190,22 @@ class ChangesResultIterableIterator {
|
|
|
164
190
|
this.successTimestamp = Date.now();
|
|
165
191
|
}
|
|
166
192
|
this.since = response.result.lastSeq;
|
|
193
|
+
const { results } = response.result;
|
|
194
|
+
if (this.seqMarkers.length >=
|
|
195
|
+
ChangesResultIterableIterator.RETAINED_SIZE +
|
|
196
|
+
ChangesResultIterableIterator.EVICTION_COUNT) {
|
|
197
|
+
this.seqMarkers.splice(0, ChangesResultIterableIterator.EVICTION_COUNT);
|
|
198
|
+
}
|
|
199
|
+
if (results.length > 0) {
|
|
200
|
+
this.seqMarkers.push({
|
|
201
|
+
seq: results.at(-1).seq,
|
|
202
|
+
seqMarkerType: SeqMarkerType.ROW,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
this.seqMarkers.push({
|
|
206
|
+
seq: response.result.lastSeq,
|
|
207
|
+
seqMarkerType: SeqMarkerType.LAST,
|
|
208
|
+
});
|
|
167
209
|
this.pending = response.result.pending;
|
|
168
210
|
if (this.mode === changesParamsHelper_1.Mode.FINITE && this.pending === 0) {
|
|
169
211
|
this.logger.debug('No more changes pending, setting stopped flag.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changesResultIterator.js","sourceRoot":"","sources":["../../../cloudant/features/changesResultIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAAkD;AAClD,yCAAsC;AACtC,+DAAkE;AAGlE,IAAK,yBAIJ;AAJD,WAAK,yBAAyB;IAC5B,6EAAM,CAAA;IACN,2EAAK,CAAA;IACL,2EAAK,CAAA;AACP,CAAC,EAJI,yBAAyB,KAAzB,yBAAyB,QAI7B;AAED,MAAa,6BAA6B;IACvB,cAAc,GAAG,IAAA,qBAAS,EAAC,UAAU,CAAC,CAAC;IACvC,WAAW,GAAG,+BAA+B,CAAC;IAC9C,MAAM,CAAa;IACnB,UAAU,GAA6C;QACtE,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB,CAAC;IACe,cAAc,CAAU;IACxB,MAAM,GAAG,IAAA,iCAAY,EAAC,mBAAmB,CAAC,CAAC;IAC3C,IAAI,CAAO;IACX,cAAc,CAAgB;IAC9B,yBAAyB,CAA4B;IACrD,SAAS,GAAW,GAAG,CAAC;IACxB,YAAY,GAAW,IAAI,CAAC,KAAK,CAChD,IAAI,CAAC,IAAI,CAAC,yCAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,CACjE,CAAC;
|
|
1
|
+
{"version":3,"file":"changesResultIterator.js","sourceRoot":"","sources":["../../../cloudant/features/changesResultIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAAkD;AAClD,yCAAsC;AACtC,+DAAkE;AAGlE,IAAK,yBAIJ;AAJD,WAAK,yBAAyB;IAC5B,6EAAM,CAAA;IACN,2EAAK,CAAA;IACL,2EAAK,CAAA;AACP,CAAC,EAJI,yBAAyB,KAAzB,yBAAyB,QAI7B;AAED,IAAK,aAGJ;AAHD,WAAK,aAAa;IAChB,iDAAI,CAAA;IACJ,+CAAG,CAAA;AACL,CAAC,EAHI,aAAa,KAAb,aAAa,QAGjB;AAOD,MAAa,6BAA6B;IACvB,cAAc,GAAG,IAAA,qBAAS,EAAC,UAAU,CAAC,CAAC;IACvC,WAAW,GAAG,+BAA+B,CAAC;IAC9C,MAAM,CAAa;IACnB,UAAU,GAA6C;QACtE,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,SAAS;KACjB,CAAC;IACe,cAAc,CAAU;IACxB,MAAM,GAAG,IAAA,iCAAY,EAAC,mBAAmB,CAAC,CAAC;IAC3C,IAAI,CAAO;IACX,cAAc,CAAgB;IAC9B,yBAAyB,CAA4B;IACrD,SAAS,GAAW,GAAG,CAAC;IACxB,YAAY,GAAW,IAAI,CAAC,KAAK,CAChD,IAAI,CAAC,IAAI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AAC,MAAM,GAAG,IAAI,CAAC;YACnB,wDAAwD;YACxD,kBAAkB,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;;AAlTH,sEAmTC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibm-cloud/cloudant",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.26",
|
|
4
4
|
"description": "IBM Cloudant Node.js SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -26,13 +26,11 @@
|
|
|
26
26
|
"postbuild": "npm run copymeta",
|
|
27
27
|
"version": "bump-my-version bump patch --allow-dirty --new-version $npm_package_version && git add README.md .bumpversion.toml docs/*.md",
|
|
28
28
|
"postversion": "npm run copymeta",
|
|
29
|
-
"jest": "jest --runInBand",
|
|
30
|
-
"test": "npm run build && npm run lint && jest --
|
|
31
|
-
"test-unit": "npm
|
|
32
|
-
"test-integration": "npm
|
|
33
|
-
"test-ci": "
|
|
34
|
-
"test-unit-ci": "jest --runInBand test/unit/",
|
|
35
|
-
"test-integration-ci": "jest --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' --json test/integration > test-output.log",
|
|
29
|
+
"jest": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
|
|
30
|
+
"test": "npm run build && npm run lint && npm run jest --",
|
|
31
|
+
"test-unit": "npm test -- test/unit/",
|
|
32
|
+
"test-integration": "npm test -- test/integration",
|
|
33
|
+
"test-ci": "npm test -- --testNamePattern='^((?!@slow).)*$' test/",
|
|
36
34
|
"typedoc": "typedoc"
|
|
37
35
|
},
|
|
38
36
|
"license": "Apache-2.0",
|
|
@@ -40,48 +38,37 @@
|
|
|
40
38
|
"node": "^22 || ^24"
|
|
41
39
|
},
|
|
42
40
|
"dependencies": {
|
|
43
|
-
"@types/node": "22.20.
|
|
44
|
-
"ibm-cloud-sdk-core": "5.
|
|
41
|
+
"@types/node": "22.20.5",
|
|
42
|
+
"ibm-cloud-sdk-core": "5.9.0"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"@eslint/js": "9.39.5",
|
|
48
46
|
"@ibm-cloud/sdk-test-utilities": "^1.0.0",
|
|
49
47
|
"@types/extend": "3.0.4",
|
|
50
48
|
"@types/jest": "30.0.0",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
52
|
-
"@typescript-eslint/parser": "8.
|
|
53
|
-
"dotenv": "
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "8.71.1",
|
|
50
|
+
"@typescript-eslint/parser": "8.71.1",
|
|
51
|
+
"dotenv": "18.0.7",
|
|
54
52
|
"eslint": "9.39.5",
|
|
55
53
|
"eslint-config-prettier": "10.1.8",
|
|
56
54
|
"eslint-plugin-header": "3.1.1",
|
|
57
55
|
"eslint-plugin-import": "2.32.0",
|
|
58
|
-
"eslint-plugin-jest": "29.16.
|
|
59
|
-
"eslint-plugin-jsdoc": "
|
|
56
|
+
"eslint-plugin-jest": "29.16.11",
|
|
57
|
+
"eslint-plugin-jsdoc": "65.2.4",
|
|
60
58
|
"eslint-plugin-prettier": "5.5.6",
|
|
61
|
-
"globals": "17.
|
|
62
|
-
"jest": "30.
|
|
59
|
+
"globals": "17.13.0",
|
|
60
|
+
"jest": "30.5.2",
|
|
63
61
|
"jest-junit": "17.0.0",
|
|
64
|
-
"nock": "
|
|
65
|
-
"prettier": "3.9.
|
|
62
|
+
"nock": "15.0.1",
|
|
63
|
+
"prettier": "3.9.10",
|
|
66
64
|
"sinon": "22.1.0",
|
|
67
|
-
"ts-jest": "29.4.
|
|
65
|
+
"ts-jest": "29.4.14",
|
|
68
66
|
"typedoc": "0.28.20",
|
|
69
67
|
"typescript": "6.0.3"
|
|
70
68
|
},
|
|
71
69
|
"peerDependencies": {
|
|
72
|
-
"@types/tough-cookie": "^4.0.0",
|
|
73
70
|
"extend": "^3.0.2",
|
|
74
|
-
"tough-cookie": "^
|
|
75
|
-
},
|
|
76
|
-
"jest": {
|
|
77
|
-
"collectCoverage": true,
|
|
78
|
-
"coverageDirectory": "./coverage/",
|
|
79
|
-
"coveragePathIgnorePatterns": [
|
|
80
|
-
"<rootDir>/test/"
|
|
81
|
-
],
|
|
82
|
-
"preset": "ts-jest",
|
|
83
|
-
"testEnvironment": "node",
|
|
84
|
-
"testResultsProcessor": "jest-junit"
|
|
71
|
+
"tough-cookie": "^6.0.0"
|
|
85
72
|
},
|
|
86
73
|
"jest-junit": {
|
|
87
74
|
"suiteName": "Generated unit tests",
|
|
@@ -102,7 +89,7 @@
|
|
|
102
89
|
"/lib"
|
|
103
90
|
],
|
|
104
91
|
"allowScripts": {
|
|
105
|
-
"
|
|
106
|
-
"
|
|
92
|
+
"unrs-resolver": false,
|
|
93
|
+
"@parcel/watcher": false
|
|
107
94
|
}
|
|
108
95
|
}
|