mirror of
https://github.com/hanzoai/chat.git
synced 2026-09-30 20:51:17 +00:00
The tilde resolves through the importing project's tsconfig, so a published file asking for ~/data/types reads the consumer's source, not ours. A relative path means the same thing in every project that installs this one.
20 lines
611 B
TypeScript
20 lines
611 B
TypeScript
/**
|
|
* Who a visitor is before they sign in.
|
|
*
|
|
* Anonymous means anonymous: there is no account behind this and no credential
|
|
* in front of it. The value exists so the composer has a name to render and the
|
|
* shell has something to hold; the server never sees it and never trusts it.
|
|
* What a guest may do is decided there, from the absence of a bearer — which is
|
|
* also why becoming one cannot fail and asks nobody's permission.
|
|
*/
|
|
import type { User } from './types'
|
|
|
|
export const GUEST = 'guest'
|
|
|
|
export const guest = (): User => ({
|
|
id: GUEST,
|
|
role: GUEST,
|
|
username: GUEST,
|
|
name: 'Guest',
|
|
})
|