diff --git a/lib/types/link-types.js b/lib/types/link-types.js index 3c83d53bf..e2bc2b914 100644 --- a/lib/types/link-types.js +++ b/lib/types/link-types.js @@ -1,45 +1,45 @@ // @flow import t, { type TInterface } from 'tcomb'; import { tID, tShape } from '../utils/validation-utils.js'; export type InviteLinkVerificationRequest = { +secret: string, }; export type InviteLinkVerificationResponse = | { +status: 'valid' | 'already_joined', +community: { +name: string, +id: string, }, } | { +status: 'invalid' | 'expired', }; export type InviteLink = { +name: string, +primary: boolean, +role: string, +communityID: string, - +expirationTime: number, - +limitOfUses: number, + +expirationTime: ?number, + +limitOfUses: ?number, +numberOfUses: number, }; export const inviteLinkValidator: TInterface = tShape({ name: t.String, primary: t.Boolean, role: tID, communityID: tID, - expirationTime: t.Number, - limitOfUses: t.Number, + expirationTime: t.maybe(t.Number), + limitOfUses: t.maybe(t.Number), numberOfUses: t.Number, }); export type FetchInviteLinksResponse = { +links: $ReadOnlyArray, };