diff --git a/changelog/8159-codegen-correspondence-ts-types.yaml b/changelog/8159-codegen-correspondence-ts-types.yaml new file mode 100644 index 00000000000..d250f524aa6 --- /dev/null +++ b/changelog/8159-codegen-correspondence-ts-types.yaml @@ -0,0 +1,4 @@ +type: Added +description: Generated TypeScript types for correspondence and notification API contract (ENG-3303). +pr: 8159 +labels: [] diff --git a/clients/admin-ui/src/types/api/index.ts b/clients/admin-ui/src/types/api/index.ts index 365a6fdf93f..52e7245070f 100644 --- a/clients/admin-ui/src/types/api/index.ts +++ b/clients/admin-ui/src/types/api/index.ts @@ -80,6 +80,7 @@ export type * from "./models/Body_create_comment_api_v1_plus_privacy_request__pr export type * from "./models/Body_create_comment_api_v1_plus_privacy_request__privacy_request_id__comment_post"; export type * from "./models/Body_create_comment_api_v1_plus_privacy_request__privacy_request_id__erasure_manual_webhook__connection_key__comment_post"; export type * from "./models/Body_export_minimal_datamap_with_format_api_v1_plus_datamap_minimal__export_format__post"; +export type * from "./models/Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post"; export type * from "./models/Body_skip_single_manual_field_api_v1_privacy_request__privacy_request_id__manual_field__manual_field_id__skip_post"; export type * from "./models/Body_submit_single_manual_field_api_v1_privacy_request__privacy_request_id__manual_field__manual_field_id__complete_post"; export type * from "./models/Body_upload_data_api_v1_storage__request_id__post"; @@ -155,6 +156,7 @@ export * from "./models/ColumnSort"; export type * from "./models/CommentResponse"; export * from "./models/CommentType"; export * from "./models/ComponentType"; +export * from "./models/CorrespondenceDeliveryStatus"; export type * from "./models/ConditionGroup"; export type * from "./models/ConditionLeaf"; export type * from "./models/ConditionalTotalCursorPage_DatastoreStagedResourceTreeAPIResponse_"; @@ -327,6 +329,7 @@ export * from "./models/EnforcementLevel"; export type * from "./models/EntraDocsSchema"; export type * from "./models/EntraMonitorConfig"; export * from "./models/ErrorNotificationMode"; +export type * from "./models/ErrorResponse"; export * from "./models/ErrorType"; export type * from "./models/Evaluation"; export type * from "./models/EventAuditResponse"; @@ -489,6 +492,7 @@ export type * from "./models/ManualWebhookDocsSchema"; export type * from "./models/ManualWebhookField"; export type * from "./models/MappedPurpose"; export type * from "./models/MariaDBDocsSchema"; +export type * from "./models/MarkAllReadResponse"; export type * from "./models/MaskingAPIRequest"; export type * from "./models/MaskingAPIResponse"; export * from "./models/MaskingStrategies"; @@ -550,6 +554,9 @@ export type * from "./models/NoticeTranslation"; export type * from "./models/NoticeTranslationCreate"; export type * from "./models/NoticeTranslationResponse"; export type * from "./models/NotificationApplicationConfig"; +export type * from "./models/NotificationResourceType"; +export type * from "./models/NotificationResponse"; +export * from "./models/NotificationType"; export type * from "./models/OAuthConfigSchema"; export * from "./models/OAuthGrantType"; export type * from "./models/OktaConfig"; @@ -603,6 +610,7 @@ export type * from "./models/Page_MonitorConfigStagedResourcesAggregateRecord_"; export type * from "./models/Page_MonitorExecution_"; export type * from "./models/Page_MonitorStatusResponse_"; export type * from "./models/Page_MonitorTaskResponse_"; +export type * from "./models/Page_NotificationResponse_"; export type * from "./models/Page_PolicyResponse_"; export type * from "./models/Page_PolicyWebhookResponse_"; export type * from "./models/Page_PreApprovalWebhookResponse_"; @@ -924,6 +932,7 @@ export type * from "./models/TrendMetric"; export * from "./models/TrendPeriod"; export type * from "./models/TrendsResponse"; export type * from "./models/UnlabeledIdentities"; +export type * from "./models/UnreadCountResponse"; export type * from "./models/UnverifiedIdentity"; export type * from "./models/UnverifiedPrivacyPreferencesRequest"; export type * from "./models/UpdateAnswerRequest"; diff --git a/clients/admin-ui/src/types/api/models/Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post.ts b/clients/admin-ui/src/types/api/models/Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post.ts new file mode 100644 index 00000000000..1704f6aaae3 --- /dev/null +++ b/clients/admin-ui/src/types/api/models/Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post.ts @@ -0,0 +1,32 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post + */ +export type Body_send_correspondence_api_v1_plus_privacy_request__privacy_request_id__correspondence_post = + { + /** + * Subject + * + * Email subject line + */ + subject: string; + /** + * Body + * + * Email body content (HTML supported) + */ + body: string; + /** + * Template Id + * + * Optional template ID + */ + template_id?: string | null; + /** + * Attachments + * + * Optional file attachments + */ + attachments?: Array; + }; diff --git a/clients/admin-ui/src/types/api/models/CommentResponse.ts b/clients/admin-ui/src/types/api/models/CommentResponse.ts index 2646b64f4be..12c24cb07c5 100644 --- a/clients/admin-ui/src/types/api/models/CommentResponse.ts +++ b/clients/admin-ui/src/types/api/models/CommentResponse.ts @@ -2,6 +2,7 @@ import type { AttachmentResponse } from "./AttachmentResponse"; import { CommentType } from "./CommentType"; +import { CorrespondenceDeliveryStatus } from "./CorrespondenceDeliveryStatus"; /** * CommentResponse @@ -67,4 +68,38 @@ export type CommentResponse = { * The comment type */ comment_type: CommentType; + /** + * Delivery status for correspondence messages + */ + delivery_status?: CorrespondenceDeliveryStatus | null; + /** + * Parent Id + * + * Parent comment ID for threaded replies + */ + parent_id?: string | null; + /** + * Sender Email + * + * Sender email address for correspondence messages + */ + sender_email?: string | null; + /** + * Recipient Email + * + * Recipient email address for correspondence messages + */ + recipient_email?: string | null; + /** + * Bounce Reason + * + * Bounce reason if delivery failed + */ + bounce_reason?: string | null; + /** + * Reply To Address + * + * Reply-to address for correspondence threading + */ + reply_to_address?: string | null; }; diff --git a/clients/admin-ui/src/types/api/models/CorrespondenceDeliveryStatus.ts b/clients/admin-ui/src/types/api/models/CorrespondenceDeliveryStatus.ts new file mode 100644 index 00000000000..10a9369aaec --- /dev/null +++ b/clients/admin-ui/src/types/api/models/CorrespondenceDeliveryStatus.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * CorrespondenceDeliveryStatus + * + * Delivery status for correspondence messages. + */ +export enum CorrespondenceDeliveryStatus { + PENDING = "pending", + SENT = "sent", + DELIVERED = "delivered", + BOUNCED = "bounced", + FAILED = "failed", +} diff --git a/clients/admin-ui/src/types/api/models/ErrorResponse.ts b/clients/admin-ui/src/types/api/models/ErrorResponse.ts new file mode 100644 index 00000000000..0b8ca7e39b0 --- /dev/null +++ b/clients/admin-ui/src/types/api/models/ErrorResponse.ts @@ -0,0 +1,13 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * ErrorResponse + * + * Model for error responses. + */ +export type ErrorResponse = { + /** + * Detail + */ + detail: string; +}; diff --git a/clients/admin-ui/src/types/api/models/MarkAllReadResponse.ts b/clients/admin-ui/src/types/api/models/MarkAllReadResponse.ts new file mode 100644 index 00000000000..e6f263025e1 --- /dev/null +++ b/clients/admin-ui/src/types/api/models/MarkAllReadResponse.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * MarkAllReadResponse + * + * Response for bulk mark-all-as-read. + */ +export type MarkAllReadResponse = { + /** + * Marked Count + * + * Number of notifications marked as read + */ + marked_count: number; +}; diff --git a/clients/admin-ui/src/types/api/models/NotificationResourceType.ts b/clients/admin-ui/src/types/api/models/NotificationResourceType.ts new file mode 100644 index 00000000000..53f0051d6f8 --- /dev/null +++ b/clients/admin-ui/src/types/api/models/NotificationResourceType.ts @@ -0,0 +1,10 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * NotificationResourceType + * + * Resource types that notifications can link to. + */ +export enum NotificationResourceType { + PRIVACY_REQUEST = "privacy_request", +} diff --git a/clients/admin-ui/src/types/api/models/NotificationResponse.ts b/clients/admin-ui/src/types/api/models/NotificationResponse.ts new file mode 100644 index 00000000000..cfd9fa518ee --- /dev/null +++ b/clients/admin-ui/src/types/api/models/NotificationResponse.ts @@ -0,0 +1,62 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { NotificationResourceType } from "./NotificationResourceType"; +import { NotificationType } from "./NotificationType"; + +/** + * NotificationResponse + * + * Response schema for a single notification. + */ +export type NotificationResponse = { + /** + * Id + * + * The notification ID + */ + id: string; + /** + * The type of notification + */ + notification_type: NotificationType; + /** + * Title + * + * Notification title + */ + title: string; + /** + * Body + * + * Notification body text + */ + body?: string | null; + /** + * Type of the linked resource + */ + resource_type?: NotificationResourceType | null; + /** + * Resource Id + * + * ID of the linked resource + */ + resource_id?: string | null; + /** + * Is Read + * + * Whether the notification has been read + */ + is_read?: boolean; + /** + * Read At + * + * When the notification was read + */ + read_at?: string | null; + /** + * Created At + * + * When the notification was created + */ + created_at: string; +}; diff --git a/clients/admin-ui/src/types/api/models/NotificationType.ts b/clients/admin-ui/src/types/api/models/NotificationType.ts new file mode 100644 index 00000000000..b0042ac2a9d --- /dev/null +++ b/clients/admin-ui/src/types/api/models/NotificationType.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * NotificationType + * + * Types of in-app notifications. + * + * String constants — the DB column is a plain String (no migration + * for new values), but the API contract enumerates valid values so + * FE can switch on them. + */ +export enum NotificationType { + CORRESPONDENCE_REPLY = "correspondence_reply", + CORRESPONDENCE_BOUNCE = "correspondence_bounce", +} diff --git a/clients/admin-ui/src/types/api/models/Page_NotificationResponse_.ts b/clients/admin-ui/src/types/api/models/Page_NotificationResponse_.ts new file mode 100644 index 00000000000..2ba48efc21c --- /dev/null +++ b/clients/admin-ui/src/types/api/models/Page_NotificationResponse_.ts @@ -0,0 +1,29 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { NotificationResponse } from "./NotificationResponse"; + +/** + * Page[NotificationResponse] + */ +export type Page_NotificationResponse_ = { + /** + * Items + */ + items: Array; + /** + * Total + */ + total: number; + /** + * Page + */ + page: number; + /** + * Size + */ + size: number; + /** + * Pages + */ + pages: number; +}; diff --git a/clients/admin-ui/src/types/api/models/UnreadCountResponse.ts b/clients/admin-ui/src/types/api/models/UnreadCountResponse.ts new file mode 100644 index 00000000000..5c262a52288 --- /dev/null +++ b/clients/admin-ui/src/types/api/models/UnreadCountResponse.ts @@ -0,0 +1,15 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * UnreadCountResponse + * + * Response schema for unread notification count. + */ +export type UnreadCountResponse = { + /** + * Count + * + * Number of unread notifications + */ + count: number; +}; diff --git a/src/fides/api/models/comment.py b/src/fides/api/models/comment.py index 9fc9f1dff32..2f37ba8f294 100644 --- a/src/fides/api/models/comment.py +++ b/src/fides/api/models/comment.py @@ -161,6 +161,7 @@ class Comment(Base): "CorrespondenceMetadata", back_populates="comment", uselist=False, + lazy="selectin", cascade="all, delete-orphan", )