|
| 1 | +# Migration Guide |
| 2 | + |
| 3 | +## Upgrading from v20111101 (v2.x) to v20250224 (v3.x) |
| 4 | + |
| 5 | +The v20250224 API is now available, and v3.0.0 of this SDK provides support as an independent major version. |
| 6 | + |
| 7 | +### Installation |
| 8 | + |
| 9 | +The two API versions are published as separate major versions of the same npm package: |
| 10 | + |
| 11 | +**For v20111101 API:** |
| 12 | +```bash |
| 13 | +npm install mx-platform-node@^2 |
| 14 | +``` |
| 15 | + |
| 16 | +**For v20250224 API:** |
| 17 | +```bash |
| 18 | +npm install mx-platform-node@^3 |
| 19 | +``` |
| 20 | + |
| 21 | +### Migration Path |
| 22 | + |
| 23 | +1. **Review API Changes**: Consult the [MX Platform API Migration Guide](https://docs.mx.com/api-reference/platform-api/overview/migration) for breaking changes and new features |
| 24 | +2. **Update Package**: Update your `package.json` to use `mx-platform-node@^3` |
| 25 | +3. **Update Imports**: Both APIs have similar structure, but review type definitions for any breaking changes |
| 26 | +4. **Run Tests**: Validate your code works with the new SDK version |
| 27 | +5. **Deploy**: Update production once validated |
| 28 | + |
| 29 | +### Benefits of TypeScript |
| 30 | + |
| 31 | +Since this is a TypeScript SDK, the compiler will help catch most compatibility issues at compile time when you update to v3.x. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Upgrading to v2.0.0 from v1.10.0 or earlier |
| 36 | + |
| 37 | +### Breaking Change: API Class Restructure |
| 38 | + |
| 39 | +**Important:** Starting with version 2.0.0 (originally introduced in v1.10.1, now properly versioned), the unified `MxPlatformApi` class has been replaced with domain-specific API classes. If you're upgrading from v1.10.0 or earlier, you'll need to update your imports and API instantiation. |
| 40 | + |
| 41 | +**Note:** Versions v1.10.1 through v1.12.1 are deprecated. If you're on any of these versions, please upgrade to v2.0.0 (functionally identical to v1.12.1, just properly versioned). |
| 42 | + |
| 43 | +### What Changed |
| 44 | + |
| 45 | +The library now provides granular API classes organized by domain (Users, Members, Accounts, Transactions, etc.) instead of a single `MxPlatformApi` class. This aligns with the OpenAPI specification structure and provides better code organization. |
| 46 | + |
| 47 | +### How to Migrate |
| 48 | + |
| 49 | +**Before (v1.10.0 and earlier):** |
| 50 | +```javascript |
| 51 | +import { Configuration, MxPlatformApi } from 'mx-platform-node'; |
| 52 | + |
| 53 | +const client = new MxPlatformApi(configuration); |
| 54 | +await client.createUser(requestBody); |
| 55 | +await client.listMembers(userGuid); |
| 56 | +await client.listAccounts(userGuid); |
| 57 | +``` |
| 58 | + |
| 59 | +**After (v2.0.0+):** |
| 60 | +```javascript |
| 61 | +import { Configuration, UsersApi, MembersApi, AccountsApi } from 'mx-platform-node'; |
| 62 | + |
| 63 | +const usersApi = new UsersApi(configuration); |
| 64 | +const membersApi = new MembersApi(configuration); |
| 65 | +const accountsApi = new AccountsApi(configuration); |
| 66 | + |
| 67 | +await usersApi.createUser(requestBody); |
| 68 | +await membersApi.listMembers(userGuid); |
| 69 | +await accountsApi.listAccounts(userGuid); |
| 70 | +``` |
| 71 | + |
| 72 | +### Available API Classes |
| 73 | + |
| 74 | +The new structure includes the following API classes: |
| 75 | + |
| 76 | +- `AccountsApi` - Account operations |
| 77 | +- `AuthorizationApi` - Authorization operations |
| 78 | +- `BudgetsApi` - Budget operations |
| 79 | +- `CategoriesApi` - Category operations |
| 80 | +- `GoalsApi` - Goal operations |
| 81 | +- `InsightsApi` - Insight operations |
| 82 | +- `InstitutionsApi` - Institution operations |
| 83 | +- `InvestmentHoldingsApi` - Investment holding operations |
| 84 | +- `ManagedDataApi` - Managed data operations |
| 85 | +- `MembersApi` - Member operations |
| 86 | +- `MerchantsApi` - Merchant operations |
| 87 | +- `MicrodepositsApi` - Microdeposit operations |
| 88 | +- `MonthlyCashFlowProfileApi` - Monthly cash flow profile operations |
| 89 | +- `NotificationsApi` - Notification operations |
| 90 | +- `ProcessorTokenApi` - Processor token operations |
| 91 | +- `RewardsApi` - Rewards operations |
| 92 | +- `SpendingPlanApi` - Spending plan operations |
| 93 | +- `StatementsApi` - Statement operations |
| 94 | +- `TaggingsApi` - Tagging operations |
| 95 | +- `TagsApi` - Tag operations |
| 96 | +- `TransactionRulesApi` - Transaction rule operations |
| 97 | +- `TransactionsApi` - Transaction operations |
| 98 | +- `UsersApi` - User operations |
| 99 | +- `VerifiableCredentialsApi` - Verifiable credential operations |
| 100 | +- `WidgetsApi` - Widget operations |
| 101 | + |
| 102 | +For the complete list of available methods, please refer to the [API documentation](https://docs.mx.com/api). |
| 103 | + |
| 104 | +### Migration Checklist |
| 105 | + |
| 106 | +1. **Update your imports**: Replace `MxPlatformApi` with the specific API classes you need |
| 107 | +2. **Update instantiation**: Create separate instances for each API class instead of a single client |
| 108 | +3. **Update method calls**: Call methods on the appropriate API class instance |
| 109 | +4. **Test thoroughly**: Verify all API calls work as expected with the new structure |
| 110 | +5. **Update documentation**: If you have internal docs referencing the old API, update them |
| 111 | + |
| 112 | +### Need Help? |
| 113 | + |
| 114 | +If you encounter any issues during migration, please [open an issue](https://github.com/mxenabled/mx-platform-node/issues) on GitHub. |
0 commit comments