@scaleway/sdk-marketplace 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Marketplace.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
93
94
  ## License
94
95
 
95
96
  This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
96
-
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v2/index.gen.js";
2
- export {
3
- index_gen as Marketplacev2
4
- };
1
+ import { index_gen_exports } from "./v2/index.gen.js";
2
+ export { index_gen_exports as Marketplacev2 };
@@ -1,155 +1,111 @@
1
- import { API as API$1, urlParams, enrichForPagination, validatePathParam, resolveOneOf } from "@scaleway/sdk-client";
2
- import { unmarshalListImagesResponse, unmarshalImage, unmarshalListVersionsResponse, unmarshalVersion, unmarshalListLocalImagesResponse, unmarshalLocalImage, unmarshalListCategoriesResponse, unmarshalCategory } from "./marshalling.gen.js";
3
- class API extends API$1 {
4
- pageOfListImages = (request) => this.client.fetch(
5
- {
6
- method: "GET",
7
- path: `/marketplace/v2/images`,
8
- urlParams: urlParams(
9
- ["arch", request.arch],
10
- ["category", request.category],
11
- ["include_eol", request.includeEol],
12
- ["order_by", request.orderBy],
13
- ["page", request.page],
14
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
15
- )
16
- },
17
- unmarshalListImagesResponse
18
- );
19
- /**
20
- * List marketplace images. List all available images on the marketplace, their UUID, CPU architecture and description.
21
- *
22
- * @param request - The request {@link ListImagesRequest}
23
- * @returns A Promise of ListImagesResponse
24
- */
25
- listImages = (request) => enrichForPagination("images", this.pageOfListImages, request);
26
- /**
27
- * Get a specific marketplace image. Get detailed information about a 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
- {
34
- method: "GET",
35
- path: `/marketplace/v2/images/${validatePathParam("imageId", request.imageId)}`
36
- },
37
- unmarshalImage
38
- );
39
- pageOfListVersions = (request) => this.client.fetch(
40
- {
41
- method: "GET",
42
- path: `/marketplace/v2/versions`,
43
- urlParams: urlParams(
44
- ["image_id", request.imageId],
45
- ["order_by", request.orderBy],
46
- ["page", request.page],
47
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
48
- )
49
- },
50
- unmarshalListVersionsResponse
51
- );
52
- /**
53
- * List versions of an Image. Get a list of all available version of an image, specified by its `image_id` (UUID format).
54
- *
55
- * @param request - The request {@link ListVersionsRequest}
56
- * @returns A Promise of ListVersionsResponse
57
- */
58
- listVersions = (request) => enrichForPagination("versions", this.pageOfListVersions, request);
59
- /**
60
- * Get a specific image version. Get information such as the name, creation date, last update and published date for an image version specified by its `version_id` (UUID format).
61
- *
62
- * @param request - The request {@link GetVersionRequest}
63
- * @returns A Promise of Version
64
- */
65
- getVersion = (request) => this.client.fetch(
66
- {
67
- method: "GET",
68
- path: `/marketplace/v2/versions/${validatePathParam("versionId", request.versionId)}`
69
- },
70
- unmarshalVersion
71
- );
72
- pageOfListLocalImages = (request = {}) => this.client.fetch(
73
- {
74
- method: "GET",
75
- path: `/marketplace/v2/local-images`,
76
- urlParams: urlParams(
77
- ["arch", request.arch],
78
- ["order_by", request.orderBy],
79
- ["page", request.page],
80
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
81
- ["type", request.type],
82
- ["zone", request.zone],
83
- ...Object.entries(resolveOneOf([
84
- {
85
- param: "image_id",
86
- value: request.imageId
87
- },
88
- {
89
- param: "version_id",
90
- value: request.versionId
91
- },
92
- {
93
- param: "image_label",
94
- value: request.imageLabel
95
- }
96
- ]))
97
- )
98
- },
99
- unmarshalListLocalImagesResponse
100
- );
101
- /**
102
- * List local images from a specific image or version. List information about local images in a specific Availability Zone, specified by its `image_id` (UUID format), `version_id` (UUID format) or `image_label`. Only one of these three parameters may be set.
103
- *
104
- * @param request - The request {@link ListLocalImagesRequest}
105
- * @returns A Promise of ListLocalImagesResponse
106
- */
107
- listLocalImages = (request = {}) => enrichForPagination("localImages", this.pageOfListLocalImages, request);
108
- /**
109
- * Get a specific local image by ID. Get detailed information about a local image, including compatible commercial types, supported architecture, labels and the Availability Zone of the image, specified by its `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
- {
116
- method: "GET",
117
- path: `/marketplace/v2/local-images/${validatePathParam("localImageId", request.localImageId)}`
118
- },
119
- unmarshalLocalImage
120
- );
121
- pageOfListCategories = (request = {}) => this.client.fetch(
122
- {
123
- method: "GET",
124
- path: `/marketplace/v2/categories`,
125
- urlParams: urlParams(
126
- ["page", request.page],
127
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
128
- )
129
- },
130
- unmarshalListCategoriesResponse
131
- );
132
- /**
133
- * List existing image categories. Get a list of all existing categories. The output can be paginated.
134
- *
135
- * @param request - The request {@link ListCategoriesRequest}
136
- * @returns A Promise of ListCategoriesResponse
137
- */
138
- listCategories = (request = {}) => enrichForPagination("categories", this.pageOfListCategories, request);
139
- /**
140
- * Get a specific category. Get information about a specific category of the marketplace catalog, specified by its `category_id` (UUID format).
141
- *
142
- * @param request - The request {@link GetCategoryRequest}
143
- * @returns A Promise of Category
144
- */
145
- getCategory = (request) => this.client.fetch(
146
- {
147
- method: "GET",
148
- path: `/marketplace/v2/categories/${validatePathParam("categoryId", request.categoryId)}`
149
- },
150
- unmarshalCategory
151
- );
152
- }
153
- export {
154
- API
1
+ import { unmarshalCategory, unmarshalImage, unmarshalListCategoriesResponse, unmarshalListImagesResponse, unmarshalListLocalImagesResponse, unmarshalListVersionsResponse, unmarshalLocalImage, unmarshalVersion } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, resolveOneOf, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ /**
4
+ * Marketplace API.
5
+
6
+ This API allows you to find available images for use when launching a Scaleway Instance.
7
+ */
8
+ var API$1 = class extends API {
9
+ pageOfListImages = (request) => this.client.fetch({
10
+ method: "GET",
11
+ path: `/marketplace/v2/images`,
12
+ 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])
13
+ }, unmarshalListImagesResponse);
14
+ /**
15
+ * List marketplace images. List all available images on the marketplace, their UUID, CPU architecture and description.
16
+ *
17
+ * @param request - The request {@link ListImagesRequest}
18
+ * @returns A Promise of ListImagesResponse
19
+ */
20
+ listImages = (request) => enrichForPagination("images", this.pageOfListImages, request);
21
+ /**
22
+ * Get a specific marketplace image. Get detailed information about a marketplace image, specified by its `image_id` (UUID format).
23
+ *
24
+ * @param request - The request {@link GetImageRequest}
25
+ * @returns A Promise of Image
26
+ */
27
+ getImage = (request) => this.client.fetch({
28
+ method: "GET",
29
+ path: `/marketplace/v2/images/${validatePathParam("imageId", request.imageId)}`
30
+ }, unmarshalImage);
31
+ pageOfListVersions = (request) => this.client.fetch({
32
+ method: "GET",
33
+ path: `/marketplace/v2/versions`,
34
+ urlParams: urlParams(["image_id", request.imageId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
35
+ }, unmarshalListVersionsResponse);
36
+ /**
37
+ * List versions of an Image. Get a list of all available version of an image, specified by its `image_id` (UUID format).
38
+ *
39
+ * @param request - The request {@link ListVersionsRequest}
40
+ * @returns A Promise of ListVersionsResponse
41
+ */
42
+ listVersions = (request) => enrichForPagination("versions", this.pageOfListVersions, request);
43
+ /**
44
+ * Get a specific image version. Get information such as the name, creation date, last update and published date for an image version specified by its `version_id` (UUID format).
45
+ *
46
+ * @param request - The request {@link GetVersionRequest}
47
+ * @returns A Promise of Version
48
+ */
49
+ getVersion = (request) => this.client.fetch({
50
+ method: "GET",
51
+ path: `/marketplace/v2/versions/${validatePathParam("versionId", request.versionId)}`
52
+ }, unmarshalVersion);
53
+ pageOfListLocalImages = (request = {}) => this.client.fetch({
54
+ method: "GET",
55
+ path: `/marketplace/v2/local-images`,
56
+ urlParams: urlParams(["arch", request.arch], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["type", request.type], ["zone", request.zone], ...Object.entries(resolveOneOf([
57
+ {
58
+ param: "image_id",
59
+ value: request.imageId
60
+ },
61
+ {
62
+ param: "version_id",
63
+ value: request.versionId
64
+ },
65
+ {
66
+ param: "image_label",
67
+ value: request.imageLabel
68
+ }
69
+ ])))
70
+ }, unmarshalListLocalImagesResponse);
71
+ /**
72
+ * List local images from a specific image or version. List information about local images in a specific Availability Zone, specified by its `image_id` (UUID format), `version_id` (UUID format) or `image_label`. Only one of these three parameters may be set.
73
+ *
74
+ * @param request - The request {@link ListLocalImagesRequest}
75
+ * @returns A Promise of ListLocalImagesResponse
76
+ */
77
+ listLocalImages = (request = {}) => enrichForPagination("localImages", this.pageOfListLocalImages, request);
78
+ /**
79
+ * Get a specific local image by ID. Get detailed information about a local image, including compatible commercial types, supported architecture, labels and the Availability Zone of the image, specified by its `local_image_id` (UUID format).
80
+ *
81
+ * @param request - The request {@link GetLocalImageRequest}
82
+ * @returns A Promise of LocalImage
83
+ */
84
+ getLocalImage = (request) => this.client.fetch({
85
+ method: "GET",
86
+ path: `/marketplace/v2/local-images/${validatePathParam("localImageId", request.localImageId)}`
87
+ }, unmarshalLocalImage);
88
+ pageOfListCategories = (request = {}) => this.client.fetch({
89
+ method: "GET",
90
+ path: `/marketplace/v2/categories`,
91
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
92
+ }, unmarshalListCategoriesResponse);
93
+ /**
94
+ * List existing image categories. Get a list of all existing categories. The output can be paginated.
95
+ *
96
+ * @param request - The request {@link ListCategoriesRequest}
97
+ * @returns A Promise of ListCategoriesResponse
98
+ */
99
+ listCategories = (request = {}) => enrichForPagination("categories", this.pageOfListCategories, request);
100
+ /**
101
+ * Get a specific category. Get information about a specific category of the marketplace catalog, specified by its `category_id` (UUID format).
102
+ *
103
+ * @param request - The request {@link GetCategoryRequest}
104
+ * @returns A Promise of Category
105
+ */
106
+ getCategory = (request) => this.client.fetch({
107
+ method: "GET",
108
+ path: `/marketplace/v2/categories/${validatePathParam("categoryId", request.categoryId)}`
109
+ }, unmarshalCategory);
155
110
  };
111
+ export { API$1 as API };
@@ -1,13 +1,15 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { unmarshalCategory, unmarshalImage, unmarshalListCategoriesResponse, unmarshalListImagesResponse, unmarshalListLocalImagesResponse, unmarshalListVersionsResponse, unmarshalLocalImage, unmarshalVersion } from "./marshalling.gen.js";
3
- export {
4
- API,
5
- unmarshalCategory,
6
- unmarshalImage,
7
- unmarshalListCategoriesResponse,
8
- unmarshalListImagesResponse,
9
- unmarshalListLocalImagesResponse,
10
- unmarshalListVersionsResponse,
11
- unmarshalLocalImage,
12
- unmarshalVersion
13
- };
3
+ import { API } from "./api.gen.js";
4
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
5
+ API: () => API,
6
+ unmarshalCategory: () => unmarshalCategory,
7
+ unmarshalImage: () => unmarshalImage,
8
+ unmarshalListCategoriesResponse: () => unmarshalListCategoriesResponse,
9
+ unmarshalListImagesResponse: () => unmarshalListImagesResponse,
10
+ unmarshalListLocalImagesResponse: () => unmarshalListLocalImagesResponse,
11
+ unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
12
+ unmarshalLocalImage: () => unmarshalLocalImage,
13
+ unmarshalVersion: () => unmarshalVersion
14
+ });
15
+ export { index_gen_exports };
@@ -1,114 +1,73 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  const unmarshalCategory = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'Category' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- description: data.description,
10
- id: data.id,
11
- name: data.name
12
- };
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Category' failed as data isn't a dictionary.`);
4
+ return {
5
+ description: data.description,
6
+ id: data.id,
7
+ name: data.name
8
+ };
13
9
  };
14
10
  const unmarshalImage = (data) => {
15
- if (!isJSONObject(data)) {
16
- throw new TypeError(
17
- `Unmarshalling the type 'Image' failed as data isn't a dictionary.`
18
- );
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
- };
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
12
+ return {
13
+ categories: data.categories,
14
+ createdAt: unmarshalDate(data.created_at),
15
+ description: data.description,
16
+ id: data.id,
17
+ label: data.label,
18
+ logo: data.logo,
19
+ name: data.name,
20
+ updatedAt: unmarshalDate(data.updated_at),
21
+ validUntil: unmarshalDate(data.valid_until)
22
+ };
31
23
  };
32
24
  const unmarshalLocalImage = (data) => {
33
- if (!isJSONObject(data)) {
34
- throw new TypeError(
35
- `Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`
36
- );
37
- }
38
- return {
39
- arch: data.arch,
40
- compatibleCommercialTypes: data.compatible_commercial_types,
41
- id: data.id,
42
- label: data.label,
43
- type: data.type,
44
- zone: data.zone
45
- };
25
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);
26
+ return {
27
+ arch: data.arch,
28
+ compatibleCommercialTypes: data.compatible_commercial_types,
29
+ id: data.id,
30
+ label: data.label,
31
+ type: data.type,
32
+ zone: data.zone
33
+ };
46
34
  };
47
35
  const unmarshalVersion = (data) => {
48
- if (!isJSONObject(data)) {
49
- throw new TypeError(
50
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
51
- );
52
- }
53
- return {
54
- createdAt: unmarshalDate(data.created_at),
55
- id: data.id,
56
- name: data.name,
57
- publishedAt: unmarshalDate(data.published_at),
58
- updatedAt: unmarshalDate(data.updated_at)
59
- };
36
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
37
+ return {
38
+ createdAt: unmarshalDate(data.created_at),
39
+ id: data.id,
40
+ name: data.name,
41
+ publishedAt: unmarshalDate(data.published_at),
42
+ updatedAt: unmarshalDate(data.updated_at)
43
+ };
60
44
  };
