@scaleway/sdk 3.0.0-alpha.0 → 3.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.
Files changed (214) hide show
  1. package/dist/index.gen.d.ts +362 -0
  2. package/dist/index.gen.js +323 -0
  3. package/package.json +71 -25
  4. package/README.md +0 -46
  5. package/dist/api/account/index.js +0 -4
  6. package/dist/api/account/v2/api.gen.js +0 -147
  7. package/dist/api/account/v2/index.gen.js +0 -4
  8. package/dist/api/account/v2/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/api.gen.js +0 -129
  10. package/dist/api/account/v3/index.gen.js +0 -6
  11. package/dist/api/account/v3/marshalling.gen.js +0 -39
  12. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  13. package/dist/api/applesilicon/index.js +0 -2
  14. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  15. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  16. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  17. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  18. package/dist/api/baremetal/index.js +0 -2
  19. package/dist/api/baremetal/v1/api.gen.js +0 -523
  20. package/dist/api/baremetal/v1/api.utils.js +0 -27
  21. package/dist/api/baremetal/v1/content.gen.js +0 -13
  22. package/dist/api/baremetal/v1/index.js +0 -5
  23. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  24. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  25. package/dist/api/billing/index.js +0 -2
  26. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  27. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  28. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  29. package/dist/api/block/index.js +0 -2
  30. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  31. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  32. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  33. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  34. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  35. package/dist/api/cockpit/index.js +0 -2
  36. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  37. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  38. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  39. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  40. package/dist/api/container/index.js +0 -2
  41. package/dist/api/container/v1beta1/api.gen.js +0 -549
  42. package/dist/api/container/v1beta1/content.gen.js +0 -22
  43. package/dist/api/container/v1beta1/index.gen.js +0 -5
  44. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  45. package/dist/api/document_db/index.js +0 -2
  46. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  47. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  48. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  49. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  50. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  51. package/dist/api/domain/index.js +0 -2
  52. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  53. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  54. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  55. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  56. package/dist/api/flexibleip/index.js +0 -2
  57. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  58. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  59. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  60. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  61. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  62. package/dist/api/function/index.js +0 -2
  63. package/dist/api/function/v1beta1/api.gen.js +0 -560
  64. package/dist/api/function/v1beta1/content.gen.js +0 -22
  65. package/dist/api/function/v1beta1/index.gen.js +0 -5
  66. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  67. package/dist/api/iam/index.js +0 -2
  68. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  69. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  70. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  71. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  72. package/dist/api/instance/index.js +0 -2
  73. package/dist/api/instance/v1/api.gen.js +0 -1003
  74. package/dist/api/instance/v1/api.utils.js +0 -369
  75. package/dist/api/instance/v1/content.gen.js +0 -31
  76. package/dist/api/instance/v1/index.js +0 -2
  77. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  78. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  79. package/dist/api/iot/index.js +0 -2
  80. package/dist/api/iot/v1/api.gen.js +0 -581
  81. package/dist/api/iot/v1/content.gen.js +0 -7
  82. package/dist/api/iot/v1/index.gen.js +0 -5
  83. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  84. package/dist/api/ipfs/index.js +0 -2
  85. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  86. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  87. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  88. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  89. package/dist/api/k8s/index.js +0 -2
  90. package/dist/api/k8s/v1/api.gen.js +0 -454
  91. package/dist/api/k8s/v1/api.utils.js +0 -13
  92. package/dist/api/k8s/v1/content.gen.js +0 -13
  93. package/dist/api/k8s/v1/index.js +0 -4
  94. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  95. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  96. package/dist/api/lb/index.js +0 -2
  97. package/dist/api/lb/v1/api.gen.js +0 -1669
  98. package/dist/api/lb/v1/api.utils.js +0 -81
  99. package/dist/api/lb/v1/content.gen.js +0 -16
  100. package/dist/api/lb/v1/index.js +0 -2
  101. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  102. package/dist/api/marketplace/index.js +0 -4
  103. package/dist/api/marketplace/v1/api.gen.js +0 -60
  104. package/dist/api/marketplace/v1/index.gen.js +0 -4
  105. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  106. package/dist/api/marketplace/v2/api.gen.js +0 -162
  107. package/dist/api/marketplace/v2/index.gen.js +0 -4
  108. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  109. package/dist/api/mnq/index.js +0 -2
  110. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  111. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  112. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  113. package/dist/api/rdb/index.js +0 -2
  114. package/dist/api/rdb/v1/api.gen.js +0 -972
  115. package/dist/api/rdb/v1/content.gen.js +0 -22
  116. package/dist/api/rdb/v1/index.gen.js +0 -7
  117. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  118. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  119. package/dist/api/redis/index.js +0 -2
  120. package/dist/api/redis/v1/api.gen.js +0 -389
  121. package/dist/api/redis/v1/content.gen.js +0 -7
  122. package/dist/api/redis/v1/index.gen.js +0 -5
  123. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  124. package/dist/api/registry/index.js +0 -2
  125. package/dist/api/registry/v1/api.gen.js +0 -252
  126. package/dist/api/registry/v1/content.gen.js +0 -13
  127. package/dist/api/registry/v1/index.gen.js +0 -5
  128. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  129. package/dist/api/secret/index.js +0 -2
  130. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  131. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  132. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  133. package/dist/api/tem/index.js +0 -2
  134. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  135. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  136. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  137. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  138. package/dist/api/test/index.js +0 -2
  139. package/dist/api/test/v1/api.gen.js +0 -152
  140. package/dist/api/test/v1/content.gen.js +0 -7
  141. package/dist/api/test/v1/index.gen.js +0 -5
  142. package/dist/api/test/v1/marshalling.gen.js +0 -79
  143. package/dist/api/vpc/index.js +0 -4
  144. package/dist/api/vpc/v1/api.gen.js +0 -110
  145. package/dist/api/vpc/v1/index.gen.js +0 -4
  146. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  147. package/dist/api/vpc/v2/api.gen.js +0 -276
  148. package/dist/api/vpc/v2/index.gen.js +0 -4
  149. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  150. package/dist/api/vpcgw/index.js +0 -2
  151. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  152. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  153. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  154. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  155. package/dist/api/webhosting/index.js +0 -2
  156. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  157. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  158. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  159. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  160. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  161. package/dist/helpers/is-browser.js +0 -5
  162. package/dist/helpers/is-response.js +0 -10
  163. package/dist/helpers/json.js +0 -11
  164. package/dist/helpers/marshalling.js +0 -130
  165. package/dist/index.cjs +0 -24364
  166. package/dist/index.d.ts +0 -27584
  167. package/dist/index.js +0 -69
  168. package/dist/internal/async/interval-retrier.js +0 -105
  169. package/dist/internal/async/sleep.js +0 -13
  170. package/dist/internal/interceptors/composer.js +0 -46
  171. package/dist/internal/interceptors/helpers.js +0 -32
  172. package/dist/internal/logger/console-logger.js +0 -38
  173. package/dist/internal/logger/index.js +0 -41
  174. package/dist/internal/logger/level-resolver.js +0 -13
  175. package/dist/internal/validations/string-validation.js +0 -38
  176. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  177. package/dist/scw/api.js +0 -12
  178. package/dist/scw/auth.js +0 -68
  179. package/dist/scw/client-ini-factory.js +0 -174
  180. package/dist/scw/client-ini-profile.js +0 -54
  181. package/dist/scw/client-settings.js +0 -78
  182. package/dist/scw/client.js +0 -98
  183. package/dist/scw/constants.js +0 -4
  184. package/dist/scw/custom-marshalling.js +0 -131
  185. package/dist/scw/errors/error-parser.js +0 -107
  186. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  187. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  188. package/dist/scw/errors/scw-error.js +0 -66
  189. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  190. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  191. package/dist/scw/errors/standard/index.js +0 -13
  192. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  193. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  194. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  195. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  196. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  197. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  198. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  199. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  200. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  201. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  202. package/dist/scw/errors/types.js +0 -23
  203. package/dist/scw/fetch/build-fetcher.js +0 -72
  204. package/dist/scw/fetch/http-dumper.js +0 -54
  205. package/dist/scw/fetch/http-interceptors.js +0 -99
  206. package/dist/scw/fetch/resource-paginator.js +0 -84
  207. package/dist/scw/fetch/response-parser.js +0 -72
  208. package/node_modules/@scaleway/random-name/.npmignore +0 -4
  209. package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
  210. package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
  211. package/node_modules/@scaleway/random-name/README.md +0 -26
  212. package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
  213. package/node_modules/@scaleway/random-name/dist/index.js +0 -13
  214. package/node_modules/@scaleway/random-name/package.json +0 -23
