@scaleway/sdk-webhosting 1.4.0 → 2.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.
- package/README.md +96 -0
- package/dist/v1/api.gen.d.ts +9 -2
- package/dist/v1/api.gen.js +21 -1
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +2 -1
- package/dist/v1/marshalling.gen.d.ts +2 -1
- package/dist/v1/marshalling.gen.js +22 -13
- package/dist/v1/types.gen.d.ts +41 -19
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -1009
- package/dist/v1/content.gen.cjs +0 -15
- package/dist/v1/index.gen.cjs +0 -71
- package/dist/v1/marshalling.gen.cjs +0 -799
- package/dist/v1/validation-rules.gen.cjs +0 -102
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-webhosting
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-webhosting)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-webhosting)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Webhosting API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-webhosting @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-webhosting @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-webhosting @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Webhosting } from '@scaleway/sdk-webhosting'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Webhosting.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Webhosting } from '@scaleway/sdk-webhosting'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Webhosting.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Webhosting API Documentation](https://www.scaleway.com/en/developers/api/webhosting/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
package/dist/v1/api.gen.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { Backup, BackupApiGetBackupRequest, BackupApiGetProgressRequest, BackupApiListBackupItemsRequest, BackupApiListBackupsRequest, BackupApiListRecentProgressesRequest, BackupApiRestoreBackupItemsRequest, BackupApiRestoreBackupRequest, CheckFreeDomainAvailabilityResponse, CheckUserOwnsDomainResponse, ControlPanelApiListControlPanelsRequest, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiDeleteDatabaseRequest, DatabaseApiDeleteDatabaseUserRequest, DatabaseApiGetDatabaseRequest, DatabaseApiGetDatabaseUserRequest, DatabaseApiListDatabasesRequest, DatabaseApiListDatabaseUsersRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiGetDomainDnsRecordsRequest, DnsApiGetDomainRequest, DnsApiSearchDomainsRequest, DnsApiSyncDomainDnsRecordsRequest, DnsRecords, Domain, FreeDomainApiCheckFreeDomainAvailabilityRequest, FreeDomainApiListFreeRootDomainsRequest, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, FtpAccountApiListFtpAccountsRequest, FtpAccountApiRemoveFtpAccountRequest, Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, HostingApiCreateSessionRequest, HostingApiDeleteHostingRequest, HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, HostingSummary, ListBackupItemsResponse, ListBackupsResponse, ListControlPanelsResponse, ListDatabasesResponse, ListDatabaseUsersResponse, ListFreeRootDomainsResponse, ListFtpAccountsResponse, ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, ListRecentProgressesResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiListMailAccountsRequest, MailAccountApiRemoveMailAccountRequest, OfferApiListOffersRequest, Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, RestoreBackupResponse, SearchDomainsResponse, Session, Website, WebsiteApiCreateWebsiteRequest, WebsiteApiDeleteWebsiteRequest, WebsiteApiListWebsitesRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Web Hosting backup API.
|
|
6
6
|
|
|
@@ -366,6 +366,13 @@ export declare class HostingAPI extends ParentAPI {
|
|
|
366
366
|
* @returns A Promise of HostingSummary
|
|
367
367
|
*/
|
|
368
368
|
removeCustomDomain: (request: Readonly<HostingApiRemoveCustomDomainRequest>) => Promise<HostingSummary>;
|
|
369
|
+
/**
|
|
370
|
+
* Migrate a hosting to a new control panel.. Migrate a hosting to a new control panel.
|
|
371
|
+
*
|
|
372
|
+
* @param request - The request {@link HostingApiMigrateControlPanelRequest}
|
|
373
|
+
* @returns A Promise of HostingSummary
|
|
374
|
+
*/
|
|
375
|
+
migrateControlPanel: (request: Readonly<HostingApiMigrateControlPanelRequest>) => Promise<HostingSummary>;
|
|
369
376
|
}
|
|
370
377
|
/**
|
|
371
378
|
* Web Hosting free domain API.
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
|
|
2
2
|
import { BACKUP_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { unmarshalListBackupsResponse, unmarshalBackup, unmarshalRestoreBackupResponse, unmarshalListBackupItemsResponse, marshalBackupApiRestoreBackupItemsRequest, unmarshalRestoreBackupItemsResponse, unmarshalProgress, unmarshalListRecentProgressesResponse, unmarshalListControlPanelsResponse, marshalDatabaseApiCreateDatabaseRequest, unmarshalDatabase, unmarshalListDatabasesResponse, marshalDatabaseApiCreateDatabaseUserRequest, unmarshalDatabaseUser, unmarshalListDatabaseUsersResponse, marshalDatabaseApiChangeDatabaseUserPasswordRequest, marshalDatabaseApiAssignDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, unmarshalDnsRecords, marshalDnsApiCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, marshalDnsApiSyncDomainDnsRecordsRequest, unmarshalSearchDomainsResponse, unmarshalDomain, unmarshalListOffersResponse, marshalHostingApiCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalHostingApiUpdateHostingRequest, unmarshalSession, unmarshalResetHostingPasswordResponse, unmarshalResourceSummary, marshalHostingApiAddCustomDomainRequest, unmarshalHostingSummary, marshalHostingApiRemoveCustomDomainRequest, marshalFreeDomainApiCheckFreeDomainAvailabilityRequest, unmarshalCheckFreeDomainAvailabilityResponse, unmarshalListFreeRootDomainsResponse, marshalFtpAccountApiCreateFtpAccountRequest, unmarshalFtpAccount, unmarshalListFtpAccountsResponse, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalMailAccountApiCreateMailAccountRequest, unmarshalMailAccount, unmarshalListMailAccountsResponse, marshalMailAccountApiRemoveMailAccountRequest, marshalMailAccountApiChangeMailAccountPasswordRequest, unmarshalListWebsitesResponse, marshalWebsiteApiCreateWebsiteRequest, unmarshalWebsite } from "./marshalling.gen.js";
|
|
3
|
+
import { unmarshalListBackupsResponse, unmarshalBackup, unmarshalRestoreBackupResponse, unmarshalListBackupItemsResponse, marshalBackupApiRestoreBackupItemsRequest, unmarshalRestoreBackupItemsResponse, unmarshalProgress, unmarshalListRecentProgressesResponse, unmarshalListControlPanelsResponse, marshalDatabaseApiCreateDatabaseRequest, unmarshalDatabase, unmarshalListDatabasesResponse, marshalDatabaseApiCreateDatabaseUserRequest, unmarshalDatabaseUser, unmarshalListDatabaseUsersResponse, marshalDatabaseApiChangeDatabaseUserPasswordRequest, marshalDatabaseApiAssignDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, unmarshalDnsRecords, marshalDnsApiCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, marshalDnsApiSyncDomainDnsRecordsRequest, unmarshalSearchDomainsResponse, unmarshalDomain, unmarshalListOffersResponse, marshalHostingApiCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalHostingApiUpdateHostingRequest, unmarshalSession, unmarshalResetHostingPasswordResponse, unmarshalResourceSummary, marshalHostingApiAddCustomDomainRequest, unmarshalHostingSummary, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiMigrateControlPanelRequest, marshalFreeDomainApiCheckFreeDomainAvailabilityRequest, unmarshalCheckFreeDomainAvailabilityResponse, unmarshalListFreeRootDomainsResponse, marshalFtpAccountApiCreateFtpAccountRequest, unmarshalFtpAccount, unmarshalListFtpAccountsResponse, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalMailAccountApiCreateMailAccountRequest, unmarshalMailAccount, unmarshalListMailAccountsResponse, marshalMailAccountApiRemoveMailAccountRequest, marshalMailAccountApiChangeMailAccountPasswordRequest, unmarshalListWebsitesResponse, marshalWebsiteApiCreateWebsiteRequest, unmarshalWebsite } from "./marshalling.gen.js";
|
|
4
4
|
const jsonContentHeaders = {
|
|
5
5
|
"Content-Type": "application/json; charset=utf-8"
|
|
6
6
|
};
|
|
@@ -716,6 +716,26 @@ class HostingAPI extends API {
|
|
|
716
716
|
},
|
|
717
717
|
unmarshalHostingSummary
|
|
718
718
|
);
|
|
719
|
+
/**
|
|
720
|
+
* Migrate a hosting to a new control panel.. Migrate a hosting to a new control panel.
|
|
721
|
+
*
|
|
722
|
+
* @param request - The request {@link HostingApiMigrateControlPanelRequest}
|
|
723
|
+
* @returns A Promise of HostingSummary
|
|
724
|
+
*/
|
|
725
|
+
migrateControlPanel = (request) => this.client.fetch(
|
|
726
|
+
{
|
|
727
|
+
body: JSON.stringify(
|
|
728
|
+
marshalHostingApiMigrateControlPanelRequest(
|
|
729
|
+
request,
|
|
730
|
+
this.client.settings
|
|
731
|
+
)
|
|
732
|
+
),
|
|
733
|
+
headers: jsonContentHeaders,
|
|
734
|
+
method: "POST",
|
|
735
|
+
path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/migrate-control-panel`
|
|
736
|
+
},
|
|
737
|
+
unmarshalHostingSummary
|
|
738
|
+
);
|
|
719
739
|
}
|
|
720
740
|
class FreeDomainAPI extends API {
|
|
721
741
|
/**
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BackupAPI, ControlPanelAPI, DatabaseAPI, DnsAPI, FreeDomainAPI, FtpAccountAPI, HostingAPI, MailAccountAPI, OfferAPI, WebsiteAPI, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { AutoConfigDomainDns, Backup, BackupApiGetBackupRequest, BackupApiGetProgressRequest, BackupApiListBackupItemsRequest, BackupApiListBackupsRequest, BackupApiListRecentProgressesRequest, BackupApiRestoreBackupItemsRequest, BackupApiRestoreBackupRequest, BackupItem, BackupItemGroup, BackupItemType, BackupStatus, CheckFreeDomainAvailabilityResponse, CheckFreeDomainAvailabilityResponseUnavailableReason, CheckUserOwnsDomainResponse, ControlPanel, ControlPanelApiListControlPanelsRequest, CreateDatabaseRequestUser, CreateHostingRequestDomainConfiguration, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiDeleteDatabaseRequest, DatabaseApiDeleteDatabaseUserRequest, DatabaseApiGetDatabaseRequest, DatabaseApiGetDatabaseUserRequest,
|
|
4
|
+
export type { AutoConfigDomainDns, Backup, BackupApiGetBackupRequest, BackupApiGetProgressRequest, BackupApiListBackupItemsRequest, BackupApiListBackupsRequest, BackupApiListRecentProgressesRequest, BackupApiRestoreBackupItemsRequest, BackupApiRestoreBackupRequest, BackupItem, BackupItemGroup, BackupItemType, BackupStatus, CheckFreeDomainAvailabilityResponse, CheckFreeDomainAvailabilityResponseUnavailableReason, CheckUserOwnsDomainResponse, ControlPanel, ControlPanelApiListControlPanelsRequest, CreateDatabaseRequestUser, CreateHostingRequestDomainConfiguration, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiDeleteDatabaseRequest, DatabaseApiDeleteDatabaseUserRequest, DatabaseApiGetDatabaseRequest, DatabaseApiGetDatabaseUserRequest, DatabaseApiListDatabasesRequest, DatabaseApiListDatabaseUsersRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiGetDomainDnsRecordsRequest, DnsApiGetDomainRequest, DnsApiSearchDomainsRequest, DnsApiSyncDomainDnsRecordsRequest, DnsRecord, DnsRecordStatus, DnsRecords, DnsRecordsStatus, DnsRecordType, Domain, DomainAction, DomainAvailability, DomainAvailabilityAction, DomainAvailabilityStatus, DomainDnsAction, DomainStatus, DomainZoneOwner, FreeDomain, FreeDomainApiCheckFreeDomainAvailabilityRequest, FreeDomainApiListFreeRootDomainsRequest, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, FtpAccountApiListFtpAccountsRequest, FtpAccountApiRemoveFtpAccountRequest, Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, HostingApiCreateSessionRequest, HostingApiDeleteHostingRequest, HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, HostingDomain, HostingDomainCustomDomain, HostingStatus, HostingSummary, HostingUser, ListBackupItemsResponse, ListBackupsRequestOrderBy, ListBackupsResponse, ListControlPanelsResponse, ListDatabasesRequestOrderBy, ListDatabasesResponse, ListDatabaseUsersRequestOrderBy, ListDatabaseUsersResponse, ListFreeRootDomainsResponse, ListFtpAccountsRequestOrderBy, ListFtpAccountsResponse, ListHostingsRequestOrderBy, ListHostingsResponse, ListMailAccountsRequestOrderBy, ListMailAccountsResponse, ListOffersRequestOrderBy, ListOffersResponse, ListRecentProgressesResponse, ListWebsitesRequestOrderBy, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiListMailAccountsRequest, MailAccountApiRemoveMailAccountRequest, Nameserver, NameserverStatus, Offer, OfferApiListOffersRequest, OfferOption, OfferOptionName, OfferOptionRequest, OfferOptionWarning, Platform, PlatformControlPanel, PlatformControlPanelUrls, PlatformPlatformGroup, Progress, ProgressStatus, ProgressSummary, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, RestoreBackupResponse, SearchDomainsResponse, Session, SyncDomainDnsRecordsRequestRecord, Website, WebsiteApiCreateWebsiteRequest, WebsiteApiDeleteWebsiteRequest, WebsiteApiListWebsitesRequest, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
package/dist/v1/index.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BackupAPI, ControlPanelAPI, DatabaseAPI, DnsAPI, FreeDomainAPI, FtpAccountAPI, HostingAPI, MailAccountAPI, OfferAPI, WebsiteAPI } from "./api.gen.js";
|
|
2
2
|
import { BACKUP_TRANSIENT_STATUSES, DOMAIN_AVAILABILITY_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalBackupApiRestoreBackupItemsRequest, marshalDatabaseApiAssignDatabaseUserRequest, marshalDatabaseApiChangeDatabaseUserPasswordRequest, marshalDatabaseApiCreateDatabaseRequest, marshalDatabaseApiCreateDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, marshalDnsApiCheckUserOwnsDomainRequest, marshalDnsApiSyncDomainDnsRecordsRequest, marshalFreeDomainApiCheckFreeDomainAvailabilityRequest, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalFtpAccountApiCreateFtpAccountRequest, marshalHostingApiAddCustomDomainRequest, marshalHostingApiCreateHostingRequest, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiUpdateHostingRequest, marshalMailAccountApiChangeMailAccountPasswordRequest, marshalMailAccountApiCreateMailAccountRequest, marshalMailAccountApiRemoveMailAccountRequest, marshalWebsiteApiCreateWebsiteRequest, unmarshalBackup, unmarshalCheckFreeDomainAvailabilityResponse, unmarshalCheckUserOwnsDomainResponse, unmarshalDatabase, unmarshalDatabaseUser, unmarshalDnsRecords, unmarshalDomain, unmarshalFtpAccount, unmarshalHosting, unmarshalHostingSummary, unmarshalListBackupItemsResponse, unmarshalListBackupsResponse, unmarshalListControlPanelsResponse, unmarshalListDatabaseUsersResponse, unmarshalListDatabasesResponse, unmarshalListFreeRootDomainsResponse, unmarshalListFtpAccountsResponse, unmarshalListHostingsResponse, unmarshalListMailAccountsResponse, unmarshalListOffersResponse, unmarshalListRecentProgressesResponse, unmarshalListWebsitesResponse, unmarshalMailAccount, unmarshalProgress, unmarshalResetHostingPasswordResponse, unmarshalResourceSummary, unmarshalRestoreBackupItemsResponse, unmarshalRestoreBackupResponse, unmarshalSearchDomainsResponse, unmarshalSession, unmarshalWebsite } from "./marshalling.gen.js";
|
|
3
|
+
import { marshalBackupApiRestoreBackupItemsRequest, marshalDatabaseApiAssignDatabaseUserRequest, marshalDatabaseApiChangeDatabaseUserPasswordRequest, marshalDatabaseApiCreateDatabaseRequest, marshalDatabaseApiCreateDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, marshalDnsApiCheckUserOwnsDomainRequest, marshalDnsApiSyncDomainDnsRecordsRequest, marshalFreeDomainApiCheckFreeDomainAvailabilityRequest, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalFtpAccountApiCreateFtpAccountRequest, marshalHostingApiAddCustomDomainRequest, marshalHostingApiCreateHostingRequest, marshalHostingApiMigrateControlPanelRequest, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiUpdateHostingRequest, marshalMailAccountApiChangeMailAccountPasswordRequest, marshalMailAccountApiCreateMailAccountRequest, marshalMailAccountApiRemoveMailAccountRequest, marshalWebsiteApiCreateWebsiteRequest, unmarshalBackup, unmarshalCheckFreeDomainAvailabilityResponse, unmarshalCheckUserOwnsDomainResponse, unmarshalDatabase, unmarshalDatabaseUser, unmarshalDnsRecords, unmarshalDomain, unmarshalFtpAccount, unmarshalHosting, unmarshalHostingSummary, unmarshalListBackupItemsResponse, unmarshalListBackupsResponse, unmarshalListControlPanelsResponse, unmarshalListDatabaseUsersResponse, unmarshalListDatabasesResponse, unmarshalListFreeRootDomainsResponse, unmarshalListFtpAccountsResponse, unmarshalListHostingsResponse, unmarshalListMailAccountsResponse, unmarshalListOffersResponse, unmarshalListRecentProgressesResponse, unmarshalListWebsitesResponse, unmarshalMailAccount, unmarshalProgress, unmarshalResetHostingPasswordResponse, unmarshalResourceSummary, unmarshalRestoreBackupItemsResponse, unmarshalRestoreBackupResponse, unmarshalSearchDomainsResponse, unmarshalSession, unmarshalWebsite } from "./marshalling.gen.js";
|
|
4
4
|
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
5
5
|
export {
|
|
6
6
|
BACKUP_TRANSIENT_STATUSES,
|
|
@@ -31,6 +31,7 @@ export {
|
|
|
31
31
|
marshalFtpAccountApiCreateFtpAccountRequest,
|
|
32
32
|
marshalHostingApiAddCustomDomainRequest,
|
|
33
33
|
marshalHostingApiCreateHostingRequest,
|
|
34
|
+
marshalHostingApiMigrateControlPanelRequest,
|
|
34
35
|
marshalHostingApiRemoveCustomDomainRequest,
|
|
35
36
|
marshalHostingApiUpdateHostingRequest,
|
|
36
37
|
marshalMailAccountApiChangeMailAccountPasswordRequest,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { Backup, BackupApiRestoreBackupItemsRequest, CheckFreeDomainAvailabilityResponse, CheckUserOwnsDomainResponse, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiSyncDomainDnsRecordsRequest, DnsRecords, Domain, FreeDomainApiCheckFreeDomainAvailabilityRequest, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, ListBackupItemsResponse, ListBackupsResponse, ListControlPanelsResponse,
|
|
2
|
+
import type { Backup, BackupApiRestoreBackupItemsRequest, CheckFreeDomainAvailabilityResponse, CheckUserOwnsDomainResponse, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiSyncDomainDnsRecordsRequest, DnsRecords, Domain, FreeDomainApiCheckFreeDomainAvailabilityRequest, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, ListBackupItemsResponse, ListBackupsResponse, ListControlPanelsResponse, ListDatabasesResponse, ListDatabaseUsersResponse, ListFreeRootDomainsResponse, ListFtpAccountsResponse, ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, ListRecentProgressesResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiRemoveMailAccountRequest, Progress, ResetHostingPasswordResponse, ResourceSummary, RestoreBackupItemsResponse, RestoreBackupResponse, SearchDomainsResponse, Session, Website, WebsiteApiCreateWebsiteRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalBackup: (data: unknown) => Backup;
|
|
4
4
|
export declare const unmarshalDatabaseUser: (data: unknown) => DatabaseUser;
|
|
5
5
|
export declare const unmarshalDatabase: (data: unknown) => Database;
|
|
@@ -44,6 +44,7 @@ export declare const marshalFtpAccountApiChangeFtpAccountPasswordRequest: (reque
|
|
|
44
44
|
export declare const marshalFtpAccountApiCreateFtpAccountRequest: (request: FtpAccountApiCreateFtpAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
45
45
|
export declare const marshalHostingApiAddCustomDomainRequest: (request: HostingApiAddCustomDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
46
46
|
export declare const marshalHostingApiCreateHostingRequest: (request: HostingApiCreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
47
|
+
export declare const marshalHostingApiMigrateControlPanelRequest: (request: HostingApiMigrateControlPanelRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
47
48
|
export declare const marshalHostingApiRemoveCustomDomainRequest: (request: HostingApiRemoveCustomDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
48
49
|
export declare const marshalHostingApiUpdateHostingRequest: (request: HostingApiUpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
49
50
|
export declare const marshalMailAccountApiChangeMailAccountPasswordRequest: (request: MailAccountApiChangeMailAccountPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -230,6 +230,19 @@ const unmarshalPlatformControlPanelUrls = (data) => {
|
|
|
230
230
|
webmail: data.webmail
|
|
231
231
|
};
|
|
232
232
|
};
|
|
233
|
+
const unmarshalControlPanel = (data) => {
|
|
234
|
+
if (!isJSONObject(data)) {
|
|
235
|
+
throw new TypeError(
|
|
236
|
+
`Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
available: data.available,
|
|
241
|
+
availableLanguages: data.available_languages,
|
|
242
|
+
logoUrl: data.logo_url,
|
|
243
|
+
name: data.name
|
|
244
|
+
};
|
|
245
|
+
};
|
|
233
246
|
const unmarshalOfferOption = (data) => {
|
|
234
247
|
if (!isJSONObject(data)) {
|
|
235
248
|
throw new TypeError(
|
|
@@ -281,6 +294,10 @@ const unmarshalOffer = (data) => {
|
|
|
281
294
|
available: data.available,
|
|
282
295
|
billingOperationPath: data.billing_operation_path,
|
|
283
296
|
controlPanelName: data.control_panel_name,
|
|
297
|
+
controlPanels: unmarshalArrayOfObject(
|
|
298
|
+
data.control_panels,
|
|
299
|
+
unmarshalControlPanel
|
|
300
|
+
),
|
|
284
301
|
endOfLife: data.end_of_life,
|
|
285
302
|
id: data.id,
|
|
286
303
|
name: data.name,
|
|
@@ -378,19 +395,6 @@ const unmarshalListBackupsResponse = (data) => {
|
|
|
378
395
|
totalCount: data.total_count
|
|
379
396
|
};
|
|
380
397
|
};
|
|
381
|
-
const unmarshalControlPanel = (data) => {
|
|
382
|
-
if (!isJSONObject(data)) {
|
|
383
|
-
throw new TypeError(
|
|
384
|
-
`Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
return {
|
|
388
|
-
available: data.available,
|
|
389
|
-
availableLanguages: data.available_languages,
|
|
390
|
-
logoUrl: data.logo_url,
|
|
391
|
-
name: data.name
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
398
|
const unmarshalListControlPanelsResponse = (data) => {
|
|
395
399
|
if (!isJSONObject(data)) {
|
|
396
400
|
throw new TypeError(
|
|
@@ -716,6 +720,10 @@ const marshalHostingApiCreateHostingRequest = (request, defaults) => ({
|
|
|
716
720
|
subdomain: request.subdomain,
|
|
717
721
|
tags: request.tags
|
|
718
722
|
});
|
|
723
|
+
const marshalHostingApiMigrateControlPanelRequest = (request, defaults) => ({
|
|
724
|
+
control_panel_name: request.controlPanelName,
|
|
725
|
+
offer_id: request.offerId
|
|
726
|
+
});
|
|
719
727
|
const marshalHostingApiRemoveCustomDomainRequest = (request, defaults) => ({
|
|
720
728
|
domain_name: request.domainName
|
|
721
729
|
});
|
|
@@ -759,6 +767,7 @@ export {
|
|
|
759
767
|
marshalFtpAccountApiCreateFtpAccountRequest,
|
|
760
768
|
marshalHostingApiAddCustomDomainRequest,
|
|
761
769
|
marshalHostingApiCreateHostingRequest,
|
|
770
|
+
marshalHostingApiMigrateControlPanelRequest,
|
|
762
771
|
marshalHostingApiRemoveCustomDomainRequest,
|
|
763
772
|
marshalHostingApiUpdateHostingRequest,
|
|
764
773
|
marshalMailAccountApiChangeMailAccountPasswordRequest,
|
package/dist/v1/types.gen.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type ListMailAccountsRequestOrderBy = 'username_asc' | 'username_desc' |
|
|
|
22
22
|
export type ListOffersRequestOrderBy = 'price_asc';
|
|
23
23
|
export type ListWebsitesRequestOrderBy = 'domain_asc' | 'domain_desc';
|
|
24
24
|
export type NameserverStatus = 'unknown_status' | 'valid' | 'invalid';
|
|
25
|
-
export type OfferOptionName = 'unknown_name' | 'domain_count' | 'email_count' | 'storage_gb' | 'vcpu_count' | 'ram_gb' | 'backup' | 'dedicated_ip' | 'email_storage_gb' | 'database_count' | 'support';
|
|
25
|
+
export type OfferOptionName = 'unknown_name' | 'domain_count' | 'email_count' | 'storage_gb' | 'vcpu_count' | 'ram_gb' | 'backup' | 'dedicated_ip' | 'email_storage_gb' | 'database_count' | 'support' | 'additional_email';
|
|
26
26
|
export type OfferOptionWarning = 'unknown_warning' | 'quota_exceeded_warning' | 'usage_low_warning';
|
|
27
27
|
export type PlatformPlatformGroup = 'unknown_group' | 'default' | 'premium';
|
|
28
28
|
export type ProgressStatus = 'unknown_status' | 'pending' | 'processing' | 'completed' | 'partially_completed' | 'failed' | 'aborted' | 'never_finished';
|
|
@@ -76,6 +76,24 @@ export interface HostingDomainCustomDomain {
|
|
|
76
76
|
*/
|
|
77
77
|
autoConfigDomainDns?: AutoConfigDomainDns;
|
|
78
78
|
}
|
|
79
|
+
export interface ControlPanel {
|
|
80
|
+
/**
|
|
81
|
+
* Control panel name.
|
|
82
|
+
*/
|
|
83
|
+
name: string;
|
|
84
|
+
/**
|
|
85
|
+
* Define if the control panel type is available to order.
|
|
86
|
+
*/
|
|
87
|
+
available: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* URL of the control panel's logo.
|
|
90
|
+
*/
|
|
91
|
+
logoUrl: string;
|
|
92
|
+
/**
|
|
93
|
+
* List of available languages for the control panel.
|
|
94
|
+
*/
|
|
95
|
+
availableLanguages: StdLanguageCode[];
|
|
96
|
+
}
|
|
79
97
|
export interface OfferOption {
|
|
80
98
|
/**
|
|
81
99
|
* Option ID.
|
|
@@ -289,6 +307,10 @@ export interface Offer {
|
|
|
289
307
|
* Defines a warning if the maximum value for an option in the offer is exceeded.
|
|
290
308
|
*/
|
|
291
309
|
quotaWarning: OfferOptionWarning;
|
|
310
|
+
/**
|
|
311
|
+
* Lists available control panels for the specified offer.
|
|
312
|
+
*/
|
|
313
|
+
controlPanels: ControlPanel[];
|
|
292
314
|
/**
|
|
293
315
|
* Region where the offer is hosted.
|
|
294
316
|
*/
|
|
@@ -352,24 +374,6 @@ export interface Backup {
|
|
|
352
374
|
*/
|
|
353
375
|
totalItems: number;
|
|
354
376
|
}
|
|
355
|
-
export interface ControlPanel {
|
|
356
|
-
/**
|
|
357
|
-
* Control panel name.
|
|
358
|
-
*/
|
|
359
|
-
name: string;
|
|
360
|
-
/**
|
|
361
|
-
* Define if the control panel type is available to order.
|
|
362
|
-
*/
|
|
363
|
-
available: boolean;
|
|
364
|
-
/**
|
|
365
|
-
* URL of the control panel's logo.
|
|
366
|
-
*/
|
|
367
|
-
logoUrl: string;
|
|
368
|
-
/**
|
|
369
|
-
* List of available languages for the control panel.
|
|
370
|
-
*/
|
|
371
|
-
availableLanguages: StdLanguageCode[];
|
|
372
|
-
}
|
|
373
377
|
export interface DatabaseUser {
|
|
374
378
|
/**
|
|
375
379
|
* Name of the database user.
|
|
@@ -1314,6 +1318,24 @@ export type HostingApiListHostingsRequest = {
|
|
|
1314
1318
|
*/
|
|
1315
1319
|
subdomain?: string;
|
|
1316
1320
|
};
|
|
1321
|
+
export type HostingApiMigrateControlPanelRequest = {
|
|
1322
|
+
/**
|
|
1323
|
+
* Region to target. If none is passed will use default region from the config.
|
|
1324
|
+
*/
|
|
1325
|
+
region?: ScwRegion;
|
|
1326
|
+
/**
|
|
1327
|
+
* Hosting ID to migrate to a new control panel.
|
|
1328
|
+
*/
|
|
1329
|
+
hostingId: string;
|
|
1330
|
+
/**
|
|
1331
|
+
* Control panel will migrate the hosting to a new server.
|
|
1332
|
+
*/
|
|
1333
|
+
controlPanelName: string;
|
|
1334
|
+
/**
|
|
1335
|
+
* Migration.
|
|
1336
|
+
*/
|
|
1337
|
+
offerId: string;
|
|
1338
|
+
};
|
|
1317
1339
|
export type HostingApiRemoveCustomDomainRequest = {
|
|
1318
1340
|
/**
|
|
1319
1341
|
* Region to target. If none is passed will use default region from the config.
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-webhosting",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Scaleway SDK webhosting",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/webhosting"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "1.
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED