@scaleway/sdk-mailbox 1.19.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,37 +4,37 @@ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/s
4
4
  const unmarshalMailbox = (data) => {
5
5
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`);
6
6
  return {
7
- createdAt: unmarshalDate(data.created_at),
8
- deletionScheduledAt: unmarshalDate(data.deletion_scheduled_at),
7
+ createdAt: unmarshalDate(data.created_at) ?? null,
8
+ deletionScheduledAt: unmarshalDate(data.deletion_scheduled_at) ?? null,
9
9
  domainId: data.domain_id,
10
10
  email: data.email,
11
11
  id: data.id,
12
12
  nextSubscriptionPeriod: data.next_subscription_period,
13
- nextSubscriptionPeriodStartsAt: unmarshalDate(data.next_subscription_period_starts_at),
13
+ nextSubscriptionPeriodStartsAt: unmarshalDate(data.next_subscription_period_starts_at) ?? null,
14
14
  organizationId: data.organization_id,
15
15
  projectId: data.project_id,
16
16
  status: data.status,
17
17
  subscriptionPeriod: data.subscription_period,
18
- subscriptionPeriodStartedAt: unmarshalDate(data.subscription_period_started_at),
19
- updatedAt: unmarshalDate(data.updated_at)
18
+ subscriptionPeriodStartedAt: unmarshalDate(data.subscription_period_started_at) ?? null,
19
+ updatedAt: unmarshalDate(data.updated_at) ?? null
20
20
  };
21
21
  };
22
22
  const unmarshalAlias = (data) => {
23
23
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Alias' failed as data isn't a dictionary.`);
24
24
  return {
25
- createdAt: unmarshalDate(data.created_at),
25
+ createdAt: unmarshalDate(data.created_at) ?? null,
26
26
  description: data.description,
27
27
  email: data.email,
28
28
  id: data.id,
29
29
  mailboxId: data.mailbox_id,
30
30
  status: data.status,
31
- updatedAt: unmarshalDate(data.updated_at)
31
+ updatedAt: unmarshalDate(data.updated_at) ?? null
32
32
  };
33
33
  };
34
34
  const unmarshalDomain = (data) => {
35
35
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
36
36
  return {
37
- createdAt: unmarshalDate(data.created_at),
37
+ createdAt: unmarshalDate(data.created_at) ?? null,
38
38
  id: data.id,
39
39
  imapUrl: data.imap_url,
40
40
  mailboxTotalCount: data.mailbox_total_count,
@@ -44,19 +44,19 @@ const unmarshalDomain = (data) => {
44
44
  projectId: data.project_id,
45
45
  smtpUrl: data.smtp_url,
46
46
  status: data.status,
47
- updatedAt: unmarshalDate(data.updated_at),
47
+ updatedAt: unmarshalDate(data.updated_at) ?? null,
48
48
  webmailUrl: data.webmail_url
49
49
  };
50
50
  };
51
51
  const unmarshalForwarding = (data) => {
52
52
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Forwarding' failed as data isn't a dictionary.`);
53
53
  return {
54
- createdAt: unmarshalDate(data.created_at),
54
+ createdAt: unmarshalDate(data.created_at) ?? null,
55
55
  email: data.email,
56
56
  id: data.id,
57
57
  mailboxId: data.mailbox_id,
58
58
  status: data.status,
59
- updatedAt: unmarshalDate(data.updated_at)
59
+ updatedAt: unmarshalDate(data.updated_at) ?? null
60
60
  };
61
61
  };
62
62
  const unmarshalBatchCreateMailboxesResponse = (data) => {
@@ -66,33 +66,33 @@ const unmarshalBatchCreateMailboxesResponse = (data) => {
66
66
  const unmarshalDomainRecord = (data) => {
67
67
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.`);
68
68
  return {
69
- createdAt: unmarshalDate(data.created_at),
69
+ createdAt: unmarshalDate(data.created_at) ?? null,
70
70
  dnsName: data.dns_name,
71
71
  dnsType: data.dns_type,
72
72
  dnsValue: data.dns_value,
73
73
  domainId: data.domain_id,
74
- error: data.error,
74
+ error: data.error ?? null,
75
75
  id: data.id,
76
76
  level: data.level,
77
77
  status: data.status,
78
- updatedAt: unmarshalDate(data.updated_at)
78
+ updatedAt: unmarshalDate(data.updated_at) ?? null
79
79
  };
80
80
  };
