@scaleway/sdk 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (204) hide show
  1. package/package.json +2 -2
  2. package/dist/api/account/index.js +0 -4
  3. package/dist/api/account/v2/api.gen.js +0 -147
  4. package/dist/api/account/v2/index.gen.js +0 -4
  5. package/dist/api/account/v2/marshalling.gen.js +0 -39
  6. package/dist/api/account/v3/api.gen.js +0 -129
  7. package/dist/api/account/v3/index.gen.js +0 -6
  8. package/dist/api/account/v3/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  10. package/dist/api/applesilicon/index.js +0 -2
  11. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  12. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  13. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  14. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  15. package/dist/api/baremetal/index.js +0 -2
  16. package/dist/api/baremetal/v1/api.gen.js +0 -523
  17. package/dist/api/baremetal/v1/api.utils.js +0 -27
  18. package/dist/api/baremetal/v1/content.gen.js +0 -13
  19. package/dist/api/baremetal/v1/index.js +0 -5
  20. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  21. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  22. package/dist/api/billing/index.js +0 -2
  23. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  24. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  25. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  26. package/dist/api/block/index.js +0 -2
  27. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  28. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  29. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  30. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  31. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  32. package/dist/api/cockpit/index.js +0 -2
  33. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  34. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  35. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  36. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  37. package/dist/api/container/index.js +0 -2
  38. package/dist/api/container/v1beta1/api.gen.js +0 -549
  39. package/dist/api/container/v1beta1/content.gen.js +0 -22
  40. package/dist/api/container/v1beta1/index.gen.js +0 -5
  41. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  42. package/dist/api/document_db/index.js +0 -2
  43. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  44. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  45. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  48. package/dist/api/domain/index.js +0 -2
  49. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  50. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  51. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  53. package/dist/api/flexibleip/index.js +0 -2
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  59. package/dist/api/function/index.js +0 -2
  60. package/dist/api/function/v1beta1/api.gen.js +0 -560
  61. package/dist/api/function/v1beta1/content.gen.js +0 -22
  62. package/dist/api/function/v1beta1/index.gen.js +0 -5
  63. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  64. package/dist/api/iam/index.js +0 -2
  65. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  66. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  67. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  68. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  69. package/dist/api/instance/index.js +0 -2
  70. package/dist/api/instance/v1/api.gen.js +0 -1003
  71. package/dist/api/instance/v1/api.utils.js +0 -369
  72. package/dist/api/instance/v1/content.gen.js +0 -31
  73. package/dist/api/instance/v1/index.js +0 -2
  74. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  75. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  76. package/dist/api/iot/index.js +0 -2
  77. package/dist/api/iot/v1/api.gen.js +0 -581
  78. package/dist/api/iot/v1/content.gen.js +0 -7
  79. package/dist/api/iot/v1/index.gen.js +0 -5
  80. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  81. package/dist/api/ipfs/index.js +0 -2
  82. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  83. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  84. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  85. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  86. package/dist/api/k8s/index.js +0 -2
  87. package/dist/api/k8s/v1/api.gen.js +0 -454
  88. package/dist/api/k8s/v1/api.utils.js +0 -13
  89. package/dist/api/k8s/v1/content.gen.js +0 -13
  90. package/dist/api/k8s/v1/index.js +0 -4
  91. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  92. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  93. package/dist/api/lb/index.js +0 -2
  94. package/dist/api/lb/v1/api.gen.js +0 -1669
  95. package/dist/api/lb/v1/api.utils.js +0 -81
  96. package/dist/api/lb/v1/content.gen.js +0 -16
  97. package/dist/api/lb/v1/index.js +0 -2
  98. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  99. package/dist/api/marketplace/index.js +0 -4
  100. package/dist/api/marketplace/v1/api.gen.js +0 -60
  101. package/dist/api/marketplace/v1/index.gen.js +0 -4
  102. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  103. package/dist/api/marketplace/v2/api.gen.js +0 -162
  104. package/dist/api/marketplace/v2/index.gen.js +0 -4
  105. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  106. package/dist/api/mnq/index.js +0 -2
  107. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  108. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  109. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  110. package/dist/api/rdb/index.js +0 -2
  111. package/dist/api/rdb/v1/api.gen.js +0 -972
  112. package/dist/api/rdb/v1/content.gen.js +0 -22
  113. package/dist/api/rdb/v1/index.gen.js +0 -7
  114. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  115. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  116. package/dist/api/redis/index.js +0 -2
  117. package/dist/api/redis/v1/api.gen.js +0 -389
  118. package/dist/api/redis/v1/content.gen.js +0 -7
  119. package/dist/api/redis/v1/index.gen.js +0 -5
  120. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  121. package/dist/api/registry/index.js +0 -2
  122. package/dist/api/registry/v1/api.gen.js +0 -252
  123. package/dist/api/registry/v1/content.gen.js +0 -13
  124. package/dist/api/registry/v1/index.gen.js +0 -5
  125. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  126. package/dist/api/secret/index.js +0 -2
  127. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  128. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  129. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  130. package/dist/api/tem/index.js +0 -2
  131. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  132. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  133. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  134. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  135. package/dist/api/test/index.js +0 -2
  136. package/dist/api/test/v1/api.gen.js +0 -152
  137. package/dist/api/test/v1/content.gen.js +0 -7
  138. package/dist/api/test/v1/index.gen.js +0 -5
  139. package/dist/api/test/v1/marshalling.gen.js +0 -79
  140. package/dist/api/vpc/index.js +0 -4
  141. package/dist/api/vpc/v1/api.gen.js +0 -110
  142. package/dist/api/vpc/v1/index.gen.js +0 -4
  143. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  144. package/dist/api/vpc/v2/api.gen.js +0 -276
  145. package/dist/api/vpc/v2/index.gen.js +0 -4
  146. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  147. package/dist/api/vpcgw/index.js +0 -2
  148. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  149. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  150. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  151. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  152. package/dist/api/webhosting/index.js +0 -2
  153. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  154. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  155. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  156. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  157. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  158. package/dist/helpers/is-browser.js +0 -5
  159. package/dist/helpers/is-response.js +0 -10
  160. package/dist/helpers/json.js +0 -11
  161. package/dist/helpers/marshalling.js +0 -130
  162. package/dist/index.cjs +0 -24364
  163. package/dist/index.d.ts +0 -27584
  164. package/dist/index.js +0 -69
  165. package/dist/internal/async/interval-retrier.js +0 -105
  166. package/dist/internal/async/sleep.js +0 -13
  167. package/dist/internal/interceptors/composer.js +0 -46
  168. package/dist/internal/interceptors/helpers.js +0 -32
  169. package/dist/internal/logger/console-logger.js +0 -38
  170. package/dist/internal/logger/index.js +0 -41
  171. package/dist/internal/logger/level-resolver.js +0 -13
  172. package/dist/internal/validations/string-validation.js +0 -38
  173. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  174. package/dist/scw/api.js +0 -12
  175. package/dist/scw/auth.js +0 -68
  176. package/dist/scw/client-ini-factory.js +0 -174
  177. package/dist/scw/client-ini-profile.js +0 -54
  178. package/dist/scw/client-settings.js +0 -78
  179. package/dist/scw/client.js +0 -98
  180. package/dist/scw/constants.js +0 -4
  181. package/dist/scw/custom-marshalling.js +0 -131
  182. package/dist/scw/errors/error-parser.js +0 -107
  183. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  184. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  185. package/dist/scw/errors/scw-error.js +0 -66
  186. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  187. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  188. package/dist/scw/errors/standard/index.js +0 -13
  189. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  190. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  191. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  192. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  193. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  194. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  195. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  196. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  197. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  198. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  199. package/dist/scw/errors/types.js +0 -23
  200. package/dist/scw/fetch/build-fetcher.js +0 -72
  201. package/dist/scw/fetch/http-dumper.js +0 -54
  202. package/dist/scw/fetch/http-interceptors.js +0 -99
  203. package/dist/scw/fetch/resource-paginator.js +0 -84
  204. package/dist/scw/fetch/response-parser.js +0 -72
