@scaleway/sdk-serverless-sqldb 2.2.1 → 2.3.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 +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1alpha1/api.gen.js +125 -180
- package/dist/v1alpha1/content.gen.js +5 -6
- package/dist/v1alpha1/index.gen.js +16 -14
- package/dist/v1alpha1/marshalling.gen.js +51 -77
- package/dist/v1alpha1/validation-rules.gen.js +40 -52
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ const api = new ServerlessSqldb.v1.API(client)
|
|
|
83
83
|
## Support
|
|
84
84
|
|
|
85
85
|
We love feedback! Feel free to reach us on:
|
|
86
|
+
|
|
86
87
|
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
88
|
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
89
|
|
|
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
|
|
|
93
94
|
## License
|
|
94
95
|
|
|
95
96
|
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __exportAll = (all, no_symbols) => {
|
|
3
|
+
let target = {};
|
|
4
|
+
for (var name in all) __defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true
|
|
7
|
+
});
|
|
8
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
export { __exportAll };
|
package/dist/index.gen.js
CHANGED
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,182 +1,127 @@
|
|
|
1
|
-
import { API as API$1, toApiLocality, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
|
|
2
1
|
import { DATABASE_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalCreateDatabaseRequest,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
unmarshalDatabase
|
|
128
|
-
);
|
|
129
|
-
/**
|
|
130
|
-
* Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter.
|
|
131
|
-
*
|
|
132
|
-
* @param request - The request {@link GetDatabaseBackupRequest}
|
|
133
|
-
* @returns A Promise of DatabaseBackup
|
|
134
|
-
*/
|
|
135
|
-
getDatabaseBackup = (request) => this.client.fetch(
|
|
136
|
-
{
|
|
137
|
-
method: "GET",
|
|
138
|
-
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}`
|
|
139
|
-
},
|
|
140
|
-
unmarshalDatabaseBackup
|
|
141
|
-
);
|
|
142
|
-
pageOfListDatabaseBackups = (request) => this.client.fetch(
|
|
143
|
-
{
|
|
144
|
-
method: "GET",
|
|
145
|
-
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`,
|
|
146
|
-
urlParams: urlParams(
|
|
147
|
-
["database_id", request.databaseId],
|
|
148
|
-
["order_by", request.orderBy],
|
|
149
|
-
["organization_id", request.organizationId],
|
|
150
|
-
["page", request.page],
|
|
151
|
-
["page_size", request.pageSize],
|
|
152
|
-
["project_id", request.projectId]
|
|
153
|
-
)
|
|
154
|
-
},
|
|
155
|
-
unmarshalListDatabaseBackupsResponse
|
|
156
|
-
);
|
|
157
|
-
/**
|
|
158
|
-
* List your Serverless SQL Database backups. List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field.
|
|
159
|
-
*
|
|
160
|
-
* @param request - The request {@link ListDatabaseBackupsRequest}
|
|
161
|
-
* @returns A Promise of ListDatabaseBackupsResponse
|
|
162
|
-
*/
|
|
163
|
-
listDatabaseBackups = (request) => enrichForPagination("backups", this.pageOfListDatabaseBackups, request);
|
|
164
|
-
/**
|
|
165
|
-
* Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter.
|
|
166
|
-
*
|
|
167
|
-
* @param request - The request {@link ExportDatabaseBackupRequest}
|
|
168
|
-
* @returns A Promise of DatabaseBackup
|
|
169
|
-
*/
|
|
170
|
-
exportDatabaseBackup = (request) => this.client.fetch(
|
|
171
|
-
{
|
|
172
|
-
body: "{}",
|
|
173
|
-
headers: jsonContentHeaders,
|
|
174
|
-
method: "POST",
|
|
175
|
-
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}/export`
|
|
176
|
-
},
|
|
177
|
-
unmarshalDatabaseBackup
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
export {
|
|
181
|
-
API
|
|
2
|
+
import { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse } from "./marshalling.gen.js";
|
|
3
|
+
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
|
+
/**
|
|
6
|
+
* Serverless SQL Databases API.
|
|
7
|
+
|
|
8
|
+
This API allows you to manage your Serverless SQL Databases.
|
|
9
|
+
*/
|
|
10
|
+
var API$1 = class extends API {
|
|
11
|
+
/**
|
|
12
|
+
* Locality of this API.
|
|
13
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
14
|
+
*/
|
|
15
|
+
static LOCALITY = toApiLocality({ regions: ["fr-par"] });
|
|
16
|
+
/**
|
|
17
|
+
* Create a new Serverless SQL Database. You must provide the following parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. You can also provide `from_backup_id` to create a database from a backup.
|
|
18
|
+
*
|
|
19
|
+
* @param request - The request {@link CreateDatabaseRequest}
|
|
20
|
+
* @returns A Promise of Database
|
|
21
|
+
*/
|
|
22
|
+
createDatabase = (request) => this.client.fetch({
|
|
23
|
+
body: JSON.stringify(marshalCreateDatabaseRequest(request, this.client.settings)),
|
|
24
|
+
headers: jsonContentHeaders,
|
|
25
|
+
method: "POST",
|
|
26
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`
|
|
27
|
+
}, unmarshalDatabase);
|
|
28
|
+
/**
|
|
29
|
+
* Get a database information. Retrieve information about your Serverless SQL Database. You must provide the `database_id` parameter.
|
|
30
|
+
*
|
|
31
|
+
* @param request - The request {@link GetDatabaseRequest}
|
|
32
|
+
* @returns A Promise of Database
|
|
33
|
+
*/
|
|
34
|
+
getDatabase = (request) => this.client.fetch({
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
|
|
37
|
+
}, unmarshalDatabase);
|
|
38
|
+
/**
|
|
39
|
+
* Waits for {@link Database} to be in a final state.
|
|
40
|
+
*
|
|
41
|
+
* @param request - The request {@link GetDatabaseRequest}
|
|
42
|
+
* @param options - The waiting options
|
|
43
|
+
* @returns A Promise of Database
|
|
44
|
+
*/
|
|
45
|
+
waitForDatabase = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DATABASE_TRANSIENT_STATUSES.includes(res.status))), this.getDatabase, request, options);
|
|
46
|
+
/**
|
|
47
|
+
* Delete a database. Deletes a database. You must provide the `database_id` parameter. All data stored in the database will be permanently deleted.
|
|
48
|
+
*
|
|
49
|
+
* @param request - The request {@link DeleteDatabaseRequest}
|
|
50
|
+
* @returns A Promise of Database
|
|
51
|
+
*/
|
|
52
|
+
deleteDatabase = (request) => this.client.fetch({
|
|
53
|
+
method: "DELETE",
|
|
54
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
|
|
55
|
+
}, unmarshalDatabase);
|
|
56
|
+
pageOfListDatabases = (request = {}) => this.client.fetch({
|
|
57
|
+
method: "GET",
|
|
58
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`,
|
|
59
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
|
|
60
|
+
}, unmarshalListDatabasesResponse);
|
|
61
|
+
/**
|
|
62
|
+
* List your Serverless SQL Databases. List all Serverless SQL Databases for a given Scaleway Organization or Scaleway Project. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
|
|
63
|
+
*
|
|
64
|
+
* @param request - The request {@link ListDatabasesRequest}
|
|
65
|
+
* @returns A Promise of ListDatabasesResponse
|
|
66
|
+
*/
|
|
67
|
+
listDatabases = (request = {}) => enrichForPagination("databases", this.pageOfListDatabases, request);
|
|
68
|
+
/**
|
|
69
|
+
* Update database information. Update CPU limits of your Serverless SQL Database. You must provide the `database_id` parameter.
|
|
70
|
+
*
|
|
71
|
+
* @param request - The request {@link UpdateDatabaseRequest}
|
|
72
|
+
* @returns A Promise of Database
|
|
73
|
+
*/
|
|
74
|
+
updateDatabase = (request) => this.client.fetch({
|
|
75
|
+
body: JSON.stringify(marshalUpdateDatabaseRequest(request, this.client.settings)),
|
|
76
|
+
headers: jsonContentHeaders,
|
|
77
|
+
method: "PATCH",
|
|
78
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}`
|
|
79
|
+
}, unmarshalDatabase);
|
|
80
|
+
/**
|
|
81
|
+
* Restore a database from a backup. Restore a database from a backup. You must provide the `backup_id` parameter.
|
|
82
|
+
*
|
|
83
|
+
* @param request - The request {@link RestoreDatabaseFromBackupRequest}
|
|
84
|
+
* @returns A Promise of Database
|
|
85
|
+
*/
|
|
86
|
+
restoreDatabaseFromBackup = (request) => this.client.fetch({
|
|
87
|
+
body: JSON.stringify(marshalRestoreDatabaseFromBackupRequest(request, this.client.settings)),
|
|
88
|
+
headers: jsonContentHeaders,
|
|
89
|
+
method: "POST",
|
|
90
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${validatePathParam("databaseId", request.databaseId)}/restore`
|
|
91
|
+
}, unmarshalDatabase);
|
|
92
|
+
/**
|
|
93
|
+
* Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link GetDatabaseBackupRequest}
|
|
96
|
+
* @returns A Promise of DatabaseBackup
|
|
97
|
+
*/
|
|
98
|
+
getDatabaseBackup = (request) => this.client.fetch({
|
|
99
|
+
method: "GET",
|
|
100
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}`
|
|
101
|
+
}, unmarshalDatabaseBackup);
|
|
102
|
+
pageOfListDatabaseBackups = (request) => this.client.fetch({
|
|
103
|
+
method: "GET",
|
|
104
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`,
|
|
105
|
+
urlParams: urlParams(["database_id", request.databaseId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize], ["project_id", request.projectId])
|
|
106
|
+
}, unmarshalListDatabaseBackupsResponse);
|
|
107
|
+
/**
|
|
108
|
+
* List your Serverless SQL Database backups. List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field.
|
|
109
|
+
*
|
|
110
|
+
* @param request - The request {@link ListDatabaseBackupsRequest}
|
|
111
|
+
* @returns A Promise of ListDatabaseBackupsResponse
|
|
112
|
+
*/
|
|
113
|
+
listDatabaseBackups = (request) => enrichForPagination("backups", this.pageOfListDatabaseBackups, request);
|
|
114
|
+
/**
|
|
115
|
+
* Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter.
|
|
116
|
+
*
|
|
117
|
+
* @param request - The request {@link ExportDatabaseBackupRequest}
|
|
118
|
+
* @returns A Promise of DatabaseBackup
|
|
119
|
+
*/
|
|
120
|
+
exportDatabaseBackup = (request) => this.client.fetch({
|
|
121
|
+
body: "{}",
|
|
122
|
+
headers: jsonContentHeaders,
|
|
123
|
+
method: "POST",
|
|
124
|
+
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam("backupId", request.backupId)}/export`
|
|
125
|
+
}, unmarshalDatabaseBackup);
|
|
182
126
|
};
|
|
127
|
+
export { API$1 as API };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
/** Lists transient statutes of the enum {@link DatabaseStatus}. */
|
|
1
2
|
const DATABASE_TRANSIENT_STATUSES = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
"creating",
|
|
4
|
+
"deleting",
|
|
5
|
+
"restoring"
|
|
5
6
|
];
|
|
6
|
-
export {
|
|
7
|
-
DATABASE_TRANSIENT_STATUSES
|
|
8
|
-
};
|
|
7
|
+
export { DATABASE_TRANSIENT_STATUSES };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { DATABASE_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
3
|
import { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse } from "./marshalling.gen.js";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
import { API } from "./api.gen.js";
|
|
5
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
6
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
API: () => API,
|
|
8
|
+
DATABASE_TRANSIENT_STATUSES: () => DATABASE_TRANSIENT_STATUSES,
|
|
9
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
10
|
+
marshalCreateDatabaseRequest: () => marshalCreateDatabaseRequest,
|
|
11
|
+
marshalRestoreDatabaseFromBackupRequest: () => marshalRestoreDatabaseFromBackupRequest,
|
|
12
|
+
marshalUpdateDatabaseRequest: () => marshalUpdateDatabaseRequest,
|
|
13
|
+
unmarshalDatabase: () => unmarshalDatabase,
|
|
14
|
+
unmarshalDatabaseBackup: () => unmarshalDatabaseBackup,
|
|
15
|
+
unmarshalListDatabaseBackupsResponse: () => unmarshalListDatabaseBackupsResponse,
|
|
16
|
+
unmarshalListDatabasesResponse: () => unmarshalListDatabasesResponse
|
|
17
|
+
});
|
|
18
|
+
export { index_gen_exports };
|
|
@@ -1,89 +1,63 @@
|
|
|
1
|
-
import { isJSONObject,
|
|
1
|
+
import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
2
|
const unmarshalDatabaseBackup = (data) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
region: data.region,
|
|
19
|
-
size: data.size,
|
|
20
|
-
status: data.status
|
|
21
|
-
};
|
|
3
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);
|
|
4
|
+
return {
|
|
5
|
+
createdAt: unmarshalDate(data.created_at),
|
|
6
|
+
databaseId: data.database_id,
|
|
7
|
+
dbSize: data.db_size,
|
|
8
|
+
downloadUrl: data.download_url,
|
|
9
|
+
downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
|
|
10
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
11
|
+
id: data.id,
|
|
12
|
+
organizationId: data.organization_id,
|
|
13
|
+
projectId: data.project_id,
|
|
14
|
+
region: data.region,
|
|
15
|
+
size: data.size,
|
|
16
|
+
status: data.status
|
|
17
|
+
};
|
|
22
18
|
};
|
|
23
19
|
const unmarshalDatabase = (data) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
region: data.region,
|
|
41
|
-
started: data.started,
|
|
42
|
-
status: data.status
|
|
43
|
-
};
|
|
20
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
|
|
21
|
+
return {
|
|
22
|
+
cpuCurrent: data.cpu_current,
|
|
23
|
+
cpuMax: data.cpu_max,
|
|
24
|
+
cpuMin: data.cpu_min,
|
|
25
|
+
createdAt: unmarshalDate(data.created_at),
|
|
26
|
+
endpoint: data.endpoint,
|
|
27
|
+
engineMajorVersion: data.engine_major_version,
|
|
28
|
+
id: data.id,
|
|
29
|
+
name: data.name,
|
|
30
|
+
organizationId: data.organization_id,
|
|
31
|
+
projectId: data.project_id,
|
|
32
|
+
region: data.region,
|
|
33
|
+
started: data.started,
|
|
34
|
+
status: data.status
|
|
35
|
+
};
|
|
44
36
|
};
|
|
45
37
|
const unmarshalListDatabaseBackupsResponse = (data) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
backups: unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup),
|
|
53
|
-
totalCount: data.total_count
|
|
54
|
-
};
|
|
38
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);
|
|
39
|
+
return {
|
|
40
|
+
backups: unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup),
|
|
41
|
+
totalCount: data.total_count
|
|
42
|
+
};
|
|
55
43
|
};
|
|
56
44
|
const unmarshalListDatabasesResponse = (data) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
64
|
-
totalCount: data.total_count
|
|
65
|
-
};
|
|
45
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
|
|
46
|
+
return {
|
|
47
|
+
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
48
|
+
totalCount: data.total_count
|
|
49
|
+
};
|
|
66
50
|
};
|
|
67
51
|
const marshalCreateDatabaseRequest = (request, defaults) => ({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
const marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({
|
|
75
|
-
backup_id: request.backupId
|
|
52
|
+
cpu_max: request.cpuMax,
|
|
53
|
+
cpu_min: request.cpuMin,
|
|
54
|
+
from_backup_id: request.fromBackupId,
|
|
55
|
+
name: request.name,
|
|
56
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
76
57
|
});
|
|
58
|
+
const marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({ backup_id: request.backupId });
|
|
77
59
|
const marshalUpdateDatabaseRequest = (request, defaults) => ({
|
|
78
|
-
|
|
79
|
-
|
|
60
|
+
cpu_max: request.cpuMax,
|
|
61
|
+
cpu_min: request.cpuMin
|
|
80
62
|
});
|
|
81
|
-
export {
|
|
82
|
-
marshalCreateDatabaseRequest,
|
|
83
|
-
marshalRestoreDatabaseFromBackupRequest,
|
|
84
|
-
marshalUpdateDatabaseRequest,
|
|
85
|
-
unmarshalDatabase,
|
|
86
|
-
unmarshalDatabaseBackup,
|
|
87
|
-
unmarshalListDatabaseBackupsResponse,
|
|
88
|
-
unmarshalListDatabasesResponse
|
|
89
|
-
};
|
|
63
|
+
export { marshalCreateDatabaseRequest, marshalRestoreDatabaseFromBackupRequest, marshalUpdateDatabaseRequest, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalListDatabaseBackupsResponse, unmarshalListDatabasesResponse };
|
|
@@ -1,62 +1,50 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
3
|
+
CreateDatabaseRequest: () => CreateDatabaseRequest,
|
|
4
|
+
Database: () => Database,
|
|
5
|
+
ListDatabaseBackupsRequest: () => ListDatabaseBackupsRequest,
|
|
6
|
+
ListDatabasesRequest: () => ListDatabasesRequest,
|
|
7
|
+
UpdateDatabaseRequest: () => UpdateDatabaseRequest
|
|
8
|
+
});
|
|
1
9
|
const CreateDatabaseRequest = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name: {
|
|
13
|
-
maxLength: 63,
|
|
14
|
-
minLength: 1
|
|
15
|
-
}
|
|
10
|
+
cpuMax: {
|
|
11
|
+
greaterThanOrEqual: 1,
|
|
12
|
+
lessThanOrEqual: 15
|
|
13
|
+
},
|
|
14
|
+
cpuMin: { lessThanOrEqual: 15 },
|
|
15
|
+
fromBackupId: { ignoreEmpty: true },
|
|
16
|
+
name: {
|
|
17
|
+
maxLength: 63,
|
|
18
|
+
minLength: 1
|
|
19
|
+
}
|
|
16
20
|
};
|
|
17
21
|
const Database = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
cpuMin: {
|
|
26
|
-
lessThanOrEqual: 15
|
|
27
|
-
}
|
|
22
|
+
cpuCurrent: { lessThanOrEqual: 15 },
|
|
23
|
+
cpuMax: {
|
|
24
|
+
greaterThanOrEqual: 1,
|
|
25
|
+
lessThanOrEqual: 15
|
|
26
|
+
},
|
|
27
|
+
cpuMin: { lessThanOrEqual: 15 }
|
|
28
28
|
};
|
|
29
29
|
const ListDatabaseBackupsRequest = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
lessThanOrEqual: 1e3
|
|
36
|
-
}
|
|
30
|
+
page: { greaterThanOrEqual: 1 },
|
|
31
|
+
pageSize: {
|
|
32
|
+
greaterThanOrEqual: 1,
|
|
33
|
+
lessThanOrEqual: 1e3
|
|
34
|
+
}
|
|
37
35
|
};
|
|
38
36
|
const ListDatabasesRequest = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
lessThanOrEqual: 1e3
|
|
45
|
-
}
|
|
37
|
+
page: { greaterThanOrEqual: 1 },
|
|
38
|
+
pageSize: {
|
|
39
|
+
greaterThanOrEqual: 1,
|
|
40
|
+
lessThanOrEqual: 1e3
|
|
41
|
+
}
|
|
46
42
|
};
|
|
47
43
|
const UpdateDatabaseRequest = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
lessThanOrEqual: 15
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
CreateDatabaseRequest,
|
|
58
|
-
Database,
|
|
59
|
-
ListDatabaseBackupsRequest,
|
|
60
|
-
ListDatabasesRequest,
|
|
61
|
-
UpdateDatabaseRequest
|
|
44
|
+
cpuMax: {
|
|
45
|
+
greaterThanOrEqual: 1,
|
|
46
|
+
lessThanOrEqual: 15
|
|
47
|
+
},
|
|
48
|
+
cpuMin: { lessThanOrEqual: 15 }
|
|
62
49
|
};
|
|
50
|
+
export { validation_rules_gen_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-serverless-sqldb",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Scaleway SDK serverless-sqldb",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@scaleway/random-name": "5.1.2",
|
|
30
|
-
"@scaleway/sdk-std": "2.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.1
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.1
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|