@scaleway/sdk-s2s-vpn 2.4.0 → 2.4.1

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.
@@ -10,7 +10,11 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: ["fr-par", "nl-ams", "pl-waw"]
13
+ regions: [
14
+ "fr-par",
15
+ "nl-ams",
16
+ "pl-waw"
17
+ ]
14
18
  });
15
19
  pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch(
16
20
  {
@@ -18,10 +22,7 @@ class API extends API$1 {
18
22
  path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
19
23
  urlParams: urlParams(
20
24
  ["page", request.page],
21
- [
22
- "page_size",
23
- request.pageSize ?? this.client.settings.defaultPageSize
24
- ]
25
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
25
26
  )
26
27
  },
27
28
  unmarshalListVpnGatewayTypesResponse
@@ -43,10 +44,7 @@ class API extends API$1 {
43
44
  ["order_by", request.orderBy],
44
45
  ["organization_id", request.organizationId],
45
46
  ["page", request.page],
46
- [
47
- "page_size",
48
- request.pageSize ?? this.client.settings.defaultPageSize
49
- ],
47
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
50
48
  ["private_network_ids", request.privateNetworkIds],
51
49
  ["project_id", request.projectId],
52
50
  ["statuses", request.statuses],
@@ -83,9 +81,7 @@ class API extends API$1 {
83
81
  * @returns A Promise of VpnGateway
84
82
  */
85
83
  waitForVpnGateway = (request, options) => waitForResource(
86
- options?.stop ?? ((res) => Promise.resolve(
87
- !VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status)
88
- )),
84
+ options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
89
85
  this.getVpnGateway,
90
86
  request,
91
87
  options
@@ -148,10 +144,7 @@ class API extends API$1 {
148
144
  ["order_by", request.orderBy],
149
145
  ["organization_id", request.organizationId],
150
146
  ["page", request.page],
151
- [
152
- "page_size",
153
- request.pageSize ?? this.client.settings.defaultPageSize
154
- ],
147
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
155
148
  ["project_id", request.projectId],
156
149
  ["route_propagation_enabled", request.routePropagationEnabled],
157
150
  ["routing_policy_ids", request.routingPolicyIds],
@@ -221,10 +214,12 @@ class API extends API$1 {
221
214
  *
222
215
  * @param request - The request {@link DeleteConnectionRequest}
223
216
  */
224
- deleteConnection = (request) => this.client.fetch({
225
- method: "DELETE",
226
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
227
- });
217
+ deleteConnection = (request) => this.client.fetch(
218
+ {
219
+ method: "DELETE",
220
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
221
+ }
222
+ );
228
223
  /**
229
224
  * Renew pre-shared key. Renew pre-shared key for a given connection.
230
225
  *
@@ -313,10 +308,7 @@ class API extends API$1 {
313
308
  ["order_by", request.orderBy],
314
309
  ["organization_id", request.organizationId],
315
310
  ["page", request.page],
316
- [
317
- "page_size",
318
- request.pageSize ?? this.client.settings.defaultPageSize
319
- ],
311
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
320
312
  ["project_id", request.projectId],
321
313
  ["tags", request.tags]
322
314
  )
@@ -382,10 +374,12 @@ class API extends API$1 {
382
374
  *
383
375
  * @param request - The request {@link DeleteCustomerGatewayRequest}
384
376
  */
385
- deleteCustomerGateway = (request) => this.client.fetch({
386
- method: "DELETE",
387
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
388
- });
377
+ deleteCustomerGateway = (request) => this.client.fetch(
378
+ {
379
+ method: "DELETE",
380
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
381
+ }
382
+ );
389
383
  pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
390
384
  {
391
385
  method: "GET",
@@ -396,10 +390,7 @@ class API extends API$1 {
396
390
  ["order_by", request.orderBy],
397
391
  ["organization_id", request.organizationId],
398
392
  ["page", request.page],
399
- [
400
- "page_size",
401
- request.pageSize ?? this.client.settings.defaultPageSize
402
- ],
393
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
403
394
  ["project_id", request.projectId],
404
395
  ["tags", request.tags]
405
396
  )
@@ -412,11 +403,7 @@ class API extends API$1 {
412
403
  * @param request - The request {@link ListRoutingPoliciesRequest}
413
404
  * @returns A Promise of ListRoutingPoliciesResponse
414
405
  */
415
- listRoutingPolicies = (request = {}) => enrichForPagination(
416
- "routingPolicies",
417
- this.pageOfListRoutingPolicies,
418
- request
419
- );
406
+ listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
420
407
  /**
421
408
  * 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.
422
409
  *
@@ -469,10 +456,12 @@ class API extends API$1 {
469
456
  *
470
457
  * @param request - The request {@link DeleteRoutingPolicyRequest}
471
458
  */
472
- deleteRoutingPolicy = (request) => this.client.fetch({
473
- method: "DELETE",
474
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
475
- });
459
+ deleteRoutingPolicy = (request) => this.client.fetch(
460
+ {
461
+ method: "DELETE",
462
+ path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
463
+ }
464
+ );
476
465
  }
477
466
  export {
478
467
  API
@@ -1,5 +1,5 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
- export type { BgpSession, BgpSessionStatus, Connection, ConnectionCipher, ConnectionDhGroup, ConnectionEncryption, ConnectionInitiationPolicy, ConnectionIntegrity, ConnectionStatus, CreateConnectionRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestInitiationPolicy, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CreateVpnGatewayRequestPublicConfig, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GatewayType, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsRequestOrderBy, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysRequestOrderBy, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, ListVpnGatewaysRequest, ListVpnGatewaysRequestOrderBy, ListVpnGatewaysResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, TunnelStatus, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGatewayStatus, } from './types.gen.js';
4
+ export type { BgpSession, BgpSessionStatus, Connection, ConnectionCipher, ConnectionDhGroup, ConnectionEncryption, ConnectionInitiationPolicy, ConnectionIntegrity, ConnectionStatus, CreateConnectionRequest, CreateConnectionRequestBgpConfig, CreateConnectionRequestInitiationPolicy, CreateConnectionResponse, CreateCustomerGatewayRequest, CreateRoutingPolicyRequest, CreateVpnGatewayRequest, CreateVpnGatewayRequestDualIpTunnel, CreateVpnGatewayRequestPublicConfig, CreateVpnGatewayRequestPublicTunnelConfig, CreateVpnGatewayRequestSingleIpTunnel, CustomerGateway, DeleteConnectionRequest, DeleteCustomerGatewayRequest, DeleteRoutingPolicyRequest, DeleteVpnGatewayRequest, DetachRoutingPolicyRequest, DisableRoutePropagationRequest, EnableRoutePropagationRequest, GatewayType, GetConnectionRequest, GetCustomerGatewayRequest, GetRoutingPolicyRequest, GetVpnGatewayRequest, ListConnectionsRequest, ListConnectionsRequestOrderBy, ListConnectionsResponse, ListCustomerGatewaysRequest, ListCustomerGatewaysRequestOrderBy, ListCustomerGatewaysResponse, ListRoutingPoliciesRequest, ListRoutingPoliciesRequestOrderBy, ListRoutingPoliciesResponse, ListVpnGatewaysRequest, ListVpnGatewaysRequestOrderBy, ListVpnGatewaysResponse, ListVpnGatewayTypesRequest, ListVpnGatewayTypesResponse, RenewConnectionPskRequest, RenewConnectionPskResponse, RoutingPolicy, SetRoutingPolicyRequest, TunnelStatus, UpdateConnectionRequest, UpdateCustomerGatewayRequest, UpdateRoutingPolicyRequest, UpdateVpnGatewayRequest, VpnGateway, VpnGatewayPrivateConfig, VpnGatewayPublicConfig, VpnGatewayStatus, } from './types.gen.js';
5
5
  export * as ValidationRules from './validation-rules.gen.js';
@@ -36,15 +36,9 @@ const unmarshalConnection = (data) => {
36
36
  bgpStatusIpv6: data.bgp_status_ipv6,
37
37
  createdAt: unmarshalDate(data.created_at),
38
38
  customerGatewayId: data.customer_gateway_id,
39
- espCiphers: unmarshalArrayOfObject(
40
- data.esp_ciphers,
41
- unmarshalConnectionCipher
42
- ),
39
+ espCiphers: unmarshalArrayOfObject(data.esp_ciphers, unmarshalConnectionCipher),
43
40
  id: data.id,
44
- ikev2Ciphers: unmarshalArrayOfObject(
45
- data.ikev2_ciphers,
46
- unmarshalConnectionCipher
47
- ),
41
+ ikev2Ciphers: unmarshalArrayOfObject(data.ikev2_ciphers, unmarshalConnectionCipher),
48
42
  initiationPolicy: data.initiation_policy,
49
43
  isIpv6: data.is_ipv6,
50
44
  name: data.name,
@@ -190,10 +184,7 @@ const unmarshalListRoutingPoliciesResponse = (data) => {
190
184
  );
191
185
  }
192
186
  return {
193
- routingPolicies: unmarshalArrayOfObject(
194
- data.routing_policies,
195
- unmarshalRoutingPolicy
196
- ),
187
+ routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy),
197
188
  totalCount: data.total_count
198
189
  };
199
190
  };
@@ -218,10 +209,7 @@ const unmarshalListVpnGatewayTypesResponse = (data) => {
218
209
  );
219
210
  }
220
211
  return {
221
- gatewayTypes: unmarshalArrayOfObject(
222
- data.gateway_types,
223
- unmarshalGatewayType
224
- ),
212
+ gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType),
225
213
  totalCount: data.total_count
226
214
  };
227
215
  };
@@ -262,12 +250,8 @@ const marshalCreateConnectionRequest = (request, defaults) => ({
262
250
  bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6) : void 0,
263
251
  customer_gateway_id: request.customerGatewayId,
264
252
  enable_route_propagation: request.enableRoutePropagation,
265
- esp_ciphers: request.espCiphers.map(
266
- (elt) => marshalConnectionCipher(elt)
267
- ),
268
- ikev2_ciphers: request.ikev2Ciphers.map(
269
- (elt) => marshalConnectionCipher(elt)
270
- ),
253
+ esp_ciphers: request.espCiphers.map((elt) => marshalConnectionCipher(elt)),
254
+ ikev2_ciphers: request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt)),
271
255
  initiation_policy: request.initiationPolicy,
272
256
  is_ipv6: request.isIpv6,
273
257
  name: request.name,
@@ -291,10 +275,33 @@ const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
291
275
  project_id: request.projectId ?? defaults.defaultProjectId,
292
276
  tags: request.tags
293
277
  });
