@scaleway/sdk-s2s-vpn 1.2.0 → 2.1.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.
@@ -1,370 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const unmarshalBgpSession = (data) => {
5
- if (!sdkClient.isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'BgpSession' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- peerPrivateIp: data.peer_private_ip,
12
- privateIp: data.private_ip,
13
- routingPolicyId: data.routing_policy_id
14
- };
15
- };
16
- const unmarshalConnectionCipher = (data) => {
17
- if (!sdkClient.isJSONObject(data)) {
18
- throw new TypeError(
19
- `Unmarshalling the type 'ConnectionCipher' failed as data isn't a dictionary.`
20
- );
21
- }
22
- return {
23
- dhGroup: data.dh_group ? data.dh_group : void 0,
24
- encryption: data.encryption,
25
- integrity: data.integrity ? data.integrity : void 0
26
- };
27
- };
28
- const unmarshalConnection = (data) => {
29
- if (!sdkClient.isJSONObject(data)) {
30
- throw new TypeError(
31
- `Unmarshalling the type 'Connection' failed as data isn't a dictionary.`
32
- );
33
- }
34
- return {
35
- bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : void 0,
36
- bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : void 0,
37
- bgpStatusIpv4: data.bgp_status_ipv4,
38
- bgpStatusIpv6: data.bgp_status_ipv6,
39
- createdAt: sdkClient.unmarshalDate(data.created_at),
40
- customerGatewayId: data.customer_gateway_id,
41
- espCiphers: sdkClient.unmarshalArrayOfObject(
42
- data.esp_ciphers,
43
- unmarshalConnectionCipher
44
- ),
45
- id: data.id,
46
- ikev2Ciphers: sdkClient.unmarshalArrayOfObject(
47
- data.ikev2_ciphers,
48
- unmarshalConnectionCipher
49
- ),
50
- initiationPolicy: data.initiation_policy,
51
- isIpv6: data.is_ipv6,
52
- name: data.name,
53
- organizationId: data.organization_id,
54
- projectId: data.project_id,
55
- region: data.region,
56
- routePropagationEnabled: data.route_propagation_enabled,
57
- secretId: data.secret_id,
58
- secretRevision: data.secret_revision,
59
- status: data.status,
60
- tags: data.tags,
61
- tunnelStatus: data.tunnel_status,
62
- tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : void 0,
63
- tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : void 0,
64
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
65
- vpnGatewayId: data.vpn_gateway_id
66
- };
67
- };
68
- const unmarshalCustomerGateway = (data) => {
69
- if (!sdkClient.isJSONObject(data)) {
70
- throw new TypeError(
71
- `Unmarshalling the type 'CustomerGateway' failed as data isn't a dictionary.`
72
- );
73
- }
74
- return {
75
- asn: data.asn,
76
- createdAt: sdkClient.unmarshalDate(data.created_at),
77
- id: data.id,
78
- name: data.name,
79
- organizationId: data.organization_id,
80
- projectId: data.project_id,
81
- publicIpv4: data.public_ipv4,
82
- publicIpv6: data.public_ipv6,
83
- tags: data.tags,
84
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
85
- };
86
- };
87
- const unmarshalRoutingPolicy = (data) => {
88
- if (!sdkClient.isJSONObject(data)) {
89
- throw new TypeError(
90
- `Unmarshalling the type 'RoutingPolicy' failed as data isn't a dictionary.`
91
- );
92
- }
93
- return {
94
- createdAt: sdkClient.unmarshalDate(data.created_at),
95
- id: data.id,
96
- isIpv6: data.is_ipv6,
97
- name: data.name,
98
- organizationId: data.organization_id,
99
- prefixFilterIn: data.prefix_filter_in,
100
- prefixFilterOut: data.prefix_filter_out,
101
- projectId: data.project_id,
102
- region: data.region,
103
- tags: data.tags,
104
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
105
- };
106
- };
107
- const unmarshalVpnGatewayPrivateConfig = (data) => {
108
- if (!sdkClient.isJSONObject(data)) {
109
- throw new TypeError(
110
- `Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`
111
- );
112
- }
113
- return {};
114
- };
115
- const unmarshalVpnGatewayPublicConfig = (data) => {
116
- if (!sdkClient.isJSONObject(data)) {
117
- throw new TypeError(
118
- `Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`
119
- );
120
- }
121
- return {
122
- ipamIpv4Id: data.ipam_ipv4_id,
123
- ipamIpv6Id: data.ipam_ipv6_id
124
- };
125
- };
126
- const unmarshalVpnGateway = (data) => {
127
- if (!sdkClient.isJSONObject(data)) {
128
- throw new TypeError(
129
- `Unmarshalling the type 'VpnGateway' failed as data isn't a dictionary.`
130
- );
131
- }
132
- return {
133
- asn: data.asn,
134
- createdAt: sdkClient.unmarshalDate(data.created_at),
135
- gatewayType: data.gateway_type,
136
- id: data.id,
137
- ipamPrivateIpv4Id: data.ipam_private_ipv4_id,
138
- ipamPrivateIpv6Id: data.ipam_private_ipv6_id,
139
- name: data.name,
140
- organizationId: data.organization_id,
141
- privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : void 0,
142
- privateNetworkId: data.private_network_id,
143
- projectId: data.project_id,
144
- publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : void 0,
145
- region: data.region,
146
- status: data.status,
147
- tags: data.tags,
148
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
149
- zone: data.zone
150
- };
151
- };
152
- const unmarshalCreateConnectionResponse = (data) => {
153
- if (!sdkClient.isJSONObject(data)) {
154
- throw new TypeError(
155
- `Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`
156
- );
157
- }
158
- return {
159
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
160
- preSharedKey: data.pre_shared_key
161
- };
162
- };
163
- const unmarshalListConnectionsResponse = (data) => {
164
- if (!sdkClient.isJSONObject(data)) {
165
- throw new TypeError(
166
- `Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`
167
- );
168
- }
169
- return {
170
- connections: sdkClient.unmarshalArrayOfObject(data.connections, unmarshalConnection),
171
- totalCount: data.total_count
172
- };
173
- };
174
- const unmarshalListCustomerGatewaysResponse = (data) => {
175
- if (!sdkClient.isJSONObject(data)) {
176
- throw new TypeError(
177
- `Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`
178
- );
179
- }
180
- return {
181
- gateways: sdkClient.unmarshalArrayOfObject(data.gateways, unmarshalCustomerGateway),
182
- totalCount: data.total_count
183
- };
184
- };
185
- const unmarshalListRoutingPoliciesResponse = (data) => {
186
- if (!sdkClient.isJSONObject(data)) {
187
- throw new TypeError(
188
- `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`
189
- );
190
- }
191
- return {
192
- routingPolicies: sdkClient.unmarshalArrayOfObject(
193
- data.routing_policies,
194
- unmarshalRoutingPolicy
195
- ),
196
- totalCount: data.total_count
197
- };
198
- };
199
- const unmarshalGatewayType = (data) => {
200
- if (!sdkClient.isJSONObject(data)) {
201
- throw new TypeError(
202
- `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`
203
- );
204
- }
205
- return {
206
- allowedConnections: data.allowed_connections,
207
- bandwidth: data.bandwidth,
208
- name: data.name,
209
- region: data.region
210
- };
211
- };
212
- const unmarshalListVpnGatewayTypesResponse = (data) => {
213
- if (!sdkClient.isJSONObject(data)) {
214
- throw new TypeError(
215
- `Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`
216
- );
217
- }
218
- return {
219
- gatewayTypes: sdkClient.unmarshalArrayOfObject(
220
- data.gateway_types,
221
- unmarshalGatewayType
222
- ),
223
- totalCount: data.total_count
224
- };
225
- };
226
- const unmarshalListVpnGatewaysResponse = (data) => {
227
- if (!sdkClient.isJSONObject(data)) {
228
- throw new TypeError(
229
- `Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`
230
- );
231
- }
232
- return {
233
- gateways: sdkClient.unmarshalArrayOfObject(data.gateways, unmarshalVpnGateway),
234
- totalCount: data.total_count
235
- };
236
- };
237
- const unmarshalRenewConnectionPskResponse = (data) => {
238
- if (!sdkClient.isJSONObject(data)) {
239
- throw new TypeError(
240
- `Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`
241
- );
242
- }
243
- return {
244
- connection: data.connection ? unmarshalConnection(data.connection) : void 0,
245
- preSharedKey: data.pre_shared_key
246
- };
247
- };
248
- const marshalConnectionCipher = (request, defaults) => ({
249
- dh_group: request.dhGroup,
250
- encryption: request.encryption,
251
- integrity: request.integrity
252
- });
253
- const marshalCreateConnectionRequestBgpConfig = (request, defaults) => ({
254
- peer_private_ip: request.peerPrivateIp,
255
- private_ip: request.privateIp,
256
- routing_policy_id: request.routingPolicyId
257
- });
258
- const marshalCreateConnectionRequest = (request, defaults) => ({
259
- bgp_config_ipv4: request.bgpConfigIpv4 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4) : void 0,
260
- bgp_config_ipv6: request.bgpConfigIpv6 !== void 0 ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6) : void 0,
261
- customer_gateway_id: request.customerGatewayId,
262
- enable_route_propagation: request.enableRoutePropagation,
263
- esp_ciphers: request.espCiphers.map(
264
- (elt) => marshalConnectionCipher(elt)
265
- ),
266
- ikev2_ciphers: request.ikev2Ciphers.map(
267
- (elt) => marshalConnectionCipher(elt)
268
- ),
269
- initiation_policy: request.initiationPolicy,
270
- is_ipv6: request.isIpv6,
271
- name: request.name,
272
- project_id: request.projectId ?? defaults.defaultProjectId,
273
- tags: request.tags,
274
- vpn_gateway_id: request.vpnGatewayId
275
- });
276
- const marshalCreateCustomerGatewayRequest = (request, defaults) => ({
277
- asn: request.asn,
278
- ipv4_public: request.ipv4Public,
279
- ipv6_public: request.ipv6Public,
280
- name: request.name,
281
- project_id: request.projectId ?? defaults.defaultProjectId,
282
- tags: request.tags
283
- });
284
- const marshalCreateRoutingPolicyRequest = (request, defaults) => ({
285
- is_ipv6: request.isIpv6,
286
- name: request.name,
287
- prefix_filter_in: request.prefixFilterIn,
288
- prefix_filter_out: request.prefixFilterOut,
289
- project_id: request.projectId ?? defaults.defaultProjectId,
290
- tags: request.tags
291
- });
292
- const marshalCreateVpnGatewayRequestPublicConfig = (request, defaults) => ({
293
- ipam_ipv4_id: request.ipamIpv4Id,
294
- ipam_ipv6_id: request.ipamIpv6Id
295
- });
296
- const marshalCreateVpnGatewayRequest = (request, defaults) => ({
297
- gateway_type: request.gatewayType,
298
- ipam_private_ipv4_id: request.ipamPrivateIpv4Id,
299
- ipam_private_ipv6_id: request.ipamPrivateIpv6Id,
300
- name: request.name,
301
- private_network_id: request.privateNetworkId,
302
- project_id: request.projectId ?? defaults.defaultProjectId,
303
- tags: request.tags,
304
- zone: request.zone ?? defaults.defaultZone,
305
- ...sdkClient.resolveOneOf([
306
- {
307
- param: "public_config",
308
- value: request.publicConfig !== void 0 ? marshalCreateVpnGatewayRequestPublicConfig(
309
- request.publicConfig
310
- ) : void 0
311
- }
312
- ])
313
- });
314
- const marshalDetachRoutingPolicyRequest = (request, defaults) => ({
315
- ...sdkClient.resolveOneOf([
316
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
317
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
318
- ])
319
- });
320
- const marshalSetRoutingPolicyRequest = (request, defaults) => ({
321
- ...sdkClient.resolveOneOf([
322
- { param: "routing_policy_v4", value: request.routingPolicyV4 },
323
- { param: "routing_policy_v6", value: request.routingPolicyV6 }
324
- ])
325
- });
326
- const marshalUpdateConnectionRequest = (request, defaults) => ({
327
- esp_ciphers: request.espCiphers !== void 0 ? request.espCiphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
328
- ikev2_ciphers: request.ikev2Ciphers !== void 0 ? request.ikev2Ciphers.map((elt) => marshalConnectionCipher(elt)) : void 0,
329
- initiation_policy: request.initiationPolicy,
330
- name: request.name,
331
- tags: request.tags
332
- });
333
- const marshalUpdateCustomerGatewayRequest = (request, defaults) => ({
334
- asn: request.asn,
335
- ipv4_public: request.ipv4Public,
336
- ipv6_public: request.ipv6Public,
337
- name: request.name,
338
- tags: request.tags
339
- });
340
- const marshalUpdateRoutingPolicyRequest = (request, defaults) => ({
341
- name: request.name,
342
- prefix_filter_in: request.prefixFilterIn,
343
- prefix_filter_out: request.prefixFilterOut,
344
- tags: request.tags
345
- });
346
- const marshalUpdateVpnGatewayRequest = (request, defaults) => ({
347
- name: request.name,
348
- tags: request.tags
349
- });
350
- exports.marshalCreateConnectionRequest = marshalCreateConnectionRequest;
351
- exports.marshalCreateCustomerGatewayRequest = marshalCreateCustomerGatewayRequest;
352
- exports.marshalCreateRoutingPolicyRequest = marshalCreateRoutingPolicyRequest;
353
- exports.marshalCreateVpnGatewayRequest = marshalCreateVpnGatewayRequest;
354
- exports.marshalDetachRoutingPolicyRequest = marshalDetachRoutingPolicyRequest;
355
- exports.marshalSetRoutingPolicyRequest = marshalSetRoutingPolicyRequest;
356
- exports.marshalUpdateConnectionRequest = marshalUpdateConnectionRequest;
357
- exports.marshalUpdateCustomerGatewayRequest = marshalUpdateCustomerGatewayRequest;
358
- exports.marshalUpdateRoutingPolicyRequest = marshalUpdateRoutingPolicyRequest;
359
- exports.marshalUpdateVpnGatewayRequest = marshalUpdateVpnGatewayRequest;
360
- exports.unmarshalConnection = unmarshalConnection;
361
- exports.unmarshalCreateConnectionResponse = unmarshalCreateConnectionResponse;
362
- exports.unmarshalCustomerGateway = unmarshalCustomerGateway;
363
- exports.unmarshalListConnectionsResponse = unmarshalListConnectionsResponse;
364
- exports.unmarshalListCustomerGatewaysResponse = unmarshalListCustomerGatewaysResponse;
365
- exports.unmarshalListRoutingPoliciesResponse = unmarshalListRoutingPoliciesResponse;
366
- exports.unmarshalListVpnGatewayTypesResponse = unmarshalListVpnGatewayTypesResponse;
367
- exports.unmarshalListVpnGatewaysResponse = unmarshalListVpnGatewaysResponse;
368
- exports.unmarshalRenewConnectionPskResponse = unmarshalRenewConnectionPskResponse;
369
- exports.unmarshalRoutingPolicy = unmarshalRoutingPolicy;
370
- exports.unmarshalVpnGateway = unmarshalVpnGateway;
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CreateConnectionRequest = {
4
- name: {
5
- maxLength: 255,
6
- minLength: 1
7
- }
8
- };
9
- const CreateCustomerGatewayRequest = {
10
- asn: {
11
- greaterThanOrEqual: 1
12
- },
13
- name: {
14
- maxLength: 255,
15
- minLength: 1
16
- }
17
- };
18
- const CreateRoutingPolicyRequest = {
19
- name: {
20
- maxLength: 255,
21
- minLength: 1
22
- }
23
- };
24
- const CreateVpnGatewayRequest = {
25
- name: {
26
- maxLength: 255,
27
- minLength: 1
28
- }
29
- };
30
- const CustomerGateway = {
31
- asn: {
32
- greaterThanOrEqual: 1
33
- }
34
- };
35
- const ListConnectionsRequest = {
36
- name: {
37
- maxLength: 255,
38
- minLength: 1
39
- },
40
- page: {
41
- greaterThanOrEqual: 1
42
- },
43
- pageSize: {
44
- greaterThanOrEqual: 1,
45
- lessThanOrEqual: 1e3
46
- }
47
- };
48
- const ListCustomerGatewaysRequest = {
49
- name: {
50
- maxLength: 255,
51
- minLength: 1
52
- },
53
- page: {
54
- greaterThanOrEqual: 1
55
- },
56
- pageSize: {
57
- greaterThanOrEqual: 1,
58
- lessThanOrEqual: 1e3
59
- }
60
- };
61
- const ListRoutingPoliciesRequest = {
62
- name: {
63
- maxLength: 255,
64
- minLength: 1
65
- },
66
- page: {
67
- greaterThanOrEqual: 1
68
- },
69
- pageSize: {
70
- greaterThanOrEqual: 1,
71
- lessThanOrEqual: 1e3
72
- }
73
- };
74
- const ListVpnGatewayTypesRequest = {
75
- page: {
76
- greaterThanOrEqual: 1
77
- },
78
- pageSize: {
79
- greaterThanOrEqual: 1,
80
- lessThanOrEqual: 1e3
81
- }
82
- };
83
- const ListVpnGatewaysRequest = {
84
- name: {
85
- maxLength: 255,
86
- minLength: 1
87
- },
88
- page: {
89
- greaterThanOrEqual: 1
90
- },
91
- pageSize: {
92
- greaterThanOrEqual: 1,
93
- lessThanOrEqual: 1e3
94
- }
95
- };
96
- const UpdateConnectionRequest = {
97
- name: {
98
- maxLength: 255,
99
- minLength: 1
100
- }
101
- };
102
- const UpdateCustomerGatewayRequest = {
103
- asn: {
104
- greaterThanOrEqual: 1
105
- },
106
- name: {
107
- maxLength: 255,
108
- minLength: 1
109
- }
110
- };
111
- const UpdateRoutingPolicyRequest = {
112
- name: {
113
- maxLength: 255,
114
- minLength: 1
115
- }
116
- };
117
- const UpdateVpnGatewayRequest = {
118
- name: {
119
- maxLength: 255,
120
- minLength: 1
121
- }
122
- };
123
- const VpnGateway = {
124
- asn: {
125
- greaterThanOrEqual: 1
126
- }
127
- };
128
- exports.CreateConnectionRequest = CreateConnectionRequest;
129
- exports.CreateCustomerGatewayRequest = CreateCustomerGatewayRequest;
130
- exports.CreateRoutingPolicyRequest = CreateRoutingPolicyRequest;
131
- exports.CreateVpnGatewayRequest = CreateVpnGatewayRequest;
132
- exports.CustomerGateway = CustomerGateway;
133
- exports.ListConnectionsRequest = ListConnectionsRequest;
134
- exports.ListCustomerGatewaysRequest = ListCustomerGatewaysRequest;
135
- exports.ListRoutingPoliciesRequest = ListRoutingPoliciesRequest;
136
- exports.ListVpnGatewayTypesRequest = ListVpnGatewayTypesRequest;
137
- exports.ListVpnGatewaysRequest = ListVpnGatewaysRequest;
138
- exports.UpdateConnectionRequest = UpdateConnectionRequest;
139
- exports.UpdateCustomerGatewayRequest = UpdateCustomerGatewayRequest;
140
- exports.UpdateRoutingPolicyRequest = UpdateRoutingPolicyRequest;
141
- exports.UpdateVpnGatewayRequest = UpdateVpnGatewayRequest;
142
- exports.VpnGateway = VpnGateway;