Skip to content

Commit 5d43aaa

Browse files
authored
feat(tem): add domain records and DMARC configuration (#1186)
1 parent 1a23b6a commit 5d43aaa

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

packages/clients/src/api/tem/v1alpha1/index.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export type {
1717
DomainLastStatusDmarcRecord,
1818
DomainLastStatusRecordStatus,
1919
DomainLastStatusSpfRecord,
20+
DomainRecords,
21+
DomainRecordsDMARC,
2022
DomainReputation,
2123
DomainReputationStatus,
2224
DomainStatistics,

packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import type {
1818
DomainLastStatusDkimRecord,
1919
DomainLastStatusDmarcRecord,
2020
DomainLastStatusSpfRecord,
21+
DomainRecords,
22+
DomainRecordsDMARC,
2123
DomainReputation,
2224
DomainStatistics,
2325
Email,
@@ -68,6 +70,31 @@ export const unmarshalEmail = (data: unknown): Email => {
6870
} as Email
6971
}
7072

73+
const unmarshalDomainRecordsDMARC = (data: unknown): DomainRecordsDMARC => {
74+
if (!isJSONObject(data)) {
75+
throw new TypeError(
76+
`Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.`,
77+
)
78+
}
79+
80+
return {
81+
name: data.name,
82+
value: data.value,
83+
} as DomainRecordsDMARC
84+
}
85+
86+
const unmarshalDomainRecords = (data: unknown): DomainRecords => {
87+
if (!isJSONObject(data)) {
88+
throw new TypeError(
89+
`Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.`,
90+
)
91+
}
92+
93+
return {
94+
dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : undefined,
95+
} as DomainRecords
96+
}
97+
7198
const unmarshalDomainReputation = (data: unknown): DomainReputation => {
7299
if (!isJSONObject(data)) {
73100
throw new TypeError(
@@ -116,6 +143,7 @@ export const unmarshalDomain = (data: unknown): Domain => {
116143
nextCheckAt: unmarshalDate(data.next_check_at),
117144
organizationId: data.organization_id,
118145
projectId: data.project_id,
146+
records: data.records ? unmarshalDomainRecords(data.records) : undefined,
119147
region: data.region,
120148
reputation: data.reputation
121149
? unmarshalDomainReputation(data.reputation)

packages/clients/src/api/tem/v1alpha1/types.gen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ export type ListEmailsRequestOrderBy =
5858
| 'subject_desc'
5959
| 'subject_asc'
6060

61+
export interface DomainRecordsDMARC {
62+
/** Name of the DMARC TXT record. */
63+
name: string
64+
/** Value of the DMARC TXT record. */
65+
value: string
66+
}
67+
6168
export interface EmailTry {
6269
/** Rank number of this attempt to send the email. */
6370
rank: number
@@ -75,6 +82,11 @@ export interface EmailTry {
7582
message: string
7683
}
7784

85+
export interface DomainRecords {
86+
/** DMARC TXT record specification. */
87+
dmarc?: DomainRecordsDMARC
88+
}
89+
7890
export interface DomainReputation {
7991
/** Status of your domain's reputation. */
8092
status: DomainReputationStatus
@@ -217,6 +229,8 @@ export interface Domain {
217229
* sent enough emails.
218230
*/
219231
reputation?: DomainReputation
232+
/** List of records to configure to validate a domain. */
233+
records?: DomainRecords
220234
/**
221235
* Region to target. If none is passed will use default region from the
222236
* config.

0 commit comments

Comments
 (0)