278
+ const marshalCreateVpnGatewayRequestDualIpTunnel = (request, defaults) => ({
279
+ ipam_ipv4_id: request.ipamIpv4Id,
280
+ ipam_ipv6_id: request.ipamIpv6Id
281
+ });
282
+ const marshalCreateVpnGatewayRequestSingleIpTunnel = (request, defaults) => ({
283
+ ipam_id: request.ipamId
284
+ });
294
285
  const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
295
286
  ipam_ipv4_id: request.ipamIpv4Id,
296
287
  ipam_ipv6_id: request.ipamIpv6Id
297
288
  });
289
+ const marshalCreateVpnGatewayRequestPublicTunnelConfig = (request, defaults) => ({
290
+ ...resolveOneOf([
291
+ {
292
+ param: "single_ipv4_tunnel",
293
+ value: request.singleIpv4Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv4Tunnel) : void 0
294
+ },
295
+ {
296
+ param: "single_ipv6_tunnel",
297
+ value: request.singleIpv6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestSingleIpTunnel(request.singleIpv6Tunnel) : void 0
298
+ },
299
+ {
300
+ param: "dual_ipv4v6_tunnel",
301
+ value: request.dualIpv4V6Tunnel !== void 0 ? marshalCreateVpnGatewayRequestDualIpTunnel(request.dualIpv4V6Tunnel) : void 0
302
+ }
303
+ ])
304
+ });
298
305
  const marshalCreateVpnGatewayRequest = (request, defaults) => ({
299
306
  gateway_type: request.gatewayType,
300
307
  ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
@@ -307,22 +314,36 @@ const marshalCreateVpnGatewayRequest = (request, defaults) => ({
307
314
  ...resolveOneOf([
308
315
  {
309
316
  param: "public_config",
310
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(
311
- request.publicConfig
312
- ) : void 0
317
+ value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(request.publicConfig) : void 0
318
+ },
319
+ {
320
+ param: "public_tunnel_config",
321
+ value: request.publicTunnelConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicTunnelConfig(request.publicTunnelConfig) : void 0
313
322
  }
314
323
  ])
315
324
  });
316
325
  const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
317
326
  ...resolveOneOf([
318
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
319
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
327
+ {
328
+ param: "routing_policy_v4",
329
+ value: request.routingPolicyV4
330
+ },
331
+ {
332
+ param: "routing_policy_v6",
333
+ value: request.routingPolicyV6
334
+ }
320
335
  ])
321
336
  });
