Skip to content

Conversation

@donjerick
Copy link
Collaborator

🚀 Release v1.1.0

This PR introduces major enhancements to the Magpie Node.js SDK with new organization management capabilities and improved source authentication.

✨ New Features

  • Organizations Resource: New /me endpoint to retrieve organization details including branding, payment settings, and payout configurations
  • Dynamic API Key Management: Runtime API key switching with setApiKey() and getApiKey() methods
  • Enhanced Test Utilities: Improved mocking capabilities with mockRequest() and mockNetworkError()

🔧 Improvements

  • Lazy PK Authentication: Automatic public key fetching and caching for sources
  • Better Type System: Clean organization-related type definitions
  • Enhanced Testing: Comprehensive test coverage for new features

⚠️ Breaking Changes

  • Sources Resource: Removed create() method - sources should now be created client-side using public key authentication
  • Type Exports: Removed deprecated CardSourceCreateParams and SourceCreateParams types

📦 Migration Guide

For users upgrading from v1.0.x:

  • Remove any usage of magpie.sources.create() - implement client-side source creation instead
  • Replace removed source creation types with client-side equivalents
  • New organization data available via magpie.organizations.me()

🧪 Testing

  • All 236 tests pass ✅
  • No TypeScript compilation errors ✅
  • ESLint clean ✅
  • Build successful ✅

📝 Commits Included

  • feat: add Organizations resource
  • feat: add dynamic API key management to BaseClient
  • feat: enhance Sources resource with PK authentication
  • refactor: remove deprecated source creation types
  • feat: integrate Organizations resource into main client
  • feat: enhance test utilities with improved mocking capabilities
  • chore: bump version to 1.1.0 and update changelog
  • chore: minor license and resource updates

- Add Organization type definitions with comprehensive property types
- Implement OrganizationsResource with me() method for retrieving organization data
- Add comprehensive test suite covering success scenarios, error handling, and request options
- Support for organization branding, payment method settings, and payout configurations
- Add setApiKey() method for runtime API key switching
- Add getApiKey() method for retrieving current API key
- Support switching between secret key (SK) and public key (PK) authentication
- Maintains existing authentication validation and error handling
- Remove create() method (BREAKING CHANGE)
- Add lazy PK authentication switching for retrieve()
- Auto-fetch and cache public keys from organization endpoint
- Add tests for PK authentication flow
- Remove CardSourceCreateParams and SourceCreateParams types
- Update type exports to exclude removed source creation types
- Clean up type system following removal of sources create() method
- Add OrganizationsResource to main Magpie client class
- Export Organization-related types in Magpie namespace
- Remove deprecated source creation types from exports
- Maintain backward compatibility for all existing resources
- Add mockRequest() method for custom HTTP response mocking
- Add mockNetworkError() method for simulating network failures
- Add createTestOrganization() utility function
- Remove deprecated createTestSource() function
- Improve error handling and response structure in test mocks
- Add support for custom status codes and headers in mocks
- Update package version to 1.1.0
- Add comprehensive changelog for v1.1.0 release
- Document new features, breaking changes, and improvements
- Include migration notes for deprecated source creation
- Update LICENSE file
- Minor updates to links and sessions resources
@donjerick donjerick merged commit fb4558f into main Sep 5, 2025
9 of 12 checks passed
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.

2 participants