45 lines
4.7 KiB
TypeScript
45 lines
4.7 KiB
TypeScript
/**
|
|
* Generated by orval 🍺
|
|
* Do not edit manually.
|
|
* Lincodex API
|
|
* OpenAPI spec version: 0.1.0
|
|
*/
|
|
import * as zod from 'zod';
|
|
|
|
export const notificationListItemsItemContentOneTitleMax = 120;
|
|
|
|
export const notificationListItemsItemContentOneSummaryMax = 500;
|
|
|
|
export const notificationListItemsItemContentOneLinkPathMax = 256;
|
|
|
|
|
|
export const notificationListItemsItemContentOneLinkPathRegExp = new RegExp('^/[A-Za-z0-9/_-]{0,255}$');
|
|
export const notificationListItemsMax = 100;
|
|
|
|
export const notificationListPageNextCursorMax = 512;
|
|
|
|
|
|
export const notificationListPageNextCursorRegExp = new RegExp('^[A-Za-z0-9_-]+$');
|
|
|
|
export const NotificationList = zod.object({
|
|
"items": zod.array(zod.object({
|
|
"id": zod.uuid().describe('Identifier of the item. It equals the identifier of the event that produced it, so a repeated delivery of the same event is the same item.'),
|
|
"kind": zod.enum(['invitation_delivered', 'synthetic']).describe('Which event put the notification into the inbox. The inbox stores a reference to the event, never its text.\n\n- invitation_delivered: an invitation reached the candidate\'s inbox. This is the in-platform delivery state of the invitation: it does not depend on any email, and a failed or missing email never blocks it. The invitation operations are planned; no invitation produces a notification yet.\n- synthetic: a synthetic notice that exercises the inbox path (the event, the read-time visibility check, the list, and the read state). It has no product meaning, needs no action, and is never produced by a user action.\n\nAdding a value is a contract change; a client shows an unknown kind with the generic text of an item without content.'),
|
|
"organization_id": zod.uuid().describe('The organization context of the item: the organization that sent it to a candidate, or the organization whose cabinet holds it for an employer. The identifier is not a right to read the organization.'),
|
|
"delivered_at": zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),
|
|
"read_at": zod.union([zod.iso.datetime({"offset":true}).describe('UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.'),zod.null()]).describe('When the recipient first marked the item read, or null while it is unread. A repeated mark keeps the first time.'),
|
|
"content": zod.union([zod.object({
|
|
"title": zod.string().min(1).max(notificationListItemsItemContentOneTitleMax).describe('Short heading in Russian.'),
|
|
"summary": zod.string().min(1).max(notificationListItemsItemContentOneSummaryMax).describe('One or two sentences in Russian. Plain text, never markup.'),
|
|
"link_path": zod.string().max(notificationListItemsItemContentOneLinkPathMax).regex(notificationListItemsItemContentOneLinkPathRegExp).nullable().describe('Same-origin absolute path of the screen that the notification opens, or null when there is none. It has no origin, query, fragment, or escape; a client opens it only as a path of its own router.')
|
|
}).describe('The text of a notification as the current source shows it to the recipient now. It is computed on every read and never stored, so a hiding, a revoked membership, or a withdrawn source removes it from the next read. It holds no contact, no score, and no result of an assessment.'),zod.null()]).describe('The current content, or null when the source is gone or the recipient may not see it now. A client then shows a generic line such as "The content is no longer available" and never an old copy. The item stays in the list and can be marked read.')
|
|
}).describe('One item of the inbox of the current account. Its identity, kind, organization, delivery time, and read state are stored; its content is resolved from the current source on every read.')).max(notificationListItemsMax).describe('Items of the page.'),
|
|
"page": zod.object({
|
|
"has_more": zod.boolean().describe('Whether another page follows this one.'),
|
|
"next_cursor": zod.string().min(1).max(notificationListPageNextCursorMax).regex(notificationListPageNextCursorRegExp).nullable().describe('Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.')
|
|
}).describe('Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.')
|
|
}).describe('One page of the inbox, newest delivery first.')
|
|
|
|
export type NotificationList = zod.input<typeof NotificationList>;
|
|
export type NotificationListOutput = zod.output<typeof NotificationList>;
|