@scaleway/sdk 2.56.0 → 2.58.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/index.gen.cjs +4 -0
- package/dist/api/audit_trail/index.gen.d.ts +5 -0
- package/dist/api/audit_trail/index.gen.js +4 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.cjs +59 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.d.ts +30 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.js +59 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.cjs +6 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.js +6 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +155 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.d.ts +5 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +155 -0
- package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +161 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.cjs +19 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.d.ts +16 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.js +19 -0
- package/dist/api/billing/v2beta1/types.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +5 -1
- package/dist/api/iam/v1alpha1/api.gen.cjs +9 -7
- package/dist/api/iam/v1alpha1/api.gen.d.ts +9 -7
- package/dist/api/iam/v1alpha1/api.gen.js +9 -7
- package/dist/api/iam/v1alpha1/types.gen.d.ts +2 -2
- package/dist/api/index.gen.d.ts +2 -1
- package/dist/api/instance/v1/api.gen.cjs +11 -0
- package/dist/api/instance/v1/api.gen.d.ts +2 -1
- package/dist/api/instance/v1/api.gen.js +12 -1
- package/dist/api/instance/v1/index.gen.d.ts +1 -1
- package/dist/api/instance/v1/marshalling.gen.cjs +5 -1
- package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/instance/v1/marshalling.gen.js +5 -1
- package/dist/api/instance/v1/types.gen.d.ts +10 -5
- 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 +6 -1
- package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +6 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +6 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +6 -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/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/rdb/v1/types.gen.d.ts +15 -3
- package/dist/api/tem/v1alpha1/types.gen.d.ts +1 -1
- 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 +123 -50
- package/dist/api/webhosting/v1/marshalling.gen.d.ts +4 -1
- package/dist/api/webhosting/v1/marshalling.gen.js +124 -51
- package/dist/api/webhosting/v1/types.gen.d.ts +124 -60
- package/dist/index.cjs +46 -44
- package/dist/index.js +46 -44
- 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,6 +268,7 @@ const unmarshalHostingSummary = (data) => {
|
|
|
170
268
|
);
|
|
171
269
|
}
|
|
172
270
|
return {
|
|
271
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
173
272
|
domain: data.domain,
|
|
174
273
|
id: data.id,
|
|
175
274
|
projectId: data.project_id,
|
|
@@ -204,38 +303,6 @@ const unmarshalListMailAccountsResponse = (data) => {
|
|
|
204
303
|
totalCount: data.total_count
|
|
205
304
|
};
|
|
206
305
|
};
|
|
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
306
|
const unmarshalListOffersResponse = (data) => {
|
|
240
307
|
if (!json.isJSONObject(data)) {
|
|
241
308
|
throw new TypeError(
|
|
@@ -319,6 +386,9 @@ const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
|
319
386
|
const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({
|
|
320
387
|
username: request.username
|
|
321
388
|
});
|
|
389
|
+
const marshalDnsApiCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
390
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
391
|
+
});
|
|
322
392
|
const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({
|
|
323
393
|
password: request.password
|
|
324
394
|
});
|
|
@@ -380,6 +450,7 @@ exports.marshalDatabaseApiChangeDatabaseUserPasswordRequest = marshalDatabaseApi
|
|
|
380
450
|
exports.marshalDatabaseApiCreateDatabaseRequest = marshalDatabaseApiCreateDatabaseRequest;
|
|
381
451
|
exports.marshalDatabaseApiCreateDatabaseUserRequest = marshalDatabaseApiCreateDatabaseUserRequest;
|
|
382
452
|
exports.marshalDatabaseApiUnassignDatabaseUserRequest = marshalDatabaseApiUnassignDatabaseUserRequest;
|
|
453
|
+
exports.marshalDnsApiCheckUserOwnsDomainRequest = marshalDnsApiCheckUserOwnsDomainRequest;
|
|
383
454
|
exports.marshalFtpAccountApiChangeFtpAccountPasswordRequest = marshalFtpAccountApiChangeFtpAccountPasswordRequest;
|
|
384
455
|
exports.marshalFtpAccountApiCreateFtpAccountRequest = marshalFtpAccountApiCreateFtpAccountRequest;
|
|
385
456
|
exports.marshalHostingApiCreateHostingRequest = marshalHostingApiCreateHostingRequest;
|
|
@@ -387,8 +458,10 @@ exports.marshalHostingApiUpdateHostingRequest = marshalHostingApiUpdateHostingRe
|
|
|
387
458
|
exports.marshalMailAccountApiChangeMailAccountPasswordRequest = marshalMailAccountApiChangeMailAccountPasswordRequest;
|
|
388
459
|
exports.marshalMailAccountApiCreateMailAccountRequest = marshalMailAccountApiCreateMailAccountRequest;
|
|
389
460
|
exports.marshalMailAccountApiRemoveMailAccountRequest = marshalMailAccountApiRemoveMailAccountRequest;
|
|
461
|
+
exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
|
|
390
462
|
exports.unmarshalDatabase = unmarshalDatabase;
|
|
391
463
|
exports.unmarshalDatabaseUser = unmarshalDatabaseUser;
|
|
464
|
+
exports.unmarshalDnsRecords = unmarshalDnsRecords;
|
|
392
465
|
exports.unmarshalFtpAccount = unmarshalFtpAccount;
|
|
393
466
|
exports.unmarshalHosting = unmarshalHosting;
|
|
394
467
|
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 {
|
|
3
|
+
import { unmarshalArrayOfObject, unmarshalDate } 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,6 +266,7 @@ const unmarshalHostingSummary = (data) => {
|
|
|
168
266
|
);
|
|
169
267
|
}
|
|
170
268
|
return {
|
|
269
|
+
createdAt: unmarshalDate(data.created_at),
|
|
171
270
|
domain: data.domain,
|
|
172
271
|
id: data.id,
|
|
173
272
|
projectId: data.project_id,
|
|
@@ -202,38 +301,6 @@ const unmarshalListMailAccountsResponse = (data) => {
|
|
|
202
301
|
totalCount: data.total_count
|
|
203
302
|
};
|
|
204
303
|
};
|
|
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
304
|
const unmarshalListOffersResponse = (data) => {
|
|
238
305
|
if (!isJSONObject(data)) {
|
|
239
306
|
throw new TypeError(
|
|
@@ -317,6 +384,9 @@ const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({
|
|
|
317
384
|
const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({
|
|
318
385
|
username: request.username
|
|
319
386
|
});
|
|
387
|
+
const marshalDnsApiCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
388
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
389
|
+
});
|
|
320
390
|
const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({
|
|
321
391
|
password: request.password
|
|
322
392
|
});
|
|
@@ -379,6 +449,7 @@ export {
|
|
|
379
449
|
marshalDatabaseApiCreateDatabaseRequest,
|
|
380
450
|
marshalDatabaseApiCreateDatabaseUserRequest,
|
|
381
451
|
marshalDatabaseApiUnassignDatabaseUserRequest,
|
|
452
|
+
marshalDnsApiCheckUserOwnsDomainRequest,
|
|
382
453
|
marshalFtpAccountApiChangeFtpAccountPasswordRequest,
|
|
383
454
|
marshalFtpAccountApiCreateFtpAccountRequest,
|
|
384
455
|
marshalHostingApiCreateHostingRequest,
|
|
@@ -386,8 +457,10 @@ export {
|
|
|
386
457
|
marshalMailAccountApiChangeMailAccountPasswordRequest,
|
|
387
458
|
marshalMailAccountApiCreateMailAccountRequest,
|
|
388
459
|
marshalMailAccountApiRemoveMailAccountRequest,
|
|
460
|
+
unmarshalCheckUserOwnsDomainResponse,
|
|
389
461
|
unmarshalDatabase,
|
|
390
462
|
unmarshalDatabaseUser,
|
|
463
|
+
unmarshalDnsRecords,
|
|
391
464
|
unmarshalFtpAccount,
|
|
392
465
|
unmarshalHosting,
|
|
393
466
|
unmarshalListControlPanelsResponse,
|