@ibm-cloud/cloudant 0.12.3 → 0.12.5
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 +649 -75
- package/cloudant/features/changesFollower.js +3 -2
- package/cloudant/features/changesFollower.js.map +1 -1
- package/cloudant/features/pagination/allDocsBasePageIterator.d.ts +29 -0
- package/cloudant/features/pagination/allDocsBasePageIterator.js +47 -0
- package/cloudant/features/pagination/allDocsBasePageIterator.js.map +1 -0
- package/cloudant/features/pagination/allDocsPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/allDocsPageIterator.js +30 -0
- package/cloudant/features/pagination/allDocsPageIterator.js.map +1 -0
- package/cloudant/features/pagination/allDocsPartitionPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/allDocsPartitionPageIterator.js +30 -0
- package/cloudant/features/pagination/allDocsPartitionPageIterator.js.map +1 -0
- package/cloudant/features/pagination/basePageIterator.d.ts +39 -0
- package/cloudant/features/pagination/basePageIterator.js +84 -0
- package/cloudant/features/pagination/basePageIterator.js.map +1 -0
- package/cloudant/features/pagination/bookmarkPageIterator.d.ts +25 -0
- package/cloudant/features/pagination/bookmarkPageIterator.js +37 -0
- package/cloudant/features/pagination/bookmarkPageIterator.js.map +1 -0
- package/cloudant/features/pagination/designDocsPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/designDocsPageIterator.js +30 -0
- package/cloudant/features/pagination/designDocsPageIterator.js.map +1 -0
- package/cloudant/features/pagination/findBasePageIterator.d.ts +23 -0
- package/cloudant/features/pagination/findBasePageIterator.js +36 -0
- package/cloudant/features/pagination/findBasePageIterator.js.map +1 -0
- package/cloudant/features/pagination/findPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/findPageIterator.js +30 -0
- package/cloudant/features/pagination/findPageIterator.js.map +1 -0
- package/cloudant/features/pagination/findPartitionPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/findPartitionPageIterator.js +30 -0
- package/cloudant/features/pagination/findPartitionPageIterator.js.map +1 -0
- package/cloudant/features/pagination/iteratorPager.d.ts +32 -0
- package/cloudant/features/pagination/iteratorPager.js +58 -0
- package/cloudant/features/pagination/iteratorPager.js.map +1 -0
- package/cloudant/features/pagination/keyPageIterator.d.ts +33 -0
- package/cloudant/features/pagination/keyPageIterator.js +75 -0
- package/cloudant/features/pagination/keyPageIterator.js.map +1 -0
- package/cloudant/features/{changesResultItemStream.d.ts → pagination/pageIterator.d.ts} +4 -7
- package/cloudant/features/pagination/pageIterator.js +3 -0
- package/cloudant/features/pagination/pageIterator.js.map +1 -0
- package/cloudant/features/pagination/pager.d.ts +28 -0
- package/cloudant/features/pagination/pager.js +18 -0
- package/cloudant/features/pagination/pager.js.map +1 -0
- package/cloudant/features/pagination/pagination.d.ts +185 -0
- package/cloudant/features/pagination/pagination.js +148 -0
- package/cloudant/features/pagination/pagination.js.map +1 -0
- package/cloudant/features/pagination/searchBasePageIterator.d.ts +22 -0
- package/cloudant/features/pagination/searchBasePageIterator.js +30 -0
- package/cloudant/features/pagination/searchBasePageIterator.js.map +1 -0
- package/cloudant/features/pagination/searchPageIterator.d.ts +22 -0
- package/cloudant/features/pagination/searchPageIterator.js +40 -0
- package/cloudant/features/pagination/searchPageIterator.js.map +1 -0
- package/cloudant/features/pagination/searchPartitionPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/searchPartitionPageIterator.js +30 -0
- package/cloudant/features/pagination/searchPartitionPageIterator.js.map +1 -0
- package/cloudant/features/pagination/viewBasePageIterator.d.ts +25 -0
- package/cloudant/features/pagination/viewBasePageIterator.js +57 -0
- package/cloudant/features/pagination/viewBasePageIterator.js.map +1 -0
- package/cloudant/features/pagination/viewPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/viewPageIterator.js +30 -0
- package/cloudant/features/pagination/viewPageIterator.js.map +1 -0
- package/cloudant/features/pagination/viewPartitionPageIterator.d.ts +21 -0
- package/cloudant/features/pagination/viewPartitionPageIterator.js +30 -0
- package/cloudant/features/pagination/viewPartitionPageIterator.js.map +1 -0
- package/cloudant/features/stream.d.ts +4 -3
- package/cloudant/features/stream.js +6 -3
- package/cloudant/features/stream.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +5 -2
- package/index.js.map +1 -1
- package/package.json +17 -17
- package/cloudant/features/changesResultItemStream.js +0 -40
- package/cloudant/features/changesResultItemStream.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChangesFollower = exports.Mode = void 0;
|
|
4
|
+
const stream_1 = require("./stream");
|
|
4
5
|
const changesParamsHelper_1 = require("./changesParamsHelper");
|
|
5
|
-
const changesResultItemStream_1 = require("./changesResultItemStream");
|
|
6
6
|
const node_stream_1 = require("node:stream");
|
|
7
7
|
const changesResultIterator_1 = require("./changesResultIterator");
|
|
8
8
|
/** @internal */
|
|
@@ -178,7 +178,8 @@ class ChangesFollower {
|
|
|
178
178
|
}
|
|
179
179
|
createChangesResultItemsStream(mode) {
|
|
180
180
|
this.changesResultIterator = new changesResultIterator_1.ChangesResultIterableIterator(this.client, changesParamsHelper_1.ChangesParamsHelper.cloneParams(this.params, mode), mode, this.errorTolerance);
|
|
181
|
-
|
|
181
|
+
let resultsIterator = node_stream_1.Readable.from((0, node_stream_1.pipeline)(node_stream_1.Readable.from(this.changesResultIterator), new stream_1.Stream(), () => { })).flatMap((item) => item.results);
|
|
182
|
+
return (0, node_stream_1.pipeline)(resultsIterator, new stream_1.Stream(), () => { });
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
exports.ChangesFollower = ChangesFollower;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changesFollower.js","sourceRoot":"","sources":["../../../cloudant/features/changesFollower.ts"],"names":[],"mappings":";;;AAqBA,+DAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"changesFollower.js","sourceRoot":"","sources":["../../../cloudant/features/changesFollower.ts"],"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,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;;AAhJH,0CAiJC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { default as CloudantV1, AllDocsResult, DocsResultRow, Response } from '../../v1';
|
|
17
|
+
import { KeyPageIterator } from './keyPageIterator';
|
|
18
|
+
export declare abstract class AllDocsBasePageIterator<P extends CloudantV1.PostAllDocsParams | CloudantV1.PostPartitionAllDocsParams | CloudantV1.PostDesignDocsParams> extends KeyPageIterator<string, P, AllDocsResult, DocsResultRow> {
|
|
19
|
+
constructor(client: CloudantV1, params: P);
|
|
20
|
+
/**
|
|
21
|
+
* Setting start key doc ID is a no-op for all_docs based paging where
|
|
22
|
+
* key is the same as id.
|
|
23
|
+
*/
|
|
24
|
+
protected setNextKeyId(params: P, startKeyDocId: string): void;
|
|
25
|
+
protected getItems(result: AllDocsResult): Array<DocsResultRow>;
|
|
26
|
+
protected abstract nextRequestFunction(): (params: P) => Promise<Response<AllDocsResult>>;
|
|
27
|
+
protected checkBoundary(penultimateItem: DocsResultRow, lastItem: DocsResultRow): any;
|
|
28
|
+
protected getValidateParamsAbsentErrorMessage(paramName: any): string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AllDocsBasePageIterator = void 0;
|
|
19
|
+
const keyPageIterator_1 = require("./keyPageIterator");
|
|
20
|
+
class AllDocsBasePageIterator extends keyPageIterator_1.KeyPageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Setting start key doc ID is a no-op for all_docs based paging where
|
|
27
|
+
* key is the same as id.
|
|
28
|
+
*/
|
|
29
|
+
setNextKeyId(params, startKeyDocId) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
getItems(result) {
|
|
33
|
+
return result.rows;
|
|
34
|
+
}
|
|
35
|
+
checkBoundary(penultimateItem, lastItem) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
getValidateParamsAbsentErrorMessage(paramName) {
|
|
39
|
+
let errorMsg = super.getValidateParamsAbsentErrorMessage(paramName);
|
|
40
|
+
if (paramName === 'key') {
|
|
41
|
+
errorMsg = `${errorMsg} No need to paginate as 'key' returns a single result for an ID.`;
|
|
42
|
+
}
|
|
43
|
+
return errorMsg;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.AllDocsBasePageIterator = AllDocsBasePageIterator;
|
|
47
|
+
//# sourceMappingURL=allDocsBasePageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allDocsBasePageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/allDocsBasePageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,uDAAoD;AAEpD,MAAsB,uBAKpB,SAAQ,iCAAwD;IAChE,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAS;QACvC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAED;;;OAGG;IACO,YAAY,CAAC,MAAS,EAAE,aAAqB;QACrD,OAAO;IACT,CAAC;IAES,QAAQ,CAAC,MAAqB;QACtC,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAKS,aAAa,CACrB,eAA8B,EAC9B,QAAuB;QAEvB,OAAO,IAAI,CAAC;IACd,CAAC;IAES,mCAAmC,CAAC,SAAS;QACrD,IAAI,QAAQ,GAAG,KAAK,CAAC,mCAAmC,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;YACxB,QAAQ,GAAG,GAAG,QAAQ,kEAAkE,CAAC;QAC3F,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAxCD,0DAwCC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AllDocsResult, default as CloudantV1, PostAllDocsParams, Response } from '../../v1';
|
|
17
|
+
import { AllDocsBasePageIterator } from './allDocsBasePageIterator';
|
|
18
|
+
export declare class AllDocsPageIterator extends AllDocsBasePageIterator<PostAllDocsParams> {
|
|
19
|
+
constructor(client: CloudantV1, params: PostAllDocsParams);
|
|
20
|
+
protected nextRequestFunction(): (params: PostAllDocsParams) => Promise<Response<AllDocsResult>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AllDocsPageIterator = void 0;
|
|
19
|
+
const allDocsBasePageIterator_1 = require("./allDocsBasePageIterator");
|
|
20
|
+
class AllDocsPageIterator extends allDocsBasePageIterator_1.AllDocsBasePageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
nextRequestFunction() {
|
|
26
|
+
return this.client.postAllDocs;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AllDocsPageIterator = AllDocsPageIterator;
|
|
30
|
+
//# sourceMappingURL=allDocsPageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allDocsPageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/allDocsPageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,uEAAoE;AAEpE,MAAa,mBAAoB,SAAQ,iDAA0C;IACjF,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAyB;QACvD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,mBAAmB;QAG3B,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;CACF;AAXD,kDAWC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AllDocsResult, default as CloudantV1, PostPartitionAllDocsParams, Response } from '../../v1';
|
|
17
|
+
import { AllDocsBasePageIterator } from './allDocsBasePageIterator';
|
|
18
|
+
export declare class AllDocsPartitionPageIterator extends AllDocsBasePageIterator<PostPartitionAllDocsParams> {
|
|
19
|
+
constructor(client: CloudantV1, params: PostPartitionAllDocsParams);
|
|
20
|
+
protected nextRequestFunction(): (params: PostPartitionAllDocsParams) => Promise<Response<AllDocsResult>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AllDocsPartitionPageIterator = void 0;
|
|
19
|
+
const allDocsBasePageIterator_1 = require("./allDocsBasePageIterator");
|
|
20
|
+
class AllDocsPartitionPageIterator extends allDocsBasePageIterator_1.AllDocsBasePageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
nextRequestFunction() {
|
|
26
|
+
return this.client.postPartitionAllDocs;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AllDocsPartitionPageIterator = AllDocsPartitionPageIterator;
|
|
30
|
+
//# sourceMappingURL=allDocsPartitionPageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allDocsPartitionPageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/allDocsPartitionPageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,uEAAoE;AAEpE,MAAa,4BAA6B,SAAQ,iDAAmD;IACnG,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAkC;QAChE,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,mBAAmB;QAG3B,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAC1C,CAAC;CACF;AAXD,oEAWC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { default as CloudantV1, Response } from '../../v1';
|
|
17
|
+
import { PageIterator } from './pageIterator';
|
|
18
|
+
export declare abstract class BasePageIterator<P extends CloudantV1.PostAllDocsParams | CloudantV1.PostPartitionAllDocsParams | CloudantV1.PostDesignDocsParams | CloudantV1.PostFindParams | CloudantV1.PostPartitionFindParams | CloudantV1.PostSearchParams | CloudantV1.PostPartitionSearchParams | CloudantV1.PostViewParams | CloudantV1.PostPartitionViewParams, R extends CloudantV1.AllDocsResult | CloudantV1.FindResult | CloudantV1.SearchResult | CloudantV1.ViewResult, I extends CloudantV1.DocsResultRow | CloudantV1.Document | CloudantV1.SearchResultRow | CloudantV1.ViewResultRow> implements PageIterator<I> {
|
|
19
|
+
protected client: CloudantV1;
|
|
20
|
+
protected pageSize: number;
|
|
21
|
+
protected _hasNext: boolean;
|
|
22
|
+
protected nextPageParams: P;
|
|
23
|
+
protected static MAX_LIMIT: number;
|
|
24
|
+
protected static MIN_LIMIT: number;
|
|
25
|
+
constructor(client: CloudantV1, params: P);
|
|
26
|
+
next(...[value]: [] | [any]): Promise<IteratorResult<ReadonlyArray<I>, any>>;
|
|
27
|
+
protected nextRequest(): Promise<Array<I>>;
|
|
28
|
+
protected abstract getItems(result: R): Array<I>;
|
|
29
|
+
protected abstract setNextPageParams(params: P, result: R): void;
|
|
30
|
+
protected abstract nextRequestFunction(): (params: P) => Promise<Response<R>>;
|
|
31
|
+
protected getLimit(params: P): number;
|
|
32
|
+
protected getPageSize(params: any): number;
|
|
33
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<ReadonlyArray<I>>;
|
|
34
|
+
hasNext(): boolean;
|
|
35
|
+
protected validate(params: P): void;
|
|
36
|
+
protected validateParamsAbsent(params: P, paramNames: Array<string>): void;
|
|
37
|
+
protected getValidateParamsAbsentErrorMessage(paramName: any): string;
|
|
38
|
+
private validateLimit;
|
|
39
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BasePageIterator = void 0;
|
|
4
|
+
class BasePageIterator {
|
|
5
|
+
client;
|
|
6
|
+
pageSize;
|
|
7
|
+
_hasNext = true;
|
|
8
|
+
nextPageParams;
|
|
9
|
+
// The maximum and minimum limit values (i.e. page size)
|
|
10
|
+
static MAX_LIMIT = 200;
|
|
11
|
+
static MIN_LIMIT = 1;
|
|
12
|
+
constructor(client, params) {
|
|
13
|
+
this.client = client;
|
|
14
|
+
this.validate(params);
|
|
15
|
+
// Set the page size from the supplied params limit
|
|
16
|
+
this.pageSize = this.getPageSize(params);
|
|
17
|
+
// Clone the supplied params into the nextPageParams
|
|
18
|
+
this.nextPageParams = { ...params };
|
|
19
|
+
}
|
|
20
|
+
async next(...[value]) {
|
|
21
|
+
if (this._hasNext) {
|
|
22
|
+
const items = await this.nextRequest();
|
|
23
|
+
const readonlyItems = [...items];
|
|
24
|
+
return { done: false, value: readonlyItems };
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return { done: true, value: undefined };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async nextRequest() {
|
|
31
|
+
const response = await this.nextRequestFunction().call(this.client, this.nextPageParams);
|
|
32
|
+
const result = response.result;
|
|
33
|
+
const items = this.getItems(result);
|
|
34
|
+
if (items.length < this.pageSize) {
|
|
35
|
+
this._hasNext = false;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.setNextPageParams(this.nextPageParams, result);
|
|
39
|
+
}
|
|
40
|
+
return items;
|
|
41
|
+
}
|
|
42
|
+
getLimit(params) {
|
|
43
|
+
return params.limit;
|
|
44
|
+
}
|
|
45
|
+
getPageSize(params) {
|
|
46
|
+
return this.getLimit(params)
|
|
47
|
+
? this.getLimit(params)
|
|
48
|
+
: BasePageIterator.MAX_LIMIT;
|
|
49
|
+
}
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
hasNext() {
|
|
54
|
+
return this._hasNext;
|
|
55
|
+
}
|
|
56
|
+
validate(params) {
|
|
57
|
+
// != undefined filters out undefined and null values for limit:
|
|
58
|
+
if (params.limit != undefined) {
|
|
59
|
+
this.validateLimit(params.limit);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
validateParamsAbsent(params, paramNames) {
|
|
63
|
+
for (let paramName of paramNames) {
|
|
64
|
+
if (params[paramName] !== undefined) {
|
|
65
|
+
throw new Error(this.getValidateParamsAbsentErrorMessage(paramName));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
getValidateParamsAbsentErrorMessage(paramName) {
|
|
70
|
+
return `The param '${paramName}' is invalid when using pagination.`;
|
|
71
|
+
}
|
|
72
|
+
validateLimit(limit) {
|
|
73
|
+
// If limit is set check it is within range
|
|
74
|
+
// Else it is unset and we will set the valid default value later
|
|
75
|
+
if (limit > BasePageIterator.MAX_LIMIT) {
|
|
76
|
+
throw new Error(`The provided limit ${limit} exceeds the maximum page size value of ${BasePageIterator.MAX_LIMIT}.`);
|
|
77
|
+
}
|
|
78
|
+
if (limit < BasePageIterator.MIN_LIMIT) {
|
|
79
|
+
throw new Error(`The provided limit ${limit} is lower than the minimum page size value of ${BasePageIterator.MIN_LIMIT}.`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.BasePageIterator = BasePageIterator;
|
|
84
|
+
//# sourceMappingURL=basePageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basePageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/basePageIterator.ts"],"names":[],"mappings":";;;AAkBA,MAAsB,gBAAgB;IAuB1B,MAAM,CAAa;IACnB,QAAQ,CAAS;IACjB,QAAQ,GAAY,IAAI,CAAC;IACzB,cAAc,CAAI;IAE5B,wDAAwD;IAC9C,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC;IACvB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;IAE/B,YAAY,MAAkB,EAAE,MAAS;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtB,mDAAmD;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAA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the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { BasePageIterator } from './basePageIterator';
|
|
17
|
+
import { default as CloudantV1, Response } from '../../v1';
|
|
18
|
+
export declare abstract class BookmarkPageIterator<P extends CloudantV1.PostFindParams | CloudantV1.PostPartitionFindParams | CloudantV1.PostSearchParams | CloudantV1.PostPartitionSearchParams, R extends CloudantV1.FindResult | CloudantV1.SearchResult, I> extends BasePageIterator<P, R, I> {
|
|
19
|
+
constructor(client: CloudantV1, params: P);
|
|
20
|
+
protected setBookmark(params: P, bookmark: string): void;
|
|
21
|
+
protected getBookmark(result: R): string;
|
|
22
|
+
protected abstract getItems(result: R): Array<I>;
|
|
23
|
+
protected setNextPageParams(params: P, result: R): void;
|
|
24
|
+
protected abstract nextRequestFunction(): (params: P) => Promise<Response<R>>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BookmarkPageIterator = void 0;
|
|
19
|
+
const basePageIterator_1 = require("./basePageIterator");
|
|
20
|
+
class BookmarkPageIterator extends basePageIterator_1.BasePageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
setBookmark(params, bookmark) {
|
|
26
|
+
params.bookmark = bookmark;
|
|
27
|
+
}
|
|
28
|
+
getBookmark(result) {
|
|
29
|
+
return result.bookmark;
|
|
30
|
+
}
|
|
31
|
+
setNextPageParams(params, result) {
|
|
32
|
+
const bookmark = this.getBookmark(result);
|
|
33
|
+
this.setBookmark(params, bookmark);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.BookmarkPageIterator = BookmarkPageIterator;
|
|
37
|
+
//# sourceMappingURL=bookmarkPageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookmarkPageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/bookmarkPageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yDAAsD;AAGtD,MAAsB,oBAQpB,SAAQ,mCAAyB;IACjC,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAS;QACvC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,WAAW,CAAC,MAAS,EAAE,QAAgB;QAC/C,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAES,WAAW,CAAC,MAAS;QAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;IAGS,iBAAiB,CAAC,MAAS,EAAE,MAAS;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;CAEF;AA5BD,oDA4BC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AllDocsResult, default as CloudantV1, PostDesignDocsParams, Response } from '../../v1';
|
|
17
|
+
import { AllDocsBasePageIterator } from './allDocsBasePageIterator';
|
|
18
|
+
export declare class DesignDocsPageIterator extends AllDocsBasePageIterator<PostDesignDocsParams> {
|
|
19
|
+
constructor(client: CloudantV1, params: PostDesignDocsParams);
|
|
20
|
+
protected nextRequestFunction(): (params: PostDesignDocsParams) => Promise<Response<AllDocsResult>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.DesignDocsPageIterator = void 0;
|
|
19
|
+
const allDocsBasePageIterator_1 = require("./allDocsBasePageIterator");
|
|
20
|
+
class DesignDocsPageIterator extends allDocsBasePageIterator_1.AllDocsBasePageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
nextRequestFunction() {
|
|
26
|
+
return this.client.postDesignDocs;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.DesignDocsPageIterator = DesignDocsPageIterator;
|
|
30
|
+
//# sourceMappingURL=designDocsPageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"designDocsPageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/designDocsPageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,uEAAoE;AAEpE,MAAa,sBAAuB,SAAQ,iDAA6C;IACvF,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAA4B;QAC1D,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,mBAAmB;QAG3B,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;IACpC,CAAC;CACF;AAXD,wDAWC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { default as CloudantV1, FindResult, Document, Response } from '../../v1';
|
|
17
|
+
import { BookmarkPageIterator } from './bookmarkPageIterator';
|
|
18
|
+
export declare abstract class FindBasePageIterator<P extends CloudantV1.PostFindParams | CloudantV1.PostPartitionFindParams> extends BookmarkPageIterator<P, FindResult, Document> {
|
|
19
|
+
constructor(client: CloudantV1, params: P);
|
|
20
|
+
protected getItems(result: FindResult): Array<Document>;
|
|
21
|
+
protected abstract nextRequestFunction(): (params: P) => Promise<Response<FindResult>>;
|
|
22
|
+
protected setNextPageParams(params: P, result: FindResult): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FindBasePageIterator = void 0;
|
|
19
|
+
const bookmarkPageIterator_1 = require("./bookmarkPageIterator");
|
|
20
|
+
class FindBasePageIterator extends bookmarkPageIterator_1.BookmarkPageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
getItems(result) {
|
|
26
|
+
return result.docs;
|
|
27
|
+
}
|
|
28
|
+
setNextPageParams(params, result) {
|
|
29
|
+
super.setNextPageParams(params, result);
|
|
30
|
+
if (params.skip) {
|
|
31
|
+
delete params.skip;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.FindBasePageIterator = FindBasePageIterator;
|
|
36
|
+
//# sourceMappingURL=findBasePageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findBasePageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/findBasePageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,iEAA8D;AAE9D,MAAsB,oBAEpB,SAAQ,2CAA6C;IACrD,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAS;QACvC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,QAAQ,CAAC,MAAkB;QACnC,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAKS,iBAAiB,CAAC,MAAS,EAAE,MAAkB;QACvD,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AArBD,oDAqBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { default as CloudantV1, FindResult, PostFindParams, Response } from '../../v1';
|
|
17
|
+
import { FindBasePageIterator } from './findBasePageIterator';
|
|
18
|
+
export declare class FindPageIterator extends FindBasePageIterator<PostFindParams> {
|
|
19
|
+
constructor(client: CloudantV1, params: PostFindParams);
|
|
20
|
+
protected nextRequestFunction(): (params: PostFindParams) => Promise<Response<FindResult>>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FindPageIterator = void 0;
|
|
19
|
+
const findBasePageIterator_1 = require("./findBasePageIterator");
|
|
20
|
+
class FindPageIterator extends findBasePageIterator_1.FindBasePageIterator {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
22
|
+
constructor(client, params) {
|
|
23
|
+
super(client, params);
|
|
24
|
+
}
|
|
25
|
+
nextRequestFunction() {
|
|
26
|
+
return this.client.postFind;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.FindPageIterator = FindPageIterator;
|
|
30
|
+
//# sourceMappingURL=findPageIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findPageIterator.js","sourceRoot":"","sources":["../../../../cloudant/features/pagination/findPageIterator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAQH,iEAA8D;AAE9D,MAAa,gBAAiB,SAAQ,2CAAoC;IACxE,qEAAqE;IACrE,YAAY,MAAkB,EAAE,MAAsB;QACpD,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC;IAES,mBAAmB;QAG3B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;CACF;AAXD,4CAWC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* © Copyright IBM Corporation 2025. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { default as CloudantV1, FindResult, PostPartitionFindParams, Response } from '../../v1';
|
|
17
|
+
import { FindBasePageIterator } from './findBasePageIterator';
|
|
18
|
+
export declare class FindPartitionPageIterator extends FindBasePageIterator<PostPartitionFindParams> {
|
|
19
|
+
constructor(client: CloudantV1, params: PostPartitionFindParams);
|
|
20
|
+
protected nextRequestFunction(): (params: PostPartitionFindParams) => Promise<Response<FindResult>>;
|
|
21
|
+
}
|