@scaleway/sdk-s2s-vpn 2.1.1 → 2.3.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.
@@ -10,11 +10,7 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: [
14
- "fr-par",
15
- "nl-ams",
16
- "pl-waw"
17
- ]
13
+ regions: ["fr-par", "nl-ams", "pl-waw"]
18
14
  });
19
15
  pageOfListVpnGatewayTypes = (request = {}) => this.client.fetch(
20
16
  {
@@ -22,7 +18,10 @@ class API extends API$1 {
22
18
  path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`,
23
19
  urlParams: urlParams(
24
20
  ["page", request.page],
25
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
21
+ [
22
+ "page_size",
23
+ request.pageSize ?? this.client.settings.defaultPageSize
24
+ ]
26
25
  )
27
26
  },
28
27
  unmarshalListVpnGatewayTypesResponse
@@ -43,7 +42,10 @@ class API extends API$1 {
43
42
  ["name", request.name],
44
43
  ["order_by", request.orderBy],
45
44
  ["page", request.page],
46
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
45
+ [
46
+ "page_size",
47
+ request.pageSize ?? this.client.settings.defaultPageSize
48
+ ],
47
49
  ["private_network_ids", request.privateNetworkIds],
48
50
  ["project_id", request.projectId],
49
51
  ["statuses", request.statuses],
@@ -80,7 +82,9 @@ class API extends API$1 {
80
82
  * @returns A Promise of VpnGateway
81
83
  */
82
84
  waitForVpnGateway = (request, options) => waitForResource(
83
- options?.stop ?? ((res) => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status))),
85
+ options?.stop ?? ((res) => Promise.resolve(
86
+ !VPN_GATEWAY_TRANSIENT_STATUSES.includes(res.status)
87
+ )),
84
88
  this.getVpnGateway,
85
89
  request,
86
90
  options
@@ -142,7 +146,10 @@ class API extends API$1 {
142
146
  ["name", request.name],
143
147
  ["order_by", request.orderBy],
144
148
  ["page", request.page],
145
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
149
+ [
150
+ "page_size",
151
+ request.pageSize ?? this.client.settings.defaultPageSize
152
+ ],
146
153
  ["project_id", request.projectId],
147
154
  ["route_propagation_enabled", request.routePropagationEnabled],
148
155
  ["routing_policy_ids", request.routingPolicyIds],
@@ -212,12 +219,10 @@ class API extends API$1 {
212
219
  *
213
220
  * @param request - The request {@link DeleteConnectionRequest}
214
221
  */
215
- deleteConnection = (request) => this.client.fetch(
216
- {
217
- method: "DELETE",
218
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam("connectionId", request.connectionId)}`
219
- }
220
- );
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
+ });
221
226
  /**
222
227
  * Renew pre-shared key. Renew pre-shared key for a given connection.
223
228
  *
@@ -305,7 +310,10 @@ class API extends API$1 {
305
310
  ["name", request.name],
306
311
  ["order_by", request.orderBy],
307
312
  ["page", request.page],
308
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
313
+ [
314
+ "page_size",
315
+ request.pageSize ?? this.client.settings.defaultPageSize
316
+ ],
309
317
  ["project_id", request.projectId],
310
318
  ["tags", request.tags]
311
319
  )
@@ -371,12 +379,10 @@ class API extends API$1 {
371
379
  *
372
380
  * @param request - The request {@link DeleteCustomerGatewayRequest}
373
381
  */
