mirror of
https://github.com/suitenumerique/messages.git
synced 2026-09-28 04:34:56 +02:00
👽️(api) update openapi schema and api client
Run `make api-update`
This commit is contained in:
committed by
Jean-Baptiste PENRATH
parent
0c44e7803a
commit
3c8bb9f6a3
@@ -144,6 +144,90 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1.0/contacts/": {
|
||||
"get": {
|
||||
"operationId": "contacts_list",
|
||||
"description": "List contacts with optional filtering by mailbox and search query.\n\nQuery parameters:\n- mailbox_id: Optional UUID to filter contacts by mailbox\n- q: Optional search query for name or email (case insensitive)",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "mailbox_id",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"description": "Filter contacts by mailbox ID."
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "q",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Search contacts by name or email (case insensitive)."
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"contacts"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Contact"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1.0/contacts/{id}/": {
|
||||
"get": {
|
||||
"operationId": "contacts_retrieve",
|
||||
"description": "ViewSet for Contact model.",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "id",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"contacts"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Contact"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1.0/draft/": {
|
||||
"post": {
|
||||
"operationId": "draft_create",
|
||||
@@ -2244,7 +2328,7 @@
|
||||
},
|
||||
"post": {
|
||||
"operationId": "maildomains_mailboxes_create",
|
||||
"description": "ViewSet for managing Mailboxes within a specific MailDomain.\nNested under /maildomains/{maildomain_pk}/mailboxes/\nPermissions are checked by IsMailDomainAdmin for the maildomain_pk.\n\nThis viewset serves a different purpose than the one in mailbox.py (/api/v1.0/mailboxes/).\nThat other one is for listing the mailboxes a user has access to in regular app use.\nThis one is for managing mailboxes within a specific maildomain in the admin interface.",
|
||||
"description": "Create new mailbox in a specific maildomain.",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
@@ -2259,21 +2343,36 @@
|
||||
"tags": [
|
||||
"maildomains"
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest"
|
||||
}
|
||||
},
|
||||
"multipart/form-data": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MailboxAdminCreatePayloadRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MailboxAdmin"
|
||||
"$ref": "#/components/schemas/MailboxAdminCreate"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
"description": "The new mailbox with one extra field `one_time_password` if identity provider is keycloak."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2453,6 +2552,54 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1.0/maildomains/{maildomain_pk}/users/": {
|
||||
"get": {
|
||||
"operationId": "maildomains_users_list",
|
||||
"description": "Search users by email, first name and last name.",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "maildomain_pk",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "q",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Search maildomains user by full name, short name or email."
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"admin-maildomain-user"
|
||||
],
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/User"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1.0/messages/": {
|
||||
"get": {
|
||||
"operationId": "messages_list",
|
||||
@@ -3983,6 +4130,107 @@
|
||||
"updated_at"
|
||||
]
|
||||
},
|
||||
"MailboxAdminCreate": {
|
||||
"type": "object",
|
||||
"description": "Serialize Mailbox details for create admin endpoint, including users with access and\nmetadata.",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"readOnly": true,
|
||||
"description": "primary key for the record as UUID"
|
||||
},
|
||||
"local_part": {
|
||||
"type": "string",
|
||||
"readOnly": true
|
||||
},
|
||||
"domain_name": {
|
||||
"type": "string",
|
||||
"readOnly": true
|
||||
},
|
||||
"alias_of": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "primary key for the record as UUID",
|
||||
"readOnly": true,
|
||||
"nullable": true
|
||||
},
|
||||
"accesses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/MailboxAccessNestedUser"
|
||||
},
|
||||
"readOnly": true
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"readOnly": true,
|
||||
"title": "Created on",
|
||||
"description": "date and time at which a record was created"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"readOnly": true,
|
||||
"title": "Updated on",
|
||||
"description": "date and time at which a record was last updated"
|
||||
},
|
||||
"one_time_password": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"description": "Fake method just to make the OpenAPI schema valid.",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"accesses",
|
||||
"alias_of",
|
||||
"created_at",
|
||||
"domain_name",
|
||||
"id",
|
||||
"local_part",
|
||||
"one_time_password",
|
||||
"updated_at"
|
||||
]
|
||||
},
|
||||
"MailboxAdminCreateMetadataRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"$ref": "#/components/schemas/TypeEnum"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
},
|
||||
"MailboxAdminCreatePayloadRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"local_part": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"alias_of": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"metadata": {
|
||||
"$ref": "#/components/schemas/MailboxAdminCreateMetadataRequest"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"local_part",
|
||||
"metadata"
|
||||
]
|
||||
},
|
||||
"MailboxLight": {
|
||||
"type": "object",
|
||||
"description": "Serializer for mailbox details in thread access.",
|
||||
@@ -4032,7 +4280,8 @@
|
||||
},
|
||||
"subject": {
|
||||
"type": "string",
|
||||
"readOnly": true
|
||||
"readOnly": true,
|
||||
"nullable": true
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string",
|
||||
@@ -4501,7 +4750,8 @@
|
||||
},
|
||||
"subject": {
|
||||
"type": "string",
|
||||
"readOnly": true
|
||||
"readOnly": true,
|
||||
"nullable": true
|
||||
},
|
||||
"snippet": {
|
||||
"type": "string",
|
||||
@@ -4783,6 +5033,15 @@
|
||||
"slug"
|
||||
]
|
||||
},
|
||||
"TypeEnum": {
|
||||
"enum": [
|
||||
"personal",
|
||||
"shared",
|
||||
"redirect"
|
||||
],
|
||||
"type": "string",
|
||||
"description": "* `personal` - personal\n* `shared` - shared\n* `redirect` - redirect"
|
||||
},
|
||||
"User": {
|
||||
"type": "object",
|
||||
"description": "Serialize users.",
|
||||
@@ -4809,9 +5068,16 @@
|
||||
"type": "string",
|
||||
"readOnly": true,
|
||||
"nullable": true
|
||||
},
|
||||
"abilities": {
|
||||
"type": "object",
|
||||
"additionalProperties": {},
|
||||
"description": "Return abilities of the logged-in user on the mail domain.",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"abilities",
|
||||
"email",
|
||||
"full_name",
|
||||
"id",
|
||||
@@ -4827,4 +5093,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseQueryOptions,
|
||||
UseQueryResult,
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type { MaildomainsUsersListParams, User } from ".././models";
|
||||
|
||||
import { fetchAPI } from "../../fetch-api";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* Search users by email, first name and last name.
|
||||
*/
|
||||
export type maildomainsUsersListResponse200 = {
|
||||
data: User[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type maildomainsUsersListResponseComposite =
|
||||
maildomainsUsersListResponse200;
|
||||
|
||||
export type maildomainsUsersListResponse =
|
||||
maildomainsUsersListResponseComposite & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export const getMaildomainsUsersListUrl = (
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1.0/maildomains/${maildomainPk}/users/?${stringifiedParams}`
|
||||
: `/api/v1.0/maildomains/${maildomainPk}/users/`;
|
||||
};
|
||||
|
||||
export const maildomainsUsersList = async (
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
options?: RequestInit,
|
||||
): Promise<maildomainsUsersListResponse> => {
|
||||
return fetchAPI<maildomainsUsersListResponse>(
|
||||
getMaildomainsUsersListUrl(maildomainPk, params),
|
||||
{
|
||||
...options,
|
||||
method: "GET",
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export const getMaildomainsUsersListQueryKey = (
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
) => {
|
||||
return [
|
||||
`/api/v1.0/maildomains/${maildomainPk}/users/`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getMaildomainsUsersListQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ??
|
||||
getMaildomainsUsersListQueryKey(maildomainPk, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>
|
||||
> = ({ signal }) =>
|
||||
maildomainsUsersList(maildomainPk, params, { signal, ...requestOptions });
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!maildomainPk,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type MaildomainsUsersListQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>
|
||||
>;
|
||||
export type MaildomainsUsersListQueryError = unknown;
|
||||
|
||||
export function useMaildomainsUsersList<
|
||||
TData = Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
maildomainPk: string,
|
||||
params: undefined | MaildomainsUsersListParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useMaildomainsUsersList<
|
||||
TData = Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useMaildomainsUsersList<
|
||||
TData = Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
|
||||
export function useMaildomainsUsersList<
|
||||
TData = Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
maildomainPk: string,
|
||||
params?: MaildomainsUsersListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof maildomainsUsersList>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getMaildomainsUsersListQueryOptions(
|
||||
maildomainPk,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseQueryOptions,
|
||||
UseQueryResult,
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type { Contact, ContactsListParams } from ".././models";
|
||||
|
||||
import { fetchAPI } from "../../fetch-api";
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
* List contacts with optional filtering by mailbox and search query.
|
||||
|
||||
Query parameters:
|
||||
- mailbox_id: Optional UUID to filter contacts by mailbox
|
||||
- q: Optional search query for name or email (case insensitive)
|
||||
*/
|
||||
export type contactsListResponse200 = {
|
||||
data: Contact[];
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type contactsListResponseComposite = contactsListResponse200;
|
||||
|
||||
export type contactsListResponse = contactsListResponseComposite & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export const getContactsListUrl = (params?: ContactsListParams) => {
|
||||
const normalizedParams = new URLSearchParams();
|
||||
|
||||
Object.entries(params || {}).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
normalizedParams.append(key, value === null ? "null" : value.toString());
|
||||
}
|
||||
});
|
||||
|
||||
const stringifiedParams = normalizedParams.toString();
|
||||
|
||||
return stringifiedParams.length > 0
|
||||
? `/api/v1.0/contacts/?${stringifiedParams}`
|
||||
: `/api/v1.0/contacts/`;
|
||||
};
|
||||
|
||||
export const contactsList = async (
|
||||
params?: ContactsListParams,
|
||||
options?: RequestInit,
|
||||
): Promise<contactsListResponse> => {
|
||||
return fetchAPI<contactsListResponse>(getContactsListUrl(params), {
|
||||
...options,
|
||||
method: "GET",
|
||||
});
|
||||
};
|
||||
|
||||
export const getContactsListQueryKey = (params?: ContactsListParams) => {
|
||||
return [`/api/v1.0/contacts/`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getContactsListQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof contactsList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
params?: ContactsListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof contactsList>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getContactsListQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof contactsList>>> = ({
|
||||
signal,
|
||||
}) => contactsList(params, { signal, ...requestOptions });
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsList>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type ContactsListQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof contactsList>>
|
||||
>;
|
||||
export type ContactsListQueryError = unknown;
|
||||
|
||||
export function useContactsList<
|
||||
TData = Awaited<ReturnType<typeof contactsList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
params: undefined | ContactsListParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof contactsList>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof contactsList>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof contactsList>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useContactsList<
|
||||
TData = Awaited<ReturnType<typeof contactsList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
params?: ContactsListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof contactsList>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof contactsList>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof contactsList>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useContactsList<
|
||||
TData = Awaited<ReturnType<typeof contactsList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
params?: ContactsListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof contactsList>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
|
||||
export function useContactsList<
|
||||
TData = Awaited<ReturnType<typeof contactsList>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
params?: ContactsListParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof contactsList>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getContactsListQueryOptions(params, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* ViewSet for Contact model.
|
||||
*/
|
||||
export type contactsRetrieveResponse200 = {
|
||||
data: Contact;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type contactsRetrieveResponseComposite = contactsRetrieveResponse200;
|
||||
|
||||
export type contactsRetrieveResponse = contactsRetrieveResponseComposite & {
|
||||
headers: Headers;
|
||||
};
|
||||
|
||||
export const getContactsRetrieveUrl = (id: string) => {
|
||||
return `/api/v1.0/contacts/${id}/`;
|
||||
};
|
||||
|
||||
export const contactsRetrieve = async (
|
||||
id: string,
|
||||
options?: RequestInit,
|
||||
): Promise<contactsRetrieveResponse> => {
|
||||
return fetchAPI<contactsRetrieveResponse>(getContactsRetrieveUrl(id), {
|
||||
...options,
|
||||
method: "GET",
|
||||
});
|
||||
};
|
||||
|
||||
export const getContactsRetrieveQueryKey = (id: string) => {
|
||||
return [`/api/v1.0/contacts/${id}/`] as const;
|
||||
};
|
||||
|
||||
export const getContactsRetrieveQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
id: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getContactsRetrieveQueryKey(id);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>
|
||||
> = ({ signal }) => contactsRetrieve(id, { signal, ...requestOptions });
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!id,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type ContactsRetrieveQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>
|
||||
>;
|
||||
export type ContactsRetrieveQueryError = unknown;
|
||||
|
||||
export function useContactsRetrieve<
|
||||
TData = Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
id: string,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useContactsRetrieve<
|
||||
TData = Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
id: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useContactsRetrieve<
|
||||
TData = Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
id: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
|
||||
export function useContactsRetrieve<
|
||||
TData = Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError = unknown,
|
||||
>(
|
||||
id: string,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof contactsRetrieve>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getContactsRetrieveQueryOptions(id, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export * from "./blob/blob";
|
||||
export * from "./config/config";
|
||||
export * from "./contacts/contacts";
|
||||
export * from "./messages/messages";
|
||||
export * from "./flags/flags";
|
||||
export * from "./import/import";
|
||||
@@ -7,6 +8,7 @@ export * from "./labels/labels";
|
||||
export * from "./mailboxes/mailboxes";
|
||||
export * from "./mailbox-accesses/mailbox-accesses";
|
||||
export * from "./maildomains/maildomains";
|
||||
export * from "./admin-maildomain-user/admin-maildomain-user";
|
||||
export * from "./mta/mta";
|
||||
export * from "./tasks/tasks";
|
||||
export * from "./threads/threads";
|
||||
|
||||
@@ -36,7 +36,7 @@ import { fetchAPI } from "../../fetch-api";
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
List all labels accessible to the user in a hierarchical structure.
|
||||
|
||||
The response returns labels in a tree structure where:
|
||||
@@ -45,7 +45,7 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
- The hierarchy is determined by the label's name (e.g., "Inbox/Important" is a child of "Inbox")
|
||||
|
||||
You can filter labels by mailbox using the mailbox_id query parameter.
|
||||
|
||||
|
||||
*/
|
||||
export type labelsListResponse200 = {
|
||||
data: TreeLabel[];
|
||||
|
||||
@@ -23,6 +23,8 @@ import type {
|
||||
|
||||
import type {
|
||||
MailboxAdmin,
|
||||
MailboxAdminCreate,
|
||||
MailboxAdminCreatePayloadRequest,
|
||||
MaildomainsListParams,
|
||||
MaildomainsMailboxesListParams,
|
||||
PaginatedMailDomainAdminList,
|
||||
@@ -447,21 +449,15 @@ export function useMaildomainsMailboxesList<
|
||||
}
|
||||
|
||||
/**
|
||||
* ViewSet for managing Mailboxes within a specific MailDomain.
|
||||
Nested under /maildomains/{maildomain_pk}/mailboxes/
|
||||
Permissions are checked by IsMailDomainAdmin for the maildomain_pk.
|
||||
|
||||
This viewset serves a different purpose than the one in mailbox.py (/api/v1.0/mailboxes/).
|
||||
That other one is for listing the mailboxes a user has access to in regular app use.
|
||||
This one is for managing mailboxes within a specific maildomain in the admin interface.
|
||||
* Create new mailbox in a specific maildomain.
|
||||
*/
|
||||
export type maildomainsMailboxesCreateResponse201 = {
|
||||
data: MailboxAdmin;
|
||||
status: 201;
|
||||
export type maildomainsMailboxesCreateResponse200 = {
|
||||
data: MailboxAdminCreate;
|
||||
status: 200;
|
||||
};
|
||||
|
||||
export type maildomainsMailboxesCreateResponseComposite =
|
||||
maildomainsMailboxesCreateResponse201;
|
||||
maildomainsMailboxesCreateResponse200;
|
||||
|
||||
export type maildomainsMailboxesCreateResponse =
|
||||
maildomainsMailboxesCreateResponseComposite & {
|
||||
@@ -474,6 +470,7 @@ export const getMaildomainsMailboxesCreateUrl = (maildomainPk: string) => {
|
||||
|
||||
export const maildomainsMailboxesCreate = async (
|
||||
maildomainPk: string,
|
||||
mailboxAdminCreatePayloadRequest: MailboxAdminCreatePayloadRequest,
|
||||
options?: RequestInit,
|
||||
): Promise<maildomainsMailboxesCreateResponse> => {
|
||||
return fetchAPI<maildomainsMailboxesCreateResponse>(
|
||||
@@ -481,6 +478,8 @@ export const maildomainsMailboxesCreate = async (
|
||||
{
|
||||
...options,
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", ...options?.headers },
|
||||
body: JSON.stringify(mailboxAdminCreatePayloadRequest),
|
||||
},
|
||||
);
|
||||
};
|
||||
@@ -492,14 +491,14 @@ export const getMaildomainsMailboxesCreateMutationOptions = <
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>,
|
||||
TError,
|
||||
{ maildomainPk: string },
|
||||
{ maildomainPk: string; data: MailboxAdminCreatePayloadRequest },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>,
|
||||
TError,
|
||||
{ maildomainPk: string },
|
||||
{ maildomainPk: string; data: MailboxAdminCreatePayloadRequest },
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = ["maildomainsMailboxesCreate"];
|
||||
@@ -513,11 +512,11 @@ export const getMaildomainsMailboxesCreateMutationOptions = <
|
||||
|
||||
const mutationFn: MutationFunction<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>,
|
||||
{ maildomainPk: string }
|
||||
{ maildomainPk: string; data: MailboxAdminCreatePayloadRequest }
|
||||
> = (props) => {
|
||||
const { maildomainPk } = props ?? {};
|
||||
const { maildomainPk, data } = props ?? {};
|
||||
|
||||
return maildomainsMailboxesCreate(maildomainPk, requestOptions);
|
||||
return maildomainsMailboxesCreate(maildomainPk, data, requestOptions);
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
@@ -526,7 +525,8 @@ export const getMaildomainsMailboxesCreateMutationOptions = <
|
||||
export type MaildomainsMailboxesCreateMutationResult = NonNullable<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>
|
||||
>;
|
||||
|
||||
export type MaildomainsMailboxesCreateMutationBody =
|
||||
MailboxAdminCreatePayloadRequest;
|
||||
export type MaildomainsMailboxesCreateMutationError = unknown;
|
||||
|
||||
export const useMaildomainsMailboxesCreate = <
|
||||
@@ -537,7 +537,7 @@ export const useMaildomainsMailboxesCreate = <
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>,
|
||||
TError,
|
||||
{ maildomainPk: string },
|
||||
{ maildomainPk: string; data: MailboxAdminCreatePayloadRequest },
|
||||
TContext
|
||||
>;
|
||||
request?: SecondParameter<typeof fetchAPI>;
|
||||
@@ -546,7 +546,7 @@ export const useMaildomainsMailboxesCreate = <
|
||||
): UseMutationResult<
|
||||
Awaited<ReturnType<typeof maildomainsMailboxesCreate>>,
|
||||
TError,
|
||||
{ maildomainPk: string },
|
||||
{ maildomainPk: string; data: MailboxAdminCreatePayloadRequest },
|
||||
TContext
|
||||
> => {
|
||||
const mutationOptions = getMaildomainsMailboxesCreateMutationOptions(options);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
|
||||
export type ContactsListParams = {
|
||||
/**
|
||||
* Filter contacts by mailbox ID.
|
||||
*/
|
||||
mailbox_id?: string;
|
||||
/**
|
||||
* Search contacts by name or email (case insensitive).
|
||||
*/
|
||||
q?: string;
|
||||
};
|
||||
@@ -11,6 +11,7 @@ export * from "./blob_upload_create201";
|
||||
export * from "./blob_upload_create_body";
|
||||
export * from "./change_flag_request_request";
|
||||
export * from "./contact";
|
||||
export * from "./contacts_list_params";
|
||||
export * from "./draft_create2400";
|
||||
export * from "./draft_create2403";
|
||||
export * from "./draft_create2404";
|
||||
@@ -46,11 +47,15 @@ export * from "./mailbox_access_role_enum";
|
||||
export * from "./mailbox_access_write";
|
||||
export * from "./mailbox_access_write_request";
|
||||
export * from "./mailbox_admin";
|
||||
export * from "./mailbox_admin_create";
|
||||
export * from "./mailbox_admin_create_metadata_request";
|
||||
export * from "./mailbox_admin_create_payload_request";
|
||||
export * from "./mailbox_light";
|
||||
export * from "./mailboxes_accesses_list_params";
|
||||
export * from "./mailboxes_search_list_params";
|
||||
export * from "./maildomains_list_params";
|
||||
export * from "./maildomains_mailboxes_list_params";
|
||||
export * from "./maildomains_users_list_params";
|
||||
export * from "./message";
|
||||
export * from "./message_html_body_item";
|
||||
export * from "./message_text_body_item";
|
||||
@@ -89,4 +94,6 @@ export * from "./threads_stats_retrieve400";
|
||||
export * from "./threads_stats_retrieve_params";
|
||||
export * from "./threads_stats_retrieve_stats_fields";
|
||||
export * from "./tree_label";
|
||||
export * from "./type_enum";
|
||||
export * from "./user";
|
||||
export * from "./user_abilities";
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import type { MailboxAccessNestedUser } from "./mailbox_access_nested_user";
|
||||
|
||||
/**
|
||||
* Serialize Mailbox details for create admin endpoint, including users with access and
|
||||
metadata.
|
||||
*/
|
||||
export interface MailboxAdminCreate {
|
||||
/** primary key for the record as UUID */
|
||||
readonly id: string;
|
||||
readonly local_part: string;
|
||||
readonly domain_name: string;
|
||||
/**
|
||||
* primary key for the record as UUID
|
||||
* @nullable
|
||||
*/
|
||||
readonly alias_of: string | null;
|
||||
readonly accesses: readonly MailboxAccessNestedUser[];
|
||||
/** date and time at which a record was created */
|
||||
readonly created_at: string;
|
||||
/** date and time at which a record was last updated */
|
||||
readonly updated_at: string;
|
||||
/**
|
||||
* Fake method just to make the OpenAPI schema valid.
|
||||
* @nullable
|
||||
*/
|
||||
readonly one_time_password: string | null;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import type { TypeEnum } from "./type_enum";
|
||||
|
||||
export interface MailboxAdminCreateMetadataRequest {
|
||||
type: TypeEnum;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import type { MailboxAdminCreateMetadataRequest } from "./mailbox_admin_create_metadata_request";
|
||||
|
||||
export interface MailboxAdminCreatePayloadRequest {
|
||||
/** @minLength 1 */
|
||||
local_part: string;
|
||||
alias_of?: string;
|
||||
metadata: MailboxAdminCreateMetadataRequest;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
|
||||
export type MaildomainsUsersListParams = {
|
||||
/**
|
||||
* Search maildomains user by full name, short name or email.
|
||||
*/
|
||||
q?: string;
|
||||
};
|
||||
@@ -21,7 +21,8 @@ export interface Message {
|
||||
readonly parent_id: string | null;
|
||||
/** @nullable */
|
||||
readonly thread_id: string | null;
|
||||
readonly subject: string;
|
||||
/** @nullable */
|
||||
readonly subject: string | null;
|
||||
/** date and time at which a record was created */
|
||||
readonly created_at: string;
|
||||
/** date and time at which a record was last updated */
|
||||
|
||||
@@ -14,7 +14,8 @@ import type { ThreadLabel } from "./thread_label";
|
||||
export interface Thread {
|
||||
/** primary key for the record as UUID */
|
||||
readonly id: string;
|
||||
readonly subject: string;
|
||||
/** @nullable */
|
||||
readonly subject: string | null;
|
||||
readonly snippet: string;
|
||||
readonly messages: string;
|
||||
readonly has_unread: boolean;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
|
||||
/**
|
||||
* * `personal` - personal
|
||||
* `shared` - shared
|
||||
* `redirect` - redirect
|
||||
*/
|
||||
export type TypeEnum = (typeof TypeEnum)[keyof typeof TypeEnum];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const TypeEnum = {
|
||||
personal: "personal",
|
||||
shared: "shared",
|
||||
redirect: "redirect",
|
||||
} as const;
|
||||
@@ -5,6 +5,7 @@
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
import type { UserAbilities } from "./user_abilities";
|
||||
|
||||
/**
|
||||
* Serialize users.
|
||||
@@ -18,4 +19,6 @@ export interface User {
|
||||
readonly full_name: string | null;
|
||||
/** @nullable */
|
||||
readonly short_name: string | null;
|
||||
/** Return abilities of the logged-in user on the mail domain. */
|
||||
readonly abilities: UserAbilities;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.10.0 🍺
|
||||
* Do not edit manually.
|
||||
* messages API
|
||||
* This is the messages API schema.
|
||||
* OpenAPI spec version: 1.0.0 (v1.0)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return abilities of the logged-in user on the mail domain.
|
||||
*/
|
||||
export type UserAbilities = { [key: string]: unknown };
|
||||
Reference in New Issue
Block a user