Changeset View
Changeset View
Standalone View
Standalone View
lib/types/link-types.js
Show All 19 Lines | | { | ||||
+status: 'invalid' | 'expired', | +status: 'invalid' | 'expired', | ||||
}; | }; | ||||
export type InviteLink = { | export type InviteLink = { | ||||
+name: string, | +name: string, | ||||
+primary: boolean, | +primary: boolean, | ||||
+role: string, | +role: string, | ||||
+communityID: string, | +communityID: string, | ||||
+expirationTime: number, | +expirationTime: ?number, | ||||
+limitOfUses: number, | +limitOfUses: ?number, | ||||
+numberOfUses: number, | +numberOfUses: number, | ||||
}; | }; | ||||
export const inviteLinkValidator: TInterface<InviteLink> = tShape<InviteLink>({ | export const inviteLinkValidator: TInterface<InviteLink> = tShape<InviteLink>({ | ||||
name: t.String, | name: t.String, | ||||
primary: t.Boolean, | primary: t.Boolean, | ||||
role: tID, | role: tID, | ||||
communityID: tID, | communityID: tID, | ||||
expirationTime: t.Number, | expirationTime: t.maybe(t.Number), | ||||
limitOfUses: t.Number, | limitOfUses: t.maybe(t.Number), | ||||
numberOfUses: t.Number, | numberOfUses: t.Number, | ||||
}); | }); | ||||
export type FetchInviteLinksResponse = { | export type FetchInviteLinksResponse = { | ||||
+links: $ReadOnlyArray<InviteLink>, | +links: $ReadOnlyArray<InviteLink>, | ||||
}; | }; |