@scaleway/sdk-webhosting 1.3.0 → 2.1.1
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 +25 -5
- package/dist/v1/api.gen.js +133 -134
- package/dist/v1/content.gen.js +9 -3
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +5 -2
- package/dist/v1/marshalling.gen.d.ts +4 -1
- package/dist/v1/marshalling.gen.js +50 -59
- package/dist/v1/types.gen.d.ts +69 -19
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1/api.gen.cjs +0 -983
- package/dist/v1/content.gen.cjs +0 -15
- package/dist/v1/index.gen.cjs +0 -69
- package/dist/v1/marshalling.gen.cjs +0 -794
- 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
|
|
|
@@ -353,7 +353,7 @@ export declare class HostingAPI extends ParentAPI {
|
|
|
353
353
|
*/
|
|
354
354
|
getResourceSummary: (request: Readonly<HostingApiGetResourceSummaryRequest>) => Promise<ResourceSummary>;
|
|
355
355
|
/**
|
|
356
|
-
* Attach a custom domain to a webhosting.
|
|
356
|
+
* Attach a custom domain to a webhosting as an alias to the main domain.
|
|
357
357
|
*
|
|
358
358
|
* @param request - The request {@link HostingApiAddCustomDomainRequest}
|
|
359
359
|
* @returns A Promise of HostingSummary
|
|
@@ -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.
|
|
@@ -498,7 +505,20 @@ export declare class WebsiteAPI extends ParentAPI {
|
|
|
498
505
|
* @returns A Promise of ListWebsitesResponse
|
|
499
506
|
*/
|
|
500
507
|
listWebsites: (request: Readonly<WebsiteApiListWebsitesRequest>) => Promise<ListWebsitesResponse> & {
|
|
501
|
-
all: () => Promise<
|
|
502
|
-
[Symbol.asyncIterator]: () => AsyncGenerator<
|
|
508
|
+
all: () => Promise<Website[]>;
|
|
509
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Website[], void, void>;
|
|
503
510
|
};
|
|
511
|
+
/**
|
|
512
|
+
* Create a new website and attach it to a webhosting.
|
|
513
|
+
*
|
|
514
|
+
* @param request - The request {@link WebsiteApiCreateWebsiteRequest}
|
|
515
|
+
* @returns A Promise of Website
|
|
516
|
+
*/
|
|
517
|
+
createWebsite: (request: Readonly<WebsiteApiCreateWebsiteRequest>) => Promise<Website>;
|
|
518
|
+
/**
|
|
519
|
+
* Delete a website from a webhosting.
|
|
520
|
+
*
|
|
521
|
+
* @param request - The request {@link WebsiteApiDeleteWebsiteRequest}
|
|
522
|
+
*/
|
|
523
|
+
deleteWebsite: (request: Readonly<WebsiteApiDeleteWebsiteRequest>) => Promise<void>;
|
|
504
524
|
}
|