Repository navigation
Allow passing options to Channel.createInvite - #197
Open
GalaxyAkiii wants to merge 2 commits into
Open
GalaxyAkiii wants to merge 2 commits into
GalaxyAkiii wants to merge 2 commits into
Conversation
Signed-off-by: Aki <aki@akiworks.xyz>
7 tasks done
Signed-off-by: Aki <aki@akiworks.xyz>
This branch has not been deployed
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.
Related to stoatchat/for-web#1637 and stoatchat/for-web#1678
Summary
Allows passing invite options (
max_uses,expires) when creating invites viaChannel.createInvite(), and exposes the corresponding usage and expiration fields onServerInvite.Changes
Channel.createInvite(data: DataCreateInvite = {})to forward the options payload toPOST /channels/{id}/invites.uses,maxUses(from APImax_uses), andexpires(parsed asDate) onServerInvite.Notes for Reviewers
ServerInvitefields use an inline cast (invite as { ... }) because thestoat-apiversion this SDK depends on (0.15.3) does not yet include the invite schema from backend PR feat: invite expiry and max use limit stoatchat#986. The schema is present onstoatchat/javascript-client-apimainbut unreleased, so the cast can be removed once a new release includes it.DataCreateInviteuntil that release is published and the SDK'sstoat-apidependency is bumped.Testing
Verified against a live backend instance running stoatchat/stoatchat#986:
max_uses(e.g. 5) and expiration timestamps, verifying they were accepted and applied.max_uses: 5and a 1-day expiry displays0 / 5with the expected expiry date, and an unlimited invite displays0uses with no expiry.