@scaleway/sdk 2.42.0 → 2.44.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/api/applesilicon/v1alpha1/marshalling.gen.cjs +3 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +3 -1
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +9 -1
- package/dist/api/billing/v2beta1/api.gen.d.ts +4 -28
- package/dist/api/block/v1alpha1/api.gen.cjs +5 -3
- package/dist/api/block/v1alpha1/api.gen.d.ts +4 -3
- package/dist/api/block/v1alpha1/api.gen.js +5 -3
- package/dist/api/container/v1beta1/marshalling.gen.cjs +3 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/container/v1beta1/types.gen.d.ts +6 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +2 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +2 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +4 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +6 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +5 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +6 -0
- package/dist/api/k8s/v1/api.gen.cjs +32 -0
- package/dist/api/k8s/v1/api.gen.d.ts +19 -1
- package/dist/api/k8s/v1/api.gen.js +33 -1
- package/dist/api/k8s/v1/index.gen.d.ts +1 -1
- package/dist/api/k8s/v1/marshalling.gen.cjs +53 -0
- package/dist/api/k8s/v1/marshalling.gen.d.ts +3 -1
- package/dist/api/k8s/v1/marshalling.gen.js +53 -0
- package/dist/api/k8s/v1/types.gen.d.ts +48 -0
- package/dist/api/key_manager/v1alpha1/types.gen.d.ts +7 -7
- package/dist/api/secret/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1beta1/types.gen.d.ts +2 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/types.gen.d.ts +3 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +2 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +2 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +4 -0
- package/dist/api/vpcgw/v1/api.gen.cjs +8 -5
- package/dist/api/vpcgw/v1/api.gen.d.ts +5 -4
- package/dist/api/vpcgw/v1/api.gen.js +9 -6
- package/dist/api/vpcgw/v1/marshalling.gen.cjs +4 -0
- package/dist/api/vpcgw/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +4 -0
- package/dist/api/vpcgw/v1/types.gen.d.ts +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.cjs +91 -0
- package/dist/api/webhosting/v1alpha1/api.gen.d.ts +47 -1
- package/dist/api/webhosting/v1alpha1/api.gen.js +93 -2
- package/dist/api/webhosting/v1alpha1/index.gen.cjs +1 -0
- package/dist/api/webhosting/v1alpha1/index.gen.d.ts +2 -2
- package/dist/api/webhosting/v1alpha1/index.gen.js +2 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +48 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +5 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +48 -0
- package/dist/api/webhosting/v1alpha1/types.gen.d.ts +84 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +10 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +9 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -0
- package/dist/helpers/marshalling.d.ts +1 -4
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/dist/scw/fetch/resource-paginator.d.ts +3 -3
- package/dist/scw/fetch/response-parser.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
6
6
|
import { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
7
|
-
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, marshalCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } from "./marshalling.gen.js";
|
|
7
|
+
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, marshalCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse, marshalClassicMailApiCreateMailboxRequest, unmarshalMailbox, unmarshalListMailboxesResponse, marshalClassicMailApiUpdateMailboxRequest } from "./marshalling.gen.js";
|
|
8
8
|
const jsonContentHeaders = {
|
|
9
9
|
"Content-Type": "application/json; charset=utf-8"
|
|
10
10
|
};
|
|
@@ -239,6 +239,97 @@ class API extends API$1 {
|
|
|
239
239
|
unmarshalResetHostingPasswordResponse
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
+
class ClassicMailAPI extends API$1 {
|
|
243
|
+
/** Lists the available regions of the API. */
|
|
244
|
+
static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
|
|
245
|
+
/**
|
|
246
|
+
* Create a new mailbox within your hosting plan.. Create a new mailbox within
|
|
247
|
+
* your hosting plan.
|
|
248
|
+
*
|
|
249
|
+
* @param request - The request {@link ClassicMailApiCreateMailboxRequest}
|
|
250
|
+
* @returns A Promise of Mailbox
|
|
251
|
+
*/
|
|
252
|
+
createMailbox = (request) => this.client.fetch(
|
|
253
|
+
{
|
|
254
|
+
body: JSON.stringify(
|
|
255
|
+
marshalClassicMailApiCreateMailboxRequest(
|
|
256
|
+
request,
|
|
257
|
+
this.client.settings
|
|
258
|
+
)
|
|
259
|
+
),
|
|
260
|
+
headers: jsonContentHeaders,
|
|
261
|
+
method: "POST",
|
|
262
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes`
|
|
263
|
+
},
|
|
264
|
+
unmarshalMailbox
|
|
265
|
+
);
|
|
266
|
+
/**
|
|
267
|
+
* Get a mailbox by id within your hosting plan.. Get a mailbox by id within
|
|
268
|
+
* your hosting plan.
|
|
269
|
+
*
|
|
270
|
+
* @param request - The request {@link ClassicMailApiGetMailboxRequest}
|
|
271
|
+
* @returns A Promise of Mailbox
|
|
272
|
+
*/
|
|
273
|
+
getMailbox = (request) => this.client.fetch(
|
|
274
|
+
{
|
|
275
|
+
method: "GET",
|
|
276
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
|
|
277
|
+
},
|
|
278
|
+
unmarshalMailbox
|
|
279
|
+
);
|
|
280
|
+
pageOfListMailboxes = (request) => this.client.fetch(
|
|
281
|
+
{
|
|
282
|
+
method: "GET",
|
|
283
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes`,
|
|
284
|
+
urlParams: urlParams(
|
|
285
|
+
["domain", request.domain],
|
|
286
|
+
["page", request.page],
|
|
287
|
+
[
|
|
288
|
+
"page_size",
|
|
289
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
290
|
+
]
|
|
291
|
+
)
|
|
292
|
+
},
|
|
293
|
+
unmarshalListMailboxesResponse
|
|
294
|
+
);
|
|
295
|
+
/**
|
|
296
|
+
* List all mailboxes within your hosting plan.. List all mailboxes within
|
|
297
|
+
* your hosting plan.
|
|
298
|
+
*
|
|
299
|
+
* @param request - The request {@link ClassicMailApiListMailboxesRequest}
|
|
300
|
+
* @returns A Promise of ListMailboxesResponse
|
|
301
|
+
*/
|
|
302
|
+
listMailboxes = (request) => enrichForPagination("mailboxes", this.pageOfListMailboxes, request);
|
|
303
|
+
deleteMailbox = (request) => this.client.fetch(
|
|
304
|
+
{
|
|
305
|
+
method: "DELETE",
|
|
306
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
|
|
307
|
+
},
|
|
308
|
+
unmarshalMailbox
|
|
309
|
+
);
|
|
310
|
+
/**
|
|
311
|
+
* Update the mailbox within your hosting plan.. Update the mailbox within
|
|
312
|
+
* your hosting plan.
|
|
313
|
+
*
|
|
314
|
+
* @param request - The request {@link ClassicMailApiUpdateMailboxRequest}
|
|
315
|
+
* @returns A Promise of Mailbox
|
|
316
|
+
*/
|
|
317
|
+
updateMailbox = (request) => this.client.fetch(
|
|
318
|
+
{
|
|
319
|
+
body: JSON.stringify(
|
|
320
|
+
marshalClassicMailApiUpdateMailboxRequest(
|
|
321
|
+
request,
|
|
322
|
+
this.client.settings
|
|
323
|
+
)
|
|
324
|
+
),
|
|
325
|
+
headers: jsonContentHeaders,
|
|
326
|
+
method: "PATCH",
|
|
327
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
|
|
328
|
+
},
|
|
329
|
+
unmarshalMailbox
|
|
330
|
+
);
|
|
331
|
+
}
|
|
242
332
|
export {
|
|
243
|
-
API
|
|
333
|
+
API,
|
|
334
|
+
ClassicMailAPI
|
|
244
335
|
};
|
|
@@ -4,5 +4,6 @@ const api_gen = require("./api.gen.cjs");
|
|
|
4
4
|
const content_gen = require("./content.gen.cjs");
|
|
5
5
|
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
6
6
|
exports.API = api_gen.API;
|
|
7
|
+
exports.ClassicMailAPI = api_gen.ClassicMailAPI;
|
|
7
8
|
exports.HOSTING_TRANSIENT_STATUSES = content_gen.HOSTING_TRANSIENT_STATUSES;
|
|
8
9
|
exports.ValidationRules = validationRules_gen;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen';
|
|
1
|
+
export { API, ClassicMailAPI } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
|
|
3
|
+
export type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ClassicMailApiCreateMailboxRequest, ClassicMailApiDeleteMailboxRequest, ClassicMailApiGetMailboxRequest, ClassicMailApiListMailboxesRequest, ClassicMailApiUpdateMailboxRequest, ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, EmailAddress, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListMailboxesResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Mailbox, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { API } from "./api.gen.js";
|
|
1
|
+
import { API, ClassicMailAPI } from "./api.gen.js";
|
|
2
2
|
import { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
3
|
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
4
4
|
export {
|
|
5
5
|
API,
|
|
6
|
+
ClassicMailAPI,
|
|
6
7
|
HOSTING_TRANSIENT_STATUSES,
|
|
7
8
|
validationRules_gen as ValidationRules
|
|
8
9
|
};
|
|
@@ -58,6 +58,28 @@ const unmarshalHosting = (data) => {
|
|
|
58
58
|
username: data.username
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
const unmarshalEmailAddress = (data) => {
|
|
62
|
+
if (!json.isJSONObject(data)) {
|
|
63
|
+
throw new TypeError(
|
|
64
|
+
`Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
domain: data.domain,
|
|
69
|
+
login: data.login
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const unmarshalMailbox = (data) => {
|
|
73
|
+
if (!json.isJSONObject(data)) {
|
|
74
|
+
throw new TypeError(
|
|
75
|
+
`Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
email: data.email ? unmarshalEmailAddress(data.email) : void 0,
|
|
80
|
+
mailboxId: data.mailbox_id
|
|
81
|
+
};
|
|
82
|
+
};
|
|
61
83
|
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
62
84
|
if (!json.isJSONObject(data)) {
|
|
63
85
|
throw new TypeError(
|
|
@@ -145,6 +167,17 @@ const unmarshalListHostingsResponse = (data) => {
|
|
|
145
167
|
totalCount: data.total_count
|
|
146
168
|
};
|
|
147
169
|
};
|
|
170
|
+
const unmarshalListMailboxesResponse = (data) => {
|
|
171
|
+
if (!json.isJSONObject(data)) {
|
|
172
|
+
throw new TypeError(
|
|
173
|
+
`Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
mailboxes: marshalling.unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),
|
|
178
|
+
totalCount: data.total_count
|
|
179
|
+
};
|
|
180
|
+
};
|
|
148
181
|
const unmarshalOfferProduct = (data) => {
|
|
149
182
|
if (!json.isJSONObject(data)) {
|
|
150
183
|
throw new TypeError(
|
|
@@ -214,6 +247,17 @@ const unmarshalSession = (data) => {
|
|
|
214
247
|
const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
215
248
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
216
249
|
});
|
|
250
|
+
const marshalEmailAddress = (request, defaults) => ({
|
|
251
|
+
domain: request.domain,
|
|
252
|
+
login: request.login
|
|
253
|
+
});
|
|
254
|
+
const marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({
|
|
255
|
+
email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0,
|
|
256
|
+
password: request.password
|
|
257
|
+
});
|
|
258
|
+
const marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({
|
|
259
|
+
password: request.password
|
|
260
|
+
});
|
|
217
261
|
const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
|
|
218
262
|
update_all_records: request.updateAllRecords,
|
|
219
263
|
update_mail_record: request.updateMailRecord,
|
|
@@ -240,6 +284,8 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
240
284
|
tags: request.tags
|
|
241
285
|
});
|
|
242
286
|
exports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest;
|
|
287
|
+
exports.marshalClassicMailApiCreateMailboxRequest = marshalClassicMailApiCreateMailboxRequest;
|
|
288
|
+
exports.marshalClassicMailApiUpdateMailboxRequest = marshalClassicMailApiUpdateMailboxRequest;
|
|
243
289
|
exports.marshalCreateHostingRequest = marshalCreateHostingRequest;
|
|
244
290
|
exports.marshalUpdateHostingRequest = marshalUpdateHostingRequest;
|
|
245
291
|
exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
|
|
@@ -247,6 +293,8 @@ exports.unmarshalDnsRecords = unmarshalDnsRecords;
|
|
|
247
293
|
exports.unmarshalHosting = unmarshalHosting;
|
|
248
294
|
exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;
|
|
249
295
|
exports.unmarshalListHostingsResponse = unmarshalListHostingsResponse;
|
|
296
|
+
exports.unmarshalListMailboxesResponse = unmarshalListMailboxesResponse;
|
|
250
297
|
exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
|
|
298
|
+
exports.unmarshalMailbox = unmarshalMailbox;
|
|
251
299
|
exports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse;
|
|
252
300
|
exports.unmarshalSession = unmarshalSession;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListOffersResponse, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
|
|
2
|
+
import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ClassicMailApiCreateMailboxRequest, ClassicMailApiUpdateMailboxRequest, CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListMailboxesResponse, ListOffersResponse, Mailbox, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
|
|
3
3
|
export declare const unmarshalHosting: (data: unknown) => Hosting;
|
|
4
|
+
export declare const unmarshalMailbox: (data: unknown) => Mailbox;
|
|
4
5
|
export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
|
|
5
6
|
export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
|
|
6
7
|
export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
|
|
7
8
|
export declare const unmarshalListHostingsResponse: (data: unknown) => ListHostingsResponse;
|
|
9
|
+
export declare const unmarshalListMailboxesResponse: (data: unknown) => ListMailboxesResponse;
|
|
8
10
|
export declare const unmarshalListOffersResponse: (data: unknown) => ListOffersResponse;
|
|
9
11
|
export declare const unmarshalResetHostingPasswordResponse: (data: unknown) => ResetHostingPasswordResponse;
|
|
10
12
|
export declare const unmarshalSession: (data: unknown) => Session;
|
|
11
13
|
export declare const marshalCheckUserOwnsDomainRequest: (request: CheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalClassicMailApiCreateMailboxRequest: (request: ClassicMailApiCreateMailboxRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalClassicMailApiUpdateMailboxRequest: (request: ClassicMailApiUpdateMailboxRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
12
16
|
export declare const marshalCreateHostingRequest: (request: CreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
17
|
export declare const marshalUpdateHostingRequest: (request: UpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -56,6 +56,28 @@ const unmarshalHosting = (data) => {
|
|
|
56
56
|
username: data.username
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
+
const unmarshalEmailAddress = (data) => {
|
|
60
|
+
if (!isJSONObject(data)) {
|
|
61
|
+
throw new TypeError(
|
|
62
|
+
`Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
domain: data.domain,
|
|
67
|
+
login: data.login
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const unmarshalMailbox = (data) => {
|
|
71
|
+
if (!isJSONObject(data)) {
|
|
72
|
+
throw new TypeError(
|
|
73
|
+
`Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
email: data.email ? unmarshalEmailAddress(data.email) : void 0,
|
|
78
|
+
mailboxId: data.mailbox_id
|
|
79
|
+
};
|
|
80
|
+
};
|
|
59
81
|
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
60
82
|
if (!isJSONObject(data)) {
|
|
61
83
|
throw new TypeError(
|
|
@@ -143,6 +165,17 @@ const unmarshalListHostingsResponse = (data) => {
|
|
|
143
165
|
totalCount: data.total_count
|
|
144
166
|
};
|
|
145
167
|
};
|
|
168
|
+
const unmarshalListMailboxesResponse = (data) => {
|
|
169
|
+
if (!isJSONObject(data)) {
|
|
170
|
+
throw new TypeError(
|
|
171
|
+
`Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
mailboxes: unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),
|
|
176
|
+
totalCount: data.total_count
|
|
177
|
+
};
|
|
178
|
+
};
|
|
146
179
|
const unmarshalOfferProduct = (data) => {
|
|
147
180
|
if (!isJSONObject(data)) {
|
|
148
181
|
throw new TypeError(
|
|
@@ -212,6 +245,17 @@ const unmarshalSession = (data) => {
|
|
|
212
245
|
const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
213
246
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
214
247
|
});
|
|
248
|
+
const marshalEmailAddress = (request, defaults) => ({
|
|
249
|
+
domain: request.domain,
|
|
250
|
+
login: request.login
|
|
251
|
+
});
|
|
252
|
+
const marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({
|
|
253
|
+
email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0,
|
|
254
|
+
password: request.password
|
|
255
|
+
});
|
|
256
|
+
const marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({
|
|
257
|
+
password: request.password
|
|
258
|
+
});
|
|
215
259
|
const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
|
|
216
260
|
update_all_records: request.updateAllRecords,
|
|
217
261
|
update_mail_record: request.updateMailRecord,
|
|
@@ -239,6 +283,8 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
239
283
|
});
|
|
240
284
|
export {
|
|
241
285
|
marshalCheckUserOwnsDomainRequest,
|
|
286
|
+
marshalClassicMailApiCreateMailboxRequest,
|
|
287
|
+
marshalClassicMailApiUpdateMailboxRequest,
|
|
242
288
|
marshalCreateHostingRequest,
|
|
243
289
|
marshalUpdateHostingRequest,
|
|
244
290
|
unmarshalCheckUserOwnsDomainResponse,
|
|
@@ -246,7 +292,9 @@ export {
|
|
|
246
292
|
unmarshalHosting,
|
|
247
293
|
unmarshalListControlPanelsResponse,
|
|
248
294
|
unmarshalListHostingsResponse,
|
|
295
|
+
unmarshalListMailboxesResponse,
|
|
249
296
|
unmarshalListOffersResponse,
|
|
297
|
+
unmarshalMailbox,
|
|
250
298
|
unmarshalResetHostingPasswordResponse,
|
|
251
299
|
unmarshalSession
|
|
252
300
|
};
|
|
@@ -19,6 +19,12 @@ export interface HostingOption {
|
|
|
19
19
|
/** Option name. */
|
|
20
20
|
name: string;
|
|
21
21
|
}
|
|
22
|
+
export interface EmailAddress {
|
|
23
|
+
/** Domain part of the mailbox address. */
|
|
24
|
+
domain: string;
|
|
25
|
+
/** Username part address of the mailbox address. */
|
|
26
|
+
login: string;
|
|
27
|
+
}
|
|
22
28
|
export interface OfferProduct {
|
|
23
29
|
/** Product name. */
|
|
24
30
|
name: string;
|
|
@@ -132,6 +138,12 @@ export interface Hosting {
|
|
|
132
138
|
/** Region where the Web Hosting plan is hosted. */
|
|
133
139
|
region: Region;
|
|
134
140
|
}
|
|
141
|
+
export interface Mailbox {
|
|
142
|
+
/** The ID of the mailbox. */
|
|
143
|
+
mailboxId: number;
|
|
144
|
+
/** The email address of the mailbox. */
|
|
145
|
+
email?: EmailAddress;
|
|
146
|
+
}
|
|
135
147
|
export interface Offer {
|
|
136
148
|
/** Offer ID. */
|
|
137
149
|
id: string;
|
|
@@ -168,6 +180,72 @@ export interface CheckUserOwnsDomainResponse {
|
|
|
168
180
|
/** Indicates whether the specified project owns the domain. */
|
|
169
181
|
ownsDomain: boolean;
|
|
170
182
|
}
|
|
183
|
+
export type ClassicMailApiCreateMailboxRequest = {
|
|
184
|
+
/**
|
|
185
|
+
* Region to target. If none is passed will use default region from the
|
|
186
|
+
* config.
|
|
187
|
+
*/
|
|
188
|
+
region?: Region;
|
|
189
|
+
/** The Online hosting ID. */
|
|
190
|
+
onlineId: number;
|
|
191
|
+
/** The email address of the mailbox. */
|
|
192
|
+
email?: EmailAddress;
|
|
193
|
+
/** Password for the new mailbox. */
|
|
194
|
+
password: string;
|
|
195
|
+
};
|
|
196
|
+
export type ClassicMailApiDeleteMailboxRequest = {
|
|
197
|
+
/**
|
|
198
|
+
* Region to target. If none is passed will use default region from the
|
|
199
|
+
* config.
|
|
200
|
+
*/
|
|
201
|
+
region?: Region;
|
|
202
|
+
/** The Online hosting ID. */
|
|
203
|
+
onlineId: number;
|
|
204
|
+
/** The ID of the mailbox to delete. */
|
|
205
|
+
mailboxId: number;
|
|
206
|
+
};
|
|
207
|
+
export type ClassicMailApiGetMailboxRequest = {
|
|
208
|
+
/**
|
|
209
|
+
* Region to target. If none is passed will use default region from the
|
|
210
|
+
* config.
|
|
211
|
+
*/
|
|
212
|
+
region?: Region;
|
|
213
|
+
/** The Online hosting ID. */
|
|
214
|
+
onlineId: number;
|
|
215
|
+
/** The ID of the mailbox to get. */
|
|
216
|
+
mailboxId: number;
|
|
217
|
+
};
|
|
218
|
+
export type ClassicMailApiListMailboxesRequest = {
|
|
219
|
+
/**
|
|
220
|
+
* Region to target. If none is passed will use default region from the
|
|
221
|
+
* config.
|
|
222
|
+
*/
|
|
223
|
+
region?: Region;
|
|
224
|
+
/** The Online hosting ID. */
|
|
225
|
+
onlineId: number;
|
|
226
|
+
/** Page number (must be a positive integer). */
|
|
227
|
+
page?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Number of mailboxes to return (must be a positive integer lower or equal to
|
|
230
|
+
* 100).
|
|
231
|
+
*/
|
|
232
|
+
pageSize?: number;
|
|
233
|
+
/** Domain to filter the mailboxes. */
|
|
234
|
+
domain?: string;
|
|
235
|
+
};
|
|
236
|
+
export type ClassicMailApiUpdateMailboxRequest = {
|
|
237
|
+
/**
|
|
238
|
+
* Region to target. If none is passed will use default region from the
|
|
239
|
+
* config.
|
|
240
|
+
*/
|
|
241
|
+
region?: Region;
|
|
242
|
+
/** The Online hosting ID. */
|
|
243
|
+
onlineId: number;
|
|
244
|
+
/** The ID of the mailbox to update. */
|
|
245
|
+
mailboxId: number;
|
|
246
|
+
/** New password for the mailbox. */
|
|
247
|
+
password?: string;
|
|
248
|
+
};
|
|
171
249
|
export type CreateHostingRequest = {
|
|
172
250
|
/**
|
|
173
251
|
* Region to target. If none is passed will use default region from the
|
|
@@ -319,6 +397,12 @@ export interface ListHostingsResponse {
|
|
|
319
397
|
/** List of Web Hosting plans. */
|
|
320
398
|
hostings: Hosting[];
|
|
321
399
|
}
|
|
400
|
+
export interface ListMailboxesResponse {
|
|
401
|
+
/** Total number of mailboxes. */
|
|
402
|
+
totalCount: number;
|
|
403
|
+
/** List of mailboxes. */
|
|
404
|
+
mailboxes: Mailbox[];
|
|
405
|
+
}
|
|
322
406
|
export type ListOffersRequest = {
|
|
323
407
|
/**
|
|
324
408
|
* Region to target. If none is passed will use default region from the
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ClassicMailApiListMailboxesRequest = {
|
|
4
|
+
page: {
|
|
5
|
+
greaterThan: 0
|
|
6
|
+
},
|
|
7
|
+
pageSize: {
|
|
8
|
+
greaterThan: 0,
|
|
9
|
+
lessThanOrEqual: 100
|
|
10
|
+
}
|
|
11
|
+
};
|
|
3
12
|
const ListControlPanelsRequest = {
|
|
4
13
|
page: {
|
|
5
14
|
greaterThan: 0
|
|
@@ -18,5 +27,6 @@ const ListHostingsRequest = {
|
|
|
18
27
|
lessThanOrEqual: 100
|
|
19
28
|
}
|
|
20
29
|
};
|
|
30
|
+
exports.ClassicMailApiListMailboxesRequest = ClassicMailApiListMailboxesRequest;
|
|
21
31
|
exports.ListControlPanelsRequest = ListControlPanelsRequest;
|
|
22
32
|
exports.ListHostingsRequest = ListHostingsRequest;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export declare const ClassicMailApiListMailboxesRequest: {
|
|
2
|
+
page: {
|
|
3
|
+
greaterThan: number;
|
|
4
|
+
};
|
|
5
|
+
pageSize: {
|
|
6
|
+
greaterThan: number;
|
|
7
|
+
lessThanOrEqual: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
1
10
|
export declare const ListControlPanelsRequest: {
|
|
2
11
|
page: {
|
|
3
12
|
greaterThan: number;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
const ClassicMailApiListMailboxesRequest = {
|
|
2
|
+
page: {
|
|
3
|
+
greaterThan: 0
|
|
4
|
+
},
|
|
5
|
+
pageSize: {
|
|
6
|
+
greaterThan: 0,
|
|
7
|
+
lessThanOrEqual: 100
|
|
8
|
+
}
|
|
9
|
+
};
|
|
1
10
|
const ListControlPanelsRequest = {
|
|
2
11
|
page: {
|
|
3
12
|
greaterThan: 0
|
|
@@ -17,6 +26,7 @@ const ListHostingsRequest = {
|
|
|
17
26
|
}
|
|
18
27
|
};
|
|
19
28
|
export {
|
|
29
|
+
ClassicMailApiListMailboxesRequest,
|
|
20
30
|
ListControlPanelsRequest,
|
|
21
31
|
ListHostingsRequest
|
|
22
32
|
};
|
|
@@ -38,10 +38,7 @@ type URLParameterValue = string | number | boolean | Date | null;
|
|
|
38
38
|
*
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
|
-
export declare const urlParams: (...paramTuples: Readonly<[
|
|
42
|
-
string,
|
|
43
|
-
URLParameterValue | URLParameterValue[] | undefined
|
|
44
|
-
]>[]) => URLSearchParams;
|
|
41
|
+
export declare const urlParams: (...paramTuples: Readonly<[string, URLParameterValue | URLParameterValue[] | undefined]>[]) => URLSearchParams;
|
|
45
42
|
/**
|
|
46
43
|
* Unmarshals data to Date object.
|
|
47
44
|
*
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.
|
|
1
|
+
export declare const version = "v2.43.0";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.43.0";
|
package/dist/scw/constants.js
CHANGED
|
@@ -9,7 +9,7 @@ export type PaginatedFetcher<T, R extends PaginationOptions = PaginationOptions>
|
|
|
9
9
|
export type PaginatedContent<K extends string, T = unknown> = PaginatedResponse & {
|
|
10
10
|
[key in K]: T[];
|
|
11
11
|
};
|
|
12
|
-
export declare const extract: <K extends string>(key: K) => <T extends PaginatedContent<K
|
|
12
|
+
export declare const extract: <K extends string>(key: K) => <T extends PaginatedContent<K>>(result: T) => T[K];
|
|
13
13
|
/**
|
|
14
14
|
* Fetches a paginated resource.
|
|
15
15
|
*
|
|
@@ -29,7 +29,7 @@ export declare function fetchPaginated<K extends string, T extends PaginatedCont
|
|
|
29
29
|
* @param initial - The first page
|
|
30
30
|
* @returns A resources array Promise
|
|
31
31
|
*/
|
|
32
|
-
export declare const fetchAll: <K extends string, T extends PaginatedContent<K
|
|
32
|
+
export declare const fetchAll: <K extends string, T extends PaginatedContent<K>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R, initial?: Promise<T>) => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
|
|
33
33
|
/**
|
|
34
34
|
* Enriches a listing method with helpers.
|
|
35
35
|
*
|
|
@@ -40,7 +40,7 @@ export declare const fetchAll: <K extends string, T extends PaginatedContent<K,
|
|
|
40
40
|
*
|
|
41
41
|
* @internal
|
|
42
42
|
*/
|
|
43
|
-
export declare const enrichForPagination: <K extends string, T extends PaginatedContent<K
|
|
43
|
+
export declare const enrichForPagination: <K extends string, T extends PaginatedContent<K>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R) => Promise<T> & {
|
|
44
44
|
all: () => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
|
|
45
45
|
[Symbol.asyncIterator]: () => AsyncGenerator<T[K], void, void>;
|
|
46
46
|
};
|
|
@@ -22,4 +22,4 @@ export declare const fixLegacyTotalCount: <T>(obj: T, headers: Headers) => T;
|
|
|
22
22
|
*
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
|
-
export declare const responseParser: <T>(unmarshaller: ResponseUnmarshaller<T>, responseType:
|
|
25
|
+
export declare const responseParser: <T>(unmarshaller: ResponseUnmarshaller<T>, responseType: "json" | "text" | "blob") => (response: Response) => Promise<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bundledDependencies": [
|
|
40
40
|
"@scaleway/random-name"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "cb232b2ecafc417dee225af4b9e23493ed39a6b8"
|
|
43
43
|
}
|