@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.
Files changed (46) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.js +2 -2
  2. package/dist/api/baremetal/v1/api.gen.js +3 -3
  3. package/dist/api/baremetal/v1/api.utils.js +1 -1
  4. package/dist/api/cockpit/v1beta1/api.gen.js +89 -29
  5. package/dist/api/cockpit/v1beta1/marshalling.gen.js +44 -1
  6. package/dist/api/container/v1beta1/api.gen.js +35 -29
  7. package/dist/api/container/v1beta1/marshalling.gen.js +1 -1
  8. package/dist/api/domain/v2beta1/api.gen.js +2 -2
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +2 -2
  10. package/dist/api/function/v1beta1/api.gen.js +40 -31
  11. package/dist/api/function/v1beta1/marshalling.gen.js +1 -20
  12. package/dist/api/iam/v1alpha1/api.gen.js +2 -3
  13. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
  14. package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -10
  15. package/dist/api/instance/v1/api.gen.js +86 -67
  16. package/dist/api/instance/v1/api.utils.js +7 -13
  17. package/dist/api/iot/v1/api.gen.js +2 -2
  18. package/dist/api/k8s/v1/api.gen.js +4 -4
  19. package/dist/api/lb/v1/api.gen.js +6 -6
  20. package/dist/api/lb/v1/api.utils.js +4 -4
  21. package/dist/api/lb/v1/marshalling.gen.js +33 -19
  22. package/dist/api/marketplace/v2/api.gen.js +46 -3
  23. package/dist/api/mnq/v1alpha1/api.gen.js +36 -13
  24. package/dist/api/rdb/v1/api.gen.js +6 -6
  25. package/dist/api/redis/v1/api.gen.js +2 -2
  26. package/dist/api/redis/v1/marshalling.gen.js +2 -0
  27. package/dist/api/registry/v1/api.gen.js +4 -4
  28. package/dist/api/secret/v1alpha1/api.gen.js +27 -16
  29. package/dist/api/secret/v1alpha1/marshalling.gen.js +22 -3
  30. package/dist/api/tem/v1alpha1/api.gen.js +3 -3
  31. package/dist/api/test/v1/api.gen.js +1 -1
  32. package/dist/api/vpc/v1/api.gen.js +15 -7
  33. package/dist/api/vpcgw/v1/api.gen.js +3 -3
  34. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -2
  35. package/dist/helpers/marshalling.js +1 -1
  36. package/dist/index.cjs +513 -234
  37. package/dist/index.d.ts +1469 -736
  38. package/dist/internal/async/interval-retrier.js +8 -2
  39. package/dist/internal/logger/level-resolver.js +3 -3
  40. package/dist/scw/client-ini-factory.js +6 -0
  41. package/dist/scw/client-ini-profile.js +18 -0
  42. package/dist/scw/client-settings.js +12 -0
  43. package/dist/scw/constants.js +1 -1
  44. package/dist/scw/custom-marshalling.js +4 -7
  45. package/dist/scw/errors/standard/quotas-exceeded-error.js +6 -0
  46. 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((options == null ? void 0 : options.minDelay) ?? DEFAULT_MIN_DELAY_SECONDS, (options == null ? void 0 : options.maxDelay) ?? DEFAULT_MAX_DELAY_SECONDS);
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 == null ? void 0 : options.timeout);
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
- })(LevelResolver || (LevelResolver = {}));
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
  *
@@ -1,4 +1,4 @@
1
- const version = 'v1.4.0';
1
+ const version = 'v1.6.0';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
@@ -108,13 +108,10 @@ const marshalMoney = obj => ({
108
108
  *
109
109
  * @internal
110
110
  */
111
- const marshalTimeSeriesPoint = obj => {
112
- var _obj$timestamp;
113
- return {
114
- timestamp: (_obj$timestamp = obj.timestamp) == null ? void 0 : _obj$timestamp.toISOString(),
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}
@@ -7,6 +7,12 @@ import { ScalewayError } from '../scw-error.js';
7
7
  * @public
8
8
  */
9
9
 
10
+ /**
11
+ * Details of an {@link QuotasExceededError} error.
12
+ *
13
+ * @public
14
+ */
15
+
10
16
  /**
11
17
  * Build the default message for {@link QuotasExceededError}.
12
18
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "1.5.0",
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": "a3aad988f8b23ba9b3554a3e59693a0f018546ea"
38
+ "gitHead": "4323306b63c07c8eb8d6ad76efeb6d3f387ffe17"
39
39
  }