v1.1.0
Key Chanages
1. API Version Support
The SDK now supports both V1 and V2 of the Payload API through an optional apiVersion parameter. The version is passed to the API via the X-API-Version header (src/payload.js:12).
Code Examples:
import payload from 'payload-api'
// V1 API (default - maintains backward compatibility)
const pl = payload.Session('secret_key_3bW9JMZtPVDOfFNzwRdfE')
// V1 API (explicit)
const plV1 = payload.Session('secret_key_3bW9JMZtPVDOfFNzwRdfE', {
apiVersion: 'v1'
})
// V2 API (new!)
const plV2 = payload.Session('secret_key_3bW9JMZtPVDOfFNzwRdfE', {
apiVersion: 'v2'
}) 2. New Objects Added (12 total)
These new objects are primarily for API V2 support (src/objects.js:156-207):
- Profile - User profile management
- BillingItem - Individual billing items
- Intent - Payment intents
- InvoiceItem - Invoice line items
- PaymentAllocation - Payment allocation tracking
- Entity - Business entities
- Stakeholder - Entity stakeholders
- ProcessingAgreement - Processing agreements
- Transfer - Fund transfers
- TransactionOperation - Transaction operations
- CheckFront - Check front images
- CheckBack - Check back images
- ProcessingRule - Payment processing rules
Backward Compatibility
The SDK maintains full backward compatibility - if you don't specify an apiVersion, it defaults to V1 behavior. This means existing code continues to work without any changes.
Features
- Payload API V2 Support (#33): Upgraded SDK to support Payload API V2, bringing compatibility with the latest Payload features and endpoints.
Dependencies
- Bump axios from 1.6.7 to 1.12.2 (#26, #31)
- Bump esbuild from 0.18.19 to 0.25.0 (#27)
- Bump form-data from 4.0.0 to 4.0.4 (#29)
- Bump js-yaml from 3.14.1 to 3.14.2 (#32, #34)
- Bump braces from 3.0.2 to 3.0.3 (#24)
New Contributors
- @russellw-dev made their first contribution in #33
Full Changelog: v1.0.8...v1.1.0