81
81
  const unmarshalGetDomainRecordsResponse = (data) => {
82
82
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetDomainRecordsResponse' failed as data isn't a dictionary.`);
83
83
  return {
84
- autoconfig: data.autoconfig ? unmarshalDomainRecord(data.autoconfig) : void 0,
85
- autodiscover: data.autodiscover ? unmarshalDomainRecord(data.autodiscover) : void 0,
86
- caldav: data.caldav ? unmarshalDomainRecord(data.caldav) : void 0,
87
- carddav: data.carddav ? unmarshalDomainRecord(data.carddav) : void 0,
88
- dkim: data.dkim ? unmarshalDomainRecord(data.dkim) : void 0,
89
- dmarc: data.dmarc ? unmarshalDomainRecord(data.dmarc) : void 0,
90
- domainValidation: data.domain_validation ? unmarshalDomainRecord(data.domain_validation) : void 0,
91
- imap: data.imap ? unmarshalDomainRecord(data.imap) : void 0,
92
- mx: data.mx ? unmarshalDomainRecord(data.mx) : void 0,
93
- pop3: data.pop3 ? unmarshalDomainRecord(data.pop3) : void 0,
94
- spf: data.spf ? unmarshalDomainRecord(data.spf) : void 0,
95
- submission: data.submission ? unmarshalDomainRecord(data.submission) : void 0
84
+ autoconfig: data.autoconfig ? unmarshalDomainRecord(data.autoconfig) : null,
85
+ autodiscover: data.autodiscover ? unmarshalDomainRecord(data.autodiscover) : null,
86
+ caldav: data.caldav ? unmarshalDomainRecord(data.caldav) : null,
87
+ carddav: data.carddav ? unmarshalDomainRecord(data.carddav) : null,
88
+ dkim: data.dkim ? unmarshalDomainRecord(data.dkim) : null,
89
+ dmarc: data.dmarc ? unmarshalDomainRecord(data.dmarc) : null,
90
+ domainValidation: data.domain_validation ? unmarshalDomainRecord(data.domain_validation) : null,
91
+ imap: data.imap ? unmarshalDomainRecord(data.imap) : null,
92
+ mx: data.mx ? unmarshalDomainRecord(data.mx) : null,
93
+ pop3: data.pop3 ? unmarshalDomainRecord(data.pop3) : null,
94
+ spf: data.spf ? unmarshalDomainRecord(data.spf) : null,
95
+ submission: data.submission ? unmarshalDomainRecord(data.submission) : null
96
96
  };
97
97
  };
98
98
  const unmarshalListAliasesResponse = (data) => {
@@ -126,11 +126,11 @@ const unmarshalListMailboxesResponse = (data) => {
126
126
  const unmarshalMailboxForwarding = (data) => {
127
127
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'MailboxForwarding' failed as data isn't a dictionary.`);
128
128
  return {
129
- createdAt: unmarshalDate(data.created_at),
129
+ createdAt: unmarshalDate(data.created_at) ?? null,
130
130
  enabled: data.enabled,
131
131
  keepCopy: data.keep_copy,
132
132
  mailboxId: data.mailbox_id,
133
- updatedAt: unmarshalDate(data.updated_at)
133
+ updatedAt: unmarshalDate(data.updated_at) ?? null
134
134
  };
135
135
  };
136
136
  const marshalBatchCreateMailboxesRequestMailboxParameters = (request, defaults) => ({
@@ -139,7 +139,7 @@ const marshalBatchCreateMailboxesRequestMailboxParameters = (request, defaults)
139
139
  });
