@scaleway/sdk 2.66.0 → 2.68.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 (131) hide show
  1. package/dist/api/audit_trail/v1alpha1/api.gen.cjs +5 -1
  2. package/dist/api/audit_trail/v1alpha1/api.gen.js +5 -1
  3. package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +1 -0
  4. package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +1 -0
  5. package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +6 -2
  6. package/dist/api/baremetal/v1/api.gen.cjs +13 -0
  7. package/dist/api/baremetal/v1/api.gen.d.ts +8 -1
  8. package/dist/api/baremetal/v1/api.gen.js +13 -0
  9. package/dist/api/baremetal/v1/content.gen.cjs +2 -1
  10. package/dist/api/baremetal/v1/content.gen.js +2 -1
  11. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  12. package/dist/api/baremetal/v1/marshalling.gen.cjs +1 -0
  13. package/dist/api/baremetal/v1/marshalling.gen.js +1 -0
  14. package/dist/api/baremetal/v1/types.gen.d.ts +9 -1
  15. package/dist/api/block/index.gen.cjs +4 -2
  16. package/dist/api/block/index.gen.d.ts +1 -0
  17. package/dist/api/block/index.gen.js +4 -2
  18. package/dist/api/block/v1/api.gen.cjs +303 -0
  19. package/dist/api/block/v1/api.gen.d.ts +152 -0
  20. package/dist/api/block/v1/api.gen.js +303 -0
  21. package/dist/api/block/v1/content.gen.cjs +22 -0
  22. package/dist/api/block/v1/content.gen.d.ts +7 -0
  23. package/dist/api/block/v1/content.gen.js +22 -0
  24. package/dist/api/block/v1/index.gen.cjs +10 -0
  25. package/dist/api/block/v1/index.gen.d.ts +4 -0
  26. package/dist/api/block/v1/index.gen.js +10 -0
  27. package/dist/api/block/v1/marshalling.gen.cjs +200 -0
  28. package/dist/api/block/v1/marshalling.gen.d.ts +14 -0
  29. package/dist/api/block/v1/marshalling.gen.js +200 -0
  30. package/dist/api/block/v1/types.gen.d.ts +335 -0
  31. package/dist/api/block/v1/validation-rules.gen.cjs +56 -0
  32. package/dist/api/block/v1/validation-rules.gen.d.ts +47 -0
  33. package/dist/api/block/v1/validation-rules.gen.js +56 -0
  34. package/dist/api/block/v1alpha1/api.gen.cjs +1 -0
  35. package/dist/api/block/v1alpha1/api.gen.js +1 -0
  36. package/dist/api/block/v1alpha1/types.gen.d.ts +5 -0
  37. package/dist/api/cockpit/v1/api.gen.cjs +14 -17
  38. package/dist/api/cockpit/v1/api.gen.d.ts +6 -9
  39. package/dist/api/cockpit/v1/api.gen.js +15 -18
  40. package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
  41. package/dist/api/cockpit/v1/marshalling.gen.cjs +29 -26
  42. package/dist/api/cockpit/v1/marshalling.gen.d.ts +2 -2
  43. package/dist/api/cockpit/v1/marshalling.gen.js +29 -26
  44. package/dist/api/cockpit/v1/types.gen.d.ts +49 -34
  45. package/dist/api/cockpit/v1/validation-rules.gen.cjs +0 -10
  46. package/dist/api/cockpit/v1/validation-rules.gen.d.ts +0 -9
  47. package/dist/api/cockpit/v1/validation-rules.gen.js +0 -10
  48. package/dist/api/edge_services/index.gen.cjs +2 -0
  49. package/dist/api/edge_services/index.gen.d.ts +1 -0
  50. package/dist/api/edge_services/index.gen.js +3 -1
  51. package/dist/api/edge_services/v1beta1/api.gen.cjs +941 -0
  52. package/dist/api/edge_services/v1beta1/api.gen.d.ts +454 -0
  53. package/dist/api/edge_services/v1beta1/api.gen.js +941 -0
  54. package/dist/api/edge_services/v1beta1/content.gen.cjs +8 -0
  55. package/dist/api/edge_services/v1beta1/content.gen.d.ts +5 -0
  56. package/dist/api/edge_services/v1beta1/content.gen.js +8 -0
  57. package/dist/api/{webhosting/v1alpha1 → edge_services/v1beta1}/index.gen.cjs +2 -2
  58. package/dist/api/edge_services/v1beta1/index.gen.d.ts +4 -0
  59. package/dist/api/edge_services/v1beta1/index.gen.js +9 -0
  60. package/dist/api/edge_services/v1beta1/marshalling.gen.cjs +808 -0
  61. package/dist/api/edge_services/v1beta1/marshalling.gen.d.ts +53 -0
  62. package/dist/api/edge_services/v1beta1/marshalling.gen.js +808 -0
  63. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1218 -0
  64. package/dist/api/edge_services/v1beta1/validation-rules.gen.cjs +23 -0
  65. package/dist/api/edge_services/v1beta1/validation-rules.gen.d.ts +18 -0
  66. package/dist/api/edge_services/v1beta1/validation-rules.gen.js +23 -0
  67. package/dist/api/instance/v1/api.gen.cjs +18 -0
  68. package/dist/api/instance/v1/api.gen.d.ts +13 -1
  69. package/dist/api/instance/v1/api.gen.js +19 -1
  70. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  71. package/dist/api/instance/v1/marshalling.gen.cjs +12 -0
  72. package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
  73. package/dist/api/instance/v1/marshalling.gen.js +12 -0
  74. package/dist/api/instance/v1/types.gen.d.ts +12 -0
  75. package/dist/api/lb/v1/marshalling.gen.cjs +7 -0
  76. package/dist/api/lb/v1/marshalling.gen.js +7 -0
  77. package/dist/api/lb/v1/types.gen.d.ts +27 -0
  78. package/dist/api/mongodb/v1alpha1/api.gen.cjs +11 -0
  79. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +2 -1
  80. package/dist/api/mongodb/v1alpha1/api.gen.js +12 -1
  81. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  82. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +26 -1
  83. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +2 -1
  84. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +26 -1
  85. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +29 -0
  86. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +8 -0
  87. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +7 -0
  88. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +8 -0
  89. package/dist/api/secret/v1beta1/api.gen.cjs +33 -0
  90. package/dist/api/secret/v1beta1/api.gen.d.ts +17 -1
  91. package/dist/api/secret/v1beta1/api.gen.js +33 -0
  92. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  93. package/dist/api/secret/v1beta1/marshalling.gen.cjs +2 -0
  94. package/dist/api/secret/v1beta1/marshalling.gen.js +2 -0
  95. package/dist/api/secret/v1beta1/types.gen.d.ts +30 -3
  96. package/dist/api/vpcgw/v1/api.gen.cjs +6 -0
  97. package/dist/api/vpcgw/v1/api.gen.d.ts +2 -1
  98. package/dist/api/vpcgw/v1/api.gen.js +6 -0
  99. package/dist/api/vpcgw/v1/index.gen.d.ts +1 -1
  100. package/dist/api/vpcgw/v1/types.gen.d.ts +5 -0
  101. package/dist/api/webhosting/index.gen.cjs +0 -2
  102. package/dist/api/webhosting/index.gen.d.ts +0 -1
  103. package/dist/api/webhosting/index.gen.js +1 -3
  104. package/dist/api/webhosting/v1/content.gen.cjs +0 -6
  105. package/dist/api/webhosting/v1/content.gen.d.ts +1 -3
  106. package/dist/api/webhosting/v1/content.gen.js +0 -6
  107. package/dist/api/webhosting/v1/index.gen.cjs +0 -1
  108. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  109. package/dist/api/webhosting/v1/index.gen.js +1 -2
  110. package/dist/api/webhosting/v1/marshalling.gen.cjs +5 -2
  111. package/dist/api/webhosting/v1/marshalling.gen.js +5 -2
  112. package/dist/api/webhosting/v1/types.gen.d.ts +12 -7
  113. package/dist/scw/constants.cjs +1 -1
  114. package/dist/scw/constants.d.ts +2 -2
  115. package/dist/scw/constants.js +1 -1
  116. package/package.json +2 -2
  117. package/dist/api/webhosting/v1alpha1/api.gen.cjs +0 -339
  118. package/dist/api/webhosting/v1alpha1/api.gen.d.ts +0 -168
  119. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -339
  120. package/dist/api/webhosting/v1alpha1/content.gen.cjs +0 -8
  121. package/dist/api/webhosting/v1alpha1/content.gen.d.ts +0 -3
  122. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -8
  123. package/dist/api/webhosting/v1alpha1/index.gen.d.ts +0 -4
  124. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -9
  125. package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +0 -300
  126. package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +0 -17
  127. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -300
  128. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +0 -480
  129. package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +0 -32
  130. package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +0 -27
  131. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -32
