@scaleway/sdk 1.5.0 → 1.7.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/applesilicon/v1alpha1/api.gen.js +2 -2
- package/dist/api/baremetal/v1/api.gen.js +3 -3
- package/dist/api/baremetal/v1/api.utils.js +1 -1
- package/dist/api/cockpit/v1beta1/api.gen.js +89 -29
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +44 -1
- package/dist/api/container/v1beta1/api.gen.js +35 -29
- package/dist/api/container/v1beta1/marshalling.gen.js +1 -1
- package/dist/api/domain/v2beta1/api.gen.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +40 -31
- package/dist/api/function/v1beta1/marshalling.gen.js +1 -20
- package/dist/api/iam/v1alpha1/api.gen.js +2 -3
- package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -10
- package/dist/api/instance/v1/api.gen.js +86 -67
- package/dist/api/instance/v1/api.utils.js +7 -13
- package/dist/api/iot/v1/api.gen.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +4 -4
- package/dist/api/lb/v1/api.gen.js +6 -6
- package/dist/api/lb/v1/api.utils.js +4 -4
- package/dist/api/lb/v1/marshalling.gen.js +33 -19
- package/dist/api/marketplace/v2/api.gen.js +46 -3
- package/dist/api/mnq/v1alpha1/api.gen.js +36 -13
- package/dist/api/rdb/v1/api.gen.js +6 -6
- package/dist/api/redis/v1/api.gen.js +2 -2
- package/dist/api/redis/v1/marshalling.gen.js +2 -0
- package/dist/api/registry/v1/api.gen.js +4 -4
- package/dist/api/secret/v1alpha1/api.gen.js +27 -16
- package/dist/api/secret/v1alpha1/marshalling.gen.js +22 -3
- package/dist/api/tem/v1alpha1/api.gen.js +3 -3
- package/dist/api/test/v1/api.gen.js +1 -1
- package/dist/api/vpc/v1/api.gen.js +15 -7
- package/dist/api/vpcgw/v1/api.gen.js +3 -3
- package/dist/api/webhosting/v1alpha1/api.gen.js +2 -2
- package/dist/helpers/marshalling.js +1 -1
- package/dist/index.cjs +513 -234
- package/dist/index.d.ts +1469 -736
- package/dist/internal/async/interval-retrier.js +8 -2
- package/dist/internal/logger/level-resolver.js +3 -3
- package/dist/scw/client-ini-factory.js +6 -0
- package/dist/scw/client-ini-profile.js +18 -0
- package/dist/scw/client-settings.js +12 -0
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +4 -7
- package/dist/scw/errors/standard/quotas-exceeded-error.js +6 -0
- package/package.json +2 -2
|
@@ -70,6 +70,12 @@ const tryAtIntervals = async function (retry, strategy, timeout) {
|
|
|
70
70
|
* @public
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* The options to wait until a resource is ready.
|
|
75
|
+
*
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
|
|
73
79
|
/**
|
|
74
80
|
* Fetches resource several times until an expected condition is reached, timeouts, or throws an exception.
|
|
75
81
|
*
|
|
@@ -85,7 +91,7 @@ const tryAtIntervals = async function (retry, strategy, timeout) {
|
|
|
85
91
|
*/
|
|
86
92
|
const waitForResource = function (stop, fetcher, request, options, strategy) {
|
|
87
93
|
if (strategy === void 0) {
|
|
88
|
-
strategy = createExponentialBackoffStrategy(
|
|
94
|
+
strategy = createExponentialBackoffStrategy(options?.minDelay ?? DEFAULT_MIN_DELAY_SECONDS, options?.maxDelay ?? DEFAULT_MAX_DELAY_SECONDS);
|
|
89
95
|
}
|
|
90
96
|
return tryAtIntervals(async () => {
|
|
91
97
|
const value = await fetcher(request);
|
|
@@ -93,7 +99,7 @@ const waitForResource = function (stop, fetcher, request, options, strategy) {
|
|
|
93
99
|
done: await stop(value),
|
|
94
100
|
value
|
|
95
101
|
};
|
|
96
|
-
}, strategy, options
|
|
102
|
+
}, strategy, options?.timeout);
|
|
97
103
|
};
|
|
98
104
|
|
|
99
105
|
export { createExponentialBackoffStrategy, tryAtIntervals, waitForResource };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// eslint-disable-next-line eslint-comments/disable-enable-pair
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
let LevelResolver
|
|
4
|
-
(function (LevelResolver) {
|
|
3
|
+
let LevelResolver = /*#__PURE__*/function (LevelResolver) {
|
|
5
4
|
LevelResolver[LevelResolver["silent"] = 0] = "silent";
|
|
6
5
|
LevelResolver[LevelResolver["error"] = 1] = "error";
|
|
7
6
|
LevelResolver[LevelResolver["warn"] = 2] = "warn";
|
|
8
7
|
LevelResolver[LevelResolver["info"] = 3] = "info";
|
|
9
8
|
LevelResolver[LevelResolver["debug"] = 4] = "debug";
|
|
10
|
-
|
|
9
|
+
return LevelResolver;
|
|
10
|
+
}({});
|
|
11
11
|
const shouldLog = (currentLevel, level) => LevelResolver[level] <= currentLevel;
|
|
12
12
|
|
|
13
13
|
export { LevelResolver, shouldLog };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { authenticateWithSecrets } from './auth.js';
|
|
2
2
|
import { hasAuthenticationSecrets } from './client-ini-profile.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A factory to build {@link Settings}.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
|
|
4
10
|
/**
|
|
5
11
|
* Instantiates the SDK from a configuration {@link Profile}.
|
|
6
12
|
*
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { isAccessKey, isSecretKey } from '../internal/validations/string-validation.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Holds access key and secret key.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Holds default values of a Scaleway profile.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Holds values of a Scaleway profile.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
|
|
3
21
|
/**
|
|
4
22
|
* Verifies that the payload contains both the accessKey and the secretKey.
|
|
5
23
|
*
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { isOrganizationId, isProjectId, isRegion, isZone, isURL } from '../internal/validations/string-validation.js';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Holds default values of settings.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Settings hold the values of all client options.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
|
|
3
15
|
/**
|
|
4
16
|
* Validates the content of a {@link Settings} object.
|
|
5
17
|
*
|
package/dist/scw/constants.js
CHANGED
|
@@ -108,13 +108,10 @@ const marshalMoney = obj => ({
|
|
|
108
108
|
*
|
|
109
109
|
* @internal
|
|
110
110
|
*/
|
|
111
|
-
const marshalTimeSeriesPoint = obj => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
value: obj.value
|
|
116
|
-
};
|
|
117
|
-
};
|
|
111
|
+
const marshalTimeSeriesPoint = obj => ({
|
|
112
|
+
timestamp: obj.timestamp?.toISOString(),
|
|
113
|
+
value: obj.value
|
|
114
|
+
});
|
|
118
115
|
|
|
119
116
|
/**
|
|
120
117
|
* Marshals {@link TimeSeries}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bundledDependencies": [
|
|
36
36
|
"@scaleway/random-name"
|
|
37
37
|
],
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "4323306b63c07c8eb8d6ad76efeb6d3f387ffe17"
|
|
39
39
|
}
|