322
337
  const marshalSetRoutingPolicyRequest = (request, defaults) => ({
323
338
  ...resolveOneOf([
324
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
325
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
339
+ {
340
+ param: "routing_policy_v4",
341
+ value: request.routingPolicyV4
342
+ },
343
+ {
344
+ param: "routing_policy_v6",
345
+ value: request.routingPolicyV6
346
+ }
326
347
  ])
327
348
  });
328
349
  const marshalUpdateConnectionRequest = (request, defaults) => ({
@@ -22,6 +22,13 @@ export interface ConnectionCipher {
22
22
  integrity?: ConnectionIntegrity;
23
23
  dhGroup?: ConnectionDhGroup;
24
24
  }
25
+ export interface CreateVpnGatewayRequestDualIpTunnel {
26
+ ipamIpv4Id?: string;
27
+ ipamIpv6Id?: string;
28
+ }
29
+ export interface CreateVpnGatewayRequestSingleIpTunnel {
30
+ ipamId?: string;
31
+ }
25
32
  export interface VpnGatewayPrivateConfig {
26
33
  }
27
34
  export interface VpnGatewayPublicConfig {
@@ -139,6 +146,23 @@ export interface CreateVpnGatewayRequestPublicConfig {
139
146
  ipamIpv4Id?: string;
140
147
  ipamIpv6Id?: string;
141
148
  }
149
+ export interface CreateVpnGatewayRequestPublicTunnelConfig {
150
+ /**
151
+ *
152
+ * One-of ('config'): at most one of 'singleIpv4Tunnel', 'singleIpv6Tunnel', 'dualIpv4V6Tunnel' could be set.
153
+ */
154
+ singleIpv4Tunnel?: CreateVpnGatewayRequestSingleIpTunnel;
155
+ /**
156
+ *
157
+ * One-of ('config'): at most one of 'singleIpv4Tunnel', 'singleIpv6Tunnel', 'dualIpv4V6Tunnel' could be set.
158
+ */
159
+ singleIpv6Tunnel?: CreateVpnGatewayRequestSingleIpTunnel;
160
+ /**
161
+ *
162
+ * One-of ('config'): at most one of 'singleIpv4Tunnel', 'singleIpv6Tunnel', 'dualIpv4V6Tunnel' could be set.
163
+ */
164
+ dualIpv4V6Tunnel?: CreateVpnGatewayRequestDualIpTunnel;
165
+ }
142
166
  export interface CustomerGateway {
143
167
  /**
144
168
  * Unique identifier of the customer gateway.
@@ -468,15 +492,20 @@ export type CreateVpnGatewayRequest = {
468
492
  */
469
493
  gatewayType: string;
470
494
  /**
471
- * Public endpoint configuration of the VPN gateway.
495
+ * @deprecated Public endpoint configuration of the VPN gateway.
472
496
  *
473
- * One-of ('endpoint'): at most one of 'publicConfig' could be set.
497
+ * One-of ('endpoint'): at most one of 'publicConfig', 'publicTunnelConfig' could be set.
474
498
  */
475
499
  publicConfig?: CreateVpnGatewayRequestPublicConfig;
476
500
  /**
477
501
  * ID of the Private Network to attach to the VPN gateway.
478
502
  */
479
503
  privateNetworkId: string;
504
+ /**
505
+ *
506
+ * One-of ('endpoint'): at most one of 'publicConfig', 'publicTunnelConfig' could be set.
507
+ */
508
+ publicTunnelConfig?: CreateVpnGatewayRequestPublicTunnelConfig;
480
509
  /**
481
510
  * ID of the IPAM private IPv4 address to attach to the VPN gateway.
482
511
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-s2s-vpn",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Scaleway SDK s2s-vpn",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@scaleway/sdk-client": "^2.1.0"