@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.15

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 (215) hide show
  1. package/dist/api/account/index.js +4 -0
  2. package/dist/api/account/v2/api.gen.js +147 -0
  3. package/dist/api/account/v2/index.gen.js +4 -0
  4. package/dist/api/account/v2/marshalling.gen.js +39 -0
  5. package/dist/api/account/v3/api.gen.js +129 -0
  6. package/dist/api/account/v3/index.gen.js +6 -0
  7. package/dist/api/account/v3/marshalling.gen.js +39 -0
  8. package/dist/api/account/v3/validation-rules.gen.js +39 -0
  9. package/dist/api/applesilicon/index.js +2 -0
  10. package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
  11. package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
  12. package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
  13. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
  14. package/dist/api/baremetal/index.js +2 -0
  15. package/dist/api/baremetal/v1/api.gen.js +523 -0
  16. package/dist/api/baremetal/v1/api.utils.js +27 -0
  17. package/dist/api/baremetal/v1/content.gen.js +13 -0
  18. package/dist/api/baremetal/v1/index.js +5 -0
  19. package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
  20. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  21. package/dist/api/billing/index.js +2 -0
  22. package/dist/api/billing/v2alpha1/api.gen.js +80 -0
  23. package/dist/api/billing/v2alpha1/index.gen.js +4 -0
  24. package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
  25. package/dist/api/block/index.js +2 -0
  26. package/dist/api/block/v1alpha1/api.gen.js +249 -0
  27. package/dist/api/block/v1alpha1/content.gen.js +13 -0
  28. package/dist/api/block/v1alpha1/index.gen.js +7 -0
  29. package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
  30. package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
  31. package/dist/api/cockpit/index.js +2 -0
  32. package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
  33. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  34. package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
  35. package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
  36. package/dist/api/container/index.js +2 -0
  37. package/dist/api/container/v1beta1/api.gen.js +549 -0
  38. package/dist/api/container/v1beta1/content.gen.js +22 -0
  39. package/dist/api/container/v1beta1/index.gen.js +7 -0
  40. package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
  41. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  42. package/dist/api/document_db/index.js +2 -0
  43. package/dist/api/document_db/v1beta1/api.gen.js +830 -0
  44. package/dist/api/document_db/v1beta1/content.gen.js +19 -0
  45. package/dist/api/document_db/v1beta1/index.gen.js +7 -0
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
  48. package/dist/api/domain/index.js +2 -0
  49. package/dist/api/domain/v2beta1/api.gen.js +867 -0
  50. package/dist/api/domain/v2beta1/content.gen.js +28 -0
  51. package/dist/api/domain/v2beta1/index.gen.js +5 -0
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
  53. package/dist/api/flexibleip/index.js +2 -0
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  59. package/dist/api/function/index.js +2 -0
  60. package/dist/api/function/v1beta1/api.gen.js +560 -0
  61. package/dist/api/function/v1beta1/content.gen.js +22 -0
  62. package/dist/api/function/v1beta1/index.gen.js +7 -0
  63. package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
  64. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  65. package/dist/api/iam/index.js +2 -0
  66. package/dist/api/iam/v1alpha1/api.gen.js +783 -0
  67. package/dist/api/iam/v1alpha1/index.gen.js +6 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
  69. package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
  70. package/dist/api/instance/index.js +2 -0
  71. package/dist/api/instance/v1/api.gen.js +1003 -0
  72. package/dist/api/instance/v1/api.utils.js +369 -0
  73. package/dist/api/instance/v1/content.gen.js +31 -0
  74. package/dist/api/instance/v1/index.js +2 -0
  75. package/dist/api/instance/v1/marshalling.gen.js +1415 -0
  76. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  77. package/dist/api/iot/index.js +2 -0
  78. package/dist/api/iot/v1/api.gen.js +573 -0
  79. package/dist/api/iot/v1/content.gen.js +7 -0
  80. package/dist/api/iot/v1/index.gen.js +5 -0
  81. package/dist/api/iot/v1/marshalling.gen.js +439 -0
  82. package/dist/api/ipam/index.js +2 -0
  83. package/dist/api/ipam/v1/api.gen.js +113 -0
  84. package/dist/api/ipam/v1/index.gen.js +6 -0
  85. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  86. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  87. package/dist/api/ipfs/index.js +2 -0
  88. package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
  89. package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
  90. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  91. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
  92. package/dist/api/k8s/index.js +2 -0
  93. package/dist/api/k8s/v1/api.gen.js +454 -0
  94. package/dist/api/k8s/v1/api.utils.js +13 -0
  95. package/dist/api/k8s/v1/content.gen.js +13 -0
  96. package/dist/api/k8s/v1/index.js +4 -0
  97. package/dist/api/k8s/v1/marshalling.gen.js +421 -0
  98. package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
  99. package/dist/api/lb/index.js +2 -0
  100. package/dist/api/lb/v1/api.gen.js +1669 -0
  101. package/dist/api/lb/v1/api.utils.js +81 -0
  102. package/dist/api/lb/v1/content.gen.js +16 -0
  103. package/dist/api/lb/v1/index.js +2 -0
  104. package/dist/api/lb/v1/marshalling.gen.js +1039 -0
  105. package/dist/api/marketplace/index.js +4 -0
  106. package/dist/api/marketplace/v1/api.gen.js +60 -0
  107. package/dist/api/marketplace/v1/index.gen.js +4 -0
  108. package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
  109. package/dist/api/marketplace/v2/api.gen.js +162 -0
  110. package/dist/api/marketplace/v2/index.gen.js +4 -0
  111. package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
  112. package/dist/api/mnq/index.js +4 -0
  113. package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
  114. package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
  115. package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
  116. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  117. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  118. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  119. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  120. package/dist/api/rdb/index.js +2 -0
  121. package/dist/api/rdb/v1/api.gen.js +972 -0
  122. package/dist/api/rdb/v1/content.gen.js +22 -0
  123. package/dist/api/rdb/v1/index.gen.js +7 -0
  124. package/dist/api/rdb/v1/marshalling.gen.js +694 -0
  125. package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
  126. package/dist/api/redis/index.js +2 -0
  127. package/dist/api/redis/v1/api.gen.js +389 -0
  128. package/dist/api/redis/v1/content.gen.js +7 -0
  129. package/dist/api/redis/v1/index.gen.js +5 -0
  130. package/dist/api/redis/v1/marshalling.gen.js +283 -0
  131. package/dist/api/registry/index.js +2 -0
  132. package/dist/api/registry/v1/api.gen.js +252 -0
  133. package/dist/api/registry/v1/content.gen.js +13 -0
  134. package/dist/api/registry/v1/index.gen.js +5 -0
  135. package/dist/api/registry/v1/marshalling.gen.js +108 -0
  136. package/dist/api/secret/index.js +2 -0
  137. package/dist/api/secret/v1alpha1/api.gen.js +415 -0
  138. package/dist/api/secret/v1alpha1/index.gen.js +4 -0
  139. package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
  140. package/dist/api/tem/index.js +2 -0
  141. package/dist/api/tem/v1alpha1/api.gen.js +229 -0
  142. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  143. package/dist/api/tem/v1alpha1/index.gen.js +5 -0
  144. package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
  145. package/dist/api/test/index.js +2 -0
  146. package/dist/api/test/v1/api.gen.js +152 -0
  147. package/dist/api/test/v1/content.gen.js +7 -0
  148. package/dist/api/test/v1/index.gen.js +5 -0
  149. package/dist/api/test/v1/marshalling.gen.js +81 -0
  150. package/dist/api/vpc/index.js +4 -0
  151. package/dist/api/vpc/v1/api.gen.js +110 -0
  152. package/dist/api/vpc/v1/index.gen.js +4 -0
  153. package/dist/api/vpc/v1/marshalling.gen.js +44 -0
  154. package/dist/api/vpc/v2/api.gen.js +276 -0
  155. package/dist/api/vpc/v2/index.gen.js +4 -0
  156. package/dist/api/vpc/v2/marshalling.gen.js +137 -0
  157. package/dist/api/vpcgw/index.js +2 -0
  158. package/dist/api/vpcgw/v1/api.gen.js +669 -0
  159. package/dist/api/vpcgw/v1/content.gen.js +10 -0
  160. package/dist/api/vpcgw/v1/index.gen.js +5 -0
  161. package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
  162. package/dist/api/webhosting/index.js +2 -0
  163. package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
  164. package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
  165. package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
  166. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
  167. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
  168. package/dist/helpers/is-browser.js +5 -0
  169. package/dist/helpers/is-response.js +10 -0
  170. package/dist/helpers/json.js +11 -0
  171. package/dist/helpers/marshalling.js +130 -0
  172. package/dist/index.cjs +26484 -0
  173. package/dist/index.d.ts +31184 -0
  174. package/dist/index.js +71 -0
  175. package/dist/internal/async/interval-retrier.js +105 -0
  176. package/dist/internal/async/sleep.js +13 -0
  177. package/dist/internal/interceptors/composer.js +46 -0
  178. package/dist/internal/interceptors/helpers.js +32 -0
  179. package/dist/internal/logger/console-logger.js +38 -0
  180. package/dist/internal/logger/index.js +41 -0
  181. package/dist/internal/logger/level-resolver.js +13 -0
  182. package/dist/internal/validations/string-validation.js +38 -0
  183. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
  184. package/dist/scw/api.js +12 -0
  185. package/dist/scw/auth.js +68 -0
  186. package/dist/scw/client-ini-factory.js +174 -0
  187. package/dist/scw/client-ini-profile.js +54 -0
  188. package/dist/scw/client-settings.js +78 -0
  189. package/dist/scw/client.js +98 -0
  190. package/dist/scw/constants.js +4 -0
  191. package/dist/scw/custom-marshalling.js +131 -0
  192. package/dist/scw/errors/error-parser.js +107 -0
  193. package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
  194. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
  195. package/dist/scw/errors/scw-error.js +66 -0
  196. package/dist/scw/errors/standard/already-exists-error.js +26 -0
  197. package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
  198. package/dist/scw/errors/standard/index.js +13 -0
  199. package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
  200. package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
  201. package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
  202. package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
  203. package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
  204. package/dist/scw/errors/standard/resource-expired-error.js +26 -0
  205. package/dist/scw/errors/standard/resource-locked-error.js +25 -0
  206. package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
  207. package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
  208. package/dist/scw/errors/standard/transient-state-error.js +26 -0
  209. package/dist/scw/errors/types.js +23 -0
  210. package/dist/scw/fetch/build-fetcher.js +72 -0
  211. package/dist/scw/fetch/http-dumper.js +54 -0
  212. package/dist/scw/fetch/http-interceptors.js +99 -0
  213. package/dist/scw/fetch/resource-paginator.js +84 -0
  214. package/dist/scw/fetch/response-parser.js +72 -0
  215. package/package.json +2 -2
