Skip to content

Commit 4afd042

Browse files
authored
feat(tem): add dmarc validation status to DomainLastStatus endpoint (#1108)
1 parent 501fb3e commit 4afd042

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type {
1414
Domain,
1515
DomainLastStatus,
1616
DomainLastStatusDkimRecord,
17+
DomainLastStatusDmarcRecord,
1718
DomainLastStatusRecordStatus,
1819
DomainLastStatusSpfRecord,
1920
DomainReputation,

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type {
1616
Domain,
1717
DomainLastStatus,
1818
DomainLastStatusDkimRecord,
19+
DomainLastStatusDmarcRecord,
1920
DomainLastStatusSpfRecord,
2021
DomainReputation,
2122
DomainStatistics,
@@ -158,6 +159,22 @@ const unmarshalDomainLastStatusDkimRecord = (
158159
} as DomainLastStatusDkimRecord
159160
}
160161

162+
const unmarshalDomainLastStatusDmarcRecord = (
163+
data: unknown,
164+
): DomainLastStatusDmarcRecord => {
165+
if (!isJSONObject(data)) {
166+
throw new TypeError(
167+
`Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.`,
168+
)
169+
}
170+
171+
return {
172+
error: data.error,
173+
lastValidAt: unmarshalDate(data.last_valid_at),
174+
status: data.status,
175+
} as DomainLastStatusDmarcRecord
176+
}
177+
161178
const unmarshalDomainLastStatusSpfRecord = (
162179
data: unknown,
163180
): DomainLastStatusSpfRecord => {
@@ -185,6 +202,9 @@ export const unmarshalDomainLastStatus = (data: unknown): DomainLastStatus => {
185202
dkimRecord: data.dkim_record
186203
? unmarshalDomainLastStatusDkimRecord(data.dkim_record)
187204
: undefined,
205+
dmarcRecord: data.dmarc_record
206+
? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record)
207+
: undefined,
188208
domainId: data.domain_id,
189209
domainName: data.domain_name,
190210
spfRecord: data.spf_record

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ export interface DomainLastStatusDkimRecord {
167167
error?: string
168168
}
169169

170+
export interface DomainLastStatusDmarcRecord {
171+
/** Status of the DMARC record's configuration. */
172+
status: DomainLastStatusRecordStatus
173+
/** Time and date the DMARC record was last valid. */
174+
lastValidAt?: Date
175+
/** An error text displays in case the record is not valid. */
176+
error?: string
177+
}
178+
170179
export interface DomainLastStatusSpfRecord {
171180
/** Status of the SPF record's configuration. */
172181
status: DomainLastStatusRecordStatus
@@ -293,6 +302,8 @@ export interface DomainLastStatus {
293302
spfRecord?: DomainLastStatusSpfRecord
294303
/** The DKIM record verification data. */
295304
dkimRecord?: DomainLastStatusDkimRecord
305+
/** The DMARC record verification data. */
306+
dmarcRecord?: DomainLastStatusDmarcRecord
296307
}
297308

298309
export type GetDomainLastStatusRequest = {

0 commit comments

Comments
 (0)