@scaleway/sdk 2.6.0 → 2.8.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 (65) hide show
  1. package/dist/api/account/v2/api.gen.js +26 -74
  2. package/dist/api/account/v3/api.gen.js +20 -60
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +16 -56
  4. package/dist/api/baremetal/v1/api.gen.js +36 -132
  5. package/dist/api/billing/v2alpha1/api.gen.js +17 -57
  6. package/dist/api/block/v1alpha1/api.gen.js +20 -74
  7. package/dist/api/block/v1alpha1/marshalling.gen.js +1 -8
  8. package/dist/api/block/v1alpha1/validation-rules.gen.js +1 -6
  9. package/dist/api/cockpit/v1beta1/api.gen.js +95 -279
  10. package/dist/api/container/v1beta1/api.gen.js +51 -123
  11. package/dist/api/document_db/v1beta1/api.gen.js +18 -66
  12. package/dist/api/document_db/v1beta1/marshalling.gen.js +20 -1
  13. package/dist/api/domain/v2beta1/api.gen.js +36 -124
  14. package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -22
  15. package/dist/api/function/v1beta1/api.gen.js +55 -135
  16. package/dist/api/iam/v1alpha1/api.gen.js +66 -226
  17. package/dist/api/instance/v1/api.gen.js +102 -310
  18. package/dist/api/instance/v1/marshalling.gen.js +32 -56
  19. package/dist/api/iot/v1/api.gen.js +24 -88
  20. package/dist/api/ipam/v1/api.gen.js +12 -28
  21. package/dist/api/ipfs/v1alpha1/api.gen.js +12 -44
  22. package/dist/api/jobs/v1alpha1/api.gen.js +12 -44
  23. package/dist/api/jobs/v1alpha1/marshalling.gen.js +2 -0
  24. package/dist/api/k8s/v1/api.gen.js +16 -56
  25. package/dist/api/lb/v1/api.gen.js +72 -248
  26. package/dist/api/marketplace/v1/api.gen.js +7 -31
  27. package/dist/api/marketplace/v1/marshalling.gen.js +1 -18
  28. package/dist/api/marketplace/v2/api.gen.js +21 -53
  29. package/dist/api/mnq/v1beta1/api.gen.js +76 -212
  30. package/dist/api/rdb/v1/api.gen.js +24 -88
  31. package/dist/api/rdb/v1/marshalling.gen.js +11 -1
  32. package/dist/api/redis/v1/api.gen.js +6 -22
  33. package/dist/api/registry/v1/api.gen.js +12 -44
  34. package/dist/api/secret/v1alpha1/api.gen.js +18 -66
  35. package/dist/api/serverless_sqldb/index.js +2 -0
  36. package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +162 -0
  37. package/dist/api/serverless_sqldb/v1alpha1/content.gen.js +7 -0
  38. package/dist/api/serverless_sqldb/v1alpha1/index.gen.js +7 -0
  39. package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.js +77 -0
  40. package/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.js +60 -0
  41. package/dist/api/tem/v1alpha1/api.gen.js +17 -57
  42. package/dist/api/test/v1/api.gen.js +6 -22
  43. package/dist/api/vpc/v1/api.gen.js +12 -36
  44. package/dist/api/vpc/v2/api.gen.js +30 -86
  45. package/dist/api/vpcgw/v1/api.gen.js +46 -158
  46. package/dist/api/webhosting/v1alpha1/api.gen.js +12 -44
  47. package/dist/helpers/marshalling.js +8 -23
  48. package/dist/index.cjs +925 -621
  49. package/dist/index.d.ts +2045 -1661
  50. package/dist/index.js +12 -10
  51. package/dist/internal/async/interval-retrier.js +8 -16
  52. package/dist/internal/interceptors/helpers.js +3 -4
  53. package/dist/internal/logger/console-logger.js +1 -7
  54. package/dist/internal/logger/index.js +1 -9
  55. package/dist/scw/auth.js +1 -2
  56. package/dist/scw/client.js +2 -10
  57. package/dist/scw/constants.js +1 -1
  58. package/dist/scw/errors/non-standard/invalid-request-mapper.js +5 -8
  59. package/dist/scw/errors/scw-error.js +2 -8
  60. package/dist/scw/errors/standard/permissions-denied-error.js +4 -7
  61. package/dist/scw/fetch/build-fetcher.js +1 -4
  62. package/dist/scw/fetch/http-dumper.js +1 -4
  63. package/dist/scw/fetch/http-interceptors.js +18 -31
  64. package/dist/scw/fetch/resource-paginator.js +3 -17
  65. package/package.json +2 -2
