SDK development
Use this page when changing the source code or preparing a release of @woodger/t-invest-node-sdk.
Prepare a release
The repository pins the T-Invest API contracts and documents how to generate TypeScript. Check the contract source before updating proto files and record user-facing changes in the changelog.
- Development and releases — update proto files and generate TypeScript.
- Contract source — find the pinned T-Invest API version and commit.
- CHANGELOG — version history and migration notes.
Change the package quota declaration
When the provider changes quotas, check the official limits. Update packageConfig.unaryLimits in src/config.ts, the SDK quota policy, and the related tests in one change.
Quotas can change independently of proto versions. When the limits were checked, the Dev Portal listed 300 CancelOrder requests per minute and the contract repository at tag 1.51 listed 100. Limits in the contract repository
In packageConfig, default sets a service quota, methods sets quotas for individual RPCs, and each groups entry sets a quota shared across methods. For example, both report RPCs use the same quota.
OperationsService: {
default: {
maxRequests: 200,
windowMs: 60_000
},
groups: {
reports: {
limit: {
maxRequests: 5,
windowMs: 60_000
},
methods: [
'GetBrokerReport',
'GetDividendsForeignIssuer'
]
}
}
}
PackageConfigDefinition from src/config.types.ts checks quota values, service names, and RPCs at compile time. The public defaultConfig.unaryLimits is a flat table.
maxRequests and windowMs must be finite positive numbers. Keys must be known service names or full paths of supported unary RPCs. The SDK merges defaults with instance overrides and validates the resulting quotas before creating the transport limiter middleware. See the SDK architecture for configuration order and module responsibilities.
Update the certificate
Certificate updates ship with a new SDK release. Use the official source and verification steps in the certificate reference. Bundled certificate
- Obtain the new file from the published official source.
- Check its purpose, Subject, Issuer, CA flag, validity period, and expected fingerprint.
- Compare it with the preceding X.509 certificate.
- Update the certificate file, the SDK certificate document, and the regression test in one change.
- Verify a local TLS call and confirm the package archive contains the certificate.
- Release a new SDK version that documents the certificate change.
Check the project architecture and policies
Before changing a command, the transport, or a public type, check what its module is responsible for and consult the project policies.
- SDK architecture — understand the layers and component responsibilities.
- Clean Architecture notes — see where commands are handled and where reports are built, formatted, and written.
- Project policies — read the rules for making changes.
- Documentation policy — identify the source of truth and the purpose of each document.
- Roadmap — explore possible future changes.