140
140
  const marshalBatchCreateMailboxesRequest = (request, defaults) => ({
141
141
  domain_id: request.domainId,
142
- mailboxes: request.mailboxes !== void 0 ? request.mailboxes.map((elt) => marshalBatchCreateMailboxesRequestMailboxParameters(elt, defaults)) : void 0,
142
+ mailboxes: request.mailboxes != null ? request.mailboxes.map((elt) => marshalBatchCreateMailboxesRequestMailboxParameters(elt, defaults)) : void 0,
143
143
  subscription_period: request.subscriptionPeriod
144
144
  });
145
145
  const marshalCreateAliasRequest = (request, defaults) => ({
@@ -47,7 +47,7 @@ export interface Mailbox {
47
47
  /**
48
48
  * Date and time of subscription period start.
49
49
  */
50
- subscriptionPeriodStartedAt?: Date;
50
+ subscriptionPeriodStartedAt?: Date | null;
51
51
  /**
52
52
  * Next subscription renewal period, it can be monthly or yearly or canceled if the subscription has been canceled.
53
53
  */
@@ -55,19 +55,19 @@ export interface Mailbox {
55
55
  /**
56
56
  * Date and time when the next subscription period starts.
57
57
  */
58
- nextSubscriptionPeriodStartsAt?: Date;
58
+ nextSubscriptionPeriodStartsAt?: Date | null;
59
59
  /**
60
60
  * Date and time of mailbox creation.
61
61
  */
62
- createdAt?: Date;
62
+ createdAt?: Date | null;
63
63
  /**
64
64
  * Date and time when the mailbox was last updated.
65
65
  */
66
- updatedAt?: Date;
66
+ updatedAt?: Date | null;
67
67
  /**
68
68
  * Date and time of the unrecoverable mailbox deletion.
69
69
  */
70
- deletionScheduledAt?: Date;
70
+ deletionScheduledAt?: Date | null;
71
71
  }
72
72
  export interface DomainRecord {
73
73
  /**
@@ -101,15 +101,15 @@ export interface DomainRecord {
101
101
  /**
102
102
  * Error associated in case the record is not valid.
103
103
  */
104
- error?: string;
104
+ error?: string | null;
105
105
  /**
106
106
  * Date and time of record creation.
107
107
  */
108
- createdAt?: Date;
108
+ createdAt?: Date | null;
109
109
  /**
110
110
  * Date and time of record last updated.
111
111
  */
112
- updatedAt?: Date;
112
+ updatedAt?: Date | null;
113
113
  }
114
114
  export interface Alias {
115
115
  /**
@@ -135,11 +135,11 @@ export interface Alias {
135
135
  /**
136
136
  * Date and time of alias creation.
137
137
  */
138
- createdAt?: Date;
138
+ createdAt?: Date | null;
139
139
  /**
140
140
  * Date and time when the alias was last updated.
141
141
  */
142
- updatedAt?: Date;
142
+ updatedAt?: Date | null;
143
143
  }
144
144
  export interface Domain {
145
145
  /**
@@ -169,11 +169,11 @@ export interface Domain {
169
169
  /**
170
170
  * Date and time of domain creation.
171
171
  */
172
- createdAt?: Date;
172
+ createdAt?: Date | null;
173
173
  /**
174
174
  * Date and time of the domain's last update.
175
175
  */
176
- updatedAt?: Date;
176
+ updatedAt?: Date | null;
177
177
  /**
178
178
  * URL of the domain's webmail.
179
179
  */
@@ -199,11 +199,11 @@ export interface Forwarding {
199
199
  /**
200
200
  * Date and time of forwarding rule creation.
201
201
  */
202
- createdAt?: Date;
202
+ createdAt?: Date | null;
203
203
  /**
204
204
  * Date and time when the forwarding rule was last updated.
205
205
  */
206
- updatedAt?: Date;
206
+ updatedAt?: Date | null;
207
207
  /**
208
208
  * ID of the mailbox to which the forwarding rule belongs.
209
209
  */
@@ -221,7 +221,7 @@ export type BatchCreateMailboxesRequest = {
221
221
  /**
222
222
  * Parameters for the mailboxes to create.
223
223
  */
224
- mailboxes?: BatchCreateMailboxesRequestMailboxParameters[];
224
+ mailboxes?: BatchCreateMailboxesRequestMailboxParameters[] | null;
225
225
  /**
226
226
  * ID of the domain in which to create the mailboxes.
227
227
  */
@@ -229,7 +229,7 @@ export type BatchCreateMailboxesRequest = {
229
229
  /**
230
230
  * Subscription renewal period, it can be monthly or yearly.
231
231
  */
232
- subscriptionPeriod?: MailboxSubscriptionPeriod;
232
+ subscriptionPeriod?: MailboxSubscriptionPeriod | null;
233
233
  };
234
234
  export interface BatchCreateMailboxesResponse {
235
235
  /**
@@ -249,13 +249,13 @@ export type CreateAliasRequest = {
249
249
  /**
250
250
  * (Optional) Description of the alias.
251
251
  */
252
- description?: string;
252
+ description?: string | null;
253
253
  };
254
254
  export type CreateDomainRequest = {
255
255
  /**
256
256
  * ID of the project to which the domain belongs.
257
257
  */
258
- projectId?: string;
258
+ projectId?: string | null;
259
259
  /**
260
260
  * Fully qualified domain name.
261
261
  */
@@ -311,51 +311,51 @@ export interface GetDomainRecordsResponse {
311
311
  /**
312
312
  * Record designed to automatically configure an email client with the appropriate mail server settings using a standardized XML file format.
313
313
  */
314
- autoconfig?: DomainRecord;
314
+ autoconfig?: DomainRecord | null;
315
315
  /**
316
316
  * Record designed to automate the discovery of server settings to configure email clients like Outlook.
317
317
  */
318
- autodiscover?: DomainRecord;
318
+ autodiscover?: DomainRecord | null;
319
319
  /**
320
320
  * Record that allows clients to interact with calendar data stored on a server.
321
321
  */
322
- caldav?: DomainRecord;
322
+ caldav?: DomainRecord | null;
323
323
  /**
324
324
  * Record that allows clients to interact with contact data stored on a server.
325
325
  */
326
- carddav?: DomainRecord;
326
+ carddav?: DomainRecord | null;
327
327
  /**
328
328
  * Record that allows the DKIM email authentication method to be employed to verify the authenticity of an email message.
329
329
  */
330
- dkim?: DomainRecord;
330
+ dkim?: DomainRecord | null;
331
331
  /**
332
332
  * Record that provides a mechanism for email receivers to determine if incoming messages are legitimate and were sent from authorized sources.
333
333
  */
334
- dmarc?: DomainRecord;
334
+ dmarc?: DomainRecord | null;
335
335
  /**
336
336
  * Record that provides a unique token to validate a domain ownership.
337
337
  */
338
- domainValidation?: DomainRecord;
338
+ domainValidation?: DomainRecord | null;
339
339
  /**
340
340
  * Record that allows accessing the mailbox with the IMAP protocol.
341
341
  */
342
- imap?: DomainRecord;
342
+ imap?: DomainRecord | null;
343
343
  /**
344
344
  * Record that directs emails to a mail server.
345
345
  */
346
- mx?: DomainRecord;
346
+ mx?: DomainRecord | null;
347
347
  /**
348
348
  * Record that allows accessing the mailbox with the POP3 protocol.
349
349
  */
350
- pop3?: DomainRecord;
350
+ pop3?: DomainRecord | null;
351
351
  /**
352
352
  * Record that lists all the servers authorized to send emails from a particular domain.
353
353
  */
354
- spf?: DomainRecord;
354
+ spf?: DomainRecord | null;
355
355
  /**
356
356
  * Record that allows the use of the SMTP submission mechanism.
357
357
  */
358
- submission?: DomainRecord;
358
+ submission?: DomainRecord | null;
359
359
  }
360
360
  export type GetDomainRequest = {
361
361
  /**
@@ -385,27 +385,27 @@ export type ListAliasesRequest = {
385
385
  /**
386
386
  * Order aliases by specific criteria.
387
387
  */
388
- orderBy?: ListAliasesRequestOrderBy;
388
+ orderBy?: ListAliasesRequestOrderBy | null;
389
389
  /**
390
390
  * Requested page number. Value must be greater or equal to 1.
391
391
  */
392
- page?: number;
392
+ page?: number | null;
393
393
  /**
394
394
  * Requested page size. Value must be between 1 and 100.
395
395
  */
396
- pageSize?: number;
396
+ pageSize?: number | null;
397
397
  /**
398
398
  * ID of the mailbox for which to list aliases.
399
399
  */
400
- mailboxId?: string;
400
+ mailboxId?: string | null;
401
401
  /**
402
402
  * (Optional) Filter aliases by their status.
403
403
  */
404
- status?: AliasStatus;
404
+ status?: AliasStatus | null;
405
405
  /**
406
406
  * Project ID to filter on.
407
407
  */
408
- projectId?: string;
408
+ projectId?: string | null;
409
409
  };
410
410
  export interface ListAliasesResponse {
411
411
  /**
@@ -418,12 +418,12 @@ export interface ListAliasesResponse {
418
418
  aliases: Alias[];
419
419
  }
420
420
  export type ListDomainsRequest = {
421
- orderBy?: ListDomainsRequestOrderBy;
422
- page?: number;
423
- pageSize?: number;
424
- projectId?: string;
425
- statuses?: DomainStatus[];
426
- search?: string;
421
+ orderBy?: ListDomainsRequestOrderBy | null;
422
+ page?: number | null;
423
+ pageSize?: number | null;
424
+ projectId?: string | null;
425
+ statuses?: DomainStatus[] | null;
426
+ search?: string | null;
427
427
  };
428
428
  export interface ListDomainsResponse {
429
429
  /**
@@ -439,35 +439,35 @@ export type ListForwardingsRequest = {
439
439
  /**
440
440
  * Order forwardings by specific criteria.
441
441
  */
442
- orderBy?: ListForwardingsRequestOrderBy;
442
+ orderBy?: ListForwardingsRequestOrderBy | null;
443
443
  /**
444
444
  * Requested page number. Value must be greater or equal to 1.
445
445
  */
446
- page?: number;
446
+ page?: number | null;
447
447
  /**
448
448
  * Requested page size. Value must be between 1 and 100.
449
449
  */
450
- pageSize?: number;
450
+ pageSize?: number | null;
451
451
  /**
452
452
  * (Optional) ID of the mailbox for which to list forwarding rules.
453
453
  */
454
- mailboxId?: string;
454
+ mailboxId?: string | null;
455
455
  /**
456
456
  * (Optional) Filter forwarding rules by their status.
457
457
  */
458
- status?: ForwardingStatus;
458
+ status?: ForwardingStatus | null;
459
459
  /**
460
460
  * ID of the Project to filter on.
461
461
  *
462
462
  * One-of ('scope'): at most one of 'projectId', 'organizationId' could be set.
463
463
  */
464
- projectId?: string;
464
+ projectId?: string | null;
465
465
  /**
466
466
  * ID of the Organization to filter on.
467
467
  *
468
468
  * One-of ('scope'): at most one of 'projectId', 'organizationId' could be set.
469
469
  */
470
- organizationId?: string;
470
+ organizationId?: string | null;
471
471
  };
472
472
  export interface ListForwardingsResponse {
473
473
  /**
@@ -483,31 +483,31 @@ export type ListMailboxesRequest = {
483
483
  /**
484
484
  * Order matching mailbox by different criteria.
485
485
  */
486
- orderBy?: ListMailboxesRequestOrderBy;
486
+ orderBy?: ListMailboxesRequestOrderBy | null;
487
487
  /**
488
488
  * Requested page number. Value must be greater or equal to 1.
489
489
  */
490
- page?: number;
490
+ page?: number | null;
491
491
  /**
492
492
  * Requested page size. Value must be between 1 and 1000.
493
493
  */
494
- pageSize?: number;
494
+ pageSize?: number | null;
495
495
  /**
496
496
  * (Optional) ID of the domain in which to list the mailboxes.
497
497
  */
498
- domainId?: string;
498
+ domainId?: string | null;
499
499
  /**
500
500
  * (Optional) Filter mailboxes by their statuses.
501
501
  */
502
- statuses?: MailboxStatus[];
502
+ statuses?: MailboxStatus[] | null;
503
503
  /**
504
504
  * (Optional) Search term to filter mailboxes on name and local_part.
505
505
  */
506
- search?: string;
506
+ search?: string | null;
507
507
  /**
508
508
  * (Optional) Project ID to filter mailboxes on.
509
509
  */
510
- projectId?: string;
510
+ projectId?: string | null;
511
511
  };
512
512
  export interface ListMailboxesResponse {
513
513
  /**
@@ -535,11 +535,11 @@ export interface MailboxForwarding {
535
535
  /**
536
536
  * Date and time of the forwarding settings creation.
537
537
  */
538
- createdAt?: Date;
538
+ createdAt?: Date | null;
539
539
  /**
540
540
  * Date and time when the forwarding settings were last updated.
541
541
  */
542
- updatedAt?: Date;
542
+ updatedAt?: Date | null;
543
543
  }
544
544
  export type RestoreMailboxRequest = {
545
545
  /**
@@ -555,7 +555,7 @@ export type UpdateAliasRequest = {
555
555
  /**
556
556
  * (Optional) Description of the alias.
557
557
  */
558
- description?: string;
558
+ description?: string | null;
559
559
  };
560
560
  export type UpdateForwardingRequest = {
561
561
  /**
@@ -565,7 +565,7 @@ export type UpdateForwardingRequest = {
565
565
  /**
566
566
  * (Optional) New destination email address for the forwarding rule. Must not be the same as the mailbox's own email address.
567
567
  */
568
- email?: string;
568
+ email?: string | null;
569
569
  };
570
570
  export type UpdateMailboxForwardingRequest = {
571
571
  /**
@@ -575,11 +575,11 @@ export type UpdateMailboxForwardingRequest = {
575
575
  /**
576
576
  * (Optional) Whether to keep a copy of forwarded emails in the local mailbox.
577
577
  */
578
- keepCopy?: boolean;
578
+ keepCopy?: boolean | null;
579
579
  /**
580
580
  * (Optional) Enable or disable forwarding for the mailbox.
581
581
  */
582
- enabled?: boolean;
582
+ enabled?: boolean | null;
583
583
  };
584
584
  export type UpdateMailboxRequest = {
585
585
  /**
@@ -589,11 +589,11 @@ export type UpdateMailboxRequest = {
589
589
  /**
590
590
  * (Optional) New subscription period for the mailbox.
591
591
  */
592
- subscriptionPeriod?: MailboxSubscriptionPeriod;
592
+ subscriptionPeriod?: MailboxSubscriptionPeriod | null;
593
593
  /**
594
594
  * (Optional) New password of the mailbox.
595
595
  */
596
- newPassword?: string;
596
+ newPassword?: string | null;
597
597
  };
598
598
  export type ValidateDomainRecordsRequest = {
599
599
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-mailbox",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Scaleway SDK mailbox",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@scaleway/random-name": "6.0.2",
36
- "@scaleway/sdk-std": "2.9.5"
36
+ "@scaleway/sdk-std": "2.9.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@repo/configs": "^0.1.1",
40
- "@scaleway/sdk-client": "^2.16.0"
40
+ "@scaleway/sdk-client": "^2.17.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@scaleway/sdk-client": "^2.16.0"
43
+ "@scaleway/sdk-client": "^2.17.0"
44
44
  },
45
45
  "scripts": {
46
46
  "package:check": "pnpm publint",