374
- deleteCustomerGateway = (request) => this.client.fetch(
375
- {
376
- method: "DELETE",
377
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam("gatewayId", request.gatewayId)}`
378
- }
379
- );
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
+ });
380
386
  pageOfListRoutingPolicies = (request = {}) => this.client.fetch(
381
387
  {
382
388
  method: "GET",
@@ -386,7 +392,10 @@ class API extends API$1 {
386
392
  ["name", request.name],
387
393
  ["order_by", request.orderBy],
388
394
  ["page", request.page],
389
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
395
+ [
396
+ "page_size",
397
+ request.pageSize ?? this.client.settings.defaultPageSize
398
+ ],
390
399
  ["project_id", request.projectId],
391
400
  ["tags", request.tags]
392
401
  )
@@ -399,7 +408,11 @@ class API extends API$1 {
399
408
  * @param request - The request {@link ListRoutingPoliciesRequest}
400
409
  * @returns A Promise of ListRoutingPoliciesResponse
401
410
  */
402
- listRoutingPolicies = (request = {}) => enrichForPagination("routingPolicies", this.pageOfListRoutingPolicies, request);
411
+ listRoutingPolicies = (request = {}) => enrichForPagination(
412
+ "routingPolicies",
413
+ this.pageOfListRoutingPolicies,
414
+ request
415
+ );
403
416
  /**
404
417
  * 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.
405
418
  *
@@ -452,12 +465,10 @@ class API extends API$1 {
452
465
  *
453
466
  * @param request - The request {@link DeleteRoutingPolicyRequest}
454
467
  */
455
- deleteRoutingPolicy = (request) => this.client.fetch(
456
- {
457
- method: "DELETE",
458
- path: `/s2s-vpn/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam("routingPolicyId", request.routingPolicyId)}`
459
- }
460
- );
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
+ });
461
472
  }
462
473
  export {
463
474
  API
@@ -1,4 +1,4 @@
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
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';
@@ -36,9 +36,15 @@ 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(data.esp_ciphers, unmarshalConnectionCipher),
39
+ espCiphers: unmarshalArrayOfObject(
40
+ data.esp_ciphers,
41
+ unmarshalConnectionCipher
42
+ ),
40
43
  id: data.id,
41
- ikev2Ciphers: unmarshalArrayOfObject(data.ikev2_ciphers, unmarshalConnectionCipher),
44
+ ikev2Ciphers: unmarshalArrayOfObject(
45
+ data.ikev2_ciphers,
46
+ unmarshalConnectionCipher
47
+ ),
42
48
  initiationPolicy: data.initiation_policy,
43
49
  isIpv6: data.is_ipv6,
44
50
  name: data.name,
@@ -65,6 +71,7 @@ const unmarshalCustomerGateway = (data) => {
65
71
  }
66
72
  return {
67
73
  asn: data.asn,
74
+ connectionIds: data.connection_ids,
68
75
  createdAt: unmarshalDate(data.created_at),
69
76
  id: data.id,
70
77
  name: data.name,
@@ -72,6 +79,7 @@ const unmarshalCustomerGateway = (data) => {
72
79
  projectId: data.project_id,
73
80
  publicIpv4: data.public_ipv4,
74
81
  publicIpv6: data.public_ipv6,
82
+ region: data.region,
75
83
  tags: data.tags,
76
84
  updatedAt: unmarshalDate(data.updated_at)
77
85
  };
@@ -123,6 +131,7 @@ const unmarshalVpnGateway = (data) => {
123
131
  }
124
132
  return {
125
133
  asn: data.asn,
134
+ connectionIds: data.connection_ids,
126
135
  createdAt: unmarshalDate(data.created_at),
127
136
  gatewayType: data.gateway_type,
128
137
  id: data.id,
@@ -181,7 +190,10 @@ const unmarshalListRoutingPoliciesResponse = (data) => {
181
190
  );
182
191
  }
183
192
  return {
184
- routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy),
193
+ routingPolicies: unmarshalArrayOfObject(
194
+ data.routing_policies,
195
+ unmarshalRoutingPolicy
196
+ ),
185
197
  totalCount: data.total_count
186
198
  };
187
199
  };
@@ -206,7 +218,10 @@ const unmarshalListVpnGatewayTypesResponse = (data) => {
206
218
  );
207
219
  }
208
220
  return {
209
- gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType),
221
+ gatewayTypes: unmarshalArrayOfObject(
222
+ data.gateway_types,
223
+ unmarshalGatewayType
224
+ ),
210
225
  totalCount: data.total_count
211
226
  };
212
227
  };
@@ -247,8 +262,12 @@ const marshalCreateConnectionRequest = (request, defaults) => ({
247
262
  bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6) : void 0,
248
263
  customer_gateway_id: request.customerGatewayId,
249
264
  enable_route_propagation: request.enableRoutePropagation,
250
- esp_ciphers: request.espCiphers.map((elt) => marshalConnectionCipher(elt)),
251
- ikev2_ciphers: request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt)),
265
+ esp_ciphers: request.espCiphers.map(
266
+ (elt) => marshalConnectionCipher(elt)
267
+ ),
268
+ ikev2_ciphers: request.ikev2Ciphers.map(
269
+ (elt) => marshalConnectionCipher(elt)
270
+ ),
252
271
  initiation_policy: request.initiationPolicy,
253
272
  is_ipv6: request.isIpv6,
254
273
  name: request.name,
@@ -288,32 +307,22 @@ const marshalCreateVpnGatewayRequest = (request, defaults) => ({
288
307
  ...resolveOneOf([
289
308
  {
290
309
  param: "public_config",
291
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(request.publicConfig) : void 0
310
+ value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(
311
+ request.publicConfig
312
+ ) : void 0
292
313
  }
293
314
  ])
294
315
  });
295
316
  const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
296
317
  ...resolveOneOf([
297
- {
298
- param: "routing_policy_v4",
299
- value: request.routingPolicyV4
300
- },
301
- {
302
- param: "routing_policy_v6",
303
- value: request.routingPolicyV6
304
- }
318
+ { param: "routing_policy_v4", value: request.routingPolicyV4 },
319
+ { param: "routing_policy_v6", value: request.routingPolicyV6 }
305
320
  ])
306
321
  });
307
322
  const marshalSetRoutingPolicyRequest = (request, defaults) => ({
308
323
  ...resolveOneOf([
309
- {
310
- param: "routing_policy_v4",
311
- value: request.routingPolicyV4
312
- },
313
- {
314
- param: "routing_policy_v6",
315
- value: request.routingPolicyV6
316
- }
324
+ { param: "routing_policy_v4", value: request.routingPolicyV4 },
325
+ { param: "routing_policy_v6", value: request.routingPolicyV6 }
317
326
  ])
318
327
  });
319
328
  const marshalUpdateConnectionRequest = (request, defaults) => ({
@@ -180,6 +180,14 @@ export interface CustomerGateway {
180
180
  * AS Number of the customer gateway.
181
181
  */
182
182
  asn: number;
183
+ /**
184
+ * List of connection ids of the customer gateway.
185
+ */
186
+ connectionIds: string[];
187
+ /**
188
+ * Region of the customer gateway.
189
+ */
190
+ region: ScwRegion;
183
191
  }
184
192
  export interface RoutingPolicy {
185
193
  /**
@@ -301,6 +309,10 @@ export interface VpnGateway {
301
309
  * Autonomous System Number (ASN) of the VPN gateway, used by Border Gateway Protocol (BGP) to exchange routing information with the customer gateway.
302
310
  */
303
311
  asn: number;
312
+ /**
313
+ * List of connection ids of the VPN gateway.
314
+ */
315
+ connectionIds: string[];
304
316
  /**
305
317
  * Zone where the VPN gateway resource is currently provisioned.
306
318
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-s2s-vpn",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK s2s-vpn",
5
5
  "license": "Apache-2.0",
6
6
  "files": [