@scaleway/sdk 1.2.0 → 1.5.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.
- package/dist/api/account/index.js +0 -2
- package/dist/api/account/v2/api.gen.js +16 -6
- package/dist/api/applesilicon/v1alpha1/api.gen.js +31 -13
- package/dist/api/baremetal/index.js +2 -2
- package/dist/api/baremetal/v1/api.gen.js +59 -45
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +52 -0
- package/dist/api/billing/v2alpha1/index.gen.js +3 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +52 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +36 -23
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +2 -1
- package/dist/api/container/v1beta1/api.gen.js +34 -27
- package/dist/api/domain/v2beta1/api.gen.js +89 -78
- package/dist/api/flexibleip/v1alpha1/api.gen.js +18 -11
- package/dist/api/function/v1beta1/api.gen.js +39 -30
- package/dist/api/function/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/iam/v1alpha1/api.gen.js +147 -39
- package/dist/api/instance/index.js +2 -2
- package/dist/api/instance/v1/api.gen.js +72 -61
- package/dist/api/iot/v1/api.gen.js +37 -37
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +65 -46
- package/dist/api/k8s/v1/marshalling.gen.js +6 -1
- package/dist/api/lb/index.js +2 -2
- package/dist/api/lb/v1/api.gen.js +231 -110
- package/dist/api/lb/v1/marshalling.gen.js +2 -2
- package/dist/api/marketplace/v1/api.gen.js +2 -2
- package/dist/api/marketplace/v2/api.gen.js +3 -3
- package/dist/api/mnq/v1alpha1/api.gen.js +11 -10
- package/dist/api/rdb/v1/api.gen.js +195 -63
- package/dist/api/rdb/v1/marshalling.gen.js +16 -2
- package/dist/api/redis/v1/api.gen.js +88 -25
- package/dist/api/registry/v1/api.gen.js +15 -13
- package/dist/api/secret/v1alpha1/api.gen.js +43 -18
- package/dist/api/tem/v1alpha1/api.gen.js +26 -14
- package/dist/api/tem/v1alpha1/marshalling.gen.js +2 -0
- package/dist/api/test/v1/api.gen.js +11 -10
- package/dist/api/vpc/v1/api.gen.js +5 -5
- package/dist/api/vpcgw/v1/api.gen.js +130 -41
- package/dist/api/vpcgw/v1/marshalling.gen.js +18 -15
- package/dist/api/webhosting/v1alpha1/api.gen.js +10 -9
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +3 -1
- package/dist/helpers/is-response.js +10 -0
- package/dist/index.cjs +1598 -928
- package/dist/index.d.ts +3970 -2960
- package/dist/index.js +44 -42
- package/dist/scw/constants.js +1 -1
- package/dist/scw/fetch/response-parser.js +2 -1
- package/package.json +2 -2
- package/dist/api/account/v2alpha1/api.gen.js +0 -85
- package/dist/api/account/v2alpha1/index.js +0 -1
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -57
|
@@ -210,21 +210,6 @@ const unmarshalSetPATRulesResponse = data => {
|
|
|
210
210
|
patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
|
-
const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
214
|
-
ip_address: request.ipAddress,
|
|
215
|
-
mac_address: request.macAddress
|
|
216
|
-
});
|
|
217
|
-
const marshalSetPATRulesRequestRule = (request, defaults) => ({
|
|
218
|
-
private_ip: request.privateIp,
|
|
219
|
-
private_port: request.privatePort,
|
|
220
|
-
protocol: request.protocol,
|
|
221
|
-
public_port: request.publicPort
|
|
222
|
-
});
|
|
223
|
-
const marshalCreateDHCPEntryRequest = (request, defaults) => ({
|
|
224
|
-
gateway_network_id: request.gatewayNetworkId,
|
|
225
|
-
ip_address: request.ipAddress,
|
|
226
|
-
mac_address: request.macAddress
|
|
227
|
-
});
|
|
228
213
|
const marshalCreateDHCPRequest = (request, defaults) => ({
|
|
229
214
|
address: request.address,
|
|
230
215
|
dns_local_name: request.dnsLocalName,
|
|
@@ -241,6 +226,21 @@ const marshalCreateDHCPRequest = (request, defaults) => ({
|
|
|
241
226
|
subnet: request.subnet,
|
|
242
227
|
valid_lifetime: request.validLifetime
|
|
243
228
|
});
|
|
229
|
+
const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
230
|
+
ip_address: request.ipAddress,
|
|
231
|
+
mac_address: request.macAddress
|
|
232
|
+
});
|
|
233
|
+
const marshalSetPATRulesRequestRule = (request, defaults) => ({
|
|
234
|
+
private_ip: request.privateIp,
|
|
235
|
+
private_port: request.privatePort,
|
|
236
|
+
protocol: request.protocol,
|
|
237
|
+
public_port: request.publicPort
|
|
238
|
+
});
|
|
239
|
+
const marshalCreateDHCPEntryRequest = (request, defaults) => ({
|
|
240
|
+
gateway_network_id: request.gatewayNetworkId,
|
|
241
|
+
ip_address: request.ipAddress,
|
|
242
|
+
mac_address: request.macAddress
|
|
243
|
+
});
|
|
244
244
|
const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
|
|
245
245
|
enable_dhcp: request.enableDhcp,
|
|
246
246
|
enable_masquerade: request.enableMasquerade,
|
|
@@ -249,6 +249,9 @@ const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
|
|
|
249
249
|
...resolveOneOf([{
|
|
250
250
|
param: 'dhcp_id',
|
|
251
251
|
value: request.dhcpId
|
|
252
|
+
}, {
|
|
253
|
+
param: 'dhcp',
|
|
254
|
+
value: request.dhcp ? marshalCreateDHCPRequest(request.dhcp, defaults) : undefined
|
|
252
255
|
}, {
|
|
253
256
|
param: 'address',
|
|
254
257
|
value: request.address
|
|
@@ -17,7 +17,7 @@ class API extends API$1 {
|
|
|
17
17
|
super(...arguments);
|
|
18
18
|
_this = this;
|
|
19
19
|
/**
|
|
20
|
-
* Create a hosting
|
|
20
|
+
* Create a hosting.
|
|
21
21
|
*
|
|
22
22
|
* @param request - The request {@link CreateHostingRequest}
|
|
23
23
|
* @returns A Promise of Hosting
|
|
@@ -39,7 +39,7 @@ class API extends API$1 {
|
|
|
39
39
|
}, unmarshalListHostingsResponse);
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
* List all hostings
|
|
42
|
+
* List all hostings.
|
|
43
43
|
*
|
|
44
44
|
* @param request - The request {@link ListHostingsRequest}
|
|
45
45
|
* @returns A Promise of ListHostingsResponse
|
|
@@ -51,7 +51,7 @@ class API extends API$1 {
|
|
|
51
51
|
return enrichForPagination('hostings', _this.pageOfListHostings, request);
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
-
* Get the details of a Hosting with the given ID.
|
|
54
|
+
* Get a hosting. Get the details of a Hosting with the given ID.
|
|
55
55
|
*
|
|
56
56
|
* @param request - The request {@link GetHostingRequest}
|
|
57
57
|
* @returns A Promise of Hosting
|
|
@@ -69,7 +69,7 @@ class API extends API$1 {
|
|
|
69
69
|
*/
|
|
70
70
|
this.waitForHosting = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);
|
|
71
71
|
/**
|
|
72
|
-
* Update a hosting
|
|
72
|
+
* Update a hosting.
|
|
73
73
|
*
|
|
74
74
|
* @param request - The request {@link UpdateHostingRequest}
|
|
75
75
|
* @returns A Promise of Hosting
|
|
@@ -81,7 +81,7 @@ class API extends API$1 {
|
|
|
81
81
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
82
82
|
}, unmarshalHosting);
|
|
83
83
|
/**
|
|
84
|
-
* Delete a hosting with the given ID.
|
|
84
|
+
* Delete a hosting. Delete a hosting with the given ID.
|
|
85
85
|
*
|
|
86
86
|
* @param request - The request {@link DeleteHostingRequest}
|
|
87
87
|
* @returns A Promise of Hosting
|
|
@@ -91,7 +91,7 @@ class API extends API$1 {
|
|
|
91
91
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
92
92
|
}, unmarshalHosting);
|
|
93
93
|
/**
|
|
94
|
-
* Restore a hosting with the given ID.
|
|
94
|
+
* Restore a hosting. Restore a hosting with the given ID.
|
|
95
95
|
*
|
|
96
96
|
* @param request - The request {@link RestoreHostingRequest}
|
|
97
97
|
* @returns A Promise of Hosting
|
|
@@ -103,7 +103,8 @@ class API extends API$1 {
|
|
|
103
103
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore`
|
|
104
104
|
}, unmarshalHosting);
|
|
105
105
|
/**
|
|
106
|
-
* Get the DNS records of a
|
|
106
|
+
* Get the DNS records. The set of DNS record of a specific domain associated
|
|
107
|
+
* to a hosting.
|
|
107
108
|
*
|
|
108
109
|
* @param request - The request {@link GetDomainDnsRecordsRequest}
|
|
109
110
|
* @returns A Promise of DnsRecords
|
|
@@ -113,7 +114,7 @@ class API extends API$1 {
|
|
|
113
114
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/dns-records`
|
|
114
115
|
}, unmarshalDnsRecords);
|
|
115
116
|
/**
|
|
116
|
-
* List all offers
|
|
117
|
+
* List all offers.
|
|
117
118
|
*
|
|
118
119
|
* @param request - The request {@link ListOffersRequest}
|
|
119
120
|
* @returns A Promise of ListOffersResponse
|
|
@@ -121,7 +122,7 @@ class API extends API$1 {
|
|
|
121
122
|
this.listOffers = request => this.client.fetch({
|
|
122
123
|
method: 'GET',
|
|
123
124
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,
|
|
124
|
-
urlParams: urlParams(['only_options', request.onlyOptions], ['order_by', request.orderBy ?? 'price_asc'], ['without_options', request.withoutOptions])
|
|
125
|
+
urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy ?? 'price_asc'], ['without_options', request.withoutOptions])
|
|
125
126
|
}, unmarshalListOffersResponse);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
@@ -89,10 +89,12 @@ const unmarshalOffer = data => {
|
|
|
89
89
|
throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
|
|
90
90
|
}
|
|
91
91
|
return {
|
|
92
|
+
available: data.available,
|
|
92
93
|
billingOperationPath: data.billing_operation_path,
|
|
93
94
|
id: data.id,
|
|
94
95
|
price: data.price ? unmarshalMoney(data.price) : undefined,
|
|
95
|
-
product: data.product ? unmarshalOfferProduct(data.product) : undefined
|
|
96
|
+
product: data.product ? unmarshalOfferProduct(data.product) : undefined,
|
|
97
|
+
quotaWarnings: data.quota_warnings
|
|
96
98
|
};
|
|
97
99
|
};
|
|
98
100
|
const unmarshalDnsRecords = data => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an object is of type Response without using `instanceof`.
|
|
3
|
+
*
|
|
4
|
+
* @remarks Check issue #509 for more context.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
const isResponse = obj => obj !== null && obj !== undefined && typeof obj === 'object' && 'status' in obj && typeof obj.status === 'number' && 'statusText' in obj && typeof obj.statusText === 'string' && 'headers' in obj && typeof obj.headers === 'object' && 'body' in obj && typeof obj.body !== 'undefined';
|
|
9
|
+
|
|
10
|
+
export { isResponse };
|