feat(ui): link channel accounts from the account page and remove the People page (#2095)
This commit is contained in:
8 files changed
+368
-22
No files matched your search
+26
-9
@@ -365,9 +365,15 @@ export const api = {
|
||||
alerts: <T = unknown>() => request<T>("/api/alerts"),
|
||||
dismissAlert: (id: number) =>
|
||||
request<void>(`/api/alerts/${id}/dismiss`, { method: "POST", parse: false }),
|
||||
people: () => request<Person[]>("/api/people"),
|
||||
/** Replaces the organisation's people with the list. */
|
||||
putPeople: (people: Person[]) => request<Person[]>("/api/people", { method: "PUT", body: people }),
|
||||
channelLinks: () => request<ChannelLinks>("/api/account/channels"),
|
||||
/** Issues a single-use code and returns the URL that sends it to the channel. */
|
||||
beginChannelLink: (connector: string) =>
|
||||
request<ChannelLinkStart>(`/api/account/channels/${encodeURIComponent(connector)}/link`, { method: "POST" }),
|
||||
unlinkChannel: (connector: string, subject: string) =>
|
||||
request<void>(`/api/account/channels/${encodeURIComponent(connector)}/${encodeURIComponent(subject)}`, {
|
||||
method: "DELETE",
|
||||
parse: false,
|
||||
}),
|
||||
identities: <T = unknown>() => request<T>("/api/identities"),
|
||||
identityCreate: <T = unknown>(identity: { display_name: string; kind: string }) =>
|
||||
request<T>("/api/identities", { method: "POST", body: identity }),
|
||||
@@ -681,13 +687,24 @@ export interface Run {
|
||||
result?: unknown;
|
||||
}
|
||||
|
||||
/** A person who may answer approvals, and the identities they answer as. */
|
||||
export interface Person {
|
||||
/** Empty for a new person. */
|
||||
id: string;
|
||||
/** A channel account linked to the signed-in account. */
|
||||
export interface ChannelLink {
|
||||
connector: string;
|
||||
subject: string;
|
||||
name: string;
|
||||
authority: boolean;
|
||||
identities: string[];
|
||||
linked_at: string;
|
||||
}
|
||||
|
||||
/** The connectors that can link, and the channel accounts already linked. */
|
||||
export interface ChannelLinks {
|
||||
connectors: string[];
|
||||
linked: ChannelLink[];
|
||||
}
|
||||
|
||||
/** A link code ready to open in a channel. */
|
||||
export interface ChannelLinkStart {
|
||||
url: string;
|
||||
expires_at: string;
|
||||
}
|
||||
|
||||
/** A passkey assertion made for one approval request. */
|
||||
|
||||
Reference in new issue
Block a user