diff --git a/packages/clients/src/api/tem/v1alpha1/api.gen.ts b/packages/clients/src/api/tem/v1alpha1/api.gen.ts index 5e9299890..9b26007a2 100644 --- a/packages/clients/src/api/tem/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/api.gen.ts @@ -125,8 +125,10 @@ export class API extends ParentAPI { urlParams: urlParams( ['domain_id', request.domainId], ['mail_from', request.mailFrom], + ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], + ['order_by', request.orderBy ?? 'created_at_desc'], ['page', request.page], [ 'page_size', @@ -144,7 +146,15 @@ export class API extends ParentAPI { /** * List emails. Retrieve the list of emails sent from a specific domain or for - * a specific Project or Organization. You must specify the `region`. + * a specific Project or Organization. You must specify the `region`. You can + * filter your emails in ascending or descending order using: + * + * - Created_at + * - Updated_at + * - Status + * - Mail_from + * - Mail_rcpt + * - Subject * * @param request - The request {@link ListEmailsRequest} * @returns A Promise of ListEmailsResponse diff --git a/packages/clients/src/api/tem/v1alpha1/index.gen.ts b/packages/clients/src/api/tem/v1alpha1/index.gen.ts index ac4202d07..5c9dfd7cc 100644 --- a/packages/clients/src/api/tem/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/index.gen.ts @@ -23,6 +23,7 @@ export type { ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, + ListEmailsRequestOrderBy, ListEmailsResponse, RevokeDomainRequest, Statistics, diff --git a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts index 2233caa43..cb623fdbd 100644 --- a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts @@ -90,6 +90,7 @@ export const unmarshalEmail = (data: unknown) => { id: data.id, lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry), mailFrom: data.mail_from, + mailRcpt: data.mail_rcpt, messageId: data.message_id, projectId: data.project_id, rcptTo: data.rcpt_to, diff --git a/packages/clients/src/api/tem/v1alpha1/types.gen.ts b/packages/clients/src/api/tem/v1alpha1/types.gen.ts index b11269ebe..ef57ad4d3 100644 --- a/packages/clients/src/api/tem/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/types.gen.ts @@ -21,6 +21,20 @@ export type EmailStatus = | 'failed' | 'canceled' +export type ListEmailsRequestOrderBy = + | 'created_at_desc' + | 'created_at_asc' + | 'updated_at_desc' + | 'updated_at_asc' + | 'status_desc' + | 'status_asc' + | 'mail_from_desc' + | 'mail_from_asc' + | 'mail_rcpt_desc' + | 'mail_rcpt_asc' + | 'subject_desc' + | 'subject_asc' + /** Create email request. address. */ export interface CreateEmailRequestAddress { /** Email address. */ @@ -93,8 +107,10 @@ export interface Email { projectId: string /** Email address of the sender. */ mailFrom: string + /** @deprecated (Deprecated) Email address of the recipient. */ + rcptTo?: string /** Email address of the recipient. */ - rcptTo: string + mailRcpt: string /** Type of recipient. */ rcptType: EmailRcptType /** Subject of the email. */ @@ -140,7 +156,7 @@ export interface ListDomainsResponse { /** List emails response. */ export interface ListEmailsResponse { - /** Count of all emails matching the requested criteria. */ + /** Number of emails matching the requested criteria. */ totalCount: number /** Single page of emails matching the requested criteria. */ emails: Email[] @@ -223,24 +239,41 @@ export type ListEmailsRequest = { region?: Region page?: number pageSize?: number - /** ID of the Project in which to list the emails (optional). */ + /** (Optional) ID of the Project in which to list the emails. */ projectId?: string - /** ID of the domain for which to list the emails (optional). */ + /** (Optional) ID of the domain for which to list the emails. */ domainId?: string - /** ID of the message for which to list the emails (optional). */ + /** (Optional) ID of the message for which to list the emails. */ messageId?: string - /** Subject of the email. */ - subject?: string - /** List emails created after this date (optional). */ + /** (Optional) List emails created after this date. */ since?: Date - /** List emails created before this date (optional). */ + /** (Optional) List emails created before this date. */ until?: Date - /** List emails sent with this `mail_from` sender's address (optional). */ + /** (Optional) List emails sent with this sender's email address. */ mailFrom?: string - /** List emails sent with this `mail_to` recipient's address (optional). */ + /** + * @deprecated (Deprecated) List emails sent to this recipient's email + * address. + */ mailTo?: string - /** List emails having any of this status (optional). */ + /** (Optional) List emails sent to this recipient's email address. */ + mailRcpt?: string + /** (Optional) List emails with any of these statuses. */ statuses?: EmailStatus[] + /** (Optional) List emails with this subject. */ + subject?: string + /** + * (Optional) List emails corresponding to specific criteria. You can filter + * your emails in ascending or descending order using: + * + * - Created_at + * - Updated_at + * - Status + * - Mail_from + * - Mail_rcpt + * - Subject. + */ + orderBy?: ListEmailsRequestOrderBy } export type GetStatisticsRequest = { @@ -249,18 +282,18 @@ export type GetStatisticsRequest = { * config. */ region?: Region - /** Number of emails for this Project (optional). */ + /** (Optional) Number of emails for this Project. */ projectId?: string /** - * Number of emails sent from this domain (must be coherent with the - * `project_id` and the `organization_id`) (optional). + * (Optional) Number of emails sent from this domain (must be coherent with + * the `project_id` and the `organization_id`). */ domainId?: string - /** Number of emails created after this date (optional). */ + /** (Optional) Number of emails created after this date. */ since?: Date - /** Number of emails created before this date (optional). */ + /** (Optional) Number of emails created before this date. */ until?: Date - /** Number of emails sent with this `mail_from` sender's address (optional). */ + /** (Optional) Number of emails sent with this sender's email address. */ mailFrom?: string }