@scaleway/sdk-s2s-vpn 2.3.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
@@ -41,11 +42,9 @@ class API extends API$1 {
41
42
  ["gateway_types", request.gatewayTypes],
42
43
  ["name", request.name],
43
44
  ["order_by", request.orderBy],
45
+ ["organization_id", request.organizationId],
44
46
  ["page", request.page],
45
- [
46
- "page_size",
47
- request.pageSize ?? this.client.settings.defaultPageSize
48
- ],
47
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
49
48
  ["private_network_ids", request.privateNetworkIds],
50
49
  ["project_id", request.projectId],
51
50
  ["statuses", request.statuses],
@@ -82,9 +81,7 @@ class API extends API$1 {
82
81
  * @returns A Promise of VpnGateway
83
82
  */
84
83
  waitForVpnGateway = (request, options) => waitForResource(
85
- options?.stop ?? ((res) => Promise.resolve(
86
- !VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status)
87
- )),
84
+ options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
88
85
  this.getVpnGateway,
89
86
  request,
90
87
  options
@@ -145,11 +142,9 @@ class API extends API$1 {
145
142
  ["is_ipv6", request.isIpv6],
146
143
  ["name", request.name],
147
144
  ["order_by", request.orderBy],
145
+ ["organization_id", request.organizationId],
148
146
  ["page", request.page],
149
- [
150
- "page_size",
151
- request.pageSize ?? this.client.settings.defaultPageSize
152
- ],
147
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
153
148
  ["project_id", request.projectId],
154
149
  ["route_propagation_enabled", request.routePropagationEnabled],
155
150
  ["routing_policy_ids", request.routingPolicyIds],
@@ -219,10 +214,12 @@ class API extends API$1 {
219
214
  *
220
215
  * @param request - The request {@link DeleteConnectionRequest}
221
216
  */
222
- deleteConnection = (request) => this.client.fetch({
223
- method: "DELETE",
224
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
225
- });
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
+ );
226
223
  /**
227
224
  * Renew pre-shared key. Renew pre-shared key for a given connection.
228
225
  *
@@ -309,11 +306,9 @@ class API extends API$1 {
309
306
  urlParams: urlParams(
310
307
  ["name", request.name],
311
308
  ["order_by", request.orderBy],
309
+ ["organization_id", request.organizationId],
312
310
  ["page", request.page],
313
- [
314
- "page_size",
315
- request.pageSize ?? this.client.settings.defaultPageSize
316
- ],
311
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
317
312
  ["project_id", request.projectId],
318
313
  ["tags", request.tags]
319
314
  )
@@ -379,10 +374,12 @@ class API extends API$1 {
379
374
  *
380
375
  * @param request - The request {@link DeleteCustomerGatewayRequest}
381
376
  */
382
- deleteCustomerGateway = (request) => this.client.fetch({
383
- method: "DELETE",
384
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
385
- });
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
+ );
386
383
  pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
387
384
  {
388
385
  method: "GET",
@@ -391,11 +388,9 @@ class API extends API$1 {
391
388
  ["ipv6", request.ipv6],
392
389
  ["name", request.name],
393
390
  ["order_by", request.orderBy],
391
+ ["organization_id", request.organizationId],
394
392
  ["page", request.page],
395
- [
396
- "page_size",
397
- request.pageSize ?? this.client.settings.defaultPageSize
398
- ],
393
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
399
394
  ["project_id", request.projectId],
400
395
  ["tags", request.tags]
401
396
  )
@@ -408,11 +403,7 @@ class API extends API$1 {
408
403
  * @param request - The request {@link ListRoutingPoliciesRequest}
409
404
  * @returns A Promise of ListRoutingPoliciesResponse
410
405
  */
411
- listRoutingPolicies = (request = {}) => enrichForPagination(
412
- "routingPolicies",
413
- this.pageOfListRoutingPolicies,
414
- request
415
- );
406
+ listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
416
407
  /**
417
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.
418
409
  *
@@ -465,10 +456,12 @@ class API extends API$1 {
465
456
  *
466
457
  * @param request - The request {@link DeleteRoutingPolicyRequest}
467
458
  */
468
- deleteRoutingPolicy = (request) => this.client.fetch({
469
- method: "DELETE",
470
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
471
- });
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
+ );
472
465
  }
473
466
  export {
474
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
  */
@@ -633,6 +662,10 @@ export type ListConnectionsRequest = {
633
662
  * Project ID to filter for.
634
663
  */
635
664
  projectId?: string;
665
+ /**
666
+ * Organization ID to filter for.
667
+ */
668
+ organizationId?: string;
636
669
  /**
637
670
  * Connection name to filter for.
638
671
  */
@@ -697,6 +730,10 @@ export type ListCustomerGatewaysRequest = {
697
730
  * Project ID to filter for.
698
731
  */
699
732
  projectId?: string;
733
+ /**
734
+ * Organization ID to filter for.
735
+ */
736
+ organizationId?: string;
700
737
  /**
701
738
  * Customer gateway name to filter for.
702
739
  */
@@ -737,6 +774,10 @@ export type ListRoutingPoliciesRequest = {
737
774
  * Project ID to filter for.
738
775
  */
739
776
  projectId?: string;
777
+ /**
778
+ * Organization ID to filter for.
779
+ */
780
+ organizationId?: string;
740
781
  /**
741
782
  * Routing policy name to filter for.
742
783
  */
@@ -799,6 +840,10 @@ export type ListVpnGatewaysRequest = {
799
840
  * Project ID to filter for.
800
841
  */
801
842
  projectId?: string;
843
+ /**
844
+ * Organization ID to filter for.
845
+ */
846
+ organizationId?: string;
802
847
  /**
803
848
  * VPN gateway name to filter for.
804
849
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-s2s-vpn",
3
- "version": "2.3.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"