Skip to content

Commit 9a08609

Browse files
scaleway-botyfodil
andauthored
feat(tem): add dkim, spf and mx records in domain message (#2417)
Co-authored-by: Yacine Fodil <[email protected]>
1 parent d8ecf1c commit 9a08609

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

packages_generated/tem/src/v1alpha1/index.gen.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export type {
2929
DomainLastStatusRecordStatus,
3030
DomainLastStatusSpfRecord,
3131
DomainRecords,
32+
DomainRecordsDKIM,
3233
DomainRecordsDMARC,
34+
DomainRecordsMX,
35+
DomainRecordsSPF,
3336
DomainReputation,
3437
DomainReputationStatus,
3538
DomainStatistics,

packages_generated/tem/src/v1alpha1/marshalling.gen.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import type {
2626
DomainLastStatusMXRecord,
2727
DomainLastStatusSpfRecord,
2828
DomainRecords,
29+
DomainRecordsDKIM,
2930
DomainRecordsDMARC,
31+
DomainRecordsMX,
32+
DomainRecordsSPF,
3033
DomainReputation,
3134
DomainStatistics,
3235
Email,
@@ -96,6 +99,19 @@ export const unmarshalEmail = (data: unknown): Email => {
9699
} as Email
97100
}
98101

102+
const unmarshalDomainRecordsDKIM = (data: unknown): DomainRecordsDKIM => {
103+
if (!isJSONObject(data)) {
104+
throw new TypeError(
105+
`Unmarshalling the type 'DomainRecordsDKIM' failed as data isn't a dictionary.`,
106+
)
107+
}
108+
109+
return {
110+
name: data.name,
111+
value: data.value,
112+
} as DomainRecordsDKIM
113+
}
114+
99115
const unmarshalDomainRecordsDMARC = (data: unknown): DomainRecordsDMARC => {
100116
if (!isJSONObject(data)) {
101117
throw new TypeError(
@@ -109,6 +125,32 @@ const unmarshalDomainRecordsDMARC = (data: unknown): DomainRecordsDMARC => {
109125
} as DomainRecordsDMARC
110126
}
111127

128+
const unmarshalDomainRecordsMX = (data: unknown): DomainRecordsMX => {
129+
if (!isJSONObject(data)) {
130+
throw new TypeError(
131+
`Unmarshalling the type 'DomainRecordsMX' failed as data isn't a dictionary.`,
132+
)
133+
}
134+
135+
return {
136+
name: data.name,
137+
value: data.value,
138+
} as DomainRecordsMX
139+
}
140+
141+
const unmarshalDomainRecordsSPF = (data: unknown): DomainRecordsSPF => {
142+
if (!isJSONObject(data)) {
143+
throw new TypeError(
144+
`Unmarshalling the type 'DomainRecordsSPF' failed as data isn't a dictionary.`,
145+
)
146+
}
147+
148+
return {
149+
name: data.name,
150+
value: data.value,
151+
} as DomainRecordsSPF
152+
}
153+
112154
const unmarshalDomainRecords = (data: unknown): DomainRecords => {
113155
if (!isJSONObject(data)) {
114156
throw new TypeError(
@@ -117,7 +159,10 @@ const unmarshalDomainRecords = (data: unknown): DomainRecords => {
117159
}
118160

119161
return {
162+
dkim: data.dkim ? unmarshalDomainRecordsDKIM(data.dkim) : undefined,
120163
dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : undefined,
164+
mx: data.mx ? unmarshalDomainRecordsMX(data.mx) : undefined,
165+
spf: data.spf ? unmarshalDomainRecordsSPF(data.spf) : undefined,
121166
} as DomainRecords
122167
}
123168

packages_generated/tem/src/v1alpha1/types.gen.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ export type WebhookEventType =
114114
| 'email_blocklisted'
115115
| 'blocklist_created'
116116

117+
export interface DomainRecordsDKIM {
118+
/**
119+
* Name of the DKIM TXT record.
120+
*/
121+
name: string
122+
/**
123+
* Value of the DKIM TXT record.
124+
*/
125+
value: string
126+
}
127+
117128
export interface DomainRecordsDMARC {
118129
/**
119130
* Name of the DMARC TXT record.
@@ -125,6 +136,28 @@ export interface DomainRecordsDMARC {
125136
value: string
126137
}
127138

139+
export interface DomainRecordsMX {
140+
/**
141+
* Name of the MX record.
142+
*/
143+
name: string
144+
/**
145+
* Value of the MX record.
146+
*/
147+
value: string
148+
}
149+
150+
export interface DomainRecordsSPF {
151+
/**
152+
* Name of the SPF TXT record.
153+
*/
154+
name: string
155+
/**
156+
* Value of the SPF TXT record.
157+
*/
158+
value: string
159+
}
160+
128161
export interface EmailTry {
129162
/**
130163
* Rank number of this attempt to send the email.
@@ -149,6 +182,18 @@ export interface DomainRecords {
149182
* DMARC TXT record specification.
150183
*/
151184
dmarc?: DomainRecordsDMARC
185+
/**
186+
* DKIM TXT record specification.
187+
*/
188+
dkim?: DomainRecordsDKIM
189+
/**
190+
* SPF TXT record specification.
191+
*/
192+
spf?: DomainRecordsSPF
193+
/**
194+
* MX record specification.
195+
*/
196+
mx?: DomainRecordsMX
152197
}
153198

154199
export interface DomainReputation {

0 commit comments

Comments
 (0)