@@ -1,4 +0,0 @@
1
- import * as index_gen from './v1/index.gen.js';
2
- export { index_gen as v1 };
3
- import * as index_gen$1 from './v2/index.gen.js';
4
- export { index_gen$1 as v2 };
@@ -1,60 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListImagesResponse, unmarshalGetImageResponse, unmarshalListVersionsResponse, unmarshalGetVersionResponse } from './marshalling.gen.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- /** Marketplace API. */
9
- class API extends API$1 {
10
- pageOfListImages = (() => {
11
- var _this = this;
12
- return function (request) {
13
- if (request === void 0) {
14
- request = {};
15
- }
16
- return _this.client.fetch({
17
- method: 'GET',
18
- path: `/marketplace/v1/images`,
19
- urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? _this.client.settings.defaultPageSize])
20
- }, unmarshalListImagesResponse);
21
- };
22
- })();
23
-
24
- /**
25
- * List marketplace images.
26
- *
27
- * @param request - The request {@link ListImagesRequest}
28
- * @returns A Promise of ListImagesResponse
29
- */
30
- listImages = (() => {
31
- var _this2 = this;
32
- return function (request) {
33
- if (request === void 0) {
34
- request = {};
35
- }
36
- return enrichForPagination('images', _this2.pageOfListImages, request);
37
- };
38
- })();
39
-
40
- /**
41
- * Get a specific marketplace image.
42
- *
43
- * @param request - The request {@link GetImageRequest}
44
- * @returns A Promise of GetImageResponse
45
- */
46
- getImage = request => this.client.fetch({
47
- method: 'GET',
48
- path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}`
49
- }, unmarshalGetImageResponse);
50
- listVersions = request => this.client.fetch({
51
- method: 'GET',
52
- path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions`
53
- }, unmarshalListVersionsResponse);
54
- getVersion = request => this.client.fetch({
55
- method: 'GET',
56
- path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions/${validatePathParam('versionId', request.versionId)}`
57
- }, unmarshalGetVersionResponse);
58
- }
59
-
60
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,92 +0,0 @@
1
- import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalArrayOfObject, unmarshalDate } from '../../../helpers/marshalling.js';
3
-
4
- // This file was automatically generated. DO NOT EDIT.
5
- // If you have any remark or suggestion do not hesitate to open an issue.
6
- const unmarshalOrganization = data => {
7
- if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`);
9
- }
10
- return {
11
- id: data.id,
12
- name: data.name
13
- };
14
- };
15
- const unmarshalLocalImage = data => {
16
- if (!isJSONObject(data)) {
17
- throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);
18
- }
19
- return {
20
- arch: data.arch,
21
- compatibleCommercialTypes: data.compatible_commercial_types,
22
- id: data.id,
23
- zone: data.zone
24
- };
25
- };
26
- const unmarshalVersion = data => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
29
- }
30
- return {
31
- creationDate: unmarshalDate(data.creation_date),
32
- id: data.id,
33
- localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),
34
- modificationDate: unmarshalDate(data.modification_date),
35
- name: data.name
36
- };
37
- };
38
- const unmarshalImage = data => {
39
- if (!isJSONObject(data)) {
40
- throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
41
- }
42
- return {
43
- categories: data.categories,
44
- creationDate: unmarshalDate(data.creation_date),
45
- currentPublicVersion: data.current_public_version,
46
- description: data.description,
47
- id: data.id,
48
- label: data.label,
49
- logo: data.logo,
50
- modificationDate: unmarshalDate(data.modification_date),
51
- name: data.name,
52
- organization: unmarshalOrganization(data.organization),
53
- validUntil: unmarshalDate(data.valid_until),
54
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
55
- };
56
- };
57
- const unmarshalGetImageResponse = data => {
58
- if (!isJSONObject(data)) {
59
- throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`);
60
- }
61
- return {
62
- image: unmarshalImage(data.image)
63
- };
64
- };
65
- const unmarshalGetVersionResponse = data => {
66
- if (!isJSONObject(data)) {
67
- throw new TypeError(`Unmarshalling the type 'GetVersionResponse' failed as data isn't a dictionary.`);
68
- }
69
- return {
70
- version: unmarshalVersion(data.version)
71
- };
72
- };
73
- const unmarshalListImagesResponse = data => {
74
- if (!isJSONObject(data)) {
75
- throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
76
- }
77
- return {
78
- images: unmarshalArrayOfObject(data.images, unmarshalImage),
79
- totalCount: data.total_count
80
- };
81
- };
82
- const unmarshalListVersionsResponse = data => {
83
- if (!isJSONObject(data)) {
84
- throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
85
- }
86
- return {
87
- totalCount: data.total_count,
88
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
89
- };
90
- };
91
-
92
- export { unmarshalGetImageResponse, unmarshalGetVersionResponse, unmarshalListImagesResponse, unmarshalListVersionsResponse };
@@ -1,162 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { urlParams, validatePathParam, resolveOneOf } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListImagesResponse, unmarshalImage, unmarshalListVersionsResponse, unmarshalVersion, unmarshalListLocalImagesResponse, unmarshalLocalImage, unmarshalListCategoriesResponse, unmarshalCategory } from './marshalling.gen.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- /** Marketplace API. */
9
- class API extends API$1 {
10
- pageOfListImages = request => this.client.fetch({
11
- method: 'GET',
12
- path: `/marketplace/v2/images`,
13
- urlParams: urlParams(['arch', request.arch], ['category', request.category], ['include_eol', request.includeEol], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
14
- }, unmarshalListImagesResponse);
15
-
16
- /**
17
- * List marketplace images. List all available images on the marketplace,
18
- * their UUID, CPU architecture and description.
19
- *
20
- * @param request - The request {@link ListImagesRequest}
21
- * @returns A Promise of ListImagesResponse
22
- */
23
- listImages = request => enrichForPagination('images', this.pageOfListImages, request);
24
-
25
- /**
26
- * Get a specific marketplace image. Get detailed information about a
27
- * marketplace image, specified by its `image_id` (UUID format).
28
- *
29
- * @param request - The request {@link GetImageRequest}
30
- * @returns A Promise of Image
31
- */
32
- getImage = request => this.client.fetch({
33
- method: 'GET',
34
- path: `/marketplace/v2/images/${validatePathParam('imageId', request.imageId)}`
35
- }, unmarshalImage);
36
- pageOfListVersions = request => this.client.fetch({
37
- method: 'GET',
38
- path: `/marketplace/v2/versions`,
39
- urlParams: urlParams(['image_id', request.imageId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
40
- }, unmarshalListVersionsResponse);
41
-
42
- /**
43
- * List versions of an Image. Get a list of all available version of an image,
44
- * specified by its `image_id` (UUID format).
45
- *
46
- * @param request - The request {@link ListVersionsRequest}
47
- * @returns A Promise of ListVersionsResponse
48
- */
49
- listVersions = request => enrichForPagination('versions', this.pageOfListVersions, request);
50
-
51
- /**
52
- * Get a specific image version. Get information such as the name, creation
53
- * date, last update and published date for an image version specified by its
54
- * `version_id` (UUID format).
55
- *
56
- * @param request - The request {@link GetVersionRequest}
57
- * @returns A Promise of Version
58
- */
59
- getVersion = request => this.client.fetch({
60
- method: 'GET',
61
- path: `/marketplace/v2/versions/${validatePathParam('versionId', request.versionId)}`
62
- }, unmarshalVersion);
63
- pageOfListLocalImages = (() => {
64
- var _this = this;
65
- return function (request) {
66
- if (request === void 0) {
67
- request = {};
68
- }
69
- return _this.client.fetch({
70
- method: 'GET',
71
- path: `/marketplace/v2/local-images`,
72
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['type', request.type], ['zone', request.zone], ...Object.entries(resolveOneOf([{
73
- param: 'image_id',
74
- value: request.imageId
75
- }, {
76
- param: 'image_label',
77
- value: request.imageLabel
78
- }, {
79
- param: 'version_id',
80
- value: request.versionId
81
- }])))
82
- }, unmarshalListLocalImagesResponse);
83
- };
84
- })();
85
-
86
- /**
87
- * List local images from a specific image or version. List information about
88
- * local images in a specific Availability Zone, specified by its `image_id`
89
- * (UUID format), `version_id` (UUID format) or `image_label`. Only one of
90
- * these three parameters may be set.
91
- *
92
- * @param request - The request {@link ListLocalImagesRequest}
93
- * @returns A Promise of ListLocalImagesResponse
94
- */
95
- listLocalImages = (() => {
96
- var _this2 = this;
97
- return function (request) {
98
- if (request === void 0) {
99
- request = {};
100
- }
101
- return enrichForPagination('localImages', _this2.pageOfListLocalImages, request);
102
- };
103
- })();
104
-
105
- /**
106
- * Get a specific local image by ID. Get detailed information about a local
107
- * image, including compatible commercial types, supported architecture,
108
- * labels and the Availability Zone of the image, specified by its
109
- * `local_image_id` (UUID format).
110
- *
111
- * @param request - The request {@link GetLocalImageRequest}
112
- * @returns A Promise of LocalImage
113
- */
114
- getLocalImage = request => this.client.fetch({
115
- method: 'GET',
116
- path: `/marketplace/v2/local-images/${validatePathParam('localImageId', request.localImageId)}`
117
- }, unmarshalLocalImage);
118
- pageOfListCategories = (() => {
119
- var _this3 = this;
120
- return function (request) {
121
- if (request === void 0) {
122
- request = {};
123
- }
124
- return _this3.client.fetch({
125
- method: 'GET',
126
- path: `/marketplace/v2/categories`,
127
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
128
- }, unmarshalListCategoriesResponse);
129
- };
130
- })();
131
-
132
- /**
133
- * List existing image categories. Get a list of all existing categories. The
134
- * output can be paginated.
135
- *
136
- * @param request - The request {@link ListCategoriesRequest}
137
- * @returns A Promise of ListCategoriesResponse
138
- */
139
- listCategories = (() => {
140
- var _this4 = this;
141
- return function (request) {
142
- if (request === void 0) {
143
- request = {};
144
- }
145
- return enrichForPagination('categories', _this4.pageOfListCategories, request);
146
- };
147
- })();
148
-
149
- /**
150
- * Get a specific category. Get information about a specific category of the
151
- * marketplace catalog, specified by its `category_id` (UUID format).
152
- *
153
- * @param request - The request {@link GetCategoryRequest}
154
- * @returns A Promise of Category
155
- */
156
- getCategory = request => this.client.fetch({
157
- method: 'GET',
158
- path: `/marketplace/v2/categories/${validatePathParam('categoryId', request.categoryId)}`
159
- }, unmarshalCategory);
160
- }
161
-
162
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,94 +0,0 @@
1
- import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
3
-
4
- // This file was automatically generated. DO NOT EDIT.
5
- // If you have any remark or suggestion do not hesitate to open an issue.
6
- const unmarshalCategory = data => {
7
- if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'Category' failed as data isn't a dictionary.`);
9
- }
10
- return {
11
- description: data.description,
12
- id: data.id,
13
- name: data.name
14
- };
15
- };
16
- const unmarshalImage = data => {
17
- if (!isJSONObject(data)) {
18
- throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
19
- }
20
- return {
21
- categories: data.categories,
22
- createdAt: unmarshalDate(data.created_at),
23
- description: data.description,
24
- id: data.id,
25
- label: data.label,
26
- logo: data.logo,
27
- name: data.name,
28
- updatedAt: unmarshalDate(data.updated_at),
29
- validUntil: unmarshalDate(data.valid_until)
30
- };
31
- };
32
- const unmarshalLocalImage = data => {
33
- if (!isJSONObject(data)) {
34
- throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);
35
- }
36
- return {
37
- arch: data.arch,
38
- compatibleCommercialTypes: data.compatible_commercial_types,
39
- id: data.id,
40
- label: data.label,
41
- type: data.type,
42
- zone: data.zone
43
- };
44
- };
45
- const unmarshalVersion = data => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
48
- }
49
- return {
50
- createdAt: unmarshalDate(data.created_at),
51
- id: data.id,
52
- name: data.name,
53
- publishedAt: unmarshalDate(data.published_at),
54
- updatedAt: unmarshalDate(data.updated_at)
55
- };
56
- };
57
- const unmarshalListCategoriesResponse = data => {
58
- if (!isJSONObject(data)) {
59
- throw new TypeError(`Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`);
60
- }
61
- return {
62
- categories: unmarshalArrayOfObject(data.categories, unmarshalCategory),
63
- totalCount: data.total_count
64
- };
65
- };
66
- const unmarshalListImagesResponse = data => {
67
- if (!isJSONObject(data)) {
68
- throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
69
- }
70
- return {
71
- images: unmarshalArrayOfObject(data.images, unmarshalImage),
72
- totalCount: data.total_count
73
- };
74
- };
75
- const unmarshalListLocalImagesResponse = data => {
76
- if (!isJSONObject(data)) {
77
- throw new TypeError(`Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`);
78
- }
79
- return {
80
- localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),
81
- totalCount: data.total_count
82
- };
83
- };
84
- const unmarshalListVersionsResponse = data => {
85
- if (!isJSONObject(data)) {
86
- throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
87
- }
88
- return {
89
- totalCount: data.total_count,
90
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
91
- };
92
- };
93
-
94
- export { unmarshalCategory, unmarshalImage, unmarshalListCategoriesResponse, unmarshalListImagesResponse, unmarshalListLocalImagesResponse, unmarshalListVersionsResponse, unmarshalLocalImage, unmarshalVersion };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1alpha1/index.gen.js';
2
- export { index_gen as v1alpha1 };
@@ -1,205 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListNamespacesResponse, marshalCreateNamespaceRequest, unmarshalNamespace, marshalUpdateNamespaceRequest, marshalCreateCredentialRequest, unmarshalCredential, unmarshalListCredentialsResponse, marshalUpdateCredentialRequest } from './marshalling.gen.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- const jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /**
13
- * Messaging and Queuing API.
14
- *
15
- * This API allows you to manage Scaleway Messaging and Queueing brokers.
16
- */
17
- class API extends API$1 {
18
- /** Lists the available regions of the API. */
19
- static LOCALITIES = ['fr-par'];
20
- pageOfListNamespaces = (() => {
21
- var _this = this;
22
- return function (request) {
23
- if (request === void 0) {
24
- request = {};
25
- }
26
- return _this.client.fetch({
27
- method: 'GET',
28
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
29
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
30
- }, unmarshalListNamespacesResponse);
31
- };
32
- })();
33
-
34
- /**
35
- * List namespaces. List all Messaging and Queuing namespaces in the specified
36
- * region, for a Scaleway Organization or Project. By default, the namespaces
37
- * returned in the list are ordered by creation date in ascending order,
38
- * though this can be modified via the `order_by` field.
39
- *
40
- * @param request - The request {@link ListNamespacesRequest}
41
- * @returns A Promise of ListNamespacesResponse
42
- */
43
- listNamespaces = (() => {
44
- var _this2 = this;
45
- return function (request) {
46
- if (request === void 0) {
47
- request = {};
48
- }
49
- return enrichForPagination('namespaces', _this2.pageOfListNamespaces, request);
50
- };
51
- })();
52
-
53
- /**
54
- * Create a namespace. Create a Messaging and Queuing namespace, set to the
55
- * desired protocol.
56
- *
57
- * @param request - The request {@link CreateNamespaceRequest}
58
- * @returns A Promise of Namespace
59
- */
60
- createNamespace = (() => {
61
- var _this3 = this;
62
- return function (request) {
63
- if (request === void 0) {
64
- request = {};
65
- }
66
- return _this3.client.fetch({
67
- body: JSON.stringify(marshalCreateNamespaceRequest(request, _this3.client.settings)),
68
- headers: jsonContentHeaders,
69
- method: 'POST',
70
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/namespaces`
71
- }, unmarshalNamespace);
72
- };
73
- })();
74
-
75
- /**
76
- * Update the name of a namespace. Update the name of a Messaging and Queuing
77
- * namespace, specified by its namespace ID.
78
- *
79
- * @param request - The request {@link UpdateNamespaceRequest}
80
- * @returns A Promise of Namespace
81
- */
82
- updateNamespace = request => this.client.fetch({
83
- body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
84
- headers: jsonContentHeaders,
85
- method: 'PATCH',
86
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`
87
- }, unmarshalNamespace);
88
-
89
- /**
90
- * Get a namespace. Retrieve information about an existing Messaging and
91
- * Queuing namespace, identified by its namespace ID. Its full details,
92
- * including name, endpoint and protocol, are returned in the response.
93
- *
94
- * @param request - The request {@link GetNamespaceRequest}
95
- * @returns A Promise of Namespace
96
- */
97
- getNamespace = request => this.client.fetch({
98
- method: 'GET',
99
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
100
- }, unmarshalNamespace);
101
-
102
- /**
103
- * Delete a namespace. Delete a Messaging and Queuing namespace, specified by
104
- * its namespace ID. Note that deleting a namespace is irreversible, and any
105
- * URLs, credentials and queued messages belonging to this namespace will also
106
- * be deleted.
107
- *
108
- * @param request - The request {@link DeleteNamespaceRequest}
109
- */
110
- deleteNamespace = request => this.client.fetch({
111
- method: 'DELETE',
112
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
113
- });
114
-
115
- /**
116
- * Create credentials. Create a set of credentials for a Messaging and Queuing
117
- * namespace, specified by its namespace ID. If creating credentials for a
118
- * NATS namespace, the `permissions` object must not be included in the
119
- * request. If creating credentials for an SQS/SNS namespace, the
120
- * `permissions` object is required, with all three of its child attributes.
121
- *
122
- * @param request - The request {@link CreateCredentialRequest}
123
- * @returns A Promise of Credential
124
- */
125
- createCredential = request => this.client.fetch({
126
- body: JSON.stringify(marshalCreateCredentialRequest(request, this.client.settings)),
127
- headers: jsonContentHeaders,
128
- method: 'POST',
129
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials`
130
- }, unmarshalCredential);
131
-
132
- /**
133
- * Delete credentials. Delete a set of credentials, specified by their
134
- * credential ID. Deleting credentials is irreversible and cannot be undone.
135
- * The credentials can no longer be used to access the namespace.
136
- *
137
- * @param request - The request {@link DeleteCredentialRequest}
138
- */
139
- deleteCredential = request => this.client.fetch({
140
- method: 'DELETE',
141
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
142
- });
143
- pageOfListCredentials = (() => {
144
- var _this4 = this;
145
- return function (request) {
146
- if (request === void 0) {
147
- request = {};
148
- }
149
- return _this4.client.fetch({
150
- method: 'GET',
151
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/credentials`,
152
- urlParams: urlParams(['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize])
153
- }, unmarshalListCredentialsResponse);
154
- };
155
- })();
156
-
157
- /**
158
- * List credentials. List existing credentials in the specified region. The
159
- * response contains only the metadata for the credentials, not the
160
- * credentials themselves (for this, use **Get Credentials**).
161
- *
162
- * @param request - The request {@link ListCredentialsRequest}
163
- * @returns A Promise of ListCredentialsResponse
164
- */
165
- listCredentials = (() => {
166
- var _this5 = this;
167
- return function (request) {
168
- if (request === void 0) {
169
- request = {};
170
- }
171
- return enrichForPagination('credentials', _this5.pageOfListCredentials, request);
172
- };
173
- })();
174
-
175
- /**
176
- * Update credentials. Update a set of credentials. You can update the
177
- * credentials' name, or (in the case of SQS/SNS credentials only) their
178
- * permissions. To update the name of NATS credentials, do not include the
179
- * `permissions` object in your request.
180
- *
181
- * @param request - The request {@link UpdateCredentialRequest}
182
- * @returns A Promise of Credential
183
- */
184
- updateCredential = request => this.client.fetch({
185
- body: JSON.stringify(marshalUpdateCredentialRequest(request, this.client.settings)),
186
- headers: jsonContentHeaders,
187
- method: 'PATCH',
188
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
189
- }, unmarshalCredential);
190
-
191
- /**
192
- * Get credentials. Retrieve an existing set of credentials, identified by the
193
- * `credential_id`. The credentials themselves, as well as their metadata
194
- * (protocol, namespace ID etc), are returned in the response.
195
- *
196
- * @param request - The request {@link GetCredentialRequest}
197
- * @returns A Promise of Credential
198
- */
199
- getCredential = request => this.client.fetch({
200
- method: 'GET',
201
- path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
202
- }, unmarshalCredential);
203
- }
204
-
205
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.