diff --git a/lib/api-client-react/src/generated/api.schemas.ts b/lib/api-client-react/src/generated/api.schemas.ts index 10953ed8..517dcb10 100644 --- a/lib/api-client-react/src/generated/api.schemas.ts +++ b/lib/api-client-react/src/generated/api.schemas.ts @@ -1090,6 +1090,27 @@ export interface NoteRecipientSummary { recipient?: NoteUserSummary | null; } +/** + * A note owned by the caller (My Notes / Archive view). + */ +export interface MyNote { + id: number; + userId: number; + title: string; + content: string; + color: string; + isPinned: boolean; + isArchived: boolean; + /** + * Owning folder id, or null for Unfiled. + * @nullable + */ + folderId: number | null; + createdAt: string; + updatedAt: string; + labelIds: number[]; +} + export interface NoteFolder { id: number; userId: number; @@ -1730,8 +1751,6 @@ export type ListMyNotesAliasParams = { archived?: boolean; }; -export type ListMyNotesAlias200Item = { [key: string]: unknown }; - export type ListReceivedNotesParams = { archived?: boolean; }; diff --git a/lib/api-client-react/src/generated/api.ts b/lib/api-client-react/src/generated/api.ts index 810a5eee..a332c32c 100644 --- a/lib/api-client-react/src/generated/api.ts +++ b/lib/api-client-react/src/generated/api.ts @@ -79,13 +79,13 @@ import type { LeaveConversationBody, ListAuditLogsParams, ListGroupsParams, - ListMyNotesAlias200Item, ListMyNotesAliasParams, ListNoteFoldersParams, ListReceivedNotesParams, ListUsersParams, LoginBody, MessageWithSender, + MyNote, NoteFolder, NoteReply, NoteThread, @@ -8290,14 +8290,11 @@ export const getListMyNotesAliasUrl = (params?: ListMyNotesAliasParams) => { export const listMyNotesAlias = async ( params?: ListMyNotesAliasParams, options?: RequestInit, -): Promise => { - return customFetch( - getListMyNotesAliasUrl(params), - { - ...options, - method: "GET", - }, - ); +): Promise => { + return customFetch(getListMyNotesAliasUrl(params), { + ...options, + method: "GET", + }); }; export const getListMyNotesAliasQueryKey = ( diff --git a/lib/api-spec/openapi.yaml b/lib/api-spec/openapi.yaml index d3e03ea8..f911437c 100644 --- a/lib/api-spec/openapi.yaml +++ b/lib/api-spec/openapi.yaml @@ -2750,7 +2750,7 @@ paths: application/json: schema: type: array - items: { type: object, additionalProperties: true } + items: { $ref: "#/components/schemas/MyNote" } /notes/sent: get: operationId: listSentNotes @@ -5005,6 +5005,29 @@ components: required: [id, recipientUserId, status, sentAt, readAt, archivedAt] + MyNote: + type: object + description: A note owned by the caller (My Notes / Archive view). + properties: + id: { type: integer } + userId: { type: integer } + title: { type: string } + content: { type: string } + color: { type: string } + isPinned: { type: boolean } + isArchived: { type: boolean } + folderId: + type: ["integer", "null"] + description: Owning folder id, or null for Unfiled. + createdAt: { type: string, format: date-time } + updatedAt: { type: string, format: date-time } + labelIds: + type: array + items: { type: integer } + required: + [id, userId, title, content, color, isPinned, isArchived, folderId, + createdAt, updatedAt, labelIds] + NoteFolder: type: object properties: diff --git a/lib/api-zod/src/generated/api.ts b/lib/api-zod/src/generated/api.ts index c36b216a..fb55e7df 100644 --- a/lib/api-zod/src/generated/api.ts +++ b/lib/api-zod/src/generated/api.ts @@ -3414,10 +3414,24 @@ export const ListMyNotesAliasQueryParams = zod.object({ archived: zod.coerce.boolean().default(listMyNotesAliasQueryArchivedDefault), }); -export const ListMyNotesAliasResponseItem = zod.record( - zod.string(), - zod.unknown(), -); +export const ListMyNotesAliasResponseItem = zod + .object({ + id: zod.number(), + userId: zod.number(), + title: zod.string(), + content: zod.string(), + color: zod.string(), + isPinned: zod.boolean(), + isArchived: zod.boolean(), + folderId: zod + .number() + .nullable() + .describe("Owning folder id, or null for Unfiled."), + createdAt: zod.coerce.date(), + updatedAt: zod.coerce.date(), + labelIds: zod.array(zod.number()), + }) + .describe("A note owned by the caller (My Notes \/ Archive view)."); export const ListMyNotesAliasResponse = zod.array(ListMyNotesAliasResponseItem); /**