@scaleway/sdk-mailbox 1.1.0 → 1.2.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.
@@ -1,3 +1,4 @@
1
+ //#region \0rolldown/runtime.js
1
2
  var __defProp = Object.defineProperty;
2
3
  var __exportAll = (all, no_symbols) => {
3
4
  let target = {};
@@ -8,4 +9,5 @@ var __exportAll = (all, no_symbols) => {
8
9
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
10
  return target;
10
11
  };
12
+ //#endregion
11
13
  export { __exportAll };
@@ -83,7 +83,7 @@ export declare class API extends ParentAPI {
83
83
  */
84
84
  waitForMailbox: (request: Readonly<GetMailboxRequest>, options?: Readonly<WaitForOptions<Mailbox>>) => Promise<Mailbox>;
85
85
  /**
86
- * Update a mailbox name, recovery email, subscription period or password with its ID.. Update a mailbox name, recovery email, subscription period or password with its ID.
86
+ * Update a mailbox subscription period or password with its ID.. Update a mailbox subscription period or password with its ID.
87
87
  *
88
88
  * @param request - The request {@link UpdateMailboxRequest}
89
89
  * @returns A Promise of Mailbox
@@ -1,13 +1,14 @@
1
1
  import { DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES } from "./content.gen.js";
2
2
  import { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox } from "./marshalling.gen.js";
3
- import { API, enrichForPagination, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
3
+ import { API as API$1, enrichForPagination, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1alpha1/api.gen.ts
4
5
  var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
6
  /**
6
7
  * Mailbox API.
7
8
 
8
9
  This API allows you to manage your Mailbox services.
9
10
  */
10
- var API$1 = class extends API {
11
+ var API = class extends API$1 {
11
12
  /**
12
13
  * Register a domain in a project.. You must specify a `project_id` and a `domain_name` to register a domain in a specific Project.
13
14
  *
@@ -113,7 +114,7 @@ var API$1 = class extends API {
113
114
  */
114
115
  waitForMailbox = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!MAILBOX_TRANSIENT_STATUSES.includes(res.status))), this.getMailbox, request, options);
115
116
  /**
116
- * Update a mailbox name, recovery email, subscription period or password with its ID.. Update a mailbox name, recovery email, subscription period or password with its ID.
117
+ * Update a mailbox subscription period or password with its ID.. Update a mailbox subscription period or password with its ID.
117
118
  *
118
119
  * @param request - The request {@link UpdateMailboxRequest}
119
120
  * @returns A Promise of Mailbox
@@ -147,4 +148,5 @@ var API$1 = class extends API {
147
148
  path: `/mailbox/v1alpha1/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}/restore`
148
149
  }, unmarshalMailbox);
149
150
  };
150
- export { API$1 as API };
151
+ //#endregion
152
+ export { API };
@@ -1,14 +1,15 @@
1
+ //#region src/v1alpha1/content.gen.ts
1
2
  /** Lists transient statutes of the enum {@link DomainRecordStatus}. */
2
- const DOMAIN_RECORD_TRANSIENT_STATUSES = ["validating"];
3
+ var DOMAIN_RECORD_TRANSIENT_STATUSES = ["validating"];
3
4
  /** Lists transient statutes of the enum {@link DomainStatus}. */
4
- const DOMAIN_TRANSIENT_STATUSES = [
5
+ var DOMAIN_TRANSIENT_STATUSES = [
5
6
  "creating",
6
7
  "validating",
7
8
  "provisioning",
8
9
  "deleting"
9
10
  ];
10
11
  /** Lists transient statutes of the enum {@link MailboxStatus}. */
11
- const MAILBOX_TRANSIENT_STATUSES = [
12
+ var MAILBOX_TRANSIENT_STATUSES = [
12
13
  "creating",
13
14
  "waiting_payment",
14
15
  "waiting_domain",
@@ -16,4 +17,5 @@ const MAILBOX_TRANSIENT_STATUSES = [
16
17
  "deleting",
17
18
  "restoring"
18
19
  ];
20
+ //#endregion
19
21
  export { DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES };
@@ -3,6 +3,7 @@ import { DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TR
3
3
  import { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox } from "./marshalling.gen.js";
4
4
  import { API } from "./api.gen.js";
5
5
  import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ //#region src/v1alpha1/index.gen.ts
6
7
  var index_gen_exports = /* @__PURE__ */ __exportAll({
7
8
  API: () => API,
8
9
  DOMAIN_RECORD_TRANSIENT_STATUSES: () => DOMAIN_RECORD_TRANSIENT_STATUSES,
@@ -19,4 +20,5 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
19
20
  unmarshalListMailboxesResponse: () => unmarshalListMailboxesResponse,
20
21
  unmarshalMailbox: () => unmarshalMailbox
21
22
  });
22
- export { index_gen_exports };
23
+ //#endregion
24
+ export { API, DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox };
@@ -1,23 +1,22 @@
1
1
  import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- const unmarshalMailbox = (data) => {
2
+ //#region src/v1alpha1/marshalling.gen.ts
3
+ var unmarshalMailbox = (data) => {
3
4
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`);
4
5
  return {
5
6
  createdAt: unmarshalDate(data.created_at),
6
7
  deletionScheduledAt: unmarshalDate(data.deletion_scheduled_at),
7
- displayName: data.display_name,
8
8
  domainId: data.domain_id,
9
9
  email: data.email,
10
10
  id: data.id,
11
11
  nextSubscriptionPeriod: data.next_subscription_period,
12
12
  nextSubscriptionPeriodStartsAt: unmarshalDate(data.next_subscription_period_starts_at),
13
- recoveryEmail: data.recovery_email,
14
13
  status: data.status,
15
14
  subscriptionPeriod: data.subscription_period,
16
15
  subscriptionPeriodStartedAt: unmarshalDate(data.subscription_period_started_at),
17
16
  updatedAt: unmarshalDate(data.updated_at)
18
17
  };
19
18
  };
20
- const unmarshalDomain = (data) => {
19
+ var unmarshalDomain = (data) => {
21
20
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
22
21
  return {
23
22
  createdAt: unmarshalDate(data.created_at),
@@ -34,7 +33,7 @@ const unmarshalDomain = (data) => {
34
33
  webmailUrl: data.webmail_url
35
34
  };
36
35
  };
37
- const unmarshalBatchCreateMailboxesResponse = (data) => {
36
+ var unmarshalBatchCreateMailboxesResponse = (data) => {
38
37
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BatchCreateMailboxesResponse' failed as data isn't a dictionary.`);
39
38
  return { mailboxes: unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox) };
40
39
  };
@@ -53,7 +52,7 @@ var unmarshalDomainRecord = (data) => {
53
52
  updatedAt: unmarshalDate(data.updated_at)
54
53
  };
55
54
  };
56
- const unmarshalGetDomainRecordsResponse = (data) => {
55
+ var unmarshalGetDomainRecordsResponse = (data) => {
57
56
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetDomainRecordsResponse' failed as data isn't a dictionary.`);
58
57
  return {
59
58
  autoconfig: data.autoconfig ? unmarshalDomainRecord(data.autoconfig) : void 0,
@@ -71,14 +70,14 @@ const unmarshalGetDomainRecordsResponse = (data) => {
71
70
  submission: data.submission ? unmarshalDomainRecord(data.submission) : void 0
72
71
  };
73
72
  };
74
- const unmarshalListDomainsResponse = (data) => {
73
+ var unmarshalListDomainsResponse = (data) => {
75
74
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
76
75
  return {
77
76
  domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
78
77
  totalCount: data.total_count
79
78
  };
80
79
  };
81
- const unmarshalListMailboxesResponse = (data) => {
80
+ var unmarshalListMailboxesResponse = (data) => {
82
81
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`);
83
82
  return {
84
83
  mailboxes: unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),
@@ -86,24 +85,21 @@ const unmarshalListMailboxesResponse = (data) => {
86
85
  };
87
86
  };
88
87
  var marshalBatchCreateMailboxesRequestMailboxParameters = (request, defaults) => ({
89
- display_name: request.displayName,
90
88
  local_part: request.localPart,
91
- password: request.password,
92
- recovery_email: request.recoveryEmail
89
+ password: request.password
93
90
  });
94
- const marshalBatchCreateMailboxesRequest = (request, defaults) => ({
91
+ var marshalBatchCreateMailboxesRequest = (request, defaults) => ({
95
92
  domain_id: request.domainId,
96
93
  mailboxes: request.mailboxes !== void 0 ? request.mailboxes.map((elt) => marshalBatchCreateMailboxesRequestMailboxParameters(elt, defaults)) : void 0,
97
94
  subscription_period: request.subscriptionPeriod
98
95
  });
99
- const marshalCreateDomainRequest = (request, defaults) => ({
96
+ var marshalCreateDomainRequest = (request, defaults) => ({
100
97
  name: request.name,
101
98
  project_id: request.projectId ?? defaults.defaultProjectId
102
99
  });
103
- const marshalUpdateMailboxRequest = (request, defaults) => ({
104
- display_name: request.displayName,
100
+ var marshalUpdateMailboxRequest = (request, defaults) => ({
105
101
  new_password: request.newPassword,
106
- recovery_email: request.recoveryEmail,
107
102
  subscription_period: request.subscriptionPeriod
108
103
  });
104
+ //#endregion
109
105
  export { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox };
@@ -0,0 +1,61 @@
1
+ export declare const queriesMetadata: {
2
+ readonly namespace: "mailbox";
3
+ readonly version: "v1alpha1";
4
+ readonly folderName: "mailboxv1alpha1";
5
+ readonly services: readonly [{
6
+ readonly apiClass: "API";
7
+ readonly methods: readonly [{
8
+ readonly methodName: "listDomains";
9
+ readonly protoName: "ListDomains";
10
+ readonly paramsType: "ListDomainsRequest";
11
+ readonly returnType: "ListDomainsResponse";
12
+ readonly isList: true;
13
+ readonly paginationType: "offset";
14
+ readonly pageParamKey: "page";
15
+ readonly listItemType: "Domain";
16
+ readonly isPrivate: false;
17
+ readonly description: "\"";
18
+ }, {
19
+ readonly methodName: "getDomain";
20
+ readonly protoName: "GetDomain";
21
+ readonly paramsType: "GetDomainRequest";
22
+ readonly returnType: "Domain";
23
+ readonly isList: false;
24
+ readonly paginationType: "none";
25
+ readonly isPrivate: false;
26
+ readonly description: "\"";
27
+ readonly hasWaiter: true;
28
+ }, {
29
+ readonly methodName: "getDomainRecords";
30
+ readonly protoName: "GetDomainRecords";
31
+ readonly paramsType: "GetDomainRecordsRequest";
32
+ readonly returnType: "GetDomainRecordsResponse";
33
+ readonly isList: false;
34
+ readonly paginationType: "none";
35
+ readonly isPrivate: false;
36
+ readonly description: "\"";
37
+ }, {
38
+ readonly methodName: "listMailboxes";
39
+ readonly protoName: "ListMailboxes";
40
+ readonly paramsType: "ListMailboxesRequest";
41
+ readonly returnType: "ListMailboxesResponse";
42
+ readonly isList: true;
43
+ readonly paginationType: "offset";
44
+ readonly pageParamKey: "page";
45
+ readonly listItemType: "Mailbox";
46
+ readonly isPrivate: false;
47
+ readonly description: "\"";
48
+ }, {
49
+ readonly methodName: "getMailbox";
50
+ readonly protoName: "GetMailbox";
51
+ readonly paramsType: "GetMailboxRequest";
52
+ readonly returnType: "Mailbox";
53
+ readonly isList: false;
54
+ readonly paginationType: "none";
55
+ readonly isPrivate: false;
56
+ readonly description: "\"";
57
+ readonly hasWaiter: true;
58
+ }];
59
+ }];
60
+ };
61
+ export type QueriesMetadata = typeof queriesMetadata;
@@ -0,0 +1,69 @@
1
+ //#region src/v1alpha1/metadata.gen.ts
2
+ var queriesMetadata = {
3
+ namespace: "mailbox",
4
+ version: "v1alpha1",
5
+ folderName: "mailboxv1alpha1",
6
+ services: [{
7
+ apiClass: "API",
8
+ methods: [
9
+ {
10
+ methodName: "listDomains",
11
+ protoName: "ListDomains",
12
+ paramsType: "ListDomainsRequest",
13
+ returnType: "ListDomainsResponse",
14
+ isList: true,
15
+ paginationType: "offset",
16
+ pageParamKey: "page",
17
+ listItemType: "Domain",
18
+ isPrivate: false,
19
+ description: "\""
20
+ },
21
+ {
22
+ methodName: "getDomain",
23
+ protoName: "GetDomain",
24
+ paramsType: "GetDomainRequest",
25
+ returnType: "Domain",
26
+ isList: false,
27
+ paginationType: "none",
28
+ isPrivate: false,
29
+ description: "\"",
30
+ hasWaiter: true
31
+ },
32
+ {
33
+ methodName: "getDomainRecords",
34
+ protoName: "GetDomainRecords",
35
+ paramsType: "GetDomainRecordsRequest",
36
+ returnType: "GetDomainRecordsResponse",
37
+ isList: false,
38
+ paginationType: "none",
39
+ isPrivate: false,
40
+ description: "\""
41
+ },
42
+ {
43
+ methodName: "listMailboxes",
44
+ protoName: "ListMailboxes",
45
+ paramsType: "ListMailboxesRequest",
46
+ returnType: "ListMailboxesResponse",
47
+ isList: true,
48
+ paginationType: "offset",
49
+ pageParamKey: "page",
50
+ listItemType: "Mailbox",
51
+ isPrivate: false,
52
+ description: "\""
53
+ },
54
+ {
55
+ methodName: "getMailbox",
56
+ protoName: "GetMailbox",
57
+ paramsType: "GetMailboxRequest",
58
+ returnType: "Mailbox",
59
+ isList: false,
60
+ paginationType: "none",
61
+ isPrivate: false,
62
+ description: "\"",
63
+ hasWaiter: true
64
+ }
65
+ ]
66
+ }]
67
+ };
68
+ //#endregion
69
+ export { queriesMetadata };
@@ -9,8 +9,6 @@ export type MailboxSubscriptionPeriod = 'unknown_subscription_period' | 'cancele
9
9
  export interface BatchCreateMailboxesRequestMailboxParameters {
10
10
  localPart: string;
11
11
  password: string;
12
- displayName?: string;
13
- recoveryEmail?: string;
14
12
  }
15
13
  export interface Mailbox {
16
14
  /**
@@ -21,18 +19,10 @@ export interface Mailbox {
21
19
  * ID of the domain to which the mailbox belongs.
22
20
  */
23
21
  domainId: string;
24
- /**
25
- * Name of the mailbox.
26
- */
27
- displayName: string;
28
22
  /**
29
23
  * Email address of the mailbox as local_part@domain.
30
24
  */
31
25
  email: string;
32
- /**
33
- * Recovery email for the mailbox.
34
- */
35
- recoveryEmail: string;
36
26
  /**
37
27
  * Status of the mailbox.
38
28
  */
@@ -337,14 +327,6 @@ export type UpdateMailboxRequest = {
337
327
  * ID of the mailbox to update.
338
328
  */
339
329
  mailboxId: string;
340
- /**
341
- * (Optional) New display name of the mailbox.
342
- */
343
- displayName?: string;
344
- /**
345
- * (Optional) New recovery email for the mailbox.
346
- */
347
- recoveryEmail?: string;
348
330
  /**
349
331
  * (Optional) New subscription period for the mailbox.
350
332
  */
File without changes
@@ -1,8 +1,4 @@
1
1
  export declare const BatchCreateMailboxesRequestMailboxParameters: {
2
- displayName: {
3
- maxLength: number;
4
- minLength: number;
5
- };
6
2
  localPart: {
7
3
  maxLength: number;
8
4
  minLength: number;
@@ -11,10 +7,6 @@ export declare const BatchCreateMailboxesRequestMailboxParameters: {
11
7
  maxLength: number;
12
8
  minLength: number;
13
9
  };
14
- recoveryEmail: {
15
- maxLength: number;
16
- minLength: number;
17
- };
18
10
  };
19
11
  export declare const CreateDomainRequest: {
20
12
  name: {
@@ -41,16 +33,8 @@ export declare const ListMailboxesRequest: {
41
33
  };
42
34
  };
43
35
  export declare const UpdateMailboxRequest: {
44
- displayName: {
45
- maxLength: number;
46
- minLength: number;
47
- };
48
36
  newPassword: {
49
37
  maxLength: number;
50
38
  minLength: number;
51
39
  };
52
- recoveryEmail: {
53
- maxLength: number;
54
- minLength: number;
55
- };
56
40
  };
@@ -1,4 +1,5 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/v1alpha1/validation-rules.gen.ts
2
3
  var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
4
  BatchCreateMailboxesRequestMailboxParameters: () => BatchCreateMailboxesRequestMailboxParameters,
4
5
  CreateDomainRequest: () => CreateDomainRequest,
@@ -6,11 +7,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
6
7
  ListMailboxesRequest: () => ListMailboxesRequest,
7
8
  UpdateMailboxRequest: () => UpdateMailboxRequest
8
9
  });
9
- const BatchCreateMailboxesRequestMailboxParameters = {
10
- displayName: {
11
- maxLength: 64,
12
- minLength: 1
13
- },
10
+ var BatchCreateMailboxesRequestMailboxParameters = {
14
11
  localPart: {
15
12
  maxLength: 64,
16
13
  minLength: 1
@@ -18,42 +15,29 @@ const BatchCreateMailboxesRequestMailboxParameters = {
18
15
  password: {
19
16
  maxLength: 128,
20
17
  minLength: 12
21
- },
22
- recoveryEmail: {
23
- maxLength: 320,
24
- minLength: 6
25
18
  }
26
19
  };
27
- const CreateDomainRequest = { name: {
20
+ var CreateDomainRequest = { name: {
28
21
  maxLength: 253,
29
22
  minLength: 1
30
23
  } };
31
- const ListDomainsRequest = {
24
+ var ListDomainsRequest = {
32
25
  page: { greaterThanOrEqual: 1 },
33
26
  pageSize: {
34
27
  greaterThanOrEqual: 1,
35
28
  lessThanOrEqual: 1e3
36
29
  }
37
30
  };
38
- const ListMailboxesRequest = {
31
+ var ListMailboxesRequest = {
39
32
  page: { greaterThanOrEqual: 1 },
40
33
  pageSize: {
41
34
  greaterThanOrEqual: 1,
42
35
  lessThanOrEqual: 1e3
43
36
  }
44
37
  };
45
- const UpdateMailboxRequest = {
46
- displayName: {
47
- maxLength: 64,
48
- minLength: 1
49
- },
50
- newPassword: {
51
- maxLength: 128,
52
- minLength: 12
53
- },
54
- recoveryEmail: {
55
- maxLength: 320,
56
- minLength: 6
57
- }
58
- };
59
- export { validation_rules_gen_exports };
38
+ var UpdateMailboxRequest = { newPassword: {
39
+ maxLength: 128,
40
+ minLength: 12
41
+ } };
42
+ //#endregion
43
+ export { BatchCreateMailboxesRequestMailboxParameters, CreateDomainRequest, ListDomainsRequest, ListMailboxesRequest, UpdateMailboxRequest, validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-mailbox",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Scaleway SDK mailbox",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "node": ">=20.18.3"
27
27
  },
28
28
  "dependencies": {
29
- "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.2.1"
29
+ "@scaleway/random-name": "5.1.4",
30
+ "@scaleway/sdk-std": "2.2.2"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.2.1"
33
+ "@scaleway/sdk-client": "^2.2.2"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.2.1"
36
+ "@scaleway/sdk-client": "^2.2.2"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",