Skip to content

fix: comprehensive codebase improvements and bug fixes#66

Open
Pranav-Karra-3301 wants to merge 1 commit intoKTH:masterfrom
Pranav-Karra-3301:master
Open

fix: comprehensive codebase improvements and bug fixes#66
Pranav-Karra-3301 wants to merge 1 commit intoKTH:masterfrom
Pranav-Karra-3301:master

Conversation

@Pranav-Karra-3301
Copy link

Security:

  • Fix query parameter injection by adding URL encoding
  • Guard process.env access for non-Node environments

Bug Fixes:

  • Fix rate limiter rejecting wrong object (was workItem, now err)
  • Fix array Link headers breaking pagination
  • Add MAX_RETRIES=5 to prevent infinite retry loops
  • Add parseError property to track JSON parse failures

Breaking Circular Dependency:

  • Extract CanvasApiResponse to src/canvasApiResponse.ts

Type Safety:

  • Make CanvasApiResponse generic: CanvasApiResponse
  • Add generic parameters to get(), request(), listPages(), listItems()

New Exports:

  • CanvasApiResponse, QueryParams, RequestOptions
  • CanvasApiTimeoutError, CanvasApiPaginationError
  • ExtendedGenerator

Documentation:

  • Add CHANGELOG.md with version history
  • Add CONTRIBUTING.md with dev setup and PR guidelines
  • Add .env.example template
  • Add JSDoc to all public methods
  • Expand README with rate limiting, debug logging, TypeScript types

Testing:

  • Add src/canvasApiError.test.ts (9 tests)
  • Add integration-tests/pagination.test.ts (9 tests)
  • Add integration-tests/error-handling.test.ts (14 tests)
  • Expand extendedGenerator tests (15 new tests)

Dependencies:

  • Update undici 6.19.2 → 6.23.0
  • Update typescript 4.9.5 → 5.9.3
  • Update prettier 2.8.2 → 3.8.1
  • Remove unused: fast-csv, msw, ora, tempy, @types/create-test-server

Improvements:

  • Add debug logging via CANVAS_API_DEBUG=true
  • Add proactive rate limit header checking
  • Update examples to use .json instead of deprecated .body
  • Add custom-formdata.js example

Security:
- Fix query parameter injection by adding URL encoding
- Guard process.env access for non-Node environments

Bug Fixes:
- Fix rate limiter rejecting wrong object (was workItem, now err)
- Fix array Link headers breaking pagination
- Add MAX_RETRIES=5 to prevent infinite retry loops
- Add parseError property to track JSON parse failures

Breaking Circular Dependency:
- Extract CanvasApiResponse to src/canvasApiResponse.ts

Type Safety:
- Make CanvasApiResponse generic: CanvasApiResponse<T>
- Add generic parameters to get(), request(), listPages(), listItems()

New Exports:
- CanvasApiResponse, QueryParams, RequestOptions
- CanvasApiTimeoutError, CanvasApiPaginationError
- ExtendedGenerator

Documentation:
- Add CHANGELOG.md with version history
- Add CONTRIBUTING.md with dev setup and PR guidelines
- Add .env.example template
- Add JSDoc to all public methods
- Expand README with rate limiting, debug logging, TypeScript types

Testing:
- Add src/canvasApiError.test.ts (9 tests)
- Add integration-tests/pagination.test.ts (9 tests)
- Add integration-tests/error-handling.test.ts (14 tests)
- Expand extendedGenerator tests (15 new tests)

Dependencies:
- Update undici 6.19.2 → 6.23.0
- Update typescript 4.9.5 → 5.9.3
- Update prettier 2.8.2 → 3.8.1
- Remove unused: fast-csv, msw, ora, tempy, @types/create-test-server

Improvements:
- Add debug logging via CANVAS_API_DEBUG=true
- Add proactive rate limit header checking
- Update examples to use .json instead of deprecated .body
- Add custom-formdata.js example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant