Skip to content

51 add getlastknowposition #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

miquelgall
Copy link
Contributor

The branch 51-add-getlastknowposition has been successfully pushed to
oracle-samples/ofs-proxy-js. Here's the information for creating the pull request:

Branch Information:

  • Source Branch: 51-add-getlastknowposition
  • Target Branch: main
  • Repository: oracle-samples/ofs-proxy-js

Pull Request Details:

Title: Add getLastKnownPositions and getAllLastKnownPositions methods

Description:

Summary

  • Implement getLastKnownPositions API method with proper pagination support
  • Add getAllLastKnownPositions method that automatically handles hasMore pagination
  • Include comprehensive TypeScript interfaces and type definitions
  • Add CLAUDE.md for future development guidance
  • Fix existing test suite issues for better reliability

Implementation Details

New Methods

  • getLastKnownPositions(params?): Single API call with optional offset/resources
    parameters
  • getAllLastKnownPositions(params?): Automatic pagination using hasMore flag from
    Oracle API

TypeScript Support

  • Proper type definitions with optional hasMore field for large responses (>20MB)
  • OFSGetLastKnownPositionsParams interface for input parameters
  • OFSLastKnownPosition interface for individual position data
  • OFSLastKnownPositionsResponse class for typed responses

Key Features

  • Handles Oracle's 20MB response limit with automatic pagination
  • Supports resource filtering and offset parameters
  • Comprehensive error handling for invalid resources
  • Follows existing codebase patterns and conventions

Test Coverage

Added 14 comprehensive test cases covering:

  • All parameter combinations (offset, resources, multiple resources)
  • Response structure validation and error handling
  • Pagination behavior and data accumulation
  • Invalid resource handling and edge cases
  • Both single API calls and paginated getAllLastKnownPositions

Test Fixes

  • Fixed existing activity tests to be more robust with varying data
  • Updated meta test configurations to match actual API responses
  • Increased timeouts for long-running pagination tests
  • All tests now pass except plugin tests (missing test file)

miquelgall and others added 4 commits July 10, 2025 20:01
## Summary
- Implement getLastKnownPositions API method with proper pagination support
- Add getAllLastKnownPositions method that automatically handles hasMore pagination
- Include comprehensive TypeScript interfaces and type definitions
- Add CLAUDE.md for future development guidance
- Fix existing test suite issues for better reliability

## Implementation Details
- getLastKnownPositions: Single API call with offset/resources parameters
- getAllLastKnownPositions: Automatic pagination using hasMore flag
- Proper TypeScript types with optional hasMore field for large responses
- 14 comprehensive test cases covering all scenarios
- Updated test configurations to match actual API responses

## Test Coverage
- All parameter combinations (offset, resources, multiple resources)
- Response structure validation and error handling
- Pagination behavior and data accumulation
- Invalid resource handling and edge cases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@miquelgall miquelgall linked an issue Jul 11, 2025 that may be closed by this pull request
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 11, 2025
@miquelgall miquelgall requested a review from btoron July 11, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add getLastKnowPosition
1 participant