@@ -1,336 +0,0 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
- import { isJSONObject } from '../../../helpers/json.js';
3
- import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
-
5
- // This file was automatically generated. DO NOT EDIT.
6
- // If you have any remark or suggestion do not hesitate to open an issue.
7
- const unmarshalDHCP = data => {
8
- if (!isJSONObject(data)) {
9
- throw new TypeError(`Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`);
10
- }
11
- return {
12
- address: data.address,
13
- createdAt: unmarshalDate(data.created_at),
14
- dnsLocalName: data.dns_local_name,
15
- dnsSearch: data.dns_search,
16
- dnsServersOverride: data.dns_servers_override,
17
- enableDynamic: data.enable_dynamic,
18
- id: data.id,
19
- organizationId: data.organization_id,
20
- poolHigh: data.pool_high,
21
- poolLow: data.pool_low,
22
- projectId: data.project_id,
23
- pushDefaultRoute: data.push_default_route,
24
- pushDnsServer: data.push_dns_server,
25
- rebindTimer: data.rebind_timer ? data.rebind_timer : undefined,
26
- renewTimer: data.renew_timer ? data.renew_timer : undefined,
27
- subnet: data.subnet,
28
- updatedAt: unmarshalDate(data.updated_at),
29
- validLifetime: data.valid_lifetime ? data.valid_lifetime : undefined,
30
- zone: data.zone
31
- };
32
- };
33
- const unmarshalGatewayNetwork = data => {
34
- if (!isJSONObject(data)) {
35
- throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);
36
- }
37
- return {
38
- address: data.address ? data.address : undefined,
39
- createdAt: unmarshalDate(data.created_at),
40
- dhcp: unmarshalDHCP(data.dhcp),
41
- enableDhcp: data.enable_dhcp,
42
- enableMasquerade: data.enable_masquerade,
43
- gatewayId: data.gateway_id,
44
- id: data.id,
45
- macAddress: data.mac_address ? data.mac_address : undefined,
46
- privateNetworkId: data.private_network_id,
47
- status: data.status,
48
- updatedAt: unmarshalDate(data.updated_at),
49
- zone: data.zone
50
- };
51
- };
52
- const unmarshalIP = data => {
53
- if (!isJSONObject(data)) {
54
- throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
55
- }
56
- return {
57
- address: data.address,
58
- createdAt: unmarshalDate(data.created_at),
59
- gatewayId: data.gateway_id ? data.gateway_id : undefined,
60
- id: data.id,
61
- organizationId: data.organization_id,
62
- projectId: data.project_id,
63
- reverse: data.reverse ? data.reverse : undefined,
64
- tags: data.tags,
65
- updatedAt: unmarshalDate(data.updated_at),
66
- zone: data.zone
67
- };
68
- };
69
- const unmarshalDHCPEntry = data => {
70
- if (!isJSONObject(data)) {
71
- throw new TypeError(`Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`);
72
- }
73
- return {
74
- createdAt: unmarshalDate(data.created_at),
75
- gatewayNetworkId: data.gateway_network_id,
76
- hostname: data.hostname,
77
- id: data.id,
78
- ipAddress: data.ip_address,
79
- macAddress: data.mac_address,
80
- type: data.type,
81
- updatedAt: unmarshalDate(data.updated_at),
82
- zone: data.zone
83
- };
84
- };
85
- const unmarshalGatewayType = data => {
86
- if (!isJSONObject(data)) {
87
- throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
88
- }
89
- return {
90
- bandwidth: data.bandwidth,
91
- name: data.name,
92
- zone: data.zone
93
- };
94
- };
95
- const unmarshalGateway = data => {
96
- if (!isJSONObject(data)) {
97
- throw new TypeError(`Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`);
98
- }
99
- return {
100
- bastionEnabled: data.bastion_enabled,
101
- bastionPort: data.bastion_port,
102
- canUpgradeTo: data.can_upgrade_to ? data.can_upgrade_to : undefined,
103
- createdAt: unmarshalDate(data.created_at),
104
- gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
105
- id: data.id,
106
- ip: unmarshalIP(data.ip),
107
- name: data.name,
108
- organizationId: data.organization_id,
109
- projectId: data.project_id,
110
- smtpEnabled: data.smtp_enabled,
111
- status: data.status,
112
- tags: data.tags,
113
- type: unmarshalGatewayType(data.type),
114
- updatedAt: unmarshalDate(data.updated_at),
115
- upstreamDnsServers: data.upstream_dns_servers,
116
- version: data.version ? data.version : undefined,
117
- zone: data.zone
118
- };
119
- };
120
- const unmarshalPATRule = data => {
121
- if (!isJSONObject(data)) {
122
- throw new TypeError(`Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`);
123
- }
124
- return {
125
- createdAt: unmarshalDate(data.created_at),
126
- gatewayId: data.gateway_id,
127
- id: data.id,
128
- privateIp: data.private_ip,
129
- privatePort: data.private_port,
130
- protocol: data.protocol,
131
- publicPort: data.public_port,
132
- updatedAt: unmarshalDate(data.updated_at),
133
- zone: data.zone
134
- };
135
- };
136
- const unmarshalListDHCPEntriesResponse = data => {
137
- if (!isJSONObject(data)) {
138
- throw new TypeError(`Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`);
139
- }
140
- return {
141
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),
142
- totalCount: data.total_count
143
- };
144
- };
145
- const unmarshalListDHCPsResponse = data => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(`Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`);
148
- }
149
- return {
150
- dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),
151
- totalCount: data.total_count
152
- };
153
- };
154
- const unmarshalListGatewayNetworksResponse = data => {
155
- if (!isJSONObject(data)) {
156
- throw new TypeError(`Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`);
157
- }
158
- return {
159
- gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
160
- totalCount: data.total_count
161
- };
162
- };
163
- const unmarshalListGatewayTypesResponse = data => {
164
- if (!isJSONObject(data)) {
165
- throw new TypeError(`Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`);
166
- }
167
- return {
168
- types: unmarshalArrayOfObject(data.types, unmarshalGatewayType)
169
- };
170
- };
171
- const unmarshalListGatewaysResponse = data => {
172
- if (!isJSONObject(data)) {
173
- throw new TypeError(`Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`);
174
- }
175
- return {
176
- gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),
177
- totalCount: data.total_count
178
- };
179
- };
180
- const unmarshalListIPsResponse = data => {
181
- if (!isJSONObject(data)) {
182
- throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);
183
- }
184
- return {
185
- ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
186
- totalCount: data.total_count
187
- };
188
- };
189
- const unmarshalListPATRulesResponse = data => {
190
- if (!isJSONObject(data)) {
191
- throw new TypeError(`Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`);
192
- }
193
- return {
194
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),
195
- totalCount: data.total_count
196
- };
197
- };
198
- const unmarshalSetDHCPEntriesResponse = data => {
199
- if (!isJSONObject(data)) {
200
- throw new TypeError(`Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`);
201
- }
202
- return {
203
- dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry)
204
- };
205
- };
206
- const unmarshalSetPATRulesResponse = data => {
207
- if (!isJSONObject(data)) {
208
- throw new TypeError(`Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`);
209
- }
210
- return {
211
- patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)
212
- };
213
- };
214
- const marshalCreateDHCPRequest = (request, defaults) => ({
215
- address: request.address,
216
- dns_local_name: request.dnsLocalName,
217
- dns_search: request.dnsSearch,
218
- dns_servers_override: request.dnsServersOverride,
219
- enable_dynamic: request.enableDynamic,
220
- pool_high: request.poolHigh,
221
- pool_low: request.poolLow,
222
- project_id: request.projectId ?? defaults.defaultProjectId,
223
- push_default_route: request.pushDefaultRoute,
224
- push_dns_server: request.pushDnsServer,
225
- rebind_timer: request.rebindTimer,
226
- renew_timer: request.renewTimer,
227
- subnet: request.subnet,
228
- valid_lifetime: request.validLifetime
229
- });
230
- const marshalCreateDHCPEntryRequest = (request, defaults) => ({
231
- gateway_network_id: request.gatewayNetworkId,
232
- ip_address: request.ipAddress,
233
- mac_address: request.macAddress
234
- });
235
- const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
236
- enable_dhcp: request.enableDhcp,
237
- enable_masquerade: request.enableMasquerade,
238
- gateway_id: request.gatewayId,
239
- private_network_id: request.privateNetworkId,
240
- ...resolveOneOf([{
241
- param: 'address',
242
- value: request.address
243
- }, {
244
- param: 'dhcp',
245
- value: request.dhcp
246
- }, {
247
- param: 'dhcp_id',
248
- value: request.dhcpId
249
- }, {
250
- param: 'ipam_config',
251
- value: request.ipamConfig
252
- }])
253
- });
254
- const marshalCreateGatewayRequest = (request, defaults) => ({
255
- bastion_port: request.bastionPort,
256
- enable_bastion: request.enableBastion,
257
- enable_smtp: request.enableSmtp,
258
- ip_id: request.ipId,
259
- name: request.name || randomName('gw'),
260
- project_id: request.projectId ?? defaults.defaultProjectId,
261
- tags: request.tags,
262
- type: request.type,
263
- upstream_dns_servers: request.upstreamDnsServers
264
- });
265
- const marshalCreateIPRequest = (request, defaults) => ({
266
- project_id: request.projectId ?? defaults.defaultProjectId,
267
- tags: request.tags
268
- });
269
- const marshalCreatePATRuleRequest = (request, defaults) => ({
270
- gateway_id: request.gatewayId,
271
- private_ip: request.privateIp,
272
- private_port: request.privatePort,
273
- protocol: request.protocol,
274
- public_port: request.publicPort
275
- });
276
- const marshalSetDHCPEntriesRequest = (request, defaults) => ({
277
- dhcp_entries: request.dhcpEntries,
278
- gateway_network_id: request.gatewayNetworkId
279
- });
280
- const marshalSetPATRulesRequest = (request, defaults) => ({
281
- gateway_id: request.gatewayId,
282
- pat_rules: request.patRules
283
- });
284
- const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
285
- ip_address: request.ipAddress
286
- });
287
- const marshalUpdateDHCPRequest = (request, defaults) => ({
288
- address: request.address,
289
- dns_local_name: request.dnsLocalName,
290
- dns_search: request.dnsSearch,
291
- dns_servers_override: request.dnsServersOverride,
292
- enable_dynamic: request.enableDynamic,
293
- pool_high: request.poolHigh,
294
- pool_low: request.poolLow,
295
- push_default_route: request.pushDefaultRoute,
296
- push_dns_server: request.pushDnsServer,
297
- rebind_timer: request.rebindTimer,
298
- renew_timer: request.renewTimer,
299
- subnet: request.subnet,
300
- valid_lifetime: request.validLifetime
301
- });
302
- const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
303
- enable_dhcp: request.enableDhcp,
304
- enable_masquerade: request.enableMasquerade,
305
- ...resolveOneOf([{
306
- param: 'address',
307
- value: request.address
308
- }, {
309
- param: 'dhcp_id',
310
- value: request.dhcpId
311
- }, {
312
- param: 'ipam_config',
313
- value: request.ipamConfig
314
- }])
315
- });
316
- const marshalUpdateGatewayRequest = (request, defaults) => ({
317
- bastion_port: request.bastionPort,
318
- enable_bastion: request.enableBastion,
319
- enable_smtp: request.enableSmtp,
320
- name: request.name,
321
- tags: request.tags,
322
- upstream_dns_servers: request.upstreamDnsServers
323
- });
324
- const marshalUpdateIPRequest = (request, defaults) => ({
325
- gateway_id: request.gatewayId,
326
- reverse: request.reverse,
327
- tags: request.tags
328
- });
329
- const marshalUpdatePATRuleRequest = (request, defaults) => ({
330
- private_ip: request.privateIp,
331
- private_port: request.privatePort,
332
- protocol: request.protocol,
333
- public_port: request.publicPort
334
- });
335
-
336
- export { marshalCreateDHCPEntryRequest, marshalCreateDHCPRequest, marshalCreateGatewayNetworkRequest, marshalCreateGatewayRequest, marshalCreateIPRequest, marshalCreatePATRuleRequest, marshalSetDHCPEntriesRequest, marshalSetPATRulesRequest, marshalUpdateDHCPEntryRequest, marshalUpdateDHCPRequest, marshalUpdateGatewayNetworkRequest, marshalUpdateGatewayRequest, marshalUpdateIPRequest, marshalUpdatePATRuleRequest, unmarshalDHCP, unmarshalDHCPEntry, unmarshalGateway, unmarshalGatewayNetwork, unmarshalIP, unmarshalListDHCPEntriesResponse, unmarshalListDHCPsResponse, unmarshalListGatewayNetworksResponse, unmarshalListGatewayTypesResponse, unmarshalListGatewaysResponse, unmarshalListIPsResponse, unmarshalListPATRulesResponse, unmarshalPATRule, unmarshalSetDHCPEntriesResponse, unmarshalSetPATRulesResponse };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1alpha1/index.gen.js';
2
- export { index_gen as v1alpha1 };
@@ -1,210 +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 { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListDediboxHostingsResponse, marshalDediboxApiMigrateDediboxHostingRequest } from './marshalling.gen.js';
7
-
8
- // This file was automatically generated. DO NOT EDIT.
9
- // If you have any remark or suggestion do not hesitate to open an issue.
10
- const jsonContentHeaders = {
11
- 'Content-Type': 'application/json; charset=utf-8'
12
- };
13
-
14
- /** Web Hosting API. */
15
- class API extends API$1 {
16
- /** Lists the available regions of the API. */
17
- static LOCALITIES = ['fr-par'];
18
-
19
- /**
20
- * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer
21
- * type required via the `offer_id` parameter.
22
- *
23
- * @param request - The request {@link CreateHostingRequest}
24
- * @returns A Promise of Hosting
25
- */
26
- createHosting = request => this.client.fetch({
27
- body: JSON.stringify(marshalCreateHostingRequest(request, this.client.settings)),
28
- headers: jsonContentHeaders,
29
- method: 'POST',
30
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings`
31
- }, unmarshalHosting);
32
- pageOfListHostings = (() => {
33
- var _this = this;
34
- return function (request) {
35
- if (request === void 0) {
36
- request = {};
37
- }
38
- return _this.client.fetch({
39
- method: 'GET',
40
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/hostings`,
41
- urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags])
42
- }, unmarshalListHostingsResponse);
43
- };
44
- })();
45
-
46
- /**
47
- * List all Web Hosting plans. List all of your existing Web Hosting plans.
48
- * Various filters are available to limit the results, including filtering by
49
- * domain, status, tag and Project ID.
50
- *
51
- * @param request - The request {@link ListHostingsRequest}
52
- * @returns A Promise of ListHostingsResponse
53
- */
54
- listHostings = (() => {
55
- var _this2 = this;
56
- return function (request) {
57
- if (request === void 0) {
58
- request = {};
59
- }
60
- return enrichForPagination('hostings', _this2.pageOfListHostings, request);
61
- };
62
- })();
63
-
64
- /**
65
- * Get a Web Hosting plan. Get the details of one of your existing Web Hosting
66
- * plans, specified by its `hosting_id`.
67
- *
68
- * @param request - The request {@link GetHostingRequest}
69
- * @returns A Promise of Hosting
70
- */
71
- getHosting = request => this.client.fetch({
72
- method: 'GET',
73
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
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(options?.stop ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);
84
-
85
- /**
86
- * Update a Web Hosting plan. Update the details of one of your existing Web
87
- * Hosting plans, specified by its `hosting_id`. You can update parameters
88
- * including the contact email address, tags, options and offer.
89
- *
90
- * @param request - The request {@link UpdateHostingRequest}
91
- * @returns A Promise of Hosting
92
- */
93
- updateHosting = request => this.client.fetch({
94
- body: JSON.stringify(marshalUpdateHostingRequest(request, this.client.settings)),
95
- headers: jsonContentHeaders,
96
- method: 'PATCH',
97
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
98
- }, unmarshalHosting);
99
-
100
- /**
101
- * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its
102
- * `hosting_id`. Note that deletion is not immediate: it will take place at
103
- * the end of the calendar month, after which time your Web Hosting plan and
104
- * all its data (files and emails) will be irreversibly lost.
105
- *
106
- * @param request - The request {@link DeleteHostingRequest}
107
- * @returns A Promise of Hosting
108
- */
109
- deleteHosting = request => this.client.fetch({
110
- method: 'DELETE',
111
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
112
- }, unmarshalHosting);
113
-
114
- /**
115
- * Restore a Web Hosting plan. When you [delete a Web Hosting
116
- * plan](#path-hostings-delete-a-hosting), definitive deletion does not take
117
- * place until the end of the calendar month. In the time between initiating
118
- * the deletion, and definitive deletion at the end of the month, you can
119
- * choose to **restore** the Web Hosting plan, using this endpoint and
120
- * specifying its `hosting_id`.
121
- *
122
- * @param request - The request {@link RestoreHostingRequest}
123
- * @returns A Promise of Hosting
124
- */
125
- restoreHosting = request => this.client.fetch({
126
- body: '{}',
127
- headers: jsonContentHeaders,
128
- method: 'POST',
129
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore`
130
- }, unmarshalHosting);
131
-
132
- /**
133
- * Get DNS records. Get the set of DNS records of a specified domain
134
- * associated with a Web Hosting plan.
135
- *
136
- * @param request - The request {@link GetDomainDnsRecordsRequest}
137
- * @returns A Promise of DnsRecords
138
- */
139
- getDomainDnsRecords = request => this.client.fetch({
140
- method: 'GET',
141
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/dns-records`
142
- }, unmarshalDnsRecords);
143
-
144
- /**
145
- * List all offers. List the different Web Hosting offers, and their options,
146
- * available to order from Scaleway.
147
- *
148
- * @param request - The request {@link ListOffersRequest}
149
- * @returns A Promise of ListOffersResponse
150
- */
151
- listOffers = request => this.client.fetch({
152
- method: 'GET',
153
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,
154
- urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy], ['without_options', request.withoutOptions])
155
- }, unmarshalListOffersResponse);
156
- }
157
-
158
- /**
159
- * WebHosting Dedibox API.
160
- *
161
- * This API allows to migrate your Dedibox hostings.
162
- */
163
- class DediboxAPI extends API$1 {
164
- /** Lists the available regions of the API. */
165
- static LOCALITIES = ['fr-par'];
166
- pageOfListDediboxHostings = (() => {
167
- var _this3 = this;
168
- return function (request) {
169
- if (request === void 0) {
170
- request = {};
171
- }
172
- return _this3.client.fetch({
173
- method: 'GET',
174
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/dedibox-hostings`,
175
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this3.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
176
- }, unmarshalListDediboxHostingsResponse);
177
- };
178
- })();
179
-
180
- /**
181
- * List all Dedibox hostings for Dedibox user ID.
182
- *
183
- * @param request - The request {@link DediboxApiListDediboxHostingsRequest}
184
- * @returns A Promise of ListDediboxHostingsResponse
185
- */
186
- listDediboxHostings = (() => {
187
- var _this4 = this;
188
- return function (request) {
189
- if (request === void 0) {
190
- request = {};
191
- }
192
- return enrichForPagination('dediboxHostings', _this4.pageOfListDediboxHostings, request);
193
- };
194
- })();
195
-
196
- /**
197
- * Migrate a hosting from Dedibox to Scaleway account.
198
- *
199
- * @param request - The request {@link DediboxApiMigrateDediboxHostingRequest}
200
- * @returns A Promise of Hosting
201
- */
202
- migrateDediboxHosting = request => this.client.fetch({
203
- body: JSON.stringify(marshalDediboxApiMigrateDediboxHostingRequest(request, this.client.settings)),
204
- headers: jsonContentHeaders,
205
- method: 'POST',
206
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/dedibox-hostings/migrate`
207
- }, unmarshalHosting);
208
- }
209
-
210
- export { API, DediboxAPI };
@@ -1,7 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- /** Lists transient statutes of the enum {@link HostingStatus}. */
5
- const HOSTING_TRANSIENT_STATUSES = ['delivering', 'deleting', 'migrating'];
6
-
7
- export { HOSTING_TRANSIENT_STATUSES };
@@ -1,7 +0,0 @@
1
- export { API, DediboxAPI } from './api.gen.js';
2
- export { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
3
- import * as validationRules_gen from './validation-rules.gen.js';
4
- export { validationRules_gen as ValidationRules };
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.