@scaleway/sdk-mailbox 1.4.2 → 1.6.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.
- package/dist/v1alpha1/api.gen.d.ts +52 -1
- package/dist/v1alpha1/api.gen.js +24 -3
- package/dist/v1alpha1/content.gen.d.ts +3 -1
- package/dist/v1alpha1/content.gen.js +3 -1
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +7 -3
- package/dist/v1alpha1/marshalling.gen.d.ts +4 -1
- package/dist/v1alpha1/marshalling.gen.js +25 -1
- package/dist/v1alpha1/metadata.gen.d.ts +21 -0
- package/dist/v1alpha1/metadata.gen.js +23 -0
- package/dist/v1alpha1/types.gen.d.ts +101 -0
- package/dist/v1alpha1/validation-rules.gen.d.ts +18 -0
- package/dist/v1alpha1/validation-rules.gen.js +17 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
2
|
import type { WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import type { BatchCreateMailboxesRequest, BatchCreateMailboxesResponse, CreateDomainRequest, DeleteDomainRequest, DeleteMailboxRequest, Domain, GetDomainRecordsRequest, GetDomainRecordsResponse, GetDomainRequest, GetMailboxRequest, ListDomainsRequest, ListDomainsResponse, ListMailboxesRequest, ListMailboxesResponse, Mailbox, RestoreMailboxRequest, UpdateMailboxRequest, ValidateDomainRecordsRequest } from './types.gen.js';
|
|
3
|
+
import type { Alias, BatchCreateMailboxesRequest, BatchCreateMailboxesResponse, CreateAliasRequest, CreateDomainRequest, DeleteAliasRequest, DeleteDomainRequest, DeleteMailboxRequest, Domain, GetAliasRequest, GetDomainRecordsRequest, GetDomainRecordsResponse, GetDomainRequest, GetMailboxRequest, ListAliasesRequest, ListAliasesResponse, ListDomainsRequest, ListDomainsResponse, ListMailboxesRequest, ListMailboxesResponse, Mailbox, RestoreMailboxRequest, UpdateMailboxRequest, ValidateDomainRecordsRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Mailbox API.
|
|
6
6
|
|
|
@@ -54,7 +54,18 @@ export declare class API extends ParentAPI {
|
|
|
54
54
|
* @returns A Promise of GetDomainRecordsResponse
|
|
55
55
|
*/
|
|
56
56
|
getDomainRecords: (request: Readonly<GetDomainRecordsRequest>) => Promise<GetDomainRecordsResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Validate domain records by its ID.. Validate domain records by its ID.
|
|
59
|
+
*
|
|
60
|
+
* @param request - The request {@link ValidateDomainRecordsRequest}
|
|
61
|
+
*/
|
|
57
62
|
validateDomainRecords: (request: Readonly<ValidateDomainRecordsRequest>) => Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Create one or more mailboxes.. Create one or more mailboxes.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link BatchCreateMailboxesRequest}
|
|
67
|
+
* @returns A Promise of BatchCreateMailboxesResponse
|
|
68
|
+
*/
|
|
58
69
|
batchCreateMailboxes: (request: Readonly<BatchCreateMailboxesRequest>) => Promise<BatchCreateMailboxesResponse>;
|
|
59
70
|
protected pageOfListMailboxes: (request?: Readonly<ListMailboxesRequest>) => Promise<ListMailboxesResponse>;
|
|
60
71
|
/**
|
|
@@ -103,4 +114,44 @@ export declare class API extends ParentAPI {
|
|
|
103
114
|
* @returns A Promise of Mailbox
|
|
104
115
|
*/
|
|
105
116
|
restoreMailbox: (request: Readonly<RestoreMailboxRequest>) => Promise<Mailbox>;
|
|
117
|
+
/**
|
|
118
|
+
* Create an alias for a mailbox.. Create an alias for a mailbox.
|
|
119
|
+
*
|
|
120
|
+
* @param request - The request {@link CreateAliasRequest}
|
|
121
|
+
* @returns A Promise of Alias
|
|
122
|
+
*/
|
|
123
|
+
createAlias: (request: Readonly<CreateAliasRequest>) => Promise<Alias>;
|
|
124
|
+
protected pageOfListAliases: (request?: Readonly<ListAliasesRequest>) => Promise<ListAliasesResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* List aliases for a mailbox.. List aliases for a mailbox.
|
|
127
|
+
*
|
|
128
|
+
* @param request - The request {@link ListAliasesRequest}
|
|
129
|
+
* @returns A Promise of ListAliasesResponse
|
|
130
|
+
*/
|
|
131
|
+
listAliases: (request?: Readonly<ListAliasesRequest>) => Promise<ListAliasesResponse> & {
|
|
132
|
+
all: () => Promise<Alias[]>;
|
|
133
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Alias[], void, void>;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Get an alias by its ID.. Get an alias by its ID.
|
|
137
|
+
*
|
|
138
|
+
* @param request - The request {@link GetAliasRequest}
|
|
139
|
+
* @returns A Promise of Alias
|
|
140
|
+
*/
|
|
141
|
+
getAlias: (request: Readonly<GetAliasRequest>) => Promise<Alias>;
|
|
142
|
+
/**
|
|
143
|
+
* Waits for {@link Alias} to be in a final state.
|
|
144
|
+
*
|
|
145
|
+
* @param request - The request {@link GetAliasRequest}
|
|
146
|
+
* @param options - The waiting options
|
|
147
|
+
* @returns A Promise of Alias
|
|
148
|
+
*/
|
|
149
|
+
waitForAlias: (request: Readonly<GetAliasRequest>, options?: Readonly<WaitForOptions<Alias>>) => Promise<Alias>;
|
|
150
|
+
/**
|
|
151
|
+
* Delete an alias by its ID.. Delete an alias by its ID.
|
|
152
|
+
*
|
|
153
|
+
* @param request - The request {@link DeleteAliasRequest}
|
|
154
|
+
* @returns A Promise of Alias
|
|
155
|
+
*/
|
|
156
|
+
deleteAlias: (request: Readonly<DeleteAliasRequest>) => Promise<Alias>;
|
|
106
157
|
}
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
|
-
import { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox } from "./marshalling.gen.js";
|
|
1
|
+
import { ALIAS_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
|
+
import { marshalBatchCreateMailboxesRequest, marshalCreateAliasRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalAlias, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListAliasesResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox } from "./marshalling.gen.js";
|
|
3
3
|
import { API as API$1, enrichForPagination, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
4
|
//#region src/v1alpha1/api.gen.ts
|
|
5
5
|
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
@@ -51,7 +51,7 @@ var API = class extends API$1 {
|
|
|
51
51
|
this.pageOfListMailboxes = (request = {}) => this.client.fetch({
|
|
52
52
|
method: "GET",
|
|
53
53
|
path: `/mailbox/v1alpha1/mailboxes`,
|
|
54
|
-
urlParams: urlParams(["domain_id", request.domainId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["search", request.search], ["statuses", request.statuses])
|
|
54
|
+
urlParams: urlParams(["domain_id", request.domainId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["search", request.search], ["statuses", request.statuses])
|
|
55
55
|
}, unmarshalListMailboxesResponse);
|
|
56
56
|
this.listMailboxes = (request = {}) => enrichForPagination("mailboxes", this.pageOfListMailboxes, request);
|
|
57
57
|
this.getMailbox = (request) => this.client.fetch({
|
|
@@ -75,6 +75,27 @@ var API = class extends API$1 {
|
|
|
75
75
|
method: "POST",
|
|
76
76
|
path: `/mailbox/v1alpha1/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}/restore`
|
|
77
77
|
}, unmarshalMailbox);
|
|
78
|
+
this.createAlias = (request) => this.client.fetch({
|
|
79
|
+
body: JSON.stringify(marshalCreateAliasRequest(request, this.client.settings)),
|
|
80
|
+
headers: jsonContentHeaders,
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: `/mailbox/v1alpha1/aliases`
|
|
83
|
+
}, unmarshalAlias);
|
|
84
|
+
this.pageOfListAliases = (request = {}) => this.client.fetch({
|
|
85
|
+
method: "GET",
|
|
86
|
+
path: `/mailbox/v1alpha1/aliases`,
|
|
87
|
+
urlParams: urlParams(["mailbox_id", request.mailboxId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["status", request.status])
|
|
88
|
+
}, unmarshalListAliasesResponse);
|
|
89
|
+
this.listAliases = (request = {}) => enrichForPagination("aliases", this.pageOfListAliases, request);
|
|
90
|
+
this.getAlias = (request) => this.client.fetch({
|
|
91
|
+
method: "GET",
|
|
92
|
+
path: `/mailbox/v1alpha1/aliases/${validatePathParam("aliasId", request.aliasId)}`
|
|
93
|
+
}, unmarshalAlias);
|
|
94
|
+
this.waitForAlias = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!ALIAS_TRANSIENT_STATUSES.includes(res.status))), this.getAlias, request, options);
|
|
95
|
+
this.deleteAlias = (request) => this.client.fetch({
|
|
96
|
+
method: "DELETE",
|
|
97
|
+
path: `/mailbox/v1alpha1/aliases/${validatePathParam("aliasId", request.aliasId)}`
|
|
98
|
+
}, unmarshalAlias);
|
|
78
99
|
}
|
|
79
100
|
};
|
|
80
101
|
//#endregion
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { DomainRecordStatus, DomainStatus, MailboxStatus } from './types.gen.js';
|
|
1
|
+
import type { AliasStatus, DomainRecordStatus, DomainStatus, MailboxStatus } from './types.gen.js';
|
|
2
|
+
/** Lists transient statutes of the enum {@link AliasStatus}. */
|
|
3
|
+
export declare const ALIAS_TRANSIENT_STATUSES: AliasStatus[];
|
|
2
4
|
/** Lists transient statutes of the enum {@link DomainRecordStatus}. */
|
|
3
5
|
export declare const DOMAIN_RECORD_TRANSIENT_STATUSES: DomainRecordStatus[];
|
|
4
6
|
/** Lists transient statutes of the enum {@link DomainStatus}. */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
//#region src/v1alpha1/content.gen.ts
|
|
2
|
+
/** Lists transient statutes of the enum {@link AliasStatus}. */
|
|
3
|
+
const ALIAS_TRANSIENT_STATUSES = ["provisioning", "deleting"];
|
|
2
4
|
/** Lists transient statutes of the enum {@link DomainRecordStatus}. */
|
|
3
5
|
const DOMAIN_RECORD_TRANSIENT_STATUSES = ["validating"];
|
|
4
6
|
/** Lists transient statutes of the enum {@link DomainStatus}. */
|
|
@@ -18,4 +20,4 @@ const MAILBOX_TRANSIENT_STATUSES = [
|
|
|
18
20
|
"restoring"
|
|
19
21
|
];
|
|
20
22
|
//#endregion
|
|
21
|
-
export { DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES };
|
|
23
|
+
export { ALIAS_TRANSIENT_STATUSES, DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { BatchCreateMailboxesRequest, BatchCreateMailboxesRequestMailboxParameters, BatchCreateMailboxesResponse, CreateDomainRequest, DeleteDomainRequest, DeleteMailboxRequest, Domain, DomainRecord, DomainRecordDNSType, DomainRecordLevel, DomainRecordStatus, DomainStatus, GetDomainRecordsRequest, GetDomainRecordsResponse, GetDomainRequest, GetMailboxRequest, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListMailboxesRequest, ListMailboxesRequestOrderBy, ListMailboxesResponse, Mailbox, MailboxStatus, MailboxSubscriptionPeriod, RestoreMailboxRequest, UpdateMailboxRequest, ValidateDomainRecordsRequest, } from './types.gen.js';
|
|
4
|
+
export type { Alias, AliasStatus, BatchCreateMailboxesRequest, BatchCreateMailboxesRequestMailboxParameters, BatchCreateMailboxesResponse, CreateAliasRequest, CreateDomainRequest, DeleteAliasRequest, DeleteDomainRequest, DeleteMailboxRequest, Domain, DomainRecord, DomainRecordDNSType, DomainRecordLevel, DomainRecordStatus, DomainStatus, GetAliasRequest, GetDomainRecordsRequest, GetDomainRecordsResponse, GetDomainRequest, GetMailboxRequest, ListAliasesRequest, ListAliasesRequestOrderBy, ListAliasesResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListMailboxesRequest, ListMailboxesRequestOrderBy, ListMailboxesResponse, Mailbox, MailboxStatus, MailboxSubscriptionPeriod, RestoreMailboxRequest, UpdateMailboxRequest, ValidateDomainRecordsRequest, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox } from "./marshalling.gen.js";
|
|
2
|
+
import { ALIAS_TRANSIENT_STATUSES, DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalBatchCreateMailboxesRequest, marshalCreateAliasRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalAlias, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListAliasesResponse, 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
6
|
//#region src/v1alpha1/index.gen.ts
|
|
7
7
|
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
ALIAS_TRANSIENT_STATUSES: () => ALIAS_TRANSIENT_STATUSES,
|
|
8
9
|
API: () => API,
|
|
9
10
|
DOMAIN_RECORD_TRANSIENT_STATUSES: () => DOMAIN_RECORD_TRANSIENT_STATUSES,
|
|
10
11
|
DOMAIN_TRANSIENT_STATUSES: () => DOMAIN_TRANSIENT_STATUSES,
|
|
11
12
|
MAILBOX_TRANSIENT_STATUSES: () => MAILBOX_TRANSIENT_STATUSES,
|
|
12
13
|
ValidationRules: () => validation_rules_gen_exports,
|
|
13
14
|
marshalBatchCreateMailboxesRequest: () => marshalBatchCreateMailboxesRequest,
|
|
15
|
+
marshalCreateAliasRequest: () => marshalCreateAliasRequest,
|
|
14
16
|
marshalCreateDomainRequest: () => marshalCreateDomainRequest,
|
|
15
17
|
marshalUpdateMailboxRequest: () => marshalUpdateMailboxRequest,
|
|
18
|
+
unmarshalAlias: () => unmarshalAlias,
|
|
16
19
|
unmarshalBatchCreateMailboxesResponse: () => unmarshalBatchCreateMailboxesResponse,
|
|
17
20
|
unmarshalDomain: () => unmarshalDomain,
|
|
18
21
|
unmarshalGetDomainRecordsResponse: () => unmarshalGetDomainRecordsResponse,
|
|
22
|
+
unmarshalListAliasesResponse: () => unmarshalListAliasesResponse,
|
|
19
23
|
unmarshalListDomainsResponse: () => unmarshalListDomainsResponse,
|
|
20
24
|
unmarshalListMailboxesResponse: () => unmarshalListMailboxesResponse,
|
|
21
25
|
unmarshalMailbox: () => unmarshalMailbox
|
|
22
26
|
});
|
|
23
27
|
//#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 };
|
|
28
|
+
export { ALIAS_TRANSIENT_STATUSES, API, DOMAIN_RECORD_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, MAILBOX_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalBatchCreateMailboxesRequest, marshalCreateAliasRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalAlias, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListAliasesResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { Mailbox, Domain, BatchCreateMailboxesResponse, GetDomainRecordsResponse, ListDomainsResponse, ListMailboxesResponse, BatchCreateMailboxesRequest, CreateDomainRequest, UpdateMailboxRequest } from './types.gen.js';
|
|
2
|
+
import type { Mailbox, Alias, Domain, BatchCreateMailboxesResponse, GetDomainRecordsResponse, ListAliasesResponse, ListDomainsResponse, ListMailboxesResponse, BatchCreateMailboxesRequest, CreateAliasRequest, CreateDomainRequest, UpdateMailboxRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalMailbox: (data: unknown) => Mailbox;
|
|
4
|
+
export declare const unmarshalAlias: (data: unknown) => Alias;
|
|
4
5
|
export declare const unmarshalDomain: (data: unknown) => Domain;
|
|
5
6
|
export declare const unmarshalBatchCreateMailboxesResponse: (data: unknown) => BatchCreateMailboxesResponse;
|
|
6
7
|
export declare const unmarshalGetDomainRecordsResponse: (data: unknown) => GetDomainRecordsResponse;
|
|
8
|
+
export declare const unmarshalListAliasesResponse: (data: unknown) => ListAliasesResponse;
|
|
7
9
|
export declare const unmarshalListDomainsResponse: (data: unknown) => ListDomainsResponse;
|
|
8
10
|
export declare const unmarshalListMailboxesResponse: (data: unknown) => ListMailboxesResponse;
|
|
9
11
|
export declare const marshalBatchCreateMailboxesRequest: (request: BatchCreateMailboxesRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
12
|
+
export declare const marshalCreateAliasRequest: (request: CreateAliasRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
10
13
|
export declare const marshalCreateDomainRequest: (request: CreateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
11
14
|
export declare const marshalUpdateMailboxRequest: (request: UpdateMailboxRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -16,6 +16,18 @@ const unmarshalMailbox = (data) => {
|
|
|
16
16
|
updatedAt: unmarshalDate(data.updated_at)
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
const unmarshalAlias = (data) => {
|
|
20
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Alias' failed as data isn't a dictionary.`);
|
|
21
|
+
return {
|
|
22
|
+
createdAt: unmarshalDate(data.created_at),
|
|
23
|
+
description: data.description,
|
|
24
|
+
email: data.email,
|
|
25
|
+
id: data.id,
|
|
26
|
+
mailboxId: data.mailbox_id,
|
|
27
|
+
status: data.status,
|
|
28
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
29
|
+
};
|
|
30
|
+
};
|
|
19
31
|
const unmarshalDomain = (data) => {
|
|
20
32
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
|
|
21
33
|
return {
|
|
@@ -68,6 +80,13 @@ const unmarshalGetDomainRecordsResponse = (data) => {
|
|
|
68
80
|
submission: data.submission ? unmarshalDomainRecord(data.submission) : void 0
|
|
69
81
|
};
|
|
70
82
|
};
|
|
83
|
+
const unmarshalListAliasesResponse = (data) => {
|
|
84
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAliasesResponse' failed as data isn't a dictionary.`);
|
|
85
|
+
return {
|
|
86
|
+
aliases: unmarshalArrayOfObject(data.aliases, unmarshalAlias),
|
|
87
|
+
totalCount: data.total_count
|
|
88
|
+
};
|
|
89
|
+
};
|
|
71
90
|
const unmarshalListDomainsResponse = (data) => {
|
|
72
91
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
|
|
73
92
|
return {
|
|
@@ -91,6 +110,11 @@ const marshalBatchCreateMailboxesRequest = (request, defaults) => ({
|
|
|
91
110
|
mailboxes: request.mailboxes !== void 0 ? request.mailboxes.map((elt) => marshalBatchCreateMailboxesRequestMailboxParameters(elt, defaults)) : void 0,
|
|
92
111
|
subscription_period: request.subscriptionPeriod
|
|
93
112
|
});
|
|
113
|
+
const marshalCreateAliasRequest = (request, defaults) => ({
|
|
114
|
+
description: request.description,
|
|
115
|
+
local_part: request.localPart,
|
|
116
|
+
mailbox_id: request.mailboxId
|
|
117
|
+
});
|
|
94
118
|
const marshalCreateDomainRequest = (request, defaults) => ({
|
|
95
119
|
name: request.name,
|
|
96
120
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
@@ -100,4 +124,4 @@ const marshalUpdateMailboxRequest = (request, defaults) => ({
|
|
|
100
124
|
subscription_period: request.subscriptionPeriod
|
|
101
125
|
});
|
|
102
126
|
//#endregion
|
|
103
|
-
export { marshalBatchCreateMailboxesRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox };
|
|
127
|
+
export { marshalBatchCreateMailboxesRequest, marshalCreateAliasRequest, marshalCreateDomainRequest, marshalUpdateMailboxRequest, unmarshalAlias, unmarshalBatchCreateMailboxesResponse, unmarshalDomain, unmarshalGetDomainRecordsResponse, unmarshalListAliasesResponse, unmarshalListDomainsResponse, unmarshalListMailboxesResponse, unmarshalMailbox };
|
|
@@ -55,6 +55,27 @@ export declare const queriesMetadata: {
|
|
|
55
55
|
readonly isPrivate: false;
|
|
56
56
|
readonly description: '"';
|
|
57
57
|
readonly hasWaiter: true;
|
|
58
|
+
}, {
|
|
59
|
+
readonly methodName: 'listAliases';
|
|
60
|
+
readonly protoName: 'ListAliases';
|
|
61
|
+
readonly paramsType: 'ListAliasesRequest';
|
|
62
|
+
readonly returnType: 'ListAliasesResponse';
|
|
63
|
+
readonly isList: true;
|
|
64
|
+
readonly paginationType: 'offset';
|
|
65
|
+
readonly pageParamKey: 'page';
|
|
66
|
+
readonly listItemType: 'Alias';
|
|
67
|
+
readonly isPrivate: false;
|
|
68
|
+
readonly description: '"';
|
|
69
|
+
}, {
|
|
70
|
+
readonly methodName: 'getAlias';
|
|
71
|
+
readonly protoName: 'GetAlias';
|
|
72
|
+
readonly paramsType: 'GetAliasRequest';
|
|
73
|
+
readonly returnType: 'Alias';
|
|
74
|
+
readonly isList: false;
|
|
75
|
+
readonly paginationType: 'none';
|
|
76
|
+
readonly isPrivate: false;
|
|
77
|
+
readonly description: '"';
|
|
78
|
+
readonly hasWaiter: true;
|
|
58
79
|
}];
|
|
59
80
|
}];
|
|
60
81
|
};
|
|
@@ -61,6 +61,29 @@ const queriesMetadata = {
|
|
|
61
61
|
isPrivate: false,
|
|
62
62
|
description: "\"",
|
|
63
63
|
hasWaiter: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
methodName: "listAliases",
|
|
67
|
+
protoName: "ListAliases",
|
|
68
|
+
paramsType: "ListAliasesRequest",
|
|
69
|
+
returnType: "ListAliasesResponse",
|
|
70
|
+
isList: true,
|
|
71
|
+
paginationType: "offset",
|
|
72
|
+
pageParamKey: "page",
|
|
73
|
+
listItemType: "Alias",
|
|
74
|
+
isPrivate: false,
|
|
75
|
+
description: "\""
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
methodName: "getAlias",
|
|
79
|
+
protoName: "GetAlias",
|
|
80
|
+
paramsType: "GetAliasRequest",
|
|
81
|
+
returnType: "Alias",
|
|
82
|
+
isList: false,
|
|
83
|
+
paginationType: "none",
|
|
84
|
+
isPrivate: false,
|
|
85
|
+
description: "\"",
|
|
86
|
+
hasWaiter: true
|
|
64
87
|
}
|
|
65
88
|
]
|
|
66
89
|
}]
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export type AliasStatus = 'unknown_status' | 'provisioning' | 'deleting' | 'ready';
|
|
1
2
|
export type DomainRecordDNSType = 'unknown_dns_type' | 'cname_dns_type' | 'mx_dns_type' | 'srv_dns_type' | 'txt_dns_type';
|
|
2
3
|
export type DomainRecordLevel = 'unknown_level' | 'required' | 'recommended' | 'optional';
|
|
3
4
|
export type DomainRecordStatus = 'unknown_status' | 'validating' | 'valid' | 'invalid' | 'not_found';
|
|
4
5
|
export type DomainStatus = 'unknown_status' | 'creating' | 'waiting_validation' | 'validating' | 'validation_failed' | 'provisioning' | 'ready' | 'deleting';
|
|
6
|
+
export type ListAliasesRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'name_desc' | 'name_asc';
|
|
5
7
|
export type ListDomainsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'name_desc' | 'name_asc' | 'mailbox_total_count_desc' | 'mailbox_total_count_asc';
|
|
6
8
|
export type ListMailboxesRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'email_desc' | 'email_asc';
|
|
7
9
|
export type MailboxStatus = 'unknown_status' | 'creating' | 'waiting_payment' | 'waiting_domain' | 'ready' | 'deletion_scheduled' | 'locked' | 'renewing' | 'deleting' | 'restoring' | 'payment_failed';
|
|
@@ -98,6 +100,36 @@ export interface DomainRecord {
|
|
|
98
100
|
*/
|
|
99
101
|
updatedAt?: Date;
|
|
100
102
|
}
|
|
103
|
+
export interface Alias {
|
|
104
|
+
/**
|
|
105
|
+
* Unique identifier of the alias.
|
|
106
|
+
*/
|
|
107
|
+
id: string;
|
|
108
|
+
/**
|
|
109
|
+
* Email address of the alias as local_part@domain.
|
|
110
|
+
*/
|
|
111
|
+
email: string;
|
|
112
|
+
/**
|
|
113
|
+
* ID of the mailbox to which the alias belongs.
|
|
114
|
+
*/
|
|
115
|
+
mailboxId: string;
|
|
116
|
+
/**
|
|
117
|
+
* Description of the alias.
|
|
118
|
+
*/
|
|
119
|
+
description: string;
|
|
120
|
+
/**
|
|
121
|
+
* Current status of the alias.
|
|
122
|
+
*/
|
|
123
|
+
status: AliasStatus;
|
|
124
|
+
/**
|
|
125
|
+
* Date and time of alias creation.
|
|
126
|
+
*/
|
|
127
|
+
createdAt?: Date;
|
|
128
|
+
/**
|
|
129
|
+
* Date and time when the alias was last updated.
|
|
130
|
+
*/
|
|
131
|
+
updatedAt?: Date;
|
|
132
|
+
}
|
|
101
133
|
export interface Domain {
|
|
102
134
|
/**
|
|
103
135
|
* Unique identifier of the domain.
|
|
@@ -164,6 +196,20 @@ export interface BatchCreateMailboxesResponse {
|
|
|
164
196
|
*/
|
|
165
197
|
mailboxes: Mailbox[];
|
|
166
198
|
}
|
|
199
|
+
export type CreateAliasRequest = {
|
|
200
|
+
/**
|
|
201
|
+
* Local part of the email address (e.g. local_part@domain.com).
|
|
202
|
+
*/
|
|
203
|
+
localPart: string;
|
|
204
|
+
/**
|
|
205
|
+
* ID of the mailbox to associate with the alias.
|
|
206
|
+
*/
|
|
207
|
+
mailboxId: string;
|
|
208
|
+
/**
|
|
209
|
+
* (Optional) Description of the alias.
|
|
210
|
+
*/
|
|
211
|
+
description?: string;
|
|
212
|
+
};
|
|
167
213
|
export type CreateDomainRequest = {
|
|
168
214
|
/**
|
|
169
215
|
* ID of the project to which the domain belongs.
|
|
@@ -174,6 +220,12 @@ export type CreateDomainRequest = {
|
|
|
174
220
|
*/
|
|
175
221
|
name: string;
|
|
176
222
|
};
|
|
223
|
+
export type DeleteAliasRequest = {
|
|
224
|
+
/**
|
|
225
|
+
* ID of the alias to delete.
|
|
226
|
+
*/
|
|
227
|
+
aliasId: string;
|
|
228
|
+
};
|
|
177
229
|
export type DeleteDomainRequest = {
|
|
178
230
|
/**
|
|
179
231
|
* ID of the domain to delete.
|
|
@@ -186,6 +238,12 @@ export type DeleteMailboxRequest = {
|
|
|
186
238
|
*/
|
|
187
239
|
mailboxId: string;
|
|
188
240
|
};
|
|
241
|
+
export type GetAliasRequest = {
|
|
242
|
+
/**
|
|
243
|
+
* ID of the alias to get.
|
|
244
|
+
*/
|
|
245
|
+
aliasId: string;
|
|
246
|
+
};
|
|
189
247
|
export type GetDomainRecordsRequest = {
|
|
190
248
|
/**
|
|
191
249
|
* (Optional) ID of the domain in which to get the records.
|
|
@@ -254,6 +312,42 @@ export type GetMailboxRequest = {
|
|
|
254
312
|
*/
|
|
255
313
|
mailboxId: string;
|
|
256
314
|
};
|
|
315
|
+
export type ListAliasesRequest = {
|
|
316
|
+
/**
|
|
317
|
+
* Order aliases by specific criteria.
|
|
318
|
+
*/
|
|
319
|
+
orderBy?: ListAliasesRequestOrderBy;
|
|
320
|
+
/**
|
|
321
|
+
* Requested page number. Value must be greater or equal to 1.
|
|
322
|
+
*/
|
|
323
|
+
page?: number;
|
|
324
|
+
/**
|
|
325
|
+
* Requested page size. Value must be between 1 and 100.
|
|
326
|
+
*/
|
|
327
|
+
pageSize?: number;
|
|
328
|
+
/**
|
|
329
|
+
* ID of the mailbox for which to list aliases.
|
|
330
|
+
*/
|
|
331
|
+
mailboxId?: string;
|
|
332
|
+
/**
|
|
333
|
+
* (Optional) Filter aliases by their status.
|
|
334
|
+
*/
|
|
335
|
+
status?: AliasStatus;
|
|
336
|
+
/**
|
|
337
|
+
* Project ID to filter on.
|
|
338
|
+
*/
|
|
339
|
+
projectId?: string;
|
|
340
|
+
};
|
|
341
|
+
export interface ListAliasesResponse {
|
|
342
|
+
/**
|
|
343
|
+
* Number of aliases that match the request (without pagination).
|
|
344
|
+
*/
|
|
345
|
+
totalCount: number;
|
|
346
|
+
/**
|
|
347
|
+
* Single page of aliases matching the requested criteria.
|
|
348
|
+
*/
|
|
349
|
+
aliases: Alias[];
|
|
350
|
+
}
|
|
257
351
|
export type ListDomainsRequest = {
|
|
258
352
|
orderBy?: ListDomainsRequestOrderBy;
|
|
259
353
|
page?: number;
|
|
@@ -297,6 +391,10 @@ export type ListMailboxesRequest = {
|
|
|
297
391
|
* (Optional) Search term to filter mailboxes on name and local_part.
|
|
298
392
|
*/
|
|
299
393
|
search?: string;
|
|
394
|
+
/**
|
|
395
|
+
* (Optional) Project ID to filter mailboxes on.
|
|
396
|
+
*/
|
|
397
|
+
projectId?: string;
|
|
300
398
|
};
|
|
301
399
|
export interface ListMailboxesResponse {
|
|
302
400
|
/**
|
|
@@ -329,5 +427,8 @@ export type UpdateMailboxRequest = {
|
|
|
329
427
|
newPassword?: string;
|
|
330
428
|
};
|
|
331
429
|
export type ValidateDomainRecordsRequest = {
|
|
430
|
+
/**
|
|
431
|
+
* ID of the domain with which to validate the records.
|
|
432
|
+
*/
|
|
332
433
|
domainId: string;
|
|
333
434
|
};
|
|
@@ -8,12 +8,30 @@ export declare const BatchCreateMailboxesRequestMailboxParameters: {
|
|
|
8
8
|
minLength: number;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
export declare const CreateAliasRequest: {
|
|
12
|
+
description: {
|
|
13
|
+
maxLength: number;
|
|
14
|
+
};
|
|
15
|
+
localPart: {
|
|
16
|
+
maxLength: number;
|
|
17
|
+
minLength: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
11
20
|
export declare const CreateDomainRequest: {
|
|
12
21
|
name: {
|
|
13
22
|
maxLength: number;
|
|
14
23
|
minLength: number;
|
|
15
24
|
};
|
|
16
25
|
};
|
|
26
|
+
export declare const ListAliasesRequest: {
|
|
27
|
+
page: {
|
|
28
|
+
greaterThanOrEqual: number;
|
|
29
|
+
};
|
|
30
|
+
pageSize: {
|
|
31
|
+
greaterThanOrEqual: number;
|
|
32
|
+
lessThanOrEqual: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
17
35
|
export declare const ListDomainsRequest: {
|
|
18
36
|
page: {
|
|
19
37
|
greaterThanOrEqual: number;
|
|
@@ -2,7 +2,9 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
//#region src/v1alpha1/validation-rules.gen.ts
|
|
3
3
|
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
BatchCreateMailboxesRequestMailboxParameters: () => BatchCreateMailboxesRequestMailboxParameters,
|
|
5
|
+
CreateAliasRequest: () => CreateAliasRequest,
|
|
5
6
|
CreateDomainRequest: () => CreateDomainRequest,
|
|
7
|
+
ListAliasesRequest: () => ListAliasesRequest,
|
|
6
8
|
ListDomainsRequest: () => ListDomainsRequest,
|
|
7
9
|
ListMailboxesRequest: () => ListMailboxesRequest,
|
|
8
10
|
UpdateMailboxRequest: () => UpdateMailboxRequest
|
|
@@ -17,10 +19,24 @@ const BatchCreateMailboxesRequestMailboxParameters = {
|
|
|
17
19
|
minLength: 12
|
|
18
20
|
}
|
|
19
21
|
};
|
|
22
|
+
const CreateAliasRequest = {
|
|
23
|
+
description: { maxLength: 128 },
|
|
24
|
+
localPart: {
|
|
25
|
+
maxLength: 64,
|
|
26
|
+
minLength: 1
|
|
27
|
+
}
|
|
28
|
+
};
|
|
20
29
|
const CreateDomainRequest = { name: {
|
|
21
30
|
maxLength: 253,
|
|
22
31
|
minLength: 1
|
|
23
32
|
} };
|
|
33
|
+
const ListAliasesRequest = {
|
|
34
|
+
page: { greaterThanOrEqual: 1 },
|
|
35
|
+
pageSize: {
|
|
36
|
+
greaterThanOrEqual: 1,
|
|
37
|
+
lessThanOrEqual: 100
|
|
38
|
+
}
|
|
39
|
+
};
|
|
24
40
|
const ListDomainsRequest = {
|
|
25
41
|
page: { greaterThanOrEqual: 1 },
|
|
26
42
|
pageSize: {
|
|
@@ -40,4 +56,4 @@ const UpdateMailboxRequest = { newPassword: {
|
|
|
40
56
|
minLength: 12
|
|
41
57
|
} };
|
|
42
58
|
//#endregion
|
|
43
|
-
export { BatchCreateMailboxesRequestMailboxParameters, CreateDomainRequest, ListDomainsRequest, ListMailboxesRequest, UpdateMailboxRequest, validation_rules_gen_exports };
|
|
59
|
+
export { BatchCreateMailboxesRequestMailboxParameters, CreateAliasRequest, CreateDomainRequest, ListAliasesRequest, 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.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Scaleway SDK mailbox",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@scaleway/sdk-std": "2.4.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@repo/configs": "^0.1.1",
|
|
39
|
+
"@scaleway/sdk-client": "^2.4.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@scaleway/sdk-client": "^2.4.0"
|