@scaleway/sdk 2.57.0 → 2.59.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/audit_trail/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +12 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +12 -0
- package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +28 -0
- package/dist/api/iam/v1alpha1/api.gen.cjs +63 -7
- package/dist/api/iam/v1alpha1/api.gen.d.ts +35 -8
- package/dist/api/iam/v1alpha1/api.gen.js +64 -8
- package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +23 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +4 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.js +23 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +31 -3
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +8 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +7 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +9 -1
- package/dist/api/ipam/v1/api.gen.cjs +1 -0
- package/dist/api/ipam/v1/api.gen.js +1 -0
- package/dist/api/ipam/v1/types.gen.d.ts +5 -0
- package/dist/api/k8s/v1/marshalling.gen.cjs +1 -2
- package/dist/api/k8s/v1/marshalling.gen.js +1 -2
- package/dist/api/k8s/v1/types.gen.d.ts +2 -7
- package/dist/api/marketplace/v2/types.gen.d.ts +5 -2
- package/dist/api/mnq/v1beta1/api.gen.cjs +47 -42
- package/dist/api/mnq/v1beta1/api.gen.d.ts +51 -49
- package/dist/api/mnq/v1beta1/api.gen.js +47 -42
- package/dist/api/mnq/v1beta1/types.gen.d.ts +37 -32
- package/dist/api/tem/v1alpha1/types.gen.d.ts +1 -1
- package/dist/api/vpcgw/index.gen.cjs +2 -0
- package/dist/api/vpcgw/index.gen.d.ts +1 -0
- package/dist/api/vpcgw/index.gen.js +3 -1
- package/dist/api/vpcgw/v2/api.gen.cjs +517 -0
- package/dist/api/vpcgw/v2/api.gen.d.ts +267 -0
- package/dist/api/vpcgw/v2/api.gen.js +517 -0
- package/dist/api/vpcgw/v2/content.gen.cjs +15 -0
- package/dist/api/vpcgw/v2/content.gen.d.ts +5 -0
- package/dist/api/vpcgw/v2/content.gen.js +15 -0
- package/dist/api/vpcgw/v2/index.gen.cjs +7 -0
- package/dist/api/vpcgw/v2/index.gen.d.ts +3 -0
- package/dist/api/vpcgw/v2/index.gen.js +7 -0
- package/dist/api/vpcgw/v2/marshalling.gen.cjs +259 -0
- package/dist/api/vpcgw/v2/marshalling.gen.d.ts +22 -0
- package/dist/api/vpcgw/v2/marshalling.gen.js +259 -0
- package/dist/api/vpcgw/v2/types.gen.d.ts +450 -0
- package/dist/api/webhosting/v1/api.gen.cjs +41 -2
- package/dist/api/webhosting/v1/api.gen.d.ts +26 -2
- package/dist/api/webhosting/v1/api.gen.js +42 -3
- package/dist/api/webhosting/v1/index.gen.cjs +1 -0
- package/dist/api/webhosting/v1/index.gen.d.ts +2 -2
- package/dist/api/webhosting/v1/index.gen.js +2 -1
- package/dist/api/webhosting/v1/marshalling.gen.cjs +137 -51
- package/dist/api/webhosting/v1/marshalling.gen.d.ts +4 -1
- package/dist/api/webhosting/v1/marshalling.gen.js +138 -52
- package/dist/api/webhosting/v1/types.gen.d.ts +144 -60
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -47,10 +47,59 @@ const unmarshalMailAccount = (data) => {
|
|
|
47
47
|
username: data.username
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
const
|
|
50
|
+
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
51
51
|
if (!json.isJSONObject(data)) {
|
|
52
52
|
throw new TypeError(
|
|
53
|
-
`Unmarshalling the type '
|
|
53
|
+
`Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
ownsDomain: data.owns_domain
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const unmarshalDnsRecord = (data) => {
|
|
61
|
+
if (!json.isJSONObject(data)) {
|
|
62
|
+
throw new TypeError(
|
|
63
|
+
`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
name: data.name,
|
|
68
|
+
priority: data.priority,
|
|
69
|
+
status: data.status,
|
|
70
|
+
ttl: data.ttl,
|
|
71
|
+
type: data.type,
|
|
72
|
+
value: data.value
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalNameserver = (data) => {
|
|
76
|
+
if (!json.isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
hostname: data.hostname,
|
|
83
|
+
isDefault: data.is_default,
|
|
84
|
+
status: data.status
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const unmarshalDnsRecords = (data) => {
|
|
88
|
+
if (!json.isJSONObject(data)) {
|
|
89
|
+
throw new TypeError(
|
|
90
|
+
`Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
nameServers: marshalling.unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),
|
|
95
|
+
records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDnsRecord),
|
|
96
|
+
status: data.status
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const unmarshalPlatformControlPanelUrls = (data) => {
|
|
100
|
+
if (!json.isJSONObject(data)) {
|
|
101
|
+
throw new TypeError(
|
|
102
|
+
`Unmarshalling the type 'PlatformControlPanelUrls' failed as data isn't a dictionary.`
|
|
54
103
|
);
|
|
55
104
|
}
|
|
56
105
|
return {
|
|
@@ -58,49 +107,98 @@ const unmarshalHostingCpanelUrls = (data) => {
|
|
|
58
107
|
webmail: data.webmail
|
|
59
108
|
};
|
|
60
109
|
};
|
|
61
|
-
const
|
|
110
|
+
const unmarshalOfferOption = (data) => {
|
|
62
111
|
if (!json.isJSONObject(data)) {
|
|
63
112
|
throw new TypeError(
|
|
64
|
-
`Unmarshalling the type '
|
|
113
|
+
`Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`
|
|
65
114
|
);
|
|
66
115
|
}
|
|
67
116
|
return {
|
|
117
|
+
billingOperationPath: data.billing_operation_path,
|
|
118
|
+
currentValue: data.current_value,
|
|
68
119
|
id: data.id,
|
|
120
|
+
maxValue: data.max_value,
|
|
121
|
+
minValue: data.min_value,
|
|
69
122
|
name: data.name,
|
|
70
|
-
|
|
123
|
+
price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0,
|
|
124
|
+
quotaWarning: data.quota_warning
|
|
71
125
|
};
|
|
72
126
|
};
|
|
73
|
-
const
|
|
127
|
+
const unmarshalPlatformControlPanel = (data) => {
|
|
74
128
|
if (!json.isJSONObject(data)) {
|
|
75
129
|
throw new TypeError(
|
|
76
|
-
`Unmarshalling the type '
|
|
130
|
+
`Unmarshalling the type 'PlatformControlPanel' failed as data isn't a dictionary.`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
name: data.name,
|
|
135
|
+
urls: data.urls ? unmarshalPlatformControlPanelUrls(data.urls) : void 0
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const unmarshalHostingUser = (data) => {
|
|
139
|
+
if (!json.isJSONObject(data)) {
|
|
140
|
+
throw new TypeError(
|
|
141
|
+
`Unmarshalling the type 'HostingUser' failed as data isn't a dictionary.`
|
|
77
142
|
);
|
|
78
143
|
}
|
|
79
144
|
return {
|
|
80
145
|
contactEmail: data.contact_email,
|
|
146
|
+
oneTimePassword: data.one_time_password,
|
|
147
|
+
username: data.username
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const unmarshalOffer = (data) => {
|
|
151
|
+
if (!json.isJSONObject(data)) {
|
|
152
|
+
throw new TypeError(
|
|
153
|
+
`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
available: data.available,
|
|
158
|
+
billingOperationPath: data.billing_operation_path,
|
|
81
159
|
controlPanelName: data.control_panel_name,
|
|
82
|
-
|
|
160
|
+
endOfLife: data.end_of_life,
|
|
161
|
+
id: data.id,
|
|
162
|
+
options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOption),
|
|
163
|
+
price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const unmarshalPlatform = (data) => {
|
|
167
|
+
if (!json.isJSONObject(data)) {
|
|
168
|
+
throw new TypeError(
|
|
169
|
+
`Unmarshalling the type 'Platform' failed as data isn't a dictionary.`
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
controlPanel: data.control_panel ? unmarshalPlatformControlPanel(data.control_panel) : void 0,
|
|
174
|
+
groupName: data.group_name,
|
|
175
|
+
hostname: data.hostname,
|
|
176
|
+
ipv4: data.ipv4,
|
|
177
|
+
ipv6: data.ipv6,
|
|
178
|
+
number: data.number
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const unmarshalHosting = (data) => {
|
|
182
|
+
if (!json.isJSONObject(data)) {
|
|
183
|
+
throw new TypeError(
|
|
184
|
+
`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
83
188
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
84
189
|
dnsStatus: data.dns_status,
|
|
85
190
|
domain: data.domain,
|
|
86
191
|
id: data.id,
|
|
87
192
|
ipv4: data.ipv4,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
offerId: data.offer_id,
|
|
91
|
-
offerName: data.offer_name,
|
|
92
|
-
oneTimePassword: data.one_time_password,
|
|
93
|
-
options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption),
|
|
94
|
-
platformGroup: data.platform_group,
|
|
95
|
-
platformHostname: data.platform_hostname,
|
|
96
|
-
platformNumber: data.platform_number,
|
|
193
|
+
offer: data.offer ? unmarshalOffer(data.offer) : void 0,
|
|
194
|
+
platform: data.platform ? unmarshalPlatform(data.platform) : void 0,
|
|
97
195
|
projectId: data.project_id,
|
|
98
196
|
protected: data.protected,
|
|
99
197
|
region: data.region,
|
|
100
198
|
status: data.status,
|
|
101
199
|
tags: data.tags,
|
|
102
200
|
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
103
|
-
|
|
201
|
+
user: data.user ? unmarshalHostingUser(data.user) : void 0
|
|
104
202
|
};
|
|
105
203
|
};
|
|
106
204
|
const unmarshalControlPanel = (data) => {
|
|
@@ -170,8 +268,11 @@ const unmarshalHostingSummary = (data) => {
|
|
|
170
268
|
);
|
|
171
269
|
}
|
|
172
270
|
return {
|
|
271
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
272
|
+
dnsStatus: data.dns_status,
|
|
173
273
|
domain: data.domain,
|
|
174
274
|
id: data.id,
|
|
275
|
+
offerName: data.offer_name,
|
|
175
276
|
projectId: data.project_id,
|
|
176
277
|
protected: data.protected,
|
|
177
278
|
region: data.region,
|
|
@@ -204,38 +305,6 @@ const unmarshalListMailAccountsResponse = (data) => {
|
|
|
204
305
|
totalCount: data.total_count
|
|
205
306
|
};
|
|
206
307
|
};
|
|
207
|
-
const unmarshalOfferOption = (data) => {
|
|
208
|
-
if (!json.isJSONObject(data)) {
|
|
209
|
-
throw new TypeError(
|
|
210
|
-
`Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
return {
|
|
214
|
-
billingOperationPath: data.billing_operation_path,
|
|
215
|
-
currentValue: data.current_value,
|
|
216
|
-
id: data.id,
|
|
217
|
-
maxValue: data.max_value,
|
|
218
|
-
minValue: data.min_value,
|
|
219
|
-
name: data.name,
|
|
220
|
-
quotaWarning: data.quota_warning
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
const unmarshalOffer = (data) => {
|
|
224
|
-
if (!json.isJSONObject(data)) {
|
|
225
|
-
throw new TypeError(
|
|
226
|
-
`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
return {
|
|
230
|
-
available: data.available,
|
|
231
|
-
billingOperationPath: data.billing_operation_path,
|
|
232
|
-
controlPanelName: data.control_panel_name,
|
|
233
|
-
endOfLife: data.end_of_life,
|
|
234
|
-
id: data.id,
|
|
235
|
-
options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOption),
|
|
236
|
-
price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
308
|
const unmarshalListOffersResponse = (data) => {
|
|
240
309
|
if (!json.isJSONObject(data)) {
|
|
241
310
|
throw new TypeError(
|
|
@@ -309,8 +378,19 @@ const marshalDatabaseApiAssignDatabaseUserRequest = (request, defaults) => ({
|
|
|
309
378
|
const marshalDatabaseApiChangeDatabaseUserPasswordRequest = (request, defaults) => ({
|
|
310
379
|
password: request.password
|
|
311
380
|
});
|
|
381
|
+
const marshalCreateDatabaseRequestUser = (request, defaults) => ({
|
|
382
|
+
password: request.password,
|
|
383
|
+
username: request.username
|
|
384
|
+
});
|
|
312
385
|
const marshalDatabaseApiCreateDatabaseRequest = (request, defaults) => ({
|
|
313
|
-
database_name: request.databaseName
|
|
386
|
+
database_name: request.databaseName,
|
|
387
|
+
...marshalling.resolveOneOf([
|
|
388
|
+
{
|
|
389
|
+
param: "new_user",
|
|
390
|
+
value: request.newUser !== void 0 ? marshalCreateDatabaseRequestUser(request.newUser) : void 0
|
|
391
|
+
},
|
|
392
|
+
{ param: "existing_username", value: request.existingUsername }
|
|
393
|
+
])
|
|
314
394
|
});
|
|
315
395
|
const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
316
396
|
password: request.password,
|
|
@@ -319,6 +399,9 @@ const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
|
319
399
|
const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({
|
|
320
400
|
username: request.username
|
|
321
401
|
});
|
|
402
|
+
const marshalDnsApiCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
403
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
404
|
+
});
|
|
322
405
|
const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({
|
|
323
406
|
password: request.password
|
|
324
407
|
});
|
|
@@ -380,6 +463,7 @@ exports.marshalDatabaseApiChangeDatabaseUserPasswordRequest = marshalDatabaseApi
|
|
|
380
463
|
exports.marshalDatabaseApiCreateDatabaseRequest = marshalDatabaseApiCreateDatabaseRequest;
|
|
381
464
|
exports.marshalDatabaseApiCreateDatabaseUserRequest = marshalDatabaseApiCreateDatabaseUserRequest;
|
|
382
465
|
exports.marshalDatabaseApiUnassignDatabaseUserRequest = marshalDatabaseApiUnassignDatabaseUserRequest;
|
|
466
|
+
exports.marshalDnsApiCheckUserOwnsDomainRequest = marshalDnsApiCheckUserOwnsDomainRequest;
|
|
383
467
|
exports.marshalFtpAccountApiChangeFtpAccountPasswordRequest = marshalFtpAccountApiChangeFtpAccountPasswordRequest;
|
|
384
468
|
exports.marshalFtpAccountApiCreateFtpAccountRequest = marshalFtpAccountApiCreateFtpAccountRequest;
|
|
385
469
|
exports.marshalHostingApiCreateHostingRequest = marshalHostingApiCreateHostingRequest;
|
|
@@ -387,8 +471,10 @@ exports.marshalHostingApiUpdateHostingRequest = marshalHostingApiUpdateHostingRe
|
|
|
387
471
|
exports.marshalMailAccountApiChangeMailAccountPasswordRequest = marshalMailAccountApiChangeMailAccountPasswordRequest;
|
|
388
472
|
exports.marshalMailAccountApiCreateMailAccountRequest = marshalMailAccountApiCreateMailAccountRequest;
|
|
389
473
|
exports.marshalMailAccountApiRemoveMailAccountRequest = marshalMailAccountApiRemoveMailAccountRequest;
|
|
474
|
+
exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
|
|
390
475
|
exports.unmarshalDatabase = unmarshalDatabase;
|
|
391
476
|
exports.unmarshalDatabaseUser = unmarshalDatabaseUser;
|
|
477
|
+
exports.unmarshalDnsRecords = unmarshalDnsRecords;
|
|
392
478
|
exports.unmarshalFtpAccount = unmarshalFtpAccount;
|
|
393
479
|
exports.unmarshalHosting = unmarshalHosting;
|
|
394
480
|
exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, Hosting, HostingApiCreateHostingRequest, HostingApiUpdateHostingRequest, ListControlPanelsResponse, ListDatabaseUsersResponse, ListDatabasesResponse, ListFtpAccountsResponse, ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiRemoveMailAccountRequest, ResetHostingPasswordResponse, ResourceSummary, Session } from './types.gen';
|
|
2
|
+
import type { CheckUserOwnsDomainResponse, Database, DatabaseApiAssignDatabaseUserRequest, DatabaseApiChangeDatabaseUserPasswordRequest, DatabaseApiCreateDatabaseRequest, DatabaseApiCreateDatabaseUserRequest, DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsRecords, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, FtpAccountApiCreateFtpAccountRequest, Hosting, HostingApiCreateHostingRequest, HostingApiUpdateHostingRequest, ListControlPanelsResponse, ListDatabaseUsersResponse, ListDatabasesResponse, ListFtpAccountsResponse, ListHostingsResponse, ListMailAccountsResponse, ListOffersResponse, ListWebsitesResponse, MailAccount, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, MailAccountApiRemoveMailAccountRequest, ResetHostingPasswordResponse, ResourceSummary, Session } from './types.gen';
|
|
3
3
|
export declare const unmarshalDatabaseUser: (data: unknown) => DatabaseUser;
|
|
4
4
|
export declare const unmarshalDatabase: (data: unknown) => Database;
|
|
5
5
|
export declare const unmarshalFtpAccount: (data: unknown) => FtpAccount;
|
|
6
6
|
export declare const unmarshalMailAccount: (data: unknown) => MailAccount;
|
|
7
|
+
export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
|
|
8
|
+
export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
|
|
7
9
|
export declare const unmarshalHosting: (data: unknown) => Hosting;
|
|
8
10
|
export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
|
|
9
11
|
export declare const unmarshalListDatabaseUsersResponse: (data: unknown) => ListDatabaseUsersResponse;
|
|
@@ -21,6 +23,7 @@ export declare const marshalDatabaseApiChangeDatabaseUserPasswordRequest: (reque
|
|
|
21
23
|
export declare const marshalDatabaseApiCreateDatabaseRequest: (request: DatabaseApiCreateDatabaseRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
24
|
export declare const marshalDatabaseApiCreateDatabaseUserRequest: (request: DatabaseApiCreateDatabaseUserRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
23
25
|
export declare const marshalDatabaseApiUnassignDatabaseUserRequest: (request: DatabaseApiUnassignDatabaseUserRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
26
|
+
export declare const marshalDnsApiCheckUserOwnsDomainRequest: (request: DnsApiCheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
24
27
|
export declare const marshalFtpAccountApiChangeFtpAccountPasswordRequest: (request: FtpAccountApiChangeFtpAccountPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
25
28
|
export declare const marshalFtpAccountApiCreateFtpAccountRequest: (request: FtpAccountApiCreateFtpAccountRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
26
29
|
export declare const marshalHostingApiCreateHostingRequest: (request: HostingApiCreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
2
|
import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
|
|
3
|
-
import { unmarshalDate,
|
|
3
|
+
import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
4
|
const unmarshalDatabaseUser = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) {
|
|
6
6
|
throw new TypeError(
|
|
@@ -45,10 +45,59 @@ const unmarshalMailAccount = (data) => {
|
|
|
45
45
|
username: data.username
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
const
|
|
48
|
+
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
49
49
|
if (!isJSONObject(data)) {
|
|
50
50
|
throw new TypeError(
|
|
51
|
-
`Unmarshalling the type '
|
|
51
|
+
`Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
ownsDomain: data.owns_domain
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const unmarshalDnsRecord = (data) => {
|
|
59
|
+
if (!isJSONObject(data)) {
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
name: data.name,
|
|
66
|
+
priority: data.priority,
|
|
67
|
+
status: data.status,
|
|
68
|
+
ttl: data.ttl,
|
|
69
|
+
type: data.type,
|
|
70
|
+
value: data.value
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const unmarshalNameserver = (data) => {
|
|
74
|
+
if (!isJSONObject(data)) {
|
|
75
|
+
throw new TypeError(
|
|
76
|
+
`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
hostname: data.hostname,
|
|
81
|
+
isDefault: data.is_default,
|
|
82
|
+
status: data.status
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const unmarshalDnsRecords = (data) => {
|
|
86
|
+
if (!isJSONObject(data)) {
|
|
87
|
+
throw new TypeError(
|
|
88
|
+
`Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),
|
|
93
|
+
records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord),
|
|
94
|
+
status: data.status
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const unmarshalPlatformControlPanelUrls = (data) => {
|
|
98
|
+
if (!isJSONObject(data)) {
|
|
99
|
+
throw new TypeError(
|
|
100
|
+
`Unmarshalling the type 'PlatformControlPanelUrls' failed as data isn't a dictionary.`
|
|
52
101
|
);
|
|
53
102
|
}
|
|
54
103
|
return {
|
|
@@ -56,49 +105,98 @@ const unmarshalHostingCpanelUrls = (data) => {
|
|
|
56
105
|
webmail: data.webmail
|
|
57
106
|
};
|
|
58
107
|
};
|
|
59
|
-
const
|
|
108
|
+
const unmarshalOfferOption = (data) => {
|
|
60
109
|
if (!isJSONObject(data)) {
|
|
61
110
|
throw new TypeError(
|
|
62
|
-
`Unmarshalling the type '
|
|
111
|
+
`Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`
|
|
63
112
|
);
|
|
64
113
|
}
|
|
65
114
|
return {
|
|
115
|
+
billingOperationPath: data.billing_operation_path,
|
|
116
|
+
currentValue: data.current_value,
|
|
66
117
|
id: data.id,
|
|
118
|
+
maxValue: data.max_value,
|
|
119
|
+
minValue: data.min_value,
|
|
67
120
|
name: data.name,
|
|
68
|
-
|
|
121
|
+
price: data.price ? unmarshalMoney(data.price) : void 0,
|
|
122
|
+
quotaWarning: data.quota_warning
|
|
69
123
|
};
|
|
70
124
|
};
|
|
71
|
-
const
|
|
125
|
+
const unmarshalPlatformControlPanel = (data) => {
|
|
72
126
|
if (!isJSONObject(data)) {
|
|
73
127
|
throw new TypeError(
|
|
74
|
-
`Unmarshalling the type '
|
|
128
|
+
`Unmarshalling the type 'PlatformControlPanel' failed as data isn't a dictionary.`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
name: data.name,
|
|
133
|
+
urls: data.urls ? unmarshalPlatformControlPanelUrls(data.urls) : void 0
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
const unmarshalHostingUser = (data) => {
|
|
137
|
+
if (!isJSONObject(data)) {
|
|
138
|
+
throw new TypeError(
|
|
139
|
+
`Unmarshalling the type 'HostingUser' failed as data isn't a dictionary.`
|
|
75
140
|
);
|
|
76
141
|
}
|
|
77
142
|
return {
|
|
78
143
|
contactEmail: data.contact_email,
|
|
144
|
+
oneTimePassword: data.one_time_password,
|
|
145
|
+
username: data.username
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const unmarshalOffer = (data) => {
|
|
149
|
+
if (!isJSONObject(data)) {
|
|
150
|
+
throw new TypeError(
|
|
151
|
+
`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
available: data.available,
|
|
156
|
+
billingOperationPath: data.billing_operation_path,
|
|
79
157
|
controlPanelName: data.control_panel_name,
|
|
80
|
-
|
|
158
|
+
endOfLife: data.end_of_life,
|
|
159
|
+
id: data.id,
|
|
160
|
+
options: unmarshalArrayOfObject(data.options, unmarshalOfferOption),
|
|
161
|
+
price: data.price ? unmarshalMoney(data.price) : void 0
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
const unmarshalPlatform = (data) => {
|
|
165
|
+
if (!isJSONObject(data)) {
|
|
166
|
+
throw new TypeError(
|
|
167
|
+
`Unmarshalling the type 'Platform' failed as data isn't a dictionary.`
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
controlPanel: data.control_panel ? unmarshalPlatformControlPanel(data.control_panel) : void 0,
|
|
172
|
+
groupName: data.group_name,
|
|
173
|
+
hostname: data.hostname,
|
|
174
|
+
ipv4: data.ipv4,
|
|
175
|
+
ipv6: data.ipv6,
|
|
176
|
+
number: data.number
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
const unmarshalHosting = (data) => {
|
|
180
|
+
if (!isJSONObject(data)) {
|
|
181
|
+
throw new TypeError(
|
|
182
|
+
`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
81
186
|
createdAt: unmarshalDate(data.created_at),
|
|
82
187
|
dnsStatus: data.dns_status,
|
|
83
188
|
domain: data.domain,
|
|
84
189
|
id: data.id,
|
|
85
190
|
ipv4: data.ipv4,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
offerId: data.offer_id,
|
|
89
|
-
offerName: data.offer_name,
|
|
90
|
-
oneTimePassword: data.one_time_password,
|
|
91
|
-
options: unmarshalArrayOfObject(data.options, unmarshalHostingOption),
|
|
92
|
-
platformGroup: data.platform_group,
|
|
93
|
-
platformHostname: data.platform_hostname,
|
|
94
|
-
platformNumber: data.platform_number,
|
|
191
|
+
offer: data.offer ? unmarshalOffer(data.offer) : void 0,
|
|
192
|
+
platform: data.platform ? unmarshalPlatform(data.platform) : void 0,
|
|
95
193
|
projectId: data.project_id,
|
|
96
194
|
protected: data.protected,
|
|
97
195
|
region: data.region,
|
|
98
196
|
status: data.status,
|
|
99
197
|
tags: data.tags,
|
|
100
198
|
updatedAt: unmarshalDate(data.updated_at),
|
|
101
|
-
|
|
199
|
+
user: data.user ? unmarshalHostingUser(data.user) : void 0
|
|
102
200
|
};
|
|
103
201
|
};
|
|
104
202
|
const unmarshalControlPanel = (data) => {
|
|
@@ -168,8 +266,11 @@ const unmarshalHostingSummary = (data) => {
|
|
|
168
266
|
);
|
|
169
267
|
}
|
|
170
268
|
return {
|
|
269
|
+
createdAt: unmarshalDate(data.created_at),
|
|
270
|
+
dnsStatus: data.dns_status,
|
|
171
271
|
domain: data.domain,
|
|
172
272
|
id: data.id,
|
|
273
|
+
offerName: data.offer_name,
|
|
173
274
|
projectId: data.project_id,
|
|
174
275
|
protected: data.protected,
|
|
175
276
|
region: data.region,
|
|
@@ -202,38 +303,6 @@ const unmarshalListMailAccountsResponse = (data) => {
|
|
|
202
303
|
totalCount: data.total_count
|
|
203
304
|
};
|
|
204
305
|
};
|
|
205
|
-
const unmarshalOfferOption = (data) => {
|
|
206
|
-
if (!isJSONObject(data)) {
|
|
207
|
-
throw new TypeError(
|
|
208
|
-
`Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
billingOperationPath: data.billing_operation_path,
|
|
213
|
-
currentValue: data.current_value,
|
|
214
|
-
id: data.id,
|
|
215
|
-
maxValue: data.max_value,
|
|
216
|
-
minValue: data.min_value,
|
|
217
|
-
name: data.name,
|
|
218
|
-
quotaWarning: data.quota_warning
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
const unmarshalOffer = (data) => {
|
|
222
|
-
if (!isJSONObject(data)) {
|
|
223
|
-
throw new TypeError(
|
|
224
|
-
`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
return {
|
|
228
|
-
available: data.available,
|
|
229
|
-
billingOperationPath: data.billing_operation_path,
|
|
230
|
-
controlPanelName: data.control_panel_name,
|
|
231
|
-
endOfLife: data.end_of_life,
|
|
232
|
-
id: data.id,
|
|
233
|
-
options: unmarshalArrayOfObject(data.options, unmarshalOfferOption),
|
|
234
|
-
price: data.price ? unmarshalMoney(data.price) : void 0
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
306
|
const unmarshalListOffersResponse = (data) => {
|
|
238
307
|
if (!isJSONObject(data)) {
|
|
239
308
|
throw new TypeError(
|
|
@@ -307,8 +376,19 @@ const marshalDatabaseApiAssignDatabaseUserRequest = (request, defaults) => ({
|
|
|
307
376
|
const marshalDatabaseApiChangeDatabaseUserPasswordRequest = (request, defaults) => ({
|
|
308
377
|
password: request.password
|
|
309
378
|
});
|
|
379
|
+
const marshalCreateDatabaseRequestUser = (request, defaults) => ({
|
|
380
|
+
password: request.password,
|
|
381
|
+
username: request.username
|
|
382
|
+
});
|
|
310
383
|
const marshalDatabaseApiCreateDatabaseRequest = (request, defaults) => ({
|
|
311
|
-
database_name: request.databaseName
|
|
384
|
+
database_name: request.databaseName,
|
|
385
|
+
...resolveOneOf([
|
|
386
|
+
{
|
|
387
|
+
param: "new_user",
|
|
388
|
+
value: request.newUser !== void 0 ? marshalCreateDatabaseRequestUser(request.newUser) : void 0
|
|
389
|
+
},
|
|
390
|
+
{ param: "existing_username", value: request.existingUsername }
|
|
391
|
+
])
|
|
312
392
|
});
|
|
313
393
|
const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
314
394
|
password: request.password,
|
|
@@ -317,6 +397,9 @@ const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
|
317
397
|
const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({
|
|
318
398
|
username: request.username
|
|
319
399
|
});
|
|
400
|
+
const marshalDnsApiCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
401
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
402
|
+
});
|
|
320
403
|
const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({
|
|
321
404
|
password: request.password
|
|
322
405
|
});
|
|
@@ -379,6 +462,7 @@ export {
|
|
|
379
462
|
marshalDatabaseApiCreateDatabaseRequest,
|
|
380
463
|
marshalDatabaseApiCreateDatabaseUserRequest,
|
|
381
464
|
marshalDatabaseApiUnassignDatabaseUserRequest,
|
|
465
|
+
marshalDnsApiCheckUserOwnsDomainRequest,
|
|
382
466
|
marshalFtpAccountApiChangeFtpAccountPasswordRequest,
|
|
383
467
|
marshalFtpAccountApiCreateFtpAccountRequest,
|
|
384
468
|
marshalHostingApiCreateHostingRequest,
|
|
@@ -386,8 +470,10 @@ export {
|
|
|
386
470
|
marshalMailAccountApiChangeMailAccountPasswordRequest,
|
|
387
471
|
marshalMailAccountApiCreateMailAccountRequest,
|
|
388
472
|
marshalMailAccountApiRemoveMailAccountRequest,
|
|
473
|
+
unmarshalCheckUserOwnsDomainResponse,
|
|
389
474
|
unmarshalDatabase,
|
|
390
475
|
unmarshalDatabaseUser,
|
|
476
|
+
unmarshalDnsRecords,
|
|
391
477
|
unmarshalFtpAccount,
|
|
392
478
|
unmarshalHosting,
|
|
393
479
|
unmarshalListControlPanelsResponse,
|