Skip to content

Commit 5bab820

Browse files
authored
docs(tem): revamp (#549)
1 parent cbb2f85 commit 5bab820

File tree

2 files changed

+81
-72
lines changed

2 files changed

+81
-72
lines changed

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

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ const jsonContentHeaders = {
4646
}
4747

4848
/**
49-
* Transactional Email API.
49+
* Transactional Email API documentation.
5050
*
51-
* Tem. Transactional Email API.
51+
* Tem. Transactional Email API documentation.
5252
*/
5353
export class API extends ParentAPI {
5454
/** Lists the available regions of the API. */
5555
public static readonly LOCALITIES: Region[] = ['fr-par']
5656

5757
/**
58-
* Send an email.
58+
* Send an email. You must specify the `region`, the sender and the
59+
* recipient's information and the `project_id` to send an email from a
60+
* checked domain. The subject of the email must contain at least 6
61+
* characters.
5962
*
6063
* @param request - The request {@link CreateEmailRequest}
6164
* @returns A Promise of CreateEmailResponse
@@ -77,7 +80,8 @@ export class API extends ParentAPI {
7780
)
7881

7982
/**
80-
* Get information about an email.
83+
* Get an email. Retrieve information about a specific email using the
84+
* `email_id` and `region` parameters.
8185
*
8286
* @param request - The request {@link GetEmailRequest}
8387
* @returns A Promise of Email
@@ -143,8 +147,8 @@ export class API extends ParentAPI {
143147
)
144148

145149
/**
146-
* List emails sent from a domain and/or for a project and/or for an
147-
* organization.
150+
* List emails. Retrieve the list of emails sent from a specific domain or for
151+
* a specific Project or Organization. You must specify the `region`.
148152
*
149153
* @param request - The request {@link ListEmailsRequest}
150154
* @returns A Promise of ListEmailsResponse
@@ -153,7 +157,7 @@ export class API extends ParentAPI {
153157
enrichForPagination('emails', this.pageOfListEmails, request)
154158

155159
/**
156-
* Get statistics on the email statuses.
160+
* Email statuses. Get information on your emails' statuses.
157161
*
158162
* @param request - The request {@link GetStatisticsRequest}
159163
* @returns A Promise of Statistics
@@ -178,7 +182,9 @@ export class API extends ParentAPI {
178182
)
179183

180184
/**
181-
* Try to cancel an email if it has not yet been sent.
185+
* Cancel an email. You can cancel the sending of an email if it has not been
186+
* sent yet. You must specify the `region` and the `email_id` of the email you
187+
* want to cancel.
182188
*
183189
* @param request - The request {@link CancelEmailRequest}
184190
* @returns A Promise of Email
@@ -198,7 +204,8 @@ export class API extends ParentAPI {
198204
)
199205

200206
/**
201-
* Register a domain in a project.
207+
* Register a domain in a project. You must specify the `region`, `project_id`
208+
* and `domain_name` to register a domain in a specific Project.
202209
*
203210
* @param request - The request {@link CreateDomainRequest}
204211
* @returns A Promise of Domain
@@ -220,7 +227,8 @@ export class API extends ParentAPI {
220227
)
221228

222229
/**
223-
* Get information about a domain.
230+
* Get information about a domain. Retrieve information about a specific
231+
* domain using the `region` and `domain_id` parameters.
224232
*
225233
* @param request - The request {@link GetDomainRequest}
226234
* @returns A Promise of Domain
@@ -281,7 +289,8 @@ export class API extends ParentAPI {
281289
)
282290

283291
/**
284-
* List domains in a project and/or in an organization.
292+
* List domains. Retrieve domains in a specific project or in a specific
293+
* Organization using the `region` parameter.
285294
*
286295
* @param request - The request {@link ListDomainsRequest}
287296
* @returns A Promise of ListDomainsResponse
@@ -290,7 +299,9 @@ export class API extends ParentAPI {
290299
enrichForPagination('domains', this.pageOfListDomains, request)
291300

292301
/**
293-
* Revoke a domain.
302+
* Delete a domain. You must specify the domain you want to delete by the
303+
* `region` and `domain_id`. Deleting a domain is permanent and cannot be
304+
* undone.
294305
*
295306
* @param request - The request {@link RevokeDomainRequest}
296307
* @returns A Promise of Domain
@@ -310,7 +321,8 @@ export class API extends ParentAPI {
310321
)
311322

312323
/**
313-
* Ask for an immediate check of a domain (DNS check).
324+
* Domain DNS check. Perform an immediate DNS check of a domain using the
325+
* `region` and `domain_id` parameters.
314326
*
315327
* @param request - The request {@link CheckDomainRequest}
316328
* @returns A Promise of Domain

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

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,17 @@ export type EmailStatus =
2525
export interface CreateEmailRequestAddress {
2626
/** Email address. */
2727
email: string
28-
/** Optional display name. */
28+
/** (Optional) Name displayed. */
2929
name?: string
3030
}
3131

3232
/** Create email request. attachment. */
3333
export interface CreateEmailRequestAttachment {
3434
/** Filename of the attachment. */
3535
name: string
36-
/**
37-
* MIME type of the attachment (Currently only allow, text files, pdf and html
38-
* files).
39-
*/
36+
/** MIME type of the attachment. */
4037
type: string
41-
/** Content of the attachment, encoded in base64. */
38+
/** Content of the attachment encoded in base64. */
4239
content: string
4340
}
4441

@@ -52,27 +49,27 @@ export interface CreateEmailResponse {
5249
export interface Domain {
5350
/** ID of the domain. */
5451
id: string
55-
/** ID of the organization to which the domain belongs. */
52+
/** ID of the domain's Organization. */
5653
organizationId: string
57-
/** ID of the project. */
54+
/** ID of the domain's Project. */
5855
projectId: string
5956
/** Domain name (example.com). */
6057
name: string
6158
/** Status of the domain. */
6259
status: DomainStatus
63-
/** Date and time of domain's creation. */
60+
/** Date and time of domain creation. */
6461
createdAt?: Date
6562
/** Date and time of the next scheduled check. */
6663
nextCheckAt?: Date
67-
/** Date and time the domain was last found to be valid. */
64+
/** Date and time the domain was last valid. */
6865
lastValidAt?: Date
69-
/** Date and time of the revocation of the domain. */
66+
/** Date and time of the domain's deletion. */
7067
revokedAt?: Date
71-
/** Error message if the last check failed. */
68+
/** Error message returned if the last check failed. */
7269
lastError?: string
73-
/** Snippet of the SPF record that should be registered in the DNS zone. */
70+
/** Snippet of the SPF record to register in the DNS zone. */
7471
spfConfig: string
75-
/** DKIM public key, as should be recorded in the DNS zone. */
72+
/** DKIM public key to record in the DNS zone. */
7673
dkimConfig: string
7774
/** Domain's statistics. */
7875
statistics?: DomainStatistics
@@ -90,53 +87,53 @@ export interface DomainStatistics {
9087
export interface Email {
9188
/** Technical ID of the email. */
9289
id: string
93-
/** MessageID of the email. */
90+
/** Message ID of the email. */
9491
messageId: string
95-
/** ID of the project to which the email belongs. */
92+
/** ID of the Project to which the email belongs. */
9693
projectId: string
9794
/** Email address of the sender. */
9895
mailFrom: string
9996
/** Email address of the recipient. */
10097
rcptTo: string
101-
/** Type of the recipient. */
98+
/** Type of recipient. */
10299
rcptType: EmailRcptType
103100
/** Subject of the email. */
104101
subject: string
105102
/** Creation date of the email object. */
106103
createdAt?: Date
107-
/** Last update time of the email object. */
104+
/** Last update of the email object. */
108105
updatedAt?: Date
109106
/** Status of the email. */
110107
status: EmailStatus
111-
/** Additional information on the status. */
108+
/** Additional status information. */
112109
statusDetails?: string
113-
/** Total number of attempts to send the email. */
110+
/** Number of attempts to send the email. */
114111
tryCount: number
115-
/** Informations about the latest three attempts to send the email. */
112+
/** Information about the last three attempts to send the email. */
116113
lastTries: EmailTry[]
117114
}
118115

119116
/** Email. try. */
120117
export interface EmailTry {
121118
/** Rank number of this attempt to send the email. */
122119
rank: number
123-
/** Date of the attempt. */
120+
/** Date of the attempt to send the email. */
124121
triedAt?: Date
125122
/**
126123
* The SMTP status code received after the attempt. 0 if the attempt did not
127124
* reach an SMTP server.
128125
*/
129126
code: number
130127
/**
131-
* The SMTP message received, if any. If the attempt did not reach an SMTP
132-
* server, the message says why.
128+
* The SMTP message received. If the attempt did not reach an SMTP server, the
129+
* message returned explains what happened.
133130
*/
134131
message: string
135132
}
136133

137134
/** List domains response. */
138135
export interface ListDomainsResponse {
139-
/** Total number of domains matching the request (without pagination). */
136+
/** Number of domains that match the request (without pagination). */
140137
totalCount: number
141138
domains: Domain[]
142139
}
@@ -151,31 +148,31 @@ export interface ListEmailsResponse {
151148

152149
/** Statistics. */
153150
export interface Statistics {
154-
/** Total number of emails matching the request criteria. */
151+
/** Total number of emails matching the requested criteria. */
155152
totalCount: number
156153
/**
157-
* Number of emails still in the `new` transient state (received from the API,
158-
* not yet processed).
154+
* Number of emails still in the `new` transient state. This means emails
155+
* received from the API but not yet processed.
159156
*/
160157
newCount: number
161158
/**
162-
* Number of emails still in the `sending` transient state (received from the
163-
* API, not yet in their final status).
159+
* Number of emails still in the `sending` transient state. This means emails
160+
* received from the API but not yet in their final status.
164161
*/
165162
sendingCount: number
166163
/**
167-
* Number of emails in the final `sent` state (have been delivered to the
168-
* target mail system).
164+
* Number of emails in the final `sent` state. This means emails that have
165+
* been delivered to the target mail system.
169166
*/
170167
sentCount: number
171168
/**
172-
* Number of emails in the final `failed` state (refused by the target mail
173-
* system with a final error status).
169+
* Number of emails in the final `failed` state. This means emails that have
170+
* been refused by the target mail system with a final error status.
174171
*/
175172
failedCount: number
176173
/**
177-
* Number of emails in the final `canceled` state (canceled by customer's
178-
* request).
174+
* Number of emails in the final `canceled` state. This meanns emails that
175+
* have been canceled upon request.
179176
*/
180177
canceledCount: number
181178
}
@@ -186,25 +183,25 @@ export type CreateEmailRequest = {
186183
* config.
187184
*/
188185
region?: Region
189-
/** Sender information (must be from a checked domain declared in the project). */
186+
/** Sender information. Must be from a checked domain declared in the Project. */
190187
from?: CreateEmailRequestAddress
191188
/** Array of recipient information (limited to 1 recipient). */
192189
to?: CreateEmailRequestAddress[]
193190
/** Array of recipient information (unimplemented). */
194191
cc?: CreateEmailRequestAddress[]
195192
/** Array of recipient information (unimplemented). */
196193
bcc?: CreateEmailRequestAddress[]
197-
/** Message subject. */
194+
/** Subject of the email. */
198195
subject: string
199196
/** Text content. */
200197
text: string
201198
/** HTML content. */
202199
html: string
203-
/** ID of the project in which to create the email. */
200+
/** ID of the Project in which to create the email. */
204201
projectId?: string
205202
/** Array of attachments. */
206203
attachments?: CreateEmailRequestAttachment[]
207-
/** Maximum date to deliver mail. */
204+
/** Maximum date to deliver the email. */
208205
sendBefore?: Date
209206
}
210207

@@ -226,24 +223,24 @@ export type ListEmailsRequest = {
226223
region?: Region
227224
page?: number
228225
pageSize?: number
229-
/** Optional ID of the project in which to list the emails. */
226+
/** ID of the Project in which to list the emails (optional). */
230227
projectId?: string
231-
/** Optional ID of the domain for which to list the emails. */
228+
/** ID of the domain for which to list the emails (optional). */
232229
domainId?: string
233-
/** Optional ID of the message for which to list the emails. */
230+
/** ID of the message for which to list the emails (optional). */
234231
messageId?: string
235-
/** Optional, list emails created after this date. */
232+
/** Subject of the email. */
233+
subject?: string
234+
/** List emails created after this date (optional). */
236235
since?: Date
237-
/** Optional, list emails created before this date. */
236+
/** List emails created before this date (optional). */
238237
until?: Date
239-
/** Optional, list emails sent with this `mail_from` sender's address. */
238+
/** List emails sent with this `mail_from` sender's address (optional). */
240239
mailFrom?: string
241-
/** Optional, list emails sent with this `mail_to` recipient's address. */
240+
/** List emails sent with this `mail_to` recipient's address (optional). */
242241
mailTo?: string
243-
/** Optional, list emails having any of this status. */
242+
/** List emails having any of this status (optional). */
244243
statuses?: EmailStatus[]
245-
/** Optional, list emails having this subject. */
246-
subject?: string
247244
}
248245

249246
export type GetStatisticsRequest = {
@@ -252,18 +249,18 @@ export type GetStatisticsRequest = {
252249
* config.
253250
*/
254251
region?: Region
255-
/** Optional, count emails for this project. */
252+
/** Number of emails for this Project (optional). */
256253
projectId?: string
257254
/**
258-
* Optional, count emails send from this domain (must be coherent with the
259-
* `project_id` and the `organization_id`).
255+
* Number of emails sent from this domain (must be coherent with the
256+
* `project_id` and the `organization_id`) (optional).
260257
*/
261258
domainId?: string
262-
/** Optional, count emails created after this date. */
259+
/** Number of emails created after this date (optional). */
263260
since?: Date
264-
/** Optional, count emails created before this date. */
261+
/** Number of emails created before this date (optional). */
265262
until?: Date
266-
/** Optional, count emails sent with this `mail_from` sender's address. */
263+
/** Number of emails sent with this `mail_from` sender's address (optional). */
267264
mailFrom?: string
268265
}
269266

@@ -287,7 +284,7 @@ export type CreateDomainRequest = {
287284
projectId?: string
288285
/** Fully qualified domain dame. */
289286
domainName: string
290-
/** Accept the Scaleway Terms of Service. */
287+
/** Accept Scaleway's Terms of Service. */
291288
acceptTos: boolean
292289
}
293290

@@ -307,7 +304,7 @@ export type ListDomainsRequest = {
307304
* config.
308305
*/
309306
region?: Region
310-
/** Page number (1 for the first page). */
307+
/** Requested page number. Value must be greater or equal to 1. */
311308
page?: number
312309
/** Page size. */
313310
pageSize?: number
@@ -323,7 +320,7 @@ export type RevokeDomainRequest = {
323320
* config.
324321
*/
325322
region?: Region
326-
/** ID of the domain to revoke. */
323+
/** ID of the domain to delete. */
327324
domainId: string
328325
}
329326

0 commit comments

Comments
 (0)