@camunda8/orchestration-cluster-api 10.0.0-alpha.33 → 10.0.0-alpha.34

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [10.0.0-alpha.34](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.33...v10.0.0-alpha.34) (2026-08-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * **runtime:** add .paginate() to every search operation ([#3](https://github.com/camunda/orchestration-cluster-api-js/issues/3)) ([#446](https://github.com/camunda/orchestration-cluster-api-js/issues/446)) ([fddb27c](https://github.com/camunda/orchestration-cluster-api-js/commit/fddb27c16410787912416309aa9de4e36057bf2c)), closes [Magikcraft/nano-bpm#954](https://github.com/Magikcraft/nano-bpm/issues/954)
7
+
1
8
  # [10.0.0-alpha.33](https://github.com/camunda/orchestration-cluster-api-js/compare/v10.0.0-alpha.32...v10.0.0-alpha.33) (2026-08-21)
2
9
 
3
10
 
package/README.md CHANGED
@@ -1715,7 +1715,56 @@ Notes:
1715
1715
 
1716
1716
  ## Pagination
1717
1717
 
1718
- Search endpoints expose typed request bodies that include pagination fields. Provide the desired page object; auto‑pagination is not (yet) bundled.
1718
+ Every `search*` operation exposes a `.paginate(body, options?)` method that returns a lazy,
1719
+ cancelable async stream over **all** matching results. Cursors (or offsets) are advanced
1720
+ internally, so you never hand-write next-page bookkeeping.
1721
+
1722
+ <!-- snippet-source: examples/pagination.ts | regions: PaginateItems -->
1723
+
1724
+ ```ts
1725
+ // Stream every matching process instance across all pages. Cursors are advanced
1726
+ // internally; the loop stops when the server runs out of pages.
1727
+ async function everyActiveInstanceExample() {
1728
+ const camunda = createCamundaClient();
1729
+
1730
+ const stream = camunda.searchProcessInstances.paginate({
1731
+ filter: { state: 'ACTIVE' },
1732
+ page: { limit: 100 },
1733
+ });
1734
+
1735
+ for await (const instance of stream.items()) {
1736
+ console.log(instance.processInstanceKey);
1737
+ }
1738
+ }
1739
+ ```
1740
+
1741
+ Iterate a page at a time with `.pages()`, or drain a bounded result set into an array with
1742
+ `.toArray()`. Bound long streams with a `maxPages` cap and/or an `AbortSignal`:
1743
+
1744
+ <!-- snippet-source: examples/pagination.ts | regions: PaginateBounded -->
1745
+
1746
+ ```ts
1747
+ // Bound the stream with an AbortSignal and a hard page cap. A non-zero
1748
+ // `consistency` window is applied to the first page only, so freshly-written
1749
+ // data can be waited for without the terminal empty page timing out.
1750
+ async function boundedPaginationExample(processDefinitionId: ProcessDefinitionId) {
1751
+ const camunda = createCamundaClient();
1752
+ const ac = new AbortController();
1753
+ setTimeout(() => ac.abort(), 30_000);
1754
+
1755
+ const stream = camunda.searchProcessInstances.paginate(
1756
+ { filter: { processDefinitionId }, page: { limit: 100 } },
1757
+ { signal: ac.signal, maxPages: 10, consistency: { waitUpToMs: 5000 } }
1758
+ );
1759
+
1760
+ for await (const instance of stream.items()) {
1761
+ console.log(instance.processInstanceKey);
1762
+ }
1763
+ }
1764
+ ```
1765
+
1766
+ For advanced use, the low-level `nextPageRequest()` / `paginate()` primitives are also exported
1767
+ from the package entry point.
1719
1768
 
1720
1769
  ## Configuration Reference
1721
1770