Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(rest): redesign REST API to use ScrapboxResponse #216

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 11 commits into
base: main
Choose a base branch
from

Conversation

takker99
Copy link
Owner

@takker99 takker99 commented Jan 2, 2025

BREAKING CHANGE: Replace option-t Result with ScrapboxResponse

  • Remove option-t dependency
  • Add ScrapboxResponse class extending web standard Response
  • Improve type safety with status-based type switching
  • Allow direct access to Response.body and headers
  • Add migration guide for v0.30.0

This change follows the implementation pattern from @takker/[email protected] and prepares for release as version 0.30.0.

Resolves #213

BREAKING CHANGE: Replace option-t Result with ScrapboxResponse

- Remove option-t dependency
- Add ScrapboxResponse class extending web standard Response
- Improve type safety with status-based type switching
- Allow direct access to Response.body and headers
- Add migration guide for v0.30.0

This change follows the implementation pattern from @takker/[email protected]
and prepares for release as version 0.30.0.

Resolves takker99#213
- Remove option-t dependency
- Implement TargetedResponse interface following @takker/[email protected]
- Use @std/http for StatusCode and SuccessfulStatus
- Add utility functions for response creation
- Translate Japanese comments to English
- Update all REST API endpoints to use new interface
- Update imports in page-data.ts, link.ts, parseHTTPError.ts, and pages.ts
- Remove deno.lock for clean environment setup
- Remove type keyword from imports where functions are used
- Update remaining ScrapboxResponse references to TargetedResponse in search.ts
- Fix unused imports across REST API files
- Remove type keyword from imports where functions are used
- Fix remaining unused imports in REST API files
- Update import statements to match actual usage
- Add _createErrorResponse and _createSuccessResponse aliases for unused imports
- Add _TargetedResponse alias for unused type imports
- Fix remaining linting errors across REST API files
- Add _TargetedResponse alias for unused type imports in multiple files
- Fix remaining linting errors in REST API files
- Update import path in targeted_response.ts to use jsr:@std/http
- Fix module resolution error
- Update import path in utils.ts to use jsr:@std/http
- Fix module resolution error
…e.ts to use JSR format

- Update import paths in code examples to use jsr:/@std/json@^1.0.1/types
- Update import paths in code examples to use jsr:/@std/testing@^1.0.8/types
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