Skip to content

feat: add UserClient and SubmissionsClient modules for comprehensive SDK coverage (#863) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #1435

Open
waterWang wants to merge 1 commit into
SolFoundry:mainfrom
waterWang:feat/sdk-users-submissions-modules
Open

feat: add UserClient and SubmissionsClient modules for comprehensive SDK coverage (#863) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]#1435
waterWang wants to merge 1 commit into
SolFoundry:mainfrom
waterWang:feat/sdk-users-submissions-modules

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Add dedicated UserClient and SubmissionsClient resource modules to the SolFoundry TypeScript SDK, completing the API coverage for bounties, submissions, and users as specified in the T3 bounty requirements.

Changes

New: UserClient (sdk/src/users.ts)

  • getProfile() — Get the authenticated user's profile
  • updateProfile() — Update display name, wallet, bio, skills
  • getActivity() — Paginated activity history
  • getContributionStats() — Aggregated contribution statistics
  • listNotifications() — Paginated notification list with unread filter
  • markNotificationRead() / markAllNotificationsRead() — Read/unread management
  • getNotificationPreferences() / updateNotificationPreferences() — Preference management

New: SubmissionsClient (sdk/src/submissions.ts)

  • list(bountyId) — List all submissions for a bounty
  • get(bountyId, submissionId) — Get a specific submission
  • create(bountyId, data) — Submit a solution (PR) to a bounty
  • updateStatus(bountyId, submissionId, data) — Approve/reject submissions
  • getReview(bountyId, submissionId) — Full AI review details with per-model scores

New types (sdk/src/types.ts)

  • UserProfile, UserProfileUpdate — User profile models
  • UserActivityEntry, UserActivityResponse — Activity history
  • UserContributionStats — Aggregated stats
  • UserNotification, UserNotificationResponse, UserNotificationPreferences — Notification system
  • ModelReviewResult, SubmissionReviewResponse — AI review details

Updated facade (sdk/src/index.ts)

  • SolFoundry.users — Access user operations
  • SolFoundry.submissions — Access submission operations
  • Full type re-exports for all new types

Testing

  • 220 tests pass (12 files) — all existing tests continue to pass
  • users.test.ts — 11 tests covering all 10 UserClient methods
  • submissions.test.ts — 6 tests covering all 5 SubmissionsClient methods
  • index.test.ts — Updated to verify new clients via facade
  • Follows existing vitest mocking patterns (`vi.fn()` for HttpClient)

Closes #863

Wallet: FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH

…SDK coverage (SolFoundry#863)

Add dedicated user and submission resource modules to the SolFoundry
TypeScript SDK, completing the API coverage for bounties, submissions,
and users as specified in the bounty requirements.

Changes:
- Add sdk/src/users.ts — UserClient with profile management, activity
  history, contribution stats, and notification preferences
- Add sdk/src/submissions.ts — SubmissionsClient with dedicated
  submission lifecycle operations (submit, list, review, status updates)
- Add sdk/src/types.ts types — UserProfile, UserActivityEntry,
  UserContributionStats, UserNotification, ModelReviewResult,
  SubmissionReviewResponse, and supporting types
- Update sdk/src/index.ts — Export new modules, add users and
  submissions to the SolFoundry facade class
- Add tests — users.test.ts (11 tests) and submissions.test.ts (6 tests)
  following existing vitest mocking patterns
- Update index.test.ts — Verify new clients are accessible via facade

Test: 220 passed (12 files), all existing tests continue to pass

[fFaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
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.

🏭 Bounty T3: SolFoundry TypeScript SDK

1 participant