@@ -19,32 +19,16 @@ class API extends API$1 {
19
19
  * @param request - The request {@link GetConsumptionRequest}
20
20
  * @returns A Promise of GetConsumptionResponse
21
21
  */
22
- getConsumption = (() => {
23
- var _this = this;
24
- return function (request) {
25
- if (request === void 0) {
26
- request = {};
27
- }
28
- return _this.client.fetch({
29
- method: 'GET',
30
- path: `/billing/v2alpha1/consumption`,
31
- urlParams: urlParams(['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId])
32
- }, unmarshalGetConsumptionResponse);
33
- };
34
- })();
35
- pageOfListInvoices = (() => {
36
- var _this2 = this;
37
- return function (request) {
38
- if (request === void 0) {
39
- request = {};
40
- }
41
- return _this2.client.fetch({
42
- method: 'GET',
43
- path: `/billing/v2alpha1/invoices`,
44
- urlParams: urlParams(['invoice_type', request.invoiceType], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])
45
- }, unmarshalListInvoicesResponse);
46
- };
47
- })();
22
+ getConsumption = (request = {}) => this.client.fetch({
23
+ method: 'GET',
24
+ path: `/billing/v2alpha1/consumption`,
25
+ urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId])
26
+ }, unmarshalGetConsumptionResponse);
27
+ pageOfListInvoices = (request = {}) => this.client.fetch({
28
+ method: 'GET',
29
+ path: `/billing/v2alpha1/invoices`,
30
+ urlParams: urlParams(['invoice_type', request.invoiceType], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])
31
+ }, unmarshalListInvoicesResponse);
48
32
 
49
33
  /**
50
34
  * List invoices. List all your invoices, filtering by `start_date` and
@@ -53,15 +37,7 @@ class API extends API$1 {
53
37
  * @param request - The request {@link ListInvoicesRequest}
54
38
  * @returns A Promise of ListInvoicesResponse
55
39
  */
56
- listInvoices = (() => {
57
- var _this3 = this;
58
- return function (request) {
59
- if (request === void 0) {
60
- request = {};
61
- }
62
- return enrichForPagination('invoices', _this3.pageOfListInvoices, request);
63
- };
64
- })();
40
+ listInvoices = (request = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request);
65
41
 
66
42
  /**
67
43
  * Download an invoice. Download a specific invoice, specified by its ID.
@@ -75,19 +51,11 @@ class API extends API$1 {
75
51
  urlParams: urlParams(['dl', 1], ['file_type', request.fileType]),
76
52
  responseType: 'blob'
77
53
  });
78
- pageOfListDiscounts = (() => {
79
- var _this4 = this;
80
- return function (request) {
81
- if (request === void 0) {
82
- request = {};
83
- }
84
- return _this4.client.fetch({
85
- method: 'GET',
86
- path: `/billing/v2alpha1/discounts`,
87
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize])
88
- }, unmarshalListDiscountsResponse);
89
- };
90
- })();
54
+ pageOfListDiscounts = (request = {}) => this.client.fetch({
55
+ method: 'GET',
56
+ path: `/billing/v2alpha1/discounts`,
57
+ urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
58
+ }, unmarshalListDiscountsResponse);
91
59
 
92
60
  /**
93
61
  * List all user's discounts. List all discounts for an organization and
@@ -97,15 +65,7 @@ class API extends API$1 {
97
65
  * @param request - The request {@link ListDiscountsRequest}
98
66
  * @returns A Promise of ListDiscountsResponse
99
67
  */
100
- listDiscounts = (() => {
101
- var _this5 = this;
102
- return function (request) {
103
- if (request === void 0) {
104
- request = {};
105
- }
106
- return enrichForPagination('discounts', _this5.pageOfListDiscounts, request);
107
- };
108
- })();
68
+ listDiscounts = (request = {}) => enrichForPagination('discounts', this.pageOfListDiscounts, request);
109
69
  }
110
70
 
