@scaleway/sdk-s2s-vpn 2.6.0 → 2.8.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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-s2s-vpn";
7
+ readonly namespace: "s2s-vpn";
8
+ readonly displayName: "S2S Vpn";
9
+ readonly versions: readonly ["v1alpha1"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-s2s-vpn",
8
+ namespace: "s2s-vpn",
9
+ displayName: "S2S Vpn",
10
+ versions: ["v1alpha1"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -48,7 +48,7 @@ export declare class API extends ParentAPI {
48
48
  * @param options - The waiting options
49
49
  * @returns A Promise of VpnGateway
50
50
  */
51
- waitForVpnGateway: (request: Readonly<GetVpnGatewayRequest>, options?: Readonly<WaitForOptions<VpnGateway>>) => Promise<VpnGateway>;
51
+ waitForVpnGateway: (request: Readonly<GetVpnGatewayRequest>, options?: Readonly<WaitForOptions<VpnGateway>> | undefined) => Promise<VpnGateway>;
52
52
  /**
53
53
  * Create VPN gateway.
54
54
  *
@@ -2,323 +2,164 @@ import { VPN_GATEWAY_TRANSIENT_STATUSES } from "./content.gen.js";
2
2
  import { marshalCreateConnectionRequest, marshalCreateCustomerGatewayRequest, marshalCreateRoutingPolicyRequest, marshalCreateVpnGatewayRequest, marshalDetachRoutingPolicyRequest, marshalSetRoutingPolicyRequest, marshalUpdateConnectionRequest, marshalUpdateCustomerGatewayRequest, marshalUpdateRoutingPolicyRequest, marshalUpdateVpnGatewayRequest, unmarshalConnection, unmarshalCreateConnectionResponse, unmarshalCustomerGateway, unmarshalListConnectionsResponse, unmarshalListCustomerGatewaysResponse, unmarshalListRoutingPoliciesResponse, unmarshalListVpnGatewayTypesResponse, unmarshalListVpnGatewaysResponse, unmarshalRenewConnectionPskResponse, unmarshalRoutingPolicy, unmarshalVpnGateway } from "./marshalling.gen.js";
3
3
  import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v1alpha1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Site-to-Site VPN.
8
8
 
9
9
  This API allows you to manage your Site-to-Site VPN.
10
10
  */
11
11
  var API = class extends API$1 {
12
- /**
13
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ regions: [
17
- "fr-par",
18
- "nl-ams",
19
- "pl-waw"
20
- ] });
21
- pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch({
22
- method: "GET",
23
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
24
- urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
25
- }, unmarshalListVpnGatewayTypesResponse);
26
- /**
27
- * List VPN gateway types. List the different VPN gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available VPN gateway type.
28
- *
29
- * @param request - The request {@link ListVpnGatewayTypesRequest}
30
- * @returns A Promise of ListVpnGatewayTypesResponse
31
- */
32
- listVpnGatewayTypes = (request = {}) => enrichForPagination("gatewayTypes", this.pageOfListVpnGatewayTypes, request);
33
- pageOfListVpnGateways = (request = {}) => this.client.fetch({
34
- method: "GET",
35
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`,
36
- urlParams: urlParams(["gateway_types", request.gatewayTypes], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["statuses", request.statuses], ["tags", request.tags])
37
- }, unmarshalListVpnGatewaysResponse);
38
- /**
39
- * List VPN gateways. List all your VPN gateways. A number of filters are available, including Project ID, name, tags and status.
40
- *
41
- * @param request - The request {@link ListVpnGatewaysRequest}
42
- * @returns A Promise of ListVpnGatewaysResponse
43
- */
44
- listVpnGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListVpnGateways, request);
45
- /**
46
- * Get a VPN gateway. Get a VPN gateway for the given VPN gateway ID.
47
- *
48
- * @param request - The request {@link GetVpnGatewayRequest}
49
- * @returns A Promise of VpnGateway
50
- */
51
- getVpnGateway = (request) => this.client.fetch({
52
- method: "GET",
53
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
54
- }, unmarshalVpnGateway);
55
- /**
56
- * Waits for {@link VpnGateway} to be in a final state.
57
- *
58
- * @param request - The request {@link GetVpnGatewayRequest}
59
- * @param options - The waiting options
60
- * @returns A Promise of VpnGateway
61
- */
62
- waitForVpnGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getVpnGateway, request, options);
63
- /**
64
- * Create VPN gateway.
65
- *
66
- * @param request - The request {@link CreateVpnGatewayRequest}
67
- * @returns A Promise of VpnGateway
68
- */
69
- createVpnGateway = (request) => this.client.fetch({
70
- body: JSON.stringify(marshalCreateVpnGatewayRequest(request, this.client.settings)),
71
- headers: jsonContentHeaders,
72
- method: "POST",
73
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`
74
- }, unmarshalVpnGateway);
75
- /**
76
- * Update a VPN gateway. Update an existing VPN gateway, specified by its VPN gateway ID. Only its name and tags can be updated.
77
- *
78
- * @param request - The request {@link UpdateVpnGatewayRequest}
79
- * @returns A Promise of VpnGateway
80
- */
81
- updateVpnGateway = (request) => this.client.fetch({
82
- body: JSON.stringify(marshalUpdateVpnGatewayRequest(request, this.client.settings)),
83
- headers: jsonContentHeaders,
84
- method: "PATCH",
85
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
86
- }, unmarshalVpnGateway);
87
- /**
88
- * Delete a VPN gateway. Delete an existing VPN gateway, specified by its VPN gateway ID.
89
- *
90
- * @param request - The request {@link DeleteVpnGatewayRequest}
91
- * @returns A Promise of VpnGateway
92
- */
93
- deleteVpnGateway = (request) => this.client.fetch({
94
- method: "DELETE",
95
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
96
- }, unmarshalVpnGateway);
97
- pageOfListConnections = (request = {}) => this.client.fetch({
98
- method: "GET",
99
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`,
100
- urlParams: urlParams(["customer_gateway_ids", request.customerGatewayIds], ["is_ipv6", request.isIpv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["route_propagation_enabled", request.routePropagationEnabled], ["routing_policy_ids", request.routingPolicyIds], ["statuses", request.statuses], ["tags", request.tags], ["vpn_gateway_ids", request.vpnGatewayIds])
101
- }, unmarshalListConnectionsResponse);
102
- /**
103
- * List connections. List all your connections. A number of filters are available, including Project ID, name, tags and status.
104
- *
105
- * @param request - The request {@link ListConnectionsRequest}
106
- * @returns A Promise of ListConnectionsResponse
107
- */
108
- listConnections = (request = {}) => enrichForPagination("connections", this.pageOfListConnections, request);
109
- /**
110
- * Get a connection. Get a connection for the given connection ID. The response object includes information about the connection's various configuration details.
111
- *
112
- * @param request - The request {@link GetConnectionRequest}
113
- * @returns A Promise of Connection
114
- */
115
- getConnection = (request) => this.client.fetch({
116
- method: "GET",
117
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
118
- }, unmarshalConnection);
119
- /**
120
- * Create a connection.
121
- *
122
- * @param request - The request {@link CreateConnectionRequest}
123
- * @returns A Promise of CreateConnectionResponse
124
- */
125
- createConnection = (request) => this.client.fetch({
126
- body: JSON.stringify(marshalCreateConnectionRequest(request, this.client.settings)),
127
- headers: jsonContentHeaders,
128
- method: "POST",
129
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`
130
- }, unmarshalCreateConnectionResponse);
131
- /**
132
- * Update a connection. Update an existing connection, specified by its connection ID.
133
- *
134
- * @param request - The request {@link UpdateConnectionRequest}
135
- * @returns A Promise of Connection
136
- */
137
- updateConnection = (request) => this.client.fetch({
138
- body: JSON.stringify(marshalUpdateConnectionRequest(request, this.client.settings)),
139
- headers: jsonContentHeaders,
140
- method: "PATCH",
141
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
142
- }, unmarshalConnection);
143
- /**
144
- * Delete a connection. Delete an existing connection, specified by its connection ID.
145
- *
146
- * @param request - The request {@link DeleteConnectionRequest}
147
- */
148
- deleteConnection = (request) => this.client.fetch({
149
- method: "DELETE",
150
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
151
- });
152
- /**
153
- * Renew pre-shared key. Renew pre-shared key for a given connection.
154
- *
155
- * @param request - The request {@link RenewConnectionPskRequest}
156
- * @returns A Promise of RenewConnectionPskResponse
157
- */
158
- renewConnectionPsk = (request) => this.client.fetch({
159
- body: "{}",
160
- headers: jsonContentHeaders,
161
- method: "POST",
162
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/renew-psk`
163
- }, unmarshalRenewConnectionPskResponse);
164
- /**
165
- * Set a new routing policy. Set a new routing policy on a connection, overriding the existing one if present, specified by its connection ID.
166
- *
167
- * @param request - The request {@link SetRoutingPolicyRequest}
168
- * @returns A Promise of Connection
169
- */
170
- setRoutingPolicy = (request) => this.client.fetch({
171
- body: JSON.stringify(marshalSetRoutingPolicyRequest(request, this.client.settings)),
172
- headers: jsonContentHeaders,
173
- method: "POST",
174
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/set-routing-policy`
175
- }, unmarshalConnection);
176
- /**
177
- * Detach a routing policy. Detach an existing routing policy from a connection, specified by its connection ID.
178
- *
179
- * @param request - The request {@link DetachRoutingPolicyRequest}
180
- * @returns A Promise of Connection
181
- */
182
- detachRoutingPolicy = (request) => this.client.fetch({
183
- body: JSON.stringify(marshalDetachRoutingPolicyRequest(request, this.client.settings)),
184
- headers: jsonContentHeaders,
185
- method: "POST",
186
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/detach-routing-policy`
187
- }, unmarshalConnection);
188
- /**
189
- * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce.
190
- *
191
- * @param request - The request {@link EnableRoutePropagationRequest}
192
- * @returns A Promise of Connection
193
- */
194
- enableRoutePropagation = (request) => this.client.fetch({
195
- body: "{}",
196
- headers: jsonContentHeaders,
197
- method: "POST",
198
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/enable-route-propagation`
199
- }, unmarshalConnection);
200
- /**
201
- * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the VPN Gateway until route propagation is re-enabled.
202
- *
203
- * @param request - The request {@link DisableRoutePropagationRequest}
204
- * @returns A Promise of Connection
205
- */
206
- disableRoutePropagation = (request) => this.client.fetch({
207
- body: "{}",
208
- headers: jsonContentHeaders,
209
- method: "POST",
210
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/disable-route-propagation`
211
- }, unmarshalConnection);
212
- pageOfListCustomerGateways = (request = {}) => this.client.fetch({
213
- method: "GET",
214
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`,
215
- urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
216
- }, unmarshalListCustomerGatewaysResponse);
217
- /**
218
- * List customer gateways. List all your customer gateways. A number of filters are available, including Project ID, name, and tags.
219
- *
220
- * @param request - The request {@link ListCustomerGatewaysRequest}
221
- * @returns A Promise of ListCustomerGatewaysResponse
222
- */
223
- listCustomerGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListCustomerGateways, request);
224
- /**
225
- * Get a customer gateway. Get a customer gateway for the given customer gateway ID.
226
- *
227
- * @param request - The request {@link GetCustomerGatewayRequest}
228
- * @returns A Promise of CustomerGateway
229
- */
230
- getCustomerGateway = (request) => this.client.fetch({
231
- method: "GET",
232
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
233
- }, unmarshalCustomerGateway);
234
- /**
235
- * Create a customer gateway.
236
- *
237
- * @param request - The request {@link CreateCustomerGatewayRequest}
238
- * @returns A Promise of CustomerGateway
239
- */
240
- createCustomerGateway = (request) => this.client.fetch({
241
- body: JSON.stringify(marshalCreateCustomerGatewayRequest(request, this.client.settings)),
242
- headers: jsonContentHeaders,
243
- method: "POST",
244
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`
245
- }, unmarshalCustomerGateway);
246
- /**
247
- * Update a customer gateway. Update an existing customer gateway, specified by its customer gateway ID. You can update its name, tags, public IPv4 & IPv6 address and AS Number.
248
- *
249
- * @param request - The request {@link UpdateCustomerGatewayRequest}
250
- * @returns A Promise of CustomerGateway
251
- */
252
- updateCustomerGateway = (request) => this.client.fetch({
253
- body: JSON.stringify(marshalUpdateCustomerGatewayRequest(request, this.client.settings)),
254
- headers: jsonContentHeaders,
255
- method: "PATCH",
256
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
257
- }, unmarshalCustomerGateway);
258
- /**
259
- * Delete a customer gateway. Delete an existing customer gateway, specified by its customer gateway ID.
260
- *
261
- * @param request - The request {@link DeleteCustomerGatewayRequest}
262
- */
263
- deleteCustomerGateway = (request) => this.client.fetch({
264
- method: "DELETE",
265
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
266
- });
267
- pageOfListRoutingPolicies = (request = {}) => this.client.fetch({
268
- method: "GET",
269
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
270
- urlParams: urlParams(["ipv6", request.ipv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
271
- }, unmarshalListRoutingPoliciesResponse);
272
- /**
273
- * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple connections (S2S VPN connections).
274
- *
275
- * @param request - The request {@link ListRoutingPoliciesRequest}
276
- * @returns A Promise of ListRoutingPoliciesResponse
277
- */
278
- listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
279
- /**
280
- * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters.
281
- *
282
- * @param request - The request {@link GetRoutingPolicyRequest}
283
- * @returns A Promise of RoutingPolicy
284
- */
285
- getRoutingPolicy = (request) => this.client.fetch({
286
- method: "GET",
287
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
288
- }, unmarshalRoutingPolicy);
289
- /**
290
- * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the customer gateway, and the outgoing routes to announce to the customer gateway.
291
- *
292
- * @param request - The request {@link CreateRoutingPolicyRequest}
293
- * @returns A Promise of RoutingPolicy
294
- */
295
- createRoutingPolicy = (request) => this.client.fetch({
296
- body: JSON.stringify(marshalCreateRoutingPolicyRequest(request, this.client.settings)),
297
- headers: jsonContentHeaders,
298
- method: "POST",
299
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
300
- }, unmarshalRoutingPolicy);
301
- /**
302
- * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated.
303
- *
304
- * @param request - The request {@link UpdateRoutingPolicyRequest}
305
- * @returns A Promise of RoutingPolicy
306
- */
307
- updateRoutingPolicy = (request) => this.client.fetch({
308
- body: JSON.stringify(marshalUpdateRoutingPolicyRequest(request, this.client.settings)),
309
- headers: jsonContentHeaders,
310
- method: "PATCH",
311
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
312
- }, unmarshalRoutingPolicy);
313
- /**
314
- * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID.
315
- *
316
- * @param request - The request {@link DeleteRoutingPolicyRequest}
317
- */
318
- deleteRoutingPolicy = (request) => this.client.fetch({
319
- method: "DELETE",
320
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
321
- });
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
17
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
18
+ }, unmarshalListVpnGatewayTypesResponse);
19
+ this.listVpnGatewayTypes = (request = {}) => enrichForPagination("gatewayTypes", this.pageOfListVpnGatewayTypes, request);
20
+ this.pageOfListVpnGateways = (request = {}) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`,
23
+ urlParams: urlParams(["gateway_types", request.gatewayTypes], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_ids", request.privateNetworkIds], ["project_id", request.projectId], ["statuses", request.statuses], ["tags", request.tags])
24
+ }, unmarshalListVpnGatewaysResponse);
25
+ this.listVpnGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListVpnGateways, request);
26
+ this.getVpnGateway = (request) => this.client.fetch({
27
+ method: "GET",
28
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
29
+ }, unmarshalVpnGateway);
30
+ this.waitForVpnGateway = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getVpnGateway, request, options);
31
+ this.createVpnGateway = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalCreateVpnGatewayRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "POST",
35
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways`
36
+ }, unmarshalVpnGateway);
37
+ this.updateVpnGateway = (request) => this.client.fetch({
38
+ body: JSON.stringify(marshalUpdateVpnGatewayRequest(request, this.client.settings)),
39
+ headers: jsonContentHeaders,
40
+ method: "PATCH",
41
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
42
+ }, unmarshalVpnGateway);
43
+ this.deleteVpnGateway = (request) => this.client.fetch({
44
+ method: "DELETE",
45
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
46
+ }, unmarshalVpnGateway);
47
+ this.pageOfListConnections = (request = {}) => this.client.fetch({
48
+ method: "GET",
49
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`,
50
+ urlParams: urlParams(["customer_gateway_ids", request.customerGatewayIds], ["is_ipv6", request.isIpv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["route_propagation_enabled", request.routePropagationEnabled], ["routing_policy_ids", request.routingPolicyIds], ["statuses", request.statuses], ["tags", request.tags], ["vpn_gateway_ids", request.vpnGatewayIds])
51
+ }, unmarshalListConnectionsResponse);
52
+ this.listConnections = (request = {}) => enrichForPagination("connections", this.pageOfListConnections, request);
53
+ this.getConnection = (request) => this.client.fetch({
54
+ method: "GET",
55
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
56
+ }, unmarshalConnection);
57
+ this.createConnection = (request) => this.client.fetch({
58
+ body: JSON.stringify(marshalCreateConnectionRequest(request, this.client.settings)),
59
+ headers: jsonContentHeaders,
60
+ method: "POST",
61
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections`
62
+ }, unmarshalCreateConnectionResponse);
63
+ this.updateConnection = (request) => this.client.fetch({
64
+ body: JSON.stringify(marshalUpdateConnectionRequest(request, this.client.settings)),
65
+ headers: jsonContentHeaders,
66
+ method: "PATCH",
67
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
68
+ }, unmarshalConnection);
69
+ this.deleteConnection = (request) => this.client.fetch({
70
+ method: "DELETE",
71
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
72
+ });
73
+ this.renewConnectionPsk = (request) => this.client.fetch({
74
+ body: "{}",
75
+ headers: jsonContentHeaders,
76
+ method: "POST",
77
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/renew-psk`
78
+ }, unmarshalRenewConnectionPskResponse);
79
+ this.setRoutingPolicy = (request) => this.client.fetch({
80
+ body: JSON.stringify(marshalSetRoutingPolicyRequest(request, this.client.settings)),
81
+ headers: jsonContentHeaders,
82
+ method: "POST",
83
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/set-routing-policy`
84
+ }, unmarshalConnection);
85
+ this.detachRoutingPolicy = (request) => this.client.fetch({
86
+ body: JSON.stringify(marshalDetachRoutingPolicyRequest(request, this.client.settings)),
87
+ headers: jsonContentHeaders,
88
+ method: "POST",
89
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/detach-routing-policy`
90
+ }, unmarshalConnection);
91
+ this.enableRoutePropagation = (request) => this.client.fetch({
92
+ body: "{}",
93
+ headers: jsonContentHeaders,
94
+ method: "POST",
95
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/enable-route-propagation`
96
+ }, unmarshalConnection);
97
+ this.disableRoutePropagation = (request) => this.client.fetch({
98
+ body: "{}",
99
+ headers: jsonContentHeaders,
100
+ method: "POST",
101
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}/disable-route-propagation`
102
+ }, unmarshalConnection);
103
+ this.pageOfListCustomerGateways = (request = {}) => this.client.fetch({
104
+ method: "GET",
105
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`,
106
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
107
+ }, unmarshalListCustomerGatewaysResponse);
108
+ this.listCustomerGateways = (request = {}) => enrichForPagination("gateways", this.pageOfListCustomerGateways, request);
109
+ this.getCustomerGateway = (request) => this.client.fetch({
110
+ method: "GET",
111
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
112
+ }, unmarshalCustomerGateway);
113
+ this.createCustomerGateway = (request) => this.client.fetch({
114
+ body: JSON.stringify(marshalCreateCustomerGatewayRequest(request, this.client.settings)),
115
+ headers: jsonContentHeaders,
116
+ method: "POST",
117
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways`
118
+ }, unmarshalCustomerGateway);
119
+ this.updateCustomerGateway = (request) => this.client.fetch({
120
+ body: JSON.stringify(marshalUpdateCustomerGatewayRequest(request, this.client.settings)),
121
+ headers: jsonContentHeaders,
122
+ method: "PATCH",
123
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
124
+ }, unmarshalCustomerGateway);
125
+ this.deleteCustomerGateway = (request) => this.client.fetch({
126
+ method: "DELETE",
127
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
128
+ });
129
+ this.pageOfListRoutingPolicies = (request = {}) => this.client.fetch({
130
+ method: "GET",
131
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`,
132
+ urlParams: urlParams(["ipv6", request.ipv6], ["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
133
+ }, unmarshalListRoutingPoliciesResponse);
134
+ this.listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
135
+ this.getRoutingPolicy = (request) => this.client.fetch({
136
+ method: "GET",
137
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
138
+ }, unmarshalRoutingPolicy);
139
+ this.createRoutingPolicy = (request) => this.client.fetch({
140
+ body: JSON.stringify(marshalCreateRoutingPolicyRequest(request, this.client.settings)),
141
+ headers: jsonContentHeaders,
142
+ method: "POST",
143
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies`
144
+ }, unmarshalRoutingPolicy);
145
+ this.updateRoutingPolicy = (request) => this.client.fetch({
146
+ body: JSON.stringify(marshalUpdateRoutingPolicyRequest(request, this.client.settings)),
147
+ headers: jsonContentHeaders,
148
+ method: "PATCH",
149
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
150
+ }, unmarshalRoutingPolicy);
151
+ this.deleteRoutingPolicy = (request) => this.client.fetch({
152
+ method: "DELETE",
153
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
154
+ });
155
+ }
156
+ static {
157
+ this.LOCALITY = toApiLocality({ regions: [
158
+ "fr-par",
159
+ "nl-ams",
160
+ "pl-waw"
161
+ ] });
162
+ }
322
163
  };
323
164
  //#endregion
324
165
  export { API };
@@ -1,6 +1,6 @@
1
1
  //#region src/v1alpha1/content.gen.ts
2
2
  /** Lists transient statutes of the enum {@link VpnGatewayStatus}. */
3
- var VPN_GATEWAY_TRANSIENT_STATUSES = [
3
+ const VPN_GATEWAY_TRANSIENT_STATUSES = [
4
4
  "configuring",
5
5
  "provisioning",
6
6
  "deprovisioning"
@@ -1,6 +1,6 @@
1
1
  import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  //#region src/v1alpha1/marshalling.gen.ts
3
- var unmarshalBgpSession = (data) => {
3
+ const unmarshalBgpSession = (data) => {
4
4
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`);
5
5
  return {
6
6
  peerPrivateIp: data.peer_private_ip,
@@ -8,7 +8,7 @@ var unmarshalBgpSession = (data) => {
8
8
  routingPolicyId: data.routing_policy_id
9
9
  };
10
10
  };
11
- var unmarshalConnectionCipher = (data) => {
11
+ const unmarshalConnectionCipher = (data) => {
12
12
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`);
13
13
  return {
14
14
  dhGroup: data.dh_group ? data.dh_group : void 0,
@@ -16,7 +16,7 @@ var unmarshalConnectionCipher = (data) => {
16
16
  integrity: data.integrity ? data.integrity : void 0
17
17
  };
18
18
  };
19
- var unmarshalConnection = (data) => {
19
+ const unmarshalConnection = (data) => {
20
20
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Connection' failed as data isn't a dictionary.`);
21
21
  return {
22
22
  bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
@@ -46,7 +46,7 @@ var unmarshalConnection = (data) => {
46
46
  vpnGatewayId: data.vpn_gateway_id
47
47
  };
48
48
  };
49
- var unmarshalCustomerGateway = (data) => {
49
+ const unmarshalCustomerGateway = (data) => {
50
50
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`);
51
51
  return {
52
52
  asn: data.asn,
@@ -63,7 +63,7 @@ var unmarshalCustomerGateway = (data) => {
63
63
  updatedAt: unmarshalDate(data.updated_at)
64
64
  };
65
65
  };
66
- var unmarshalRoutingPolicy = (data) => {
66
+ const unmarshalRoutingPolicy = (data) => {
67
67
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`);
68
68
  return {
69
69
  createdAt: unmarshalDate(data.created_at),
@@ -79,18 +79,18 @@ var unmarshalRoutingPolicy = (data) => {
79
79
  updatedAt: unmarshalDate(data.updated_at)
80
80
  };
81
81
  };
82
- var unmarshalVpnGatewayPrivateConfig = (data) => {
82
+ const unmarshalVpnGatewayPrivateConfig = (data) => {
83
83
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`);
84
84
  return {};
85
85
  };
86
- var unmarshalVpnGatewayPublicConfig = (data) => {
86
+ const unmarshalVpnGatewayPublicConfig = (data) => {
87
87
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`);
88
88
  return {
89
89
  ipamIpv4Id: data.ipam_ipv4_id,
90
90
  ipamIpv6Id: data.ipam_ipv6_id
91
91
  };
92
92
  };
93
- var unmarshalVpnGateway = (data) => {
93
+ const unmarshalVpnGateway = (data) => {
94
94
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VpnGateway' failed as data isn't a dictionary.`);
95
95
  return {
96
96
  asn: data.asn,
@@ -113,35 +113,35 @@ var unmarshalVpnGateway = (data) => {
113
113
  zone: data.zone
114
114
  };
115
115
  };
116
- var unmarshalCreateConnectionResponse = (data) => {
116
+ const unmarshalCreateConnectionResponse = (data) => {
117
117
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`);
118
118
  return {
119
119
  connection: data.connection ? unmarshalConnection(data.connection) : void 0,
120
120
  preSharedKey: data.pre_shared_key
121
121
  };
122
122
  };
123
- var unmarshalListConnectionsResponse = (data) => {
123
+ const unmarshalListConnectionsResponse = (data) => {
124
124
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`);
125
125
  return {
126
126
  connections: unmarshalArrayOfObject(data.connections, unmarshalConnection),
127
127
  totalCount: data.total_count
128
128
  };
129
129
  };
130
- var unmarshalListCustomerGatewaysResponse = (data) => {
130
+ const unmarshalListCustomerGatewaysResponse = (data) => {
131
131
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`);
132
132
  return {
133
133
  gateways: unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
134
134
  totalCount: data.total_count
135
135
  };
136
136
  };
137
- var unmarshalListRoutingPoliciesResponse = (data) => {
137
+ const unmarshalListRoutingPoliciesResponse = (data) => {
138
138
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`);
139
139
  return {
140
140
  routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy),
141
141
  totalCount: data.total_count
142
142
  };
143
143
  };
144
- var unmarshalGatewayType = (data) => {
144
+ const unmarshalGatewayType = (data) => {
145
145
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
146
146
  return {
147
147
  allowedConnections: data.allowed_connections,
@@ -151,38 +151,38 @@ var unmarshalGatewayType = (data) => {
151
151
  zones: data.zones
152
152
  };
153
153
  };
154
- var unmarshalListVpnGatewayTypesResponse = (data) => {
154
+ const unmarshalListVpnGatewayTypesResponse = (data) => {
155
155
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`);
156
156
  return {
157
157
  gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType),
158
158
  totalCount: data.total_count
159
159
  };
160
160
  };
161
- var unmarshalListVpnGatewaysResponse = (data) => {
161
+ const unmarshalListVpnGatewaysResponse = (data) => {
162
162
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`);
163
163
  return {
164
164
  gateways: unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
165
165
  totalCount: data.total_count
166
166
  };
167
167
  };
168
- var unmarshalRenewConnectionPskResponse = (data) => {
168
+ const unmarshalRenewConnectionPskResponse = (data) => {
169
169
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`);
170
170
  return {
171
171
  connection: data.connection ? unmarshalConnection(data.connection) : void 0,
172
172
  preSharedKey: data.pre_shared_key
173
173
  };
174
174
  };
175
- var marshalConnectionCipher = (request, defaults) => ({
175
+ const marshalConnectionCipher = (request, defaults) => ({
176
176
  dh_group: request.dhGroup,
177
177
  encryption: request.encryption,
178
178
  integrity: request.integrity
179
179
  });
180
- var marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
180
+ const marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
181
181
  peer_private_ip: request.peerPrivateIp,
182
182
  private_ip: request.privateIp,
183
183
  routing_policy_id: request.routingPolicyId
184
184
  });
185
- var marshalCreateConnectionRequest = (request, defaults) => ({
185
+ const marshalCreateConnectionRequest = (request, defaults) => ({
186
186
  bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4, defaults) : void 0,
187
187
  bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6, defaults) : void 0,
188
188
  customer_gateway_id: request.customerGatewayId,
@@ -196,7 +196,7 @@ var marshalCreateConnectionRequest = (request, defaults) => ({
196
196
  tags: request.tags,
197
197
  vpn_gateway_id: request.vpnGatewayId
198
198
  });
199
- var marshalCreateCustomerGatewayRequest = (request, defaults) => ({
199
+ const marshalCreateCustomerGatewayRequest = (request, defaults) => ({
200
200
  asn: request.asn,
201
201
  ipv4_public: request.ipv4Public,
202
202
  ipv6_public: request.ipv6Public,
@@ -204,7 +204,7 @@ var marshalCreateCustomerGatewayRequest = (request, defaults) => ({
204
204
  project_id: request.projectId ?? defaults.defaultProjectId,
205
205
  tags: request.tags
206
206
  });
207
- var marshalCreateRoutingPolicyRequest = (request, defaults) => ({
207
+ const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
208
208
  is_ipv6: request.isIpv6,
209
209
  name: request.name,
210
210
  prefix_filter_in: request.prefixFilterIn,
@@ -212,16 +212,16 @@ var marshalCreateRoutingPolicyRequest = (request, defaults) => ({
212
212
  project_id: request.projectId ?? defaults.defaultProjectId,
213
213
  tags: request.tags
214
214
  });
215
- var marshalCreateVpnGatewayRequestDualIpTunnel = (request, defaults) => ({
215
+ const marshalCreateVpnGatewayRequestDualIpTunnel = (request, defaults) => ({
216
216
  ipam_ipv4_id: request.ipamIpv4Id,
217
217
  ipam_ipv6_id: request.ipamIpv6Id
218
218
  });
219
- var marshalCreateVpnGatewayRequestSingleIpTunnel = (request, defaults) => ({ ipam_id: request.ipamId });
220
- var marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
219
+ const marshalCreateVpnGatewayRequestSingleIpTunnel = (request, defaults) => ({ ipam_id: request.ipamId });
220
+ const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
221
221
  ipam_ipv4_id: request.ipamIpv4Id,
222
222
  ipam_ipv6_id: request.ipamIpv6Id
223
223
  });
224
- var marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({ ...resolveOneOf([
224
+ const marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({ ...resolveOneOf([
225
225
  {
226
226
  param: "single_ipv4_tunnel",
227
227
  value: request.singleIpv4Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv4Tunnel, defaults) : void 0
@@ -235,7 +235,7 @@ var marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({
235
235
  value: request.dualIpv4V6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestDualIpTunnel(request.dualIpv4V6Tunnel, defaults) : void 0
236
236
  }
237
237
  ]) });
238
- var marshalCreateVpnGatewayRequest = (request, defaults) => ({
238
+ const marshalCreateVpnGatewayRequest = (request, defaults) => ({
239
239
  gateway_type: request.gatewayType,
240
240
  ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
241
241
  ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
@@ -252,41 +252,41 @@ var marshalCreateVpnGatewayRequest = (request, defaults) => ({
252
252
  value: request.publicTunnelConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicTunnelConfig(request.publicTunnelConfig, defaults) : void 0
253
253
  }])
254
254
  });
255
- var marshalDetachRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
255
+ const marshalDetachRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
256
256
  param: "routing_policy_v4",
257
257
  value: request.routingPolicyV4
258
258
  }, {
259
259
  param: "routing_policy_v6",
260
260
  value: request.routingPolicyV6
261
261
  }]) });
262
- var marshalSetRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
262
+ const marshalSetRoutingPolicyRequest = (request, defaults) => ({ ...resolveOneOf([{
263
263
  param: "routing_policy_v4",
264
264
  value: request.routingPolicyV4
265
265
  }, {
266
266
  param: "routing_policy_v6",
267
267
  value: request.routingPolicyV6
268
268
  }]) });
269
- var marshalUpdateConnectionRequest = (request, defaults) => ({
269
+ const marshalUpdateConnectionRequest = (request, defaults) => ({
270
270
  esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
271
271
  ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt, defaults)) : void 0,
272
272
  initiation_policy: request.initiationPolicy,
273
273
  name: request.name,
274
274
  tags: request.tags
275
275
  });
276
- var marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
276
+ const marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
277
277
  asn: request.asn,
278
278
  ipv4_public: request.ipv4Public,
279
279
  ipv6_public: request.ipv6Public,
280
280
  name: request.name,
281
281
  tags: request.tags
282
282
  });
283
- var marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
283
+ const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
284
284
  name: request.name,
285
285
  prefix_filter_in: request.prefixFilterIn,
286
286
  prefix_filter_out: request.prefixFilterOut,
287
287
  tags: request.tags
288
288
  });
289
- var marshalUpdateVpnGatewayRequest = (request, defaults) => ({
289
+ const marshalUpdateVpnGatewayRequest = (request, defaults) => ({
290
290
  name: request.name,
291
291
  tags: request.tags
292
292
  });
@@ -1,5 +1,5 @@
1
1
  //#region src/v1alpha1/metadata.gen.ts
2
- var queriesMetadata = {
2
+ const queriesMetadata = {
3
3
  namespace: "s2s_vpn",
4
4
  version: "v1alpha1",
5
5
  folderName: "s2SVpnv1alpha1",
@@ -17,27 +17,27 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
17
17
  UpdateVpnGatewayRequest: () => UpdateVpnGatewayRequest,
18
18
  VpnGateway: () => VpnGateway
19
19
  });
20
- var CreateConnectionRequest = { name: {
20
+ const CreateConnectionRequest = { name: {
21
21
  maxLength: 255,
22
22
  minLength: 1
23
23
  } };
24
- var CreateCustomerGatewayRequest = {
24
+ const CreateCustomerGatewayRequest = {
25
25
  asn: { greaterThanOrEqual: 1 },
26
26
  name: {
27
27
  maxLength: 255,
28
28
  minLength: 1
29
29
  }
30
30
  };
31
- var CreateRoutingPolicyRequest = { name: {
31
+ const CreateRoutingPolicyRequest = { name: {
32
32
  maxLength: 255,
33
33
  minLength: 1
34
34
  } };
35
- var CreateVpnGatewayRequest = { name: {
35
+ const CreateVpnGatewayRequest = { name: {
36
36
  maxLength: 255,
37
37
  minLength: 1
38
38
  } };
39
- var CustomerGateway = { asn: { greaterThanOrEqual: 1 } };
40
- var ListConnectionsRequest = {
39
+ const CustomerGateway = { asn: { greaterThanOrEqual: 1 } };
40
+ const ListConnectionsRequest = {
41
41
  name: {
42
42
  maxLength: 255,
43
43
  minLength: 1
@@ -48,7 +48,7 @@ var ListConnectionsRequest = {
48
48
  lessThanOrEqual: 1e3
49
49
  }
50
50
  };
51
- var ListCustomerGatewaysRequest = {
51
+ const ListCustomerGatewaysRequest = {
52
52
  name: {
53
53
  maxLength: 255,
54
54
  minLength: 1
@@ -59,7 +59,7 @@ var ListCustomerGatewaysRequest = {
59
59
  lessThanOrEqual: 1e3
60
60
  }
61
61
  };
62
- var ListRoutingPoliciesRequest = {
62
+ const ListRoutingPoliciesRequest = {
63
63
  name: {
64
64
  maxLength: 255,
65
65
  minLength: 1
@@ -70,14 +70,14 @@ var ListRoutingPoliciesRequest = {
70
70
  lessThanOrEqual: 1e3
71
71
  }
72
72
  };
73
- var ListVpnGatewayTypesRequest = {
73
+ const ListVpnGatewayTypesRequest = {
74
74
  page: { greaterThanOrEqual: 1 },
75
75
  pageSize: {
76
76
  greaterThanOrEqual: 1,
77
77
  lessThanOrEqual: 1e3
78
78
  }
79
79
  };
80
- var ListVpnGatewaysRequest = {
80
+ const ListVpnGatewaysRequest = {
81
81
  name: {
82
82
  maxLength: 255,
83
83
  minLength: 1
@@ -88,25 +88,25 @@ var ListVpnGatewaysRequest = {
88
88
  lessThanOrEqual: 1e3
89
89
  }
90
90
  };
91
- var UpdateConnectionRequest = { name: {
91
+ const UpdateConnectionRequest = { name: {
92
92
  maxLength: 255,
93
93
  minLength: 1
94
94
  } };
95
- var UpdateCustomerGatewayRequest = {
95
+ const UpdateCustomerGatewayRequest = {
96
96
  asn: { greaterThanOrEqual: 1 },
97
97
  name: {
98
98
  maxLength: 255,
99
99
  minLength: 1
100
100
  }
101
101
  };
102
- var UpdateRoutingPolicyRequest = { name: {
102
+ const UpdateRoutingPolicyRequest = { name: {
103
103
  maxLength: 255,
104
104
  minLength: 1
105
105
  } };
106
- var UpdateVpnGatewayRequest = { name: {
106
+ const UpdateVpnGatewayRequest = { name: {
107
107
  maxLength: 255,
108
108
  minLength: 1
109
109
  } };
110
- var VpnGateway = { asn: { greaterThanOrEqual: 1 } };
110
+ const VpnGateway = { asn: { greaterThanOrEqual: 1 } };
111
111
  //#endregion
112
112
  export { CreateConnectionRequest, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CustomerGateway, ListConnectionsRequest, ListCustomerGatewaysRequest, ListRoutingPoliciesRequest, ListVpnGatewayTypesRequest, ListVpnGatewaysRequest, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-s2s-vpn",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "Scaleway SDK s2s-vpn",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -16,6 +16,14 @@
16
16
  "./*": {
17
17
  "types": "./dist/*/index.gen.d.ts",
18
18
  "default": "./dist/*/index.gen.js"
19
+ },
20
+ "./metadata": {
21
+ "types": "./dist/metadata.gen.d.ts",
22
+ "default": "./dist/metadata.gen.js"
23
+ },
24
+ "./*/metadata": {
25
+ "types": "./dist/*/metadata.gen.d.ts",
26
+ "default": "./dist/*/metadata.gen.js"
19
27
  }
20
28
  },
21
29
  "repository": {
@@ -27,18 +35,20 @@
27
35
  },
28
36
  "dependencies": {
29
37
  "@scaleway/random-name": "5.1.4",
30
- "@scaleway/sdk-std": "2.2.2"
38
+ "@scaleway/sdk-std": "2.4.0"
31
39
  },
32
40
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.2.2"
41
+ "@repo/configs": "^0.1.1",
42
+ "@scaleway/sdk-client": "^2.3.0"
34
43
  },
35
44
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.2.2"
45
+ "@scaleway/sdk-client": "^2.3.0",
46
+ "@repo/configs": "^0.1.1"
37
47
  },
38
48
  "scripts": {
39
49
  "package:check": "pnpm publint",
40
- "typecheck": "tsc --noEmit",
41
- "type:generate": "tsc --declaration -p tsconfig.build.json",
50
+ "typecheck": "tsgo --noEmit",
51
+ "type:generate": "tsgo --declaration -p tsconfig.build.json",
42
52
  "build": "vite build --config vite.config.ts && pnpm run type:generate",
43
53
  "build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
44
54
  }
package/LICENSE DELETED
@@ -1,191 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- https://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- Copyright 2019 Scaleway.
180
-
181
- Licensed under the Apache License, Version 2.0 (the "License");
182
- you may not use this file except in compliance with the License.
183
- You may obtain a copy of the License at
184
-
185
- https://www.apache.org/licenses/LICENSE-2.0
186
-
187
- Unless required by applicable law or agreed to in writing, software
188
- distributed under the License is distributed on an "AS IS" BASIS,
189
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
- See the License for the specific language governing permissions and
191
- limitations under the License.