Repository navigation
feat: expose expirationDate on activate and floating checkout - #2
Merged
Merged
Conversation
Add optional expirationDate (ISO 8601 string, or null when the license never expires) to ActivateKeyResponse and FloatingCheckoutResponse. On checkout it is separate from expiresAt, the floating seat lease. Optional so older servers that omit it still type-check. Add contract tests for the date and null cases, document reading the field in the README, and note it under Unreleased in the CHANGELOG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ActivateKeyResponseandFloatingCheckoutResponse(src/types.ts) gainexpirationDate?: string | null.response.dataas-is, so no mapping code needed changing. The field passes straight through.null, and an older server that omits the field (tests/contracts.test.cjs).Contract (already live in the API)
POST /key/activatesuccess responses includeexpirationDate: an ISO 8601 string (e.g."2027-03-01T00:00:00.000Z"), ornullwhen the license never expires.POST /key/checkoutsuccess responses include the sameexpirationDate(license expiry). This is separate fromexpiresAt, the floating seat lease.The field is optional (
?) rather than required, so code that builds these response types (mocks, fixtures, older self-hosted servers) still compiles.undefinedmeans the server didn't send the field.nullmeans the license never expires.No version bump.
package.jsonis still1.5.0, so the owner can choose the release version.Checks (Node 22.23.1, npm 10.9.8)
npm ci: oknpm run lint: oknpx tsc --noEmitandnpm run build: oknpm test: 8/8 pass (3 existing, 5 new)npm run test:live: not run, because it needs live API secrets