61
45
  const unmarshalListCategoriesResponse = (data) => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- categories: unmarshalArrayOfObject(data.categories, unmarshalCategory),
69
- totalCount: data.total_count
70
- };
46
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`);
47
+ return {
48
+ categories: unmarshalArrayOfObject(data.categories, unmarshalCategory),
49
+ totalCount: data.total_count
50
+ };
71
51
  };
72
52
  const unmarshalListImagesResponse = (data) => {
73
- if (!isJSONObject(data)) {
74
- throw new TypeError(
75
- `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`
76
- );
77
- }
78
- return {
79
- images: unmarshalArrayOfObject(data.images, unmarshalImage),
80
- totalCount: data.total_count
81
- };
53
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
54
+ return {
55
+ images: unmarshalArrayOfObject(data.images, unmarshalImage),
56
+ totalCount: data.total_count
57
+ };
82
58
  };
83
59
  const unmarshalListLocalImagesResponse = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),
91
- totalCount: data.total_count
92
- };
60
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`);
61
+ return {
62
+ localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),
63
+ totalCount: data.total_count
64
+ };
93
65
  };
94
66
  const unmarshalListVersionsResponse = (data) => {
95
- if (!isJSONObject(data)) {
96
- throw new TypeError(
97
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
98
- );
99
- }
100
- return {
101
- totalCount: data.total_count,
102
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
103
- };
104
- };
105
- export {
106
- unmarshalCategory,
107
- unmarshalImage,
108
- unmarshalListCategoriesResponse,
109
- unmarshalListImagesResponse,
110
- unmarshalListLocalImagesResponse,
111
- unmarshalListVersionsResponse,
112
- unmarshalLocalImage,
113
- unmarshalVersion
67
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
68
+ return {
69
+ totalCount: data.total_count,
70
+ versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
71
+ };
114
72
  };
73
+ export { unmarshalCategory, unmarshalImage, unmarshalListCategoriesResponse, unmarshalListImagesResponse, unmarshalListLocalImagesResponse, unmarshalListVersionsResponse, unmarshalLocalImage, unmarshalVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-marketplace",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK marketplace",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.1"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",