@scaleway/sdk 2.67.0 → 2.69.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.
Files changed (136) hide show
  1. package/dist/api/audit_trail/v1alpha1/api.gen.cjs +6 -1
  2. package/dist/api/audit_trail/v1alpha1/api.gen.js +6 -1
  3. package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +6 -0
  4. package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +6 -0
  5. package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +55 -15
  6. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.cjs +3 -0
  7. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.d.ts +3 -0
  8. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.js +3 -0
  9. package/dist/api/baremetal/v1/api.gen.cjs +13 -0
  10. package/dist/api/baremetal/v1/api.gen.d.ts +8 -1
  11. package/dist/api/baremetal/v1/api.gen.js +13 -0
  12. package/dist/api/baremetal/v1/content.gen.cjs +2 -1
  13. package/dist/api/baremetal/v1/content.gen.js +2 -1
  14. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  15. package/dist/api/baremetal/v1/marshalling.gen.cjs +1 -0
  16. package/dist/api/baremetal/v1/marshalling.gen.js +1 -0
  17. package/dist/api/baremetal/v1/types.gen.d.ts +9 -1
  18. package/dist/api/billing/v2beta1/api.gen.cjs +9 -2
  19. package/dist/api/billing/v2beta1/api.gen.d.ts +9 -2
  20. package/dist/api/billing/v2beta1/api.gen.js +9 -2
  21. package/dist/api/billing/v2beta1/types.gen.d.ts +1 -1
  22. package/dist/api/block/index.gen.cjs +4 -2
  23. package/dist/api/block/index.gen.d.ts +1 -0
  24. package/dist/api/block/index.gen.js +4 -2
  25. package/dist/api/block/v1/api.gen.cjs +303 -0
  26. package/dist/api/block/v1/api.gen.d.ts +152 -0
  27. package/dist/api/block/v1/api.gen.js +303 -0
  28. package/dist/api/block/v1/content.gen.cjs +22 -0
  29. package/dist/api/block/v1/content.gen.d.ts +7 -0
  30. package/dist/api/block/v1/content.gen.js +22 -0
  31. package/dist/api/block/v1/index.gen.cjs +10 -0
  32. package/dist/api/block/v1/index.gen.d.ts +4 -0
  33. package/dist/api/block/v1/index.gen.js +10 -0
  34. package/dist/api/block/v1/marshalling.gen.cjs +200 -0
  35. package/dist/api/block/v1/marshalling.gen.d.ts +14 -0
  36. package/dist/api/block/v1/marshalling.gen.js +200 -0
  37. package/dist/api/block/v1/types.gen.d.ts +335 -0
  38. package/dist/api/block/v1/validation-rules.gen.cjs +56 -0
  39. package/dist/api/block/v1/validation-rules.gen.d.ts +47 -0
  40. package/dist/api/block/v1/validation-rules.gen.js +56 -0
  41. package/dist/api/block/v1alpha1/api.gen.cjs +1 -0
  42. package/dist/api/block/v1alpha1/api.gen.js +1 -0
  43. package/dist/api/block/v1alpha1/types.gen.d.ts +5 -0
  44. package/dist/api/edge_services/index.gen.cjs +2 -0
  45. package/dist/api/edge_services/index.gen.d.ts +1 -0
  46. package/dist/api/edge_services/index.gen.js +3 -1
  47. package/dist/api/edge_services/v1beta1/api.gen.cjs +941 -0
  48. package/dist/api/edge_services/v1beta1/api.gen.d.ts +454 -0
  49. package/dist/api/edge_services/v1beta1/api.gen.js +941 -0
  50. package/dist/api/edge_services/v1beta1/content.gen.cjs +8 -0
  51. package/dist/api/edge_services/v1beta1/content.gen.d.ts +5 -0
  52. package/dist/api/edge_services/v1beta1/content.gen.js +8 -0
  53. package/dist/api/{webhosting/v1alpha1 → edge_services/v1beta1}/index.gen.cjs +2 -2
  54. package/dist/api/edge_services/v1beta1/index.gen.d.ts +4 -0
  55. package/dist/api/edge_services/v1beta1/index.gen.js +9 -0
  56. package/dist/api/edge_services/v1beta1/marshalling.gen.cjs +809 -0
  57. package/dist/api/edge_services/v1beta1/marshalling.gen.d.ts +54 -0
  58. package/dist/api/edge_services/v1beta1/marshalling.gen.js +809 -0
  59. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1218 -0
  60. package/dist/api/edge_services/v1beta1/validation-rules.gen.cjs +23 -0
  61. package/dist/api/edge_services/v1beta1/validation-rules.gen.d.ts +18 -0
  62. package/dist/api/edge_services/v1beta1/validation-rules.gen.js +23 -0
  63. package/dist/api/iam/v1alpha1/api.gen.cjs +7 -0
  64. package/dist/api/iam/v1alpha1/api.gen.d.ts +2 -1
  65. package/dist/api/iam/v1alpha1/api.gen.js +8 -1
  66. package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
  67. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +51 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +2 -1
  69. package/dist/api/iam/v1alpha1/marshalling.gen.js +51 -0
  70. package/dist/api/iam/v1alpha1/types.gen.d.ts +24 -0
  71. package/dist/api/instance/v1/api.gen.cjs +18 -0
  72. package/dist/api/instance/v1/api.gen.d.ts +13 -1
  73. package/dist/api/instance/v1/api.gen.js +19 -1
  74. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  75. package/dist/api/instance/v1/marshalling.gen.cjs +12 -0
  76. package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
  77. package/dist/api/instance/v1/marshalling.gen.js +12 -0
  78. package/dist/api/instance/v1/types.gen.d.ts +12 -0
  79. package/dist/api/lb/v1/marshalling.gen.cjs +2 -0
  80. package/dist/api/lb/v1/marshalling.gen.js +2 -0
  81. package/dist/api/lb/v1/types.gen.d.ts +2 -0
  82. package/dist/api/mongodb/v1alpha1/api.gen.cjs +11 -0
  83. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +2 -1
  84. package/dist/api/mongodb/v1alpha1/api.gen.js +12 -1
  85. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  86. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +26 -1
  87. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +2 -1
  88. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +26 -1
  89. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +29 -0
  90. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +8 -0
  91. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +7 -0
  92. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +8 -0
  93. package/dist/api/secret/v1beta1/api.gen.cjs +2 -34
  94. package/dist/api/secret/v1beta1/api.gen.d.ts +3 -19
  95. package/dist/api/secret/v1beta1/api.gen.js +2 -34
  96. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  97. package/dist/api/secret/v1beta1/types.gen.d.ts +3 -19
  98. package/dist/api/tem/v1alpha1/types.gen.d.ts +5 -5
  99. package/dist/api/vpcgw/v1/api.gen.cjs +7 -0
  100. package/dist/api/vpcgw/v1/api.gen.d.ts +7 -0
  101. package/dist/api/vpcgw/v1/api.gen.js +7 -0
  102. package/dist/api/vpcgw/v1/types.gen.d.ts +1 -0
  103. package/dist/api/webhosting/index.gen.cjs +0 -2
  104. package/dist/api/webhosting/index.gen.d.ts +0 -1
  105. package/dist/api/webhosting/index.gen.js +1 -3
  106. package/dist/api/webhosting/v1/content.gen.cjs +0 -6
  107. package/dist/api/webhosting/v1/content.gen.d.ts +1 -3
  108. package/dist/api/webhosting/v1/content.gen.js +0 -6
  109. package/dist/api/webhosting/v1/index.gen.cjs +0 -1
  110. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  111. package/dist/api/webhosting/v1/index.gen.js +1 -2
  112. package/dist/api/webhosting/v1/marshalling.gen.cjs +1 -2
  113. package/dist/api/webhosting/v1/marshalling.gen.js +1 -2
  114. package/dist/api/webhosting/v1/types.gen.d.ts +3 -6
  115. package/dist/scw/constants.cjs +1 -1
  116. package/dist/scw/constants.d.ts +2 -2
  117. package/dist/scw/constants.js +1 -1
  118. package/dist/scw/errors/standard/quotas-exceeded-error.cjs +1 -1
  119. package/dist/scw/errors/standard/quotas-exceeded-error.d.ts +4 -4
  120. package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -1
  121. package/package.json +2 -2
  122. package/dist/api/webhosting/v1alpha1/api.gen.cjs +0 -339
  123. package/dist/api/webhosting/v1alpha1/api.gen.d.ts +0 -168
  124. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -339
  125. package/dist/api/webhosting/v1alpha1/content.gen.cjs +0 -8
  126. package/dist/api/webhosting/v1alpha1/content.gen.d.ts +0 -3
  127. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -8
  128. package/dist/api/webhosting/v1alpha1/index.gen.d.ts +0 -4
  129. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -9
  130. package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +0 -300
  131. package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +0 -17
  132. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -300
  133. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +0 -480
  134. package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +0 -32
  135. package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +0 -27
  136. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -32
@@ -1,300 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const json = require("../../../helpers/json.cjs");
4
- const customMarshalling = require("../../../scw/custom-marshalling.cjs");
5
- const marshalling = require("../../../helpers/marshalling.cjs");
6
- const unmarshalHostingCpanelUrls = (data) => {
7
- if (!json.isJSONObject(data)) {
8
- throw new TypeError(
9
- `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`
10
- );
11
- }
12
- return {
13
- dashboard: data.dashboard,
14
- webmail: data.webmail
15
- };
16
- };
17
- const unmarshalHostingOption = (data) => {
18
- if (!json.isJSONObject(data)) {
19
- throw new TypeError(
20
- `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`
21
- );
22
- }
23
- return {
24
- id: data.id,
25
- name: data.name
26
- };
27
- };
28
- const unmarshalHosting = (data) => {
29
- if (!json.isJSONObject(data)) {
30
- throw new TypeError(
31
- `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`
32
- );
33
- }
34
- return {
35
- controlPanelName: data.control_panel_name,
36
- cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0,
37
- createdAt: marshalling.unmarshalDate(data.created_at),
38
- dnsStatus: data.dns_status,
39
- domain: data.domain,
40
- id: data.id,
41
- ipv4: data.ipv4,
42
- ipv6: data.ipv6,
43
- offerEndOfLife: data.offer_end_of_life,
44
- offerId: data.offer_id,
45
- offerName: data.offer_name,
46
- oneTimePassword: data.one_time_password,
47
- options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption),
48
- organizationId: data.organization_id,
49
- platformGroup: data.platform_group,
50
- platformHostname: data.platform_hostname,
51
- platformNumber: data.platform_number,
52
- projectId: data.project_id,
53
- protected: data.protected,
54
- region: data.region,
55
- status: data.status,
56
- tags: data.tags,
57
- updatedAt: marshalling.unmarshalDate(data.updated_at),
58
- username: data.username
59
- };
60
- };
61
- const unmarshalEmailAddress = (data) => {
62
- if (!json.isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- domain: data.domain,
69
- login: data.login
70
- };
71
- };
72
- const unmarshalMailbox = (data) => {
73
- if (!json.isJSONObject(data)) {
74
- throw new TypeError(
75
- `Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`
76
- );
77
- }
78
- return {
79
- email: data.email ? unmarshalEmailAddress(data.email) : void 0,
80
- mailboxId: data.mailbox_id
81
- };
82
- };
83
- const unmarshalCheckUserOwnsDomainResponse = (data) => {
84
- if (!json.isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- ownsDomain: data.owns_domain
91
- };
92
- };
93
- const unmarshalDnsRecord = (data) => {
94
- if (!json.isJSONObject(data)) {
95
- throw new TypeError(
96
- `Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`
97
- );
98
- }
99
- return {
100
- name: data.name,
101
- priority: data.priority,
102
- status: data.status,
103
- ttl: data.ttl,
104
- type: data.type,
105
- value: data.value
106
- };
107
- };
108
- const unmarshalNameserver = (data) => {
109
- if (!json.isJSONObject(data)) {
110
- throw new TypeError(
111
- `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`
112
- );
113
- }
114
- return {
115
- hostname: data.hostname,
116
- isDefault: data.is_default,
117
- status: data.status
118
- };
119
- };
120
- const unmarshalDnsRecords = (data) => {
121
- if (!json.isJSONObject(data)) {
122
- throw new TypeError(
123
- `Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`
124
- );
125
- }
126
- return {
127
- nameServers: marshalling.unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),
128
- records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDnsRecord),
129
- status: data.status
130
- };
131
- };
132
- const unmarshalControlPanel = (data) => {
133
- if (!json.isJSONObject(data)) {
134
- throw new TypeError(
135
- `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`
136
- );
137
- }
138
- return {
139
- available: data.available,
140
- availableLanguages: data.available_languages,
141
- logoUrl: data.logo_url,
142
- name: data.name
143
- };
144
- };
145
- const unmarshalListControlPanelsResponse = (data) => {
146
- if (!json.isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- controlPanels: marshalling.unmarshalArrayOfObject(
153
- data.control_panels,
154
- unmarshalControlPanel
155
- ),
156
- totalCount: data.total_count
157
- };
158
- };
159
- const unmarshalListHostingsResponse = (data) => {
160
- if (!json.isJSONObject(data)) {
161
- throw new TypeError(
162
- `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`
163
- );
164
- }
165
- return {
166
- hostings: marshalling.unmarshalArrayOfObject(data.hostings, unmarshalHosting),
167
- totalCount: data.total_count
168
- };
169
- };
170
- const unmarshalListMailboxesResponse = (data) => {
171
- if (!json.isJSONObject(data)) {
172
- throw new TypeError(
173
- `Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`
174
- );
175
- }
176
- return {
177
- mailboxes: marshalling.unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),
178
- totalCount: data.total_count
179
- };
180
- };
181
- const unmarshalOfferProduct = (data) => {
182
- if (!json.isJSONObject(data)) {
183
- throw new TypeError(
184
- `Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`
185
- );
186
- }
187
- return {
188
- databasesQuota: data.databases_quota,
189
- emailAccountsQuota: data.email_accounts_quota,
190
- emailStorageQuota: data.email_storage_quota,
191
- hostingStorageQuota: data.hosting_storage_quota,
192
- maxAddonDomains: data.max_addon_domains,
193
- name: data.name,
194
- option: data.option,
195
- ram: data.ram,
196
- supportIncluded: data.support_included,
197
- vCpu: data.v_cpu
198
- };
199
- };
200
- const unmarshalOffer = (data) => {
201
- if (!json.isJSONObject(data)) {
202
- throw new TypeError(
203
- `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
204
- );
205
- }
206
- return {
207
- available: data.available,
208
- billingOperationPath: data.billing_operation_path,
209
- controlPanelName: data.control_panel_name,
210
- endOfLife: data.end_of_life,
211
- id: data.id,
212
- price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0,
213
- product: data.product ? unmarshalOfferProduct(data.product) : void 0,
214
- quotaWarnings: data.quota_warnings
215
- };
216
- };
217
- const unmarshalListOffersResponse = (data) => {
218
- if (!json.isJSONObject(data)) {
219
- throw new TypeError(
220
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
221
- );
222
- }
223
- return {
224
- offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer)
225
- };
226
- };
227
- const unmarshalResetHostingPasswordResponse = (data) => {
228
- if (!json.isJSONObject(data)) {
229
- throw new TypeError(
230
- `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`
231
- );
232
- }
233
- return {
234
- password: data.password
235
- };
236
- };
237
- const unmarshalSession = (data) => {
238
- if (!json.isJSONObject(data)) {
239
- throw new TypeError(
240
- `Unmarshalling the type 'Session' failed as data isn't a dictionary.`
241
- );
242
- }
243
- return {
244
- url: data.url
245
- };
246
- };
247
- const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
248
- project_id: request.projectId ?? defaults.defaultProjectId
249
- });
250
- const marshalEmailAddress = (request, defaults) => ({
251
- domain: request.domain,
252
- login: request.login
253
- });
254
- const marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({
255
- email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0,
256
- password: request.password
257
- });
258
- const marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({
259
- password: request.password
260
- });
261
- const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
262
- update_all_records: request.updateAllRecords,
263
- update_mail_record: request.updateMailRecord,
264
- update_nameservers: request.updateNameservers,
265
- update_web_record: request.updateWebRecord
266
- });
267
- const marshalCreateHostingRequest = (request, defaults) => ({
268
- domain: request.domain,
269
- domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration(
270
- request.domainConfiguration
271
- ) : void 0,
272
- email: request.email,
273
- language: request.language,
274
- offer_id: request.offerId,
275
- option_ids: request.optionIds,
276
- project_id: request.projectId ?? defaults.defaultProjectId,
277
- tags: request.tags
278
- });
279
- const marshalUpdateHostingRequest = (request, defaults) => ({
280
- email: request.email,
281
- offer_id: request.offerId,
282
- option_ids: request.optionIds,
283
- protected: request.protected,
284
- tags: request.tags
285
- });
286
- exports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest;
287
- exports.marshalClassicMailApiCreateMailboxRequest = marshalClassicMailApiCreateMailboxRequest;
288
- exports.marshalClassicMailApiUpdateMailboxRequest = marshalClassicMailApiUpdateMailboxRequest;
289
- exports.marshalCreateHostingRequest = marshalCreateHostingRequest;
290
- exports.marshalUpdateHostingRequest = marshalUpdateHostingRequest;
291
- exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
292
- exports.unmarshalDnsRecords = unmarshalDnsRecords;
293
- exports.unmarshalHosting = unmarshalHosting;
294
- exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;
295
- exports.unmarshalListHostingsResponse = unmarshalListHostingsResponse;
296
- exports.unmarshalListMailboxesResponse = unmarshalListMailboxesResponse;
297
- exports.unmarshalListOffersResponse = unmarshalListOffersResponse;
298
- exports.unmarshalMailbox = unmarshalMailbox;
299
- exports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse;
300
- exports.unmarshalSession = unmarshalSession;
@@ -1,17 +0,0 @@
1
- import type { DefaultValues } from '../../../bridge';
2
- import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ClassicMailApiCreateMailboxRequest, ClassicMailApiUpdateMailboxRequest, CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListMailboxesResponse, ListOffersResponse, Mailbox, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
3
- export declare const unmarshalHosting: (data: unknown) => Hosting;
4
- export declare const unmarshalMailbox: (data: unknown) => Mailbox;
5
- export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
6
- export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
7
- export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
8
- export declare const unmarshalListHostingsResponse: (data: unknown) => ListHostingsResponse;
9
- export declare const unmarshalListMailboxesResponse: (data: unknown) => ListMailboxesResponse;
10
- export declare const unmarshalListOffersResponse: (data: unknown) => ListOffersResponse;
11
- export declare const unmarshalResetHostingPasswordResponse: (data: unknown) => ResetHostingPasswordResponse;
12
- export declare const unmarshalSession: (data: unknown) => Session;
13
- export declare const marshalCheckUserOwnsDomainRequest: (request: CheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
14
- export declare const marshalClassicMailApiCreateMailboxRequest: (request: ClassicMailApiCreateMailboxRequest, defaults: DefaultValues) => Record<string, unknown>;
15
- export declare const marshalClassicMailApiUpdateMailboxRequest: (request: ClassicMailApiUpdateMailboxRequest, defaults: DefaultValues) => Record<string, unknown>;
16
- export declare const marshalCreateHostingRequest: (request: CreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
17
- export declare const marshalUpdateHostingRequest: (request: UpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,300 +0,0 @@
1
- import { isJSONObject } from "../../../helpers/json.js";
2
- import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
3
- import { unmarshalDate, unmarshalArrayOfObject } from "../../../helpers/marshalling.js";
4
- const unmarshalHostingCpanelUrls = (data) => {
5
- if (!isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- dashboard: data.dashboard,
12
- webmail: data.webmail
13
- };
14
- };
15
- const unmarshalHostingOption = (data) => {
16
- if (!isJSONObject(data)) {
17
- throw new TypeError(
18
- `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`
19
- );
20
- }
21
- return {
22
- id: data.id,
23
- name: data.name
24
- };
25
- };
26
- const unmarshalHosting = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- controlPanelName: data.control_panel_name,
34
- cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0,
35
- createdAt: unmarshalDate(data.created_at),
36
- dnsStatus: data.dns_status,
37
- domain: data.domain,
38
- id: data.id,
39
- ipv4: data.ipv4,
40
- ipv6: data.ipv6,
41
- offerEndOfLife: data.offer_end_of_life,
42
- offerId: data.offer_id,
43
- offerName: data.offer_name,
44
- oneTimePassword: data.one_time_password,
45
- options: unmarshalArrayOfObject(data.options, unmarshalHostingOption),
46
- organizationId: data.organization_id,
47
- platformGroup: data.platform_group,
48
- platformHostname: data.platform_hostname,
49
- platformNumber: data.platform_number,
50
- projectId: data.project_id,
51
- protected: data.protected,
52
- region: data.region,
53
- status: data.status,
54
- tags: data.tags,
55
- updatedAt: unmarshalDate(data.updated_at),
56
- username: data.username
57
- };
58
- };
59
- const unmarshalEmailAddress = (data) => {
60
- if (!isJSONObject(data)) {
61
- throw new TypeError(
62
- `Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.`
63
- );
64
- }
65
- return {
66
- domain: data.domain,
67
- login: data.login
68
- };
69
- };
70
- const unmarshalMailbox = (data) => {
71
- if (!isJSONObject(data)) {
72
- throw new TypeError(
73
- `Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`
74
- );
75
- }
76
- return {
77
- email: data.email ? unmarshalEmailAddress(data.email) : void 0,
78
- mailboxId: data.mailbox_id
79
- };
80
- };
81
- const unmarshalCheckUserOwnsDomainResponse = (data) => {
82
- if (!isJSONObject(data)) {
83
- throw new TypeError(
84
- `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
85
- );
86
- }
87
- return {
88
- ownsDomain: data.owns_domain
89
- };
90
- };
91
- const unmarshalDnsRecord = (data) => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(
94
- `Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`
95
- );
96
- }
97
- return {
98
- name: data.name,
99
- priority: data.priority,
100
- status: data.status,
101
- ttl: data.ttl,
102
- type: data.type,
103
- value: data.value
104
- };
105
- };
106
- const unmarshalNameserver = (data) => {
107
- if (!isJSONObject(data)) {
108
- throw new TypeError(
109
- `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`
110
- );
111
- }
112
- return {
113
- hostname: data.hostname,
114
- isDefault: data.is_default,
115
- status: data.status
116
- };
117
- };
118
- const unmarshalDnsRecords = (data) => {
119
- if (!isJSONObject(data)) {
120
- throw new TypeError(
121
- `Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`
122
- );
123
- }
124
- return {
125
- nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),
126
- records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord),
127
- status: data.status
128
- };
129
- };
130
- const unmarshalControlPanel = (data) => {
131
- if (!isJSONObject(data)) {
132
- throw new TypeError(
133
- `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`
134
- );
135
- }
136
- return {
137
- available: data.available,
138
- availableLanguages: data.available_languages,
139
- logoUrl: data.logo_url,
140
- name: data.name
141
- };
142
- };
143
- const unmarshalListControlPanelsResponse = (data) => {
144
- if (!isJSONObject(data)) {
145
- throw new TypeError(
146
- `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`
147
- );
148
- }
149
- return {
150
- controlPanels: unmarshalArrayOfObject(
151
- data.control_panels,
152
- unmarshalControlPanel
153
- ),
154
- totalCount: data.total_count
155
- };
156
- };
157
- const unmarshalListHostingsResponse = (data) => {
158
- if (!isJSONObject(data)) {
159
- throw new TypeError(
160
- `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`
161
- );
162
- }
163
- return {
164
- hostings: unmarshalArrayOfObject(data.hostings, unmarshalHosting),
165
- totalCount: data.total_count
166
- };
167
- };
168
- const unmarshalListMailboxesResponse = (data) => {
169
- if (!isJSONObject(data)) {
170
- throw new TypeError(
171
- `Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`
172
- );
173
- }
174
- return {
175
- mailboxes: unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),
176
- totalCount: data.total_count
177
- };
178
- };
179
- const unmarshalOfferProduct = (data) => {
180
- if (!isJSONObject(data)) {
181
- throw new TypeError(
182
- `Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`
183
- );
184
- }
185
- return {
186
- databasesQuota: data.databases_quota,
187
- emailAccountsQuota: data.email_accounts_quota,
188
- emailStorageQuota: data.email_storage_quota,
189
- hostingStorageQuota: data.hosting_storage_quota,
190
- maxAddonDomains: data.max_addon_domains,
191
- name: data.name,
192
- option: data.option,
193
- ram: data.ram,
194
- supportIncluded: data.support_included,
195
- vCpu: data.v_cpu
196
- };
197
- };
198
- const unmarshalOffer = (data) => {
199
- if (!isJSONObject(data)) {
200
- throw new TypeError(
201
- `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`
202
- );
203
- }
204
- return {
205
- available: data.available,
206
- billingOperationPath: data.billing_operation_path,
207
- controlPanelName: data.control_panel_name,
208
- endOfLife: data.end_of_life,
209
- id: data.id,
210
- price: data.price ? unmarshalMoney(data.price) : void 0,
211
- product: data.product ? unmarshalOfferProduct(data.product) : void 0,
212
- quotaWarnings: data.quota_warnings
213
- };
214
- };
215
- const unmarshalListOffersResponse = (data) => {
216
- if (!isJSONObject(data)) {
217
- throw new TypeError(
218
- `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`
219
- );
220
- }
221
- return {
222
- offers: unmarshalArrayOfObject(data.offers, unmarshalOffer)
223
- };
224
- };
225
- const unmarshalResetHostingPasswordResponse = (data) => {
226
- if (!isJSONObject(data)) {
227
- throw new TypeError(
228
- `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`
229
- );
230
- }
231
- return {
232
- password: data.password
233
- };
234
- };
235
- const unmarshalSession = (data) => {
236
- if (!isJSONObject(data)) {
237
- throw new TypeError(
238
- `Unmarshalling the type 'Session' failed as data isn't a dictionary.`
239
- );
240
- }
241
- return {
242
- url: data.url
243
- };
244
- };
245
- const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
246
- project_id: request.projectId ?? defaults.defaultProjectId
247
- });
248
- const marshalEmailAddress = (request, defaults) => ({
249
- domain: request.domain,
250
- login: request.login
251
- });
252
- const marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({
253
- email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0,
254
- password: request.password
255
- });
256
- const marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({
257
- password: request.password
258
- });
259
- const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
260
- update_all_records: request.updateAllRecords,
261
- update_mail_record: request.updateMailRecord,
262
- update_nameservers: request.updateNameservers,
263
- update_web_record: request.updateWebRecord
264
- });
265
- const marshalCreateHostingRequest = (request, defaults) => ({
266
- domain: request.domain,
267
- domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration(
268
- request.domainConfiguration
269
- ) : void 0,
270
- email: request.email,
271
- language: request.language,
272
- offer_id: request.offerId,
273
- option_ids: request.optionIds,
274
- project_id: request.projectId ?? defaults.defaultProjectId,
275
- tags: request.tags
276
- });
277
- const marshalUpdateHostingRequest = (request, defaults) => ({
278
- email: request.email,
279
- offer_id: request.offerId,
280
- option_ids: request.optionIds,
281
- protected: request.protected,
282
- tags: request.tags
283
- });
284
- export {
285
- marshalCheckUserOwnsDomainRequest,
286
- marshalClassicMailApiCreateMailboxRequest,
287
- marshalClassicMailApiUpdateMailboxRequest,
288
- marshalCreateHostingRequest,
289
- marshalUpdateHostingRequest,
290
- unmarshalCheckUserOwnsDomainResponse,
291
- unmarshalDnsRecords,
292
- unmarshalHosting,
293
- unmarshalListControlPanelsResponse,
294
- unmarshalListHostingsResponse,
295
- unmarshalListMailboxesResponse,
296
- unmarshalListOffersResponse,
297
- unmarshalMailbox,
298
- unmarshalResetHostingPasswordResponse,
299
- unmarshalSession
300
- };