111
71
  export { API };
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { VOLUME_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
6
+ import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -18,20 +18,12 @@ const jsonContentHeaders = {
18
18
  */
19
19
  class API extends API$1 {
20
20
  /** Lists the available zones of the API. */
21
- static LOCALITIES = ['fr-par-1', 'pl-waw-3'];
22
- pageOfListVolumeTypes = (() => {
23
- var _this = this;
24
- return function (request) {
25
- if (request === void 0) {
26
- request = {};
27
- }
28
- return _this.client.fetch({
29
- method: 'GET',
30
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/volume-types`,
31
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
32
- }, unmarshalListVolumeTypesResponse);
33
- };
34
- })();
21
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-3', 'pl-waw-3'];
22
+ pageOfListVolumeTypes = (request = {}) => this.client.fetch({
23
+ method: 'GET',
24
+ path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volume-types`,
25
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
26
+ }, unmarshalListVolumeTypesResponse);
35
27
 
36
28
  /**
37
29
  * List volume types. List all available volume types in a specified zone. The
@@ -40,28 +32,12 @@ class API extends API$1 {
40
32
  * @param request - The request {@link ListVolumeTypesRequest}
41
33
  * @returns A Promise of ListVolumeTypesResponse
42
34
  */
43
- listVolumeTypes = (() => {
44
- var _this2 = this;
45
- return function (request) {
46
- if (request === void 0) {
47
- request = {};
48
- }
49
- return enrichForPagination('volumeTypes', _this2.pageOfListVolumeTypes, request);
50
- };
51
- })();
52
- pageOfListVolumes = (() => {
53
- var _this3 = this;
54
- return function (request) {
55
- if (request === void 0) {
56
- request = {};
57
- }
58
- return _this3.client.fetch({
59
- method: 'GET',
60
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/volumes`,
61
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId])
62
- }, unmarshalListVolumesResponse);
63
- };
64
- })();
35
+ listVolumeTypes = (request = {}) => enrichForPagination('volumeTypes', this.pageOfListVolumeTypes, request);
36
+ pageOfListVolumes = (request = {}) => this.client.fetch({
37
+ method: 'GET',
38
+ path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`,
39
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId])
40
+ }, unmarshalListVolumesResponse);
65
41
 
66
42
  /**
67
43
  * List volumes. List all existing volumes in a specified zone. By default,
@@ -71,15 +47,7 @@ class API extends API$1 {
71
47
  * @param request - The request {@link ListVolumesRequest}
72
48
  * @returns A Promise of ListVolumesResponse
73
49
  */
74
- listVolumes = (() => {
75
- var _this4 = this;
76
- return function (request) {
77
- if (request === void 0) {
78
- request = {};
79
- }
80
- return enrichForPagination('volumes', _this4.pageOfListVolumes, request);
81
- };
82
- })();
50
+ listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request);
83
51
 
84
52
  /**
85
53
  * Create a volume. To create a new volume from scratch, you must specify
@@ -146,19 +114,11 @@ class API extends API$1 {
146
114
  method: 'PATCH',
147
115
  path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`
148
116
  }, unmarshalVolume);
149
- pageOfListSnapshots = (() => {
150
- var _this5 = this;
151
- return function (request) {
152
- if (request === void 0) {
153
- request = {};
154
- }
155
- return _this5.client.fetch({
156
- method: 'GET',
157
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/snapshots`,
158
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId])
159
- }, unmarshalListSnapshotsResponse);
160
- };
161
- })();
117
+ pageOfListSnapshots = (request = {}) => this.client.fetch({
118
+ method: 'GET',
119
+ path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`,
120
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId])
121
+ }, unmarshalListSnapshotsResponse);
162
122
 
163
123
  /**
164
124
  * List all snapshots. List all available snapshots in a specified zone. By
@@ -168,15 +128,7 @@ class API extends API$1 {
168
128
  * @param request - The request {@link ListSnapshotsRequest}
169
129
  * @returns A Promise of ListSnapshotsResponse
170
130
  */
171
- listSnapshots = (() => {
172
- var _this6 = this;
173
- return function (request) {
174
- if (request === void 0) {
175
- request = {};
176
- }
177
- return enrichForPagination('snapshots', _this6.pageOfListSnapshots, request);
178
- };
179
- })();
131
+ listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);
180
132
 
181
133
  /**
182
134
  * Get a snapshot. Retrieve technical information about a specific snapshot.
@@ -214,12 +166,6 @@ class API extends API$1 {
214
166
  method: 'POST',
215
167
  path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`
216
168
  }, unmarshalSnapshot);
217
- importSnapshotFromS3 = request => this.client.fetch({
218
- body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
219
- headers: jsonContentHeaders,
220
- method: 'POST',
221
- path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
222
- }, unmarshalSnapshot);
223
169
 
224
170
  /**
225
171
  * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you
@@ -162,13 +162,6 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
162
162
  value: request.perfIops
163
163
  }])
164
164
  });
165
- const marshalImportSnapshotFromS3Request = (request, defaults) => ({
166
- bucket: request.bucket,
167
- key: request.key,
168
- name: request.name,
169
- project_id: request.projectId ?? defaults.defaultProjectId,
170
- tags: request.tags
171
- });
172
165
  const marshalUpdateSnapshotRequest = (request, defaults) => ({
173
166
  name: request.name,
174
167
  tags: request.tags
@@ -180,4 +173,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
180
173
  tags: request.tags
181
174
  });
182
175
 
183
- export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalImportSnapshotFromS3Request, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalReference, unmarshalSnapshot, unmarshalVolume };
176
+ export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalReference, unmarshalSnapshot, unmarshalVolume };
@@ -11,11 +11,6 @@ const CreateVolumeRequest = {
11
11
  minLength: 1
12
12
  }
13
13
  };
14
- const ImportSnapshotFromS3Request = {
15
- name: {
16
- minLength: 1
17
- }
18
- };
19
14
  const ListSnapshotsRequest = {
20
15
  page: {
21
16
  greaterThan: 0
@@ -49,4 +44,4 @@ const Reference = {
49
44
  }
50
45
  };
51
46
 
52
- export { CreateSnapshotRequest, CreateVolumeRequest, ImportSnapshotFromS3Request, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference };
47
+ export { CreateSnapshotRequest, CreateVolumeRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference };