Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/8159-codegen-correspondence-ts-types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: Added
description: Generated TypeScript types for correspondence and notification API contract (ENG-3303).
pr: 8159
labels: []
9 changes: 9 additions & 0 deletions clients/admin-ui/src/types/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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_";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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_";
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Blob | File>;
};
35 changes: 35 additions & 0 deletions clients/admin-ui/src/types/api/models/CommentResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import type { AttachmentResponse } from "./AttachmentResponse";
import { CommentType } from "./CommentType";
import { CorrespondenceDeliveryStatus } from "./CorrespondenceDeliveryStatus";

/**
* CommentResponse
Expand Down Expand Up @@ -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;
};
Original file line number Diff line number Diff line change
@@ -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",
}
13 changes: 13 additions & 0 deletions clients/admin-ui/src/types/api/models/ErrorResponse.ts
Original file line number Diff line number Diff line change
@@ -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;
};
15 changes: 15 additions & 0 deletions clients/admin-ui/src/types/api/models/MarkAllReadResponse.ts
Original file line number Diff line number Diff line change
@@ -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;
};
10 changes: 10 additions & 0 deletions clients/admin-ui/src/types/api/models/NotificationResourceType.ts
Original file line number Diff line number Diff line change
@@ -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",
}
62 changes: 62 additions & 0 deletions clients/admin-ui/src/types/api/models/NotificationResponse.ts
Original file line number Diff line number Diff line change
@@ -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;
};
15 changes: 15 additions & 0 deletions clients/admin-ui/src/types/api/models/NotificationType.ts
Original file line number Diff line number Diff line change
@@ -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",
}
Original file line number Diff line number Diff line change
@@ -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<NotificationResponse>;
/**
* Total
*/
total: number;
/**
* Page
*/
page: number;
/**
* Size
*/
size: number;
/**
* Pages
*/
pages: number;
};
15 changes: 15 additions & 0 deletions clients/admin-ui/src/types/api/models/UnreadCountResponse.ts
Original file line number Diff line number Diff line change
@@ -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;
};
1 change: 1 addition & 0 deletions src/fides/api/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class Comment(Base):
"CorrespondenceMetadata",
back_populates="comment",
uselist=False,
lazy="selectin",
cascade="all, delete-orphan",
)

Expand Down
Loading