@@ -1,339 +0,0 @@
1
- import { waitForResource } from "../../../internal/async/interval-retrier.js";
2
- import { API as API$1 } from "../../../scw/api.js";
3
- import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
4
- import "../../../vendor/base64/index.js";
5
- import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
6
- import { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
7
- import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, marshalCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse, marshalClassicMailApiCreateMailboxRequest, unmarshalMailbox, unmarshalListMailboxesResponse, marshalClassicMailApiUpdateMailboxRequest } from "./marshalling.gen.js";
8
- const jsonContentHeaders = {
9
- "Content-Type": "application/json; charset=utf-8"
10
- };
11
- class API extends API$1 {
12
- /** Lists the available regions of the API. */
13
- static LOCALITIES = ["fr-par", "nl-ams"];
14
- /**
15
- * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer
16
- * type required via the `offer_id` parameter.
17
- *
18
- * @param request - The request {@link CreateHostingRequest}
19
- * @returns A Promise of Hosting
20
- */
21
- createHosting = (request) => this.client.fetch(
22
- {
23
- body: JSON.stringify(
24
- marshalCreateHostingRequest(request, this.client.settings)
25
- ),
26
- headers: jsonContentHeaders,
27
- method: "POST",
28
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`
29
- },
30
- unmarshalHosting
31
- );
32
- pageOfListHostings = (request = {}) => this.client.fetch(
33
- {
34
- method: "GET",
35
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`,
36
- urlParams: urlParams(
37
- ["control_panels", request.controlPanels],
38
- ["domain", request.domain],
39
- ["order_by", request.orderBy],
40
- ["organization_id", request.organizationId],
41
- ["page", request.page],
42
- [
43
- "page_size",
44
- request.pageSize ?? this.client.settings.defaultPageSize
45
- ],
46
- ["project_id", request.projectId],
47
- ["statuses", request.statuses],
48
- ["tags", request.tags]
49
- )
50
- },
51
- unmarshalListHostingsResponse
52
- );
53
- /**
54
- * List all Web Hosting plans. List all of your existing Web Hosting plans.
55
- * Various filters are available to limit the results, including filtering by
56
- * domain, status, tag and Project ID.
57
- *
58
- * @param request - The request {@link ListHostingsRequest}
59
- * @returns A Promise of ListHostingsResponse
60
- */
61
- listHostings = (request = {}) => enrichForPagination("hostings", this.pageOfListHostings, request);
62
- /**
63
- * Get a Web Hosting plan. Get the details of one of your existing Web Hosting
64
- * plans, specified by its `hosting_id`.
65
- *
66
- * @param request - The request {@link GetHostingRequest}
67
- * @returns A Promise of Hosting
68
- */
69
- getHosting = (request) => this.client.fetch(
70
- {
71
- method: "GET",
72
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
73
- },
74
- unmarshalHosting
75
- );
76
- /**
77
- * Waits for {@link Hosting} to be in a final state.
78
- *
79
- * @param request - The request {@link GetHostingRequest}
80
- * @param options - The waiting options
81
- * @returns A Promise of Hosting
82
- */
83
- waitForHosting = (request, options) => waitForResource(
84
- options?.stop ?? ((res) => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))),
85
- this.getHosting,
86
- request,
87
- options
88
- );
89
- /**
90
- * Update a Web Hosting plan. Update the details of one of your existing Web
91
- * Hosting plans, specified by its `hosting_id`. You can update parameters
92
- * including the contact email address, tags, options and offer.
93
- *
94
- * @param request - The request {@link UpdateHostingRequest}
95
- * @returns A Promise of Hosting
96
- */
97
- updateHosting = (request) => this.client.fetch(
98
- {
99
- body: JSON.stringify(
100
- marshalUpdateHostingRequest(request, this.client.settings)
101
- ),
102
- headers: jsonContentHeaders,
103
- method: "PATCH",
104
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
105
- },
106
- unmarshalHosting
107
- );
108
- /**
109
- * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its
110
- * `hosting_id`. Note that deletion is not immediate: it will take place at
111
- * the end of the calendar month, after which time your Web Hosting plan and
112
- * all its data (files and emails) will be irreversibly lost.
113
- *
114
- * @param request - The request {@link DeleteHostingRequest}
115
- * @returns A Promise of Hosting
116
- */
117
- deleteHosting = (request) => this.client.fetch(
118
- {
119
- method: "DELETE",
120
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}`
121
- },
122
- unmarshalHosting
123
- );
124
- /**
125
- * Restore a Web Hosting plan. When you [delete a Web Hosting
126
- * plan](#path-hostings-delete-a-hosting), definitive deletion does not take
127
- * place until the end of the calendar month. In the time between initiating
128
- * the deletion, and definitive deletion at the end of the month, you can
129
- * choose to **restore** the Web Hosting plan, using this endpoint and
130
- * specifying its `hosting_id`.
131
- *
132
- * @param request - The request {@link RestoreHostingRequest}
133
- * @returns A Promise of Hosting
134
- */
135
- restoreHosting = (request) => this.client.fetch(
136
- {
137
- body: "{}",
138
- headers: jsonContentHeaders,
139
- method: "POST",
140
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/restore`
141
- },
142
- unmarshalHosting
143
- );
144
- /**
145
- * Get DNS records. Get the set of DNS records of a specified domain
146
- * associated with a Web Hosting plan.
147
- *
148
- * @param request - The request {@link GetDomainDnsRecordsRequest}
149
- * @returns A Promise of DnsRecords
150
- */
151
- getDomainDnsRecords = (request) => this.client.fetch(
152
- {
153
- method: "GET",
154
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/dns-records`
155
- },
156
- unmarshalDnsRecords
157
- );
158
- /**
159
- * "Check whether you own this domain or not.".
160
- *
161
- * @param request - The request {@link CheckUserOwnsDomainRequest}
162
- * @returns A Promise of CheckUserOwnsDomainResponse
163
- */
164
- checkUserOwnsDomain = (request) => this.client.fetch(
165
- {
166
- body: JSON.stringify(
167
- marshalCheckUserOwnsDomainRequest(request, this.client.settings)
168
- ),
169
- headers: jsonContentHeaders,
170
- method: "POST",
171
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/check-ownership`
172
- },
173
- unmarshalCheckUserOwnsDomainResponse
174
- );
175
- /**
176
- * List all offers. List the different Web Hosting offers, and their options,
177
- * available to order from Scaleway.
178
- *
179
- * @param request - The request {@link ListOffersRequest}
180
- * @returns A Promise of ListOffersResponse
181
- */
182
- listOffers = (request) => this.client.fetch(
183
- {
184
- method: "GET",
185
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`,
186
- urlParams: urlParams(
187
- ["control_panels", request.controlPanels],
188
- ["hosting_id", request.hostingId],
189
- ["only_options", request.onlyOptions],
190
- ["order_by", request.orderBy],
191
- ["without_options", request.withoutOptions]
192
- )
193
- },
194
- unmarshalListOffersResponse
195
- );
196
- pageOfListControlPanels = (request = {}) => this.client.fetch(
197
- {
198
- method: "GET",
199
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`,
200
- urlParams: urlParams(
201
- ["page", request.page],
202
- [
203
- "page_size",
204
- request.pageSize ?? this.client.settings.defaultPageSize
205
- ]
206
- )
207
- },
208
- unmarshalListControlPanelsResponse
209
- );
210
- /**
211
- * "List the control panels type: cpanel or plesk.".
212
- *
213
- * @param request - The request {@link ListControlPanelsRequest}
214
- * @returns A Promise of ListControlPanelsResponse
215
- */
216
- listControlPanels = (request = {}) => enrichForPagination("controlPanels", this.pageOfListControlPanels, request);
217
- /**
218
- * Create a user session.
219
- *
220
- * @param request - The request {@link CreateSessionRequest}
221
- * @returns A Promise of Session
222
- */
223
- createSession = (request) => this.client.fetch(
224
- {
225
- body: "{}",
226
- headers: jsonContentHeaders,
227
- method: "POST",
228
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/sessions`
229
- },
230
- unmarshalSession
231
- );
232
- resetHostingPassword = (request) => this.client.fetch(
233
- {
234
- body: "{}",
235
- headers: jsonContentHeaders,
236
- method: "POST",
237
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam("hostingId", request.hostingId)}/reset-password`
238
- },
239
- unmarshalResetHostingPasswordResponse
240
- );
241
- }
242
- class ClassicMailAPI extends API$1 {
243
- /** Lists the available regions of the API. */
244
- static LOCALITIES = [
245
- "fr-par",
246
- "nl-ams",
247
- "pl-waw"
248
- ];
249
- /**
250
- * Create a new mailbox within your hosting plan.. Create a new mailbox within
251
- * your hosting plan.
252
- *
253
- * @param request - The request {@link ClassicMailApiCreateMailboxRequest}
254
- * @returns A Promise of Mailbox
255
- */
256
- createMailbox = (request) => this.client.fetch(
257
- {
258
- body: JSON.stringify(
259
- marshalClassicMailApiCreateMailboxRequest(
260
- request,
261
- this.client.settings
262
- )
263
- ),
264
- headers: jsonContentHeaders,
265
- method: "POST",
266
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes`
267
- },
268
- unmarshalMailbox
269
- );
270
- /**
271
- * Get a mailbox by id within your hosting plan.. Get a mailbox by id within
272
- * your hosting plan.
273
- *
274
- * @param request - The request {@link ClassicMailApiGetMailboxRequest}
275
- * @returns A Promise of Mailbox
276
- */
277
- getMailbox = (request) => this.client.fetch(
278
- {
279
- method: "GET",
280
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
281
- },
282
- unmarshalMailbox
283
- );
284
- pageOfListMailboxes = (request) => this.client.fetch(
285
- {
286
- method: "GET",
287
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes`,
288
- urlParams: urlParams(
289
- ["domain", request.domain],
290
- ["page", request.page],
291
- [
292
- "page_size",
293
- request.pageSize ?? this.client.settings.defaultPageSize
294
- ]
295
- )
296
- },
297
- unmarshalListMailboxesResponse
298
- );
299
- /**
300
- * List all mailboxes within your hosting plan.. List all mailboxes within
301
- * your hosting plan.
302
- *
303
- * @param request - The request {@link ClassicMailApiListMailboxesRequest}
304
- * @returns A Promise of ListMailboxesResponse
305
- */
306
- listMailboxes = (request) => enrichForPagination("mailboxes", this.pageOfListMailboxes, request);
307
- deleteMailbox = (request) => this.client.fetch(
308
- {
309
- method: "DELETE",
310
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
311
- },
312
- unmarshalMailbox
313
- );
314
- /**
315
- * Update the mailbox within your hosting plan.. Update the mailbox within
316
- * your hosting plan.
317
- *
318
- * @param request - The request {@link ClassicMailApiUpdateMailboxRequest}
319
- * @returns A Promise of Mailbox
320
- */
321
- updateMailbox = (request) => this.client.fetch(
322
- {
323
- body: JSON.stringify(
324
- marshalClassicMailApiUpdateMailboxRequest(
325
- request,
326
- this.client.settings
327
- )
328
- ),
329
- headers: jsonContentHeaders,
330
- method: "PATCH",
331
- path: `/webhosting/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${validatePathParam("onlineId", request.onlineId)}/mailboxes/${validatePathParam("mailboxId", request.mailboxId)}`
332
- },
333
- unmarshalMailbox
334
- );
335
- }
336
- export {
337
- API,
338
- ClassicMailAPI
339
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const HOSTING_TRANSIENT_STATUSES = [
4
- "delivering",
5
- "deleting",
6
- "migrating"
7
- ];
8
- exports.HOSTING_TRANSIENT_STATUSES = HOSTING_TRANSIENT_STATUSES;
@@ -1,3 +0,0 @@
1
- import type { HostingStatus } from './types.gen';
2
- /** Lists transient statutes of the enum {@link HostingStatus}. */
3
- export declare const HOSTING_TRANSIENT_STATUSES: HostingStatus[];
@@ -1,8 +0,0 @@
1
- const HOSTING_TRANSIENT_STATUSES = [
2
- "delivering",
3
- "deleting",
4
- "migrating"
5
- ];
6
- export {
7
- HOSTING_TRANSIENT_STATUSES
8
- };
@@ -1,4 +0,0 @@
1
- export { API, ClassicMailAPI } from './api.gen.js';
2
- export * from './content.gen.js';
3
- export type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ClassicMailApiCreateMailboxRequest, ClassicMailApiDeleteMailboxRequest, ClassicMailApiGetMailboxRequest, ClassicMailApiListMailboxesRequest, ClassicMailApiUpdateMailboxRequest, ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, EmailAddress, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListMailboxesResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Mailbox, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
4
- export * as ValidationRules from './validation-rules.gen.js';
@@ -1,9 +0,0 @@
1
- import { API, ClassicMailAPI } from "./api.gen.js";
2
- import { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import * as validationRules_gen from "./validation-rules.gen.js";
4
- export {
5
- API,
6
- ClassicMailAPI,
7
- HOSTING_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules
9
- };
@@ -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;