@@ -0,0 +1,4 @@
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 };
@@ -0,0 +1,60 @@
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 };
@@ -0,0 +1,4 @@
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.
@@ -0,0 +1,92 @@
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 unmarshalLocalImage = data => {
7
+ if (!isJSONObject(data)) {
8
+ throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);
9
+ }
10
+ return {
11
+ arch: data.arch,
12
+ compatibleCommercialTypes: data.compatible_commercial_types,
13
+ id: data.id,
14
+ zone: data.zone
15
+ };
16
+ };
17
+ const unmarshalOrganization = data => {
18
+ if (!isJSONObject(data)) {
19
+ throw new TypeError(`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`);
20
+ }
21
+ return {
22
+ id: data.id,
23
+ name: data.name
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: data.organization ? unmarshalOrganization(data.organization) : undefined,
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: data.image ? unmarshalImage(data.image) : undefined
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: data.version ? unmarshalVersion(data.version) : undefined
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 };
@@ -0,0 +1,162 @@
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: 'version_id',
77
+ value: request.versionId
78
+ }, {
79
+ param: 'image_label',
80
+ value: request.imageLabel
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 };
@@ -0,0 +1,4 @@
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.
@@ -0,0 +1,94 @@
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 };
@@ -0,0 +1,4 @@
1
+ import * as index_gen from './v1alpha1/index.gen.js';
2
+ export { index_gen as v1alpha1 };
3
+ import * as index_gen$1 from './v1beta1/index.gen.js';
4
+ export { index_gen$1 as v1beta1 };
@@ -0,0 +1,197 @@
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 = request => this.client.fetch({
61
+ body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
62
+ headers: jsonContentHeaders,
63
+ method: 'POST',
64
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`
65
+ }, unmarshalNamespace);
66
+
67
+ /**
68
+ * Update the name of a namespace. Update the name of a Messaging and Queuing
69
+ * namespace, specified by its namespace ID.
70
+ *
71
+ * @param request - The request {@link UpdateNamespaceRequest}
72
+ * @returns A Promise of Namespace
73
+ */
74
+ updateNamespace = request => this.client.fetch({
75
+ body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
76
+ headers: jsonContentHeaders,
77
+ method: 'PATCH',
78
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`
79
+ }, unmarshalNamespace);
80
+
81
+ /**
82
+ * Get a namespace. Retrieve information about an existing Messaging and
83
+ * Queuing namespace, identified by its namespace ID. Its full details,
84
+ * including name, endpoint and protocol, are returned in the response.
85
+ *
86
+ * @param request - The request {@link GetNamespaceRequest}
87
+ * @returns A Promise of Namespace
88
+ */
89
+ getNamespace = request => this.client.fetch({
90
+ method: 'GET',
91
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
92
+ }, unmarshalNamespace);
93
+
94
+ /**
95
+ * Delete a namespace. Delete a Messaging and Queuing namespace, specified by
96
+ * its namespace ID. Note that deleting a namespace is irreversible, and any
97
+ * URLs, credentials and queued messages belonging to this namespace will also
98
+ * be deleted.
99
+ *
100
+ * @param request - The request {@link DeleteNamespaceRequest}
101
+ */
102
+ deleteNamespace = request => this.client.fetch({
103
+ method: 'DELETE',
104
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
105
+ });
106
+
107
+ /**
108
+ * Create credentials. Create a set of credentials for a Messaging and Queuing
109
+ * namespace, specified by its namespace ID. If creating credentials for a
110
+ * NATS namespace, the `permissions` object must not be included in the
111
+ * request. If creating credentials for an SQS/SNS namespace, the
112
+ * `permissions` object is required, with all three of its child attributes.
113
+ *
114
+ * @param request - The request {@link CreateCredentialRequest}
115
+ * @returns A Promise of Credential
116
+ */
117
+ createCredential = request => this.client.fetch({
118
+ body: JSON.stringify(marshalCreateCredentialRequest(request, this.client.settings)),
119
+ headers: jsonContentHeaders,
120
+ method: 'POST',
121
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials`
122
+ }, unmarshalCredential);
123
+
124
+ /**
125
+ * Delete credentials. Delete a set of credentials, specified by their
126
+ * credential ID. Deleting credentials is irreversible and cannot be undone.
127
+ * The credentials can no longer be used to access the namespace.
128
+ *
129
+ * @param request - The request {@link DeleteCredentialRequest}
130
+ */
131
+ deleteCredential = request => this.client.fetch({
132
+ method: 'DELETE',
133
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
134
+ });
135
+ pageOfListCredentials = (() => {
136
+ var _this3 = this;
137
+ return function (request) {
138
+ if (request === void 0) {
139
+ request = {};
140
+ }
141
+ return _this3.client.fetch({
142
+ method: 'GET',
143
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/credentials`,
144
+ urlParams: urlParams(['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
145
+ }, unmarshalListCredentialsResponse);
146
+ };
147
+ })();
148
+
149
+ /**
150
+ * List credentials. List existing credentials in the specified region. The
151
+ * response contains only the metadata for the credentials, not the
152
+ * credentials themselves (for this, use **Get Credentials**).
153
+ *
154
+ * @param request - The request {@link ListCredentialsRequest}
155
+ * @returns A Promise of ListCredentialsResponse
156
+ */
157
+ listCredentials = (() => {
158
+ var _this4 = this;
159
+ return function (request) {
160
+ if (request === void 0) {
161
+ request = {};
162
+ }
163
+ return enrichForPagination('credentials', _this4.pageOfListCredentials, request);
164
+ };
165
+ })();
166
+
167
+ /**
168
+ * Update credentials. Update a set of credentials. You can update the
169
+ * credentials' name, or (in the case of SQS/SNS credentials only) their
170
+ * permissions. To update the name of NATS credentials, do not include the
171
+ * `permissions` object in your request.
172
+ *
173
+ * @param request - The request {@link UpdateCredentialRequest}
174
+ * @returns A Promise of Credential
175
+ */
176
+ updateCredential = request => this.client.fetch({
177
+ body: JSON.stringify(marshalUpdateCredentialRequest(request, this.client.settings)),
178
+ headers: jsonContentHeaders,
179
+ method: 'PATCH',
180
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
181
+ }, unmarshalCredential);
182
+
183
+ /**
184
+ * Get credentials. Retrieve an existing set of credentials, identified by the
185
+ * `credential_id`. The credentials themselves, as well as their metadata
186
+ * (protocol, namespace ID etc), are returned in the response.
187
+ *
188
+ * @param request - The request {@link GetCredentialRequest}
189
+ * @returns A Promise of Credential
190
+ */
191
+ getCredential = request => this.client.fetch({
192
+ method: 'GET',
193
+ path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`
194
+ }, unmarshalCredential);
195
+ }
196
+
197
+ export { API };
@@ -0,0 +1,4 @@
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.