Skip to content

Client api support - Getinstances/listinstanceids#78

Merged
YunchuWang merged 5 commits intomainfrom
wangbill/query
Jan 30, 2026
Merged

Client api support - Getinstances/listinstanceids#78
YunchuWang merged 5 commits intomainfrom
wangbill/query

Conversation

@YunchuWang
Copy link
Member

This pull request adds advanced querying and pagination capabilities for orchestration instances in the Durable Task JS SDK. It introduces new types and utilities for paginated queries, implements two new methods on the TaskHubGrpcClient for querying orchestration states and listing instance IDs, and exports these new APIs for public use.

New querying and pagination features:

  • Added OrchestrationQuery, ListInstanceIdsOptions, and DEFAULT_PAGE_SIZE types to support flexible filtering and paging of orchestration instances.
  • Introduced Page, AsyncPageable, and createAsyncPageable utilities to provide async iteration over paginated results.

Client API enhancements:

  • Implemented getAllInstances method on TaskHubGrpcClient to query orchestration instances with flexible filters and return results as an AsyncPageable for both item and page-wise async iteration.
  • Added listInstanceIds method for efficient, key-based pagination of instance IDs without fetching full instance metadata.
  • Added a helper method to convert protobuf orchestration state objects to SDK OrchestrationState instances.

Public API exports:

  • Exported the new query and pagination types and utilities from the package entry point for public use.
  • Updated imports to include new types and conversion helpers in the client implementation.

remove

real dts test
@YunchuWang YunchuWang marked this pull request as ready for review January 30, 2026 22:47
Copilot AI review requested due to automatic review settings January 30, 2026 22:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive querying and pagination capabilities for orchestration instances in the Durable Task JavaScript SDK. The implementation introduces new types for flexible filtering and pagination, implements two new client methods for querying orchestration states and listing instance IDs, and exports these APIs for public use.

Changes:

  • Added pagination infrastructure with Page, AsyncPageable, and createAsyncPageable utilities to support async iteration over paginated results
  • Introduced OrchestrationQuery and ListInstanceIdsOptions interfaces for flexible filtering and pagination of orchestration instances
  • Implemented getAllInstances and listInstanceIds methods on TaskHubGrpcClient with comprehensive E2E and unit tests

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/durabletask-js/src/orchestration/page.ts Implements Page class and AsyncPageable utilities for pagination support
packages/durabletask-js/src/orchestration/orchestration-query.ts Defines query and filtering interfaces with default page size constant
packages/durabletask-js/src/client/client.ts Adds getAllInstances and listInstanceIds methods with helper for proto-to-SDK state conversion
packages/durabletask-js/src/index.ts Exports new query types and pagination utilities for public API
packages/durabletask-js/test/query-apis.spec.ts Unit tests for pagination and query type validation
test/e2e-azuremanaged/query-apis.spec.ts Comprehensive E2E tests covering various query scenarios and edge cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

YunchuWang and others added 4 commits January 30, 2026 14:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@YunchuWang YunchuWang merged commit d24ebc5 into main Jan 30, 2026
7 checks passed
@YunchuWang YunchuWang deleted the wangbill/query branch January 30, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants