@scaleway/sdk-registry 2.2.0 → 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 Registry.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 "./v1/index.gen.js";
2
- export {
3
- index_gen as Registryv1
4
- };
1
+ import { index_gen_exports } from "./v1/index.gen.js";
2
+ export { index_gen_exports as Registryv1 };
@@ -1,267 +1,178 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
- import { NAMESPACE_TRANSIENT_STATUSES, IMAGE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListImagesResponse, unmarshalImage, marshalUpdateImageRequest, unmarshalListTagsResponse, unmarshalTag } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- regions: ["fr-par", "nl-ams", "pl-waw"]
14
- });
15
- pageOfListNamespaces = (request = {}) => this.client.fetch(
16
- {
17
- method: "GET",
18
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
19
- urlParams: urlParams(
20
- ["name", request.name],
21
- ["order_by", request.orderBy],
22
- ["organization_id", request.organizationId],
23
- ["page", request.page],
24
- [
25
- "page_size",
26
- request.pageSize ?? this.client.settings.defaultPageSize
27
- ],
28
- ["project_id", request.projectId]
29
- )
30
- },
31
- unmarshalListNamespacesResponse
32
- );
33
- /**
34
- * List namespaces. List all namespaces in a specified region. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `instance_id` and `project_id` parameters.
35
- *
36
- * @param request - The request {@link ListNamespacesRequest}
37
- * @returns A Promise of ListNamespacesResponse
38
- */
39
- listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
40
- /**
41
- * Get a namespace. Retrieve information about a given namespace, specified by its `namespace_id` and region. Full details about the namespace, such as `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and `image_count` are returned in the response.
42
- *
43
- * @param request - The request {@link GetNamespaceRequest}
44
- * @returns A Promise of Namespace
45
- */
46
- getNamespace = (request) => this.client.fetch(
47
- {
48
- method: "GET",
49
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
50
- },
51
- unmarshalNamespace
52
- );
53
- /**
54
- * Waits for {@link Namespace} to be in a final state.
55
- *
56
- * @param request - The request {@link GetNamespaceRequest}
57
- * @param options - The waiting options
58
- * @returns A Promise of Namespace
59
- */
60
- waitForNamespace = (request, options) => waitForResource(
61
- options?.stop ?? ((res) => Promise.resolve(
62
- !NAMESPACE_TRANSIENT_STATUSES.includes(res.status)
63
- )),
64
- this.getNamespace,
65
- request,
66
- options
67
- );
68
- /**
69
- * Create a namespace. Create a new Container Registry namespace. You must specify the namespace name and region in which you want it to be created. Optionally, you can specify the `project_id` and `is_public` in the request payload.
70
- *
71
- * @param request - The request {@link CreateNamespaceRequest}
72
- * @returns A Promise of Namespace
73
- */
74
- createNamespace = (request) => this.client.fetch(
75
- {
76
- body: JSON.stringify(
77
- marshalCreateNamespaceRequest(request, this.client.settings)
78
- ),
79
- headers: jsonContentHeaders,
80
- method: "POST",
81
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
82
- },
83
- unmarshalNamespace
84
- );
85
- /**
86
- * Update a namespace. Update the parameters of a given namespace, specified by its `namespace_id` and `region`. You can update the `description` and `is_public` parameters.
87
- *
88
- * @param request - The request {@link UpdateNamespaceRequest}
89
- * @returns A Promise of Namespace
90
- */
91
- updateNamespace = (request) => this.client.fetch(
92
- {
93
- body: JSON.stringify(
94
- marshalUpdateNamespaceRequest(request, this.client.settings)
95
- ),
96
- headers: jsonContentHeaders,
97
- method: "PATCH",
98
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
99
- },
100
- unmarshalNamespace
101
- );
102
- /**
103
- * Delete a namespace. Delete a given namespace. You must specify, in the endpoint, the `region` and `namespace_id` parameters of the namespace you want to delete.
104
- *
105
- * @param request - The request {@link DeleteNamespaceRequest}
106
- * @returns A Promise of Namespace
107
- */
108
- deleteNamespace = (request) => this.client.fetch(
109
- {
110
- method: "DELETE",
111
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
112
- },
113
- unmarshalNamespace
114
- );
115
- pageOfListImages = (request = {}) => this.client.fetch(
116
- {
117
- method: "GET",
118
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images`,
119
- urlParams: urlParams(
120
- ["name", request.name],
121
- ["namespace_id", request.namespaceId],
122
- ["order_by", request.orderBy],
123
- ["organization_id", request.organizationId],
124
- ["page", request.page],
125
- [
126
- "page_size",
127
- request.pageSize ?? this.client.settings.defaultPageSize
128
- ],
129
- ["project_id", request.projectId]
130
- )
131
- },
132
- unmarshalListImagesResponse
133
- );
134
- /**
135
- * List images. List all images in a specified region. By default, the images listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `namespace_id` and `project_id` parameters.
136
- *
137
- * @param request - The request {@link ListImagesRequest}
138
- * @returns A Promise of ListImagesResponse
139
- */
140
- listImages = (request = {}) => enrichForPagination("images", this.pageOfListImages, request);
141
- /**
142
- * Get an image. Retrieve information about a given container image, specified by its `image_id` and region. Full details about the image, such as `name`, `namespace_id`, `status`, `visibility`, and `size` are returned in the response.
143
- *
144
- * @param request - The request {@link GetImageRequest}
145
- * @returns A Promise of Image
146
- */
147
- getImage = (request) => this.client.fetch(
148
- {
149
- method: "GET",
150
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
151
- },
152
- unmarshalImage
153
- );
154
- /**
155
- * Waits for {@link Image} to be in a final state.
156
- *
157
- * @param request - The request {@link GetImageRequest}
158
- * @param options - The waiting options
159
- * @returns A Promise of Image
160
- */
161
- waitForImage = (request, options) => waitForResource(
162
- options?.stop ?? ((res) => Promise.resolve(
163
- !IMAGE_TRANSIENT_STATUSES.includes(res.status)
164
- )),
165
- this.getImage,
166
- request,
167
- options
168
- );
169
- /**
170
- * Update an image. Update the parameters of a given image, specified by its `image_id` and `region`. You can update the `visibility` parameter.
171
- *
172
- * @param request - The request {@link UpdateImageRequest}
173
- * @returns A Promise of Image
174
- */
175
- updateImage = (request) => this.client.fetch(
176
- {
177
- body: JSON.stringify(
178
- marshalUpdateImageRequest(request, this.client.settings)
179
- ),
180
- headers: jsonContentHeaders,
181
- method: "PATCH",
182
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
183
- },
184
- unmarshalImage
185
- );
186
- /**
187
- * Delete an image. Delete a given image. You must specify, in the endpoint, the `region` and `image_id` parameters of the image you want to delete.
188
- *
189
- * @param request - The request {@link DeleteImageRequest}
190
- * @returns A Promise of Image
191
- */
192
- deleteImage = (request) => this.client.fetch(
193
- {
194
- method: "DELETE",
195
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
196
- },
197
- unmarshalImage
198
- );
199
- pageOfListTags = (request) => this.client.fetch(
200
- {
201
- method: "GET",
202
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}/tags`,
203
- urlParams: urlParams(
204
- ["name", request.name],
205
- ["order_by", request.orderBy],
206
- ["page", request.page],
207
- [
208
- "page_size",
209
- request.pageSize ?? this.client.settings.defaultPageSize
210
- ]
211
- )
212
- },
213
- unmarshalListTagsResponse
214
- );
215
- /**
216
- * List tags. List all tags for a given image, specified by region. By default, the tags listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `name`.
217
- *
218
- * @param request - The request {@link ListTagsRequest}
219
- * @returns A Promise of ListTagsResponse
220
- */
221
- listTags = (request) => enrichForPagination("tags", this.pageOfListTags, request);
222
- /**
223
- * Get a tag. Retrieve information about a given image tag, specified by its `tag_id` and region. Full details about the tag, such as `name`, `image_id`, `status`, and `digest` are returned in the response.
224
- *
225
- * @param request - The request {@link GetTagRequest}
226
- * @returns A Promise of Tag
227
- */
228
- getTag = (request) => this.client.fetch(
229
- {
230
- method: "GET",
231
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`
232
- },
233
- unmarshalTag
234
- );
235
- /**
236
- * Waits for {@link Tag} to be in a final state.
237
- *
238
- * @param request - The request {@link GetTagRequest}
239
- * @param options - The waiting options
240
- * @returns A Promise of Tag
241
- */
242
- waitForTag = (request, options) => waitForResource(
243
- options?.stop ?? ((res) => Promise.resolve(
244
- !TAG_TRANSIENT_STATUSES.includes(res.status)
245
- )),
246
- this.getTag,
247
- request,
248
- options
249
- );
250
- /**
251
- * Delete a tag. Delete a given image tag. You must specify, in the endpoint, the `region` and `tag_id` parameters of the tag you want to delete.
252
- *
253
- * @param request - The request {@link DeleteTagRequest}
254
- * @returns A Promise of Tag
255
- */
256
- deleteTag = (request) => this.client.fetch(
257
- {
258
- method: "DELETE",
259
- path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`,
260
- urlParams: urlParams(["force", request.force])
261
- },
262
- unmarshalTag
263
- );
264
- }
265
- export {
266
- API
1
+ import { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateNamespaceRequest, marshalUpdateImageRequest, marshalUpdateNamespaceRequest, unmarshalImage, unmarshalListImagesResponse, unmarshalListNamespacesResponse, unmarshalListTagsResponse, unmarshalNamespace, unmarshalTag } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Container Registry API.
7
+
8
+ This API allows you to manage your Container Registry resources.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ regions: [
16
+ "fr-par",
17
+ "nl-ams",
18
+ "pl-waw"
19
+ ] });
20
+ pageOfListNamespaces = (request = {}) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
23
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
24
+ }, unmarshalListNamespacesResponse);
25
+ /**
26
+ * List namespaces. List all namespaces in a specified region. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `instance_id` and `project_id` parameters.
27
+ *
28
+ * @param request - The request {@link ListNamespacesRequest}
29
+ * @returns A Promise of ListNamespacesResponse
30
+ */
31
+ listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
32
+ /**
33
+ * Get a namespace. Retrieve information about a given namespace, specified by its `namespace_id` and region. Full details about the namespace, such as `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and `image_count` are returned in the response.
34
+ *
35
+ * @param request - The request {@link GetNamespaceRequest}
36
+ * @returns A Promise of Namespace
37
+ */
38
+ getNamespace = (request) => this.client.fetch({
39
+ method: "GET",
40
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
41
+ }, unmarshalNamespace);
42
+ /**
43
+ * Waits for {@link Namespace} to be in a final state.
44
+ *
45
+ * @param request - The request {@link GetNamespaceRequest}
46
+ * @param options - The waiting options
47
+ * @returns A Promise of Namespace
48
+ */
49
+ waitForNamespace = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
50
+ /**
51
+ * Create a namespace. Create a new Container Registry namespace. You must specify the namespace name and region in which you want it to be created. Optionally, you can specify the `project_id` and `is_public` in the request payload.
52
+ *
53
+ * @param request - The request {@link CreateNamespaceRequest}
54
+ * @returns A Promise of Namespace
55
+ */
56
+ createNamespace = (request) => this.client.fetch({
57
+ body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
58
+ headers: jsonContentHeaders,
59
+ method: "POST",
60
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
61
+ }, unmarshalNamespace);
62
+ /**
63
+ * Update a namespace. Update the parameters of a given namespace, specified by its `namespace_id` and `region`. You can update the `description` and `is_public` parameters.
64
+ *
65
+ * @param request - The request {@link UpdateNamespaceRequest}
66
+ * @returns A Promise of Namespace
67
+ */
68
+ updateNamespace = (request) => this.client.fetch({
69
+ body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
70
+ headers: jsonContentHeaders,
71
+ method: "PATCH",
72
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
73
+ }, unmarshalNamespace);
74
+ /**
75
+ * Delete a namespace. Delete a given namespace. You must specify, in the endpoint, the `region` and `namespace_id` parameters of the namespace you want to delete.
76
+ *
77
+ * @param request - The request {@link DeleteNamespaceRequest}
78
+ * @returns A Promise of Namespace
79
+ */
80
+ deleteNamespace = (request) => this.client.fetch({
81
+ method: "DELETE",
82
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
83
+ }, unmarshalNamespace);
84
+ pageOfListImages = (request = {}) => this.client.fetch({
85
+ method: "GET",
86
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images`,
87
+ urlParams: urlParams(["name", request.name], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
88
+ }, unmarshalListImagesResponse);
89
+ /**
90
+ * List images. List all images in a specified region. By default, the images listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `namespace_id` and `project_id` parameters.
91
+ *
92
+ * @param request - The request {@link ListImagesRequest}
93
+ * @returns A Promise of ListImagesResponse
94
+ */
95
+ listImages = (request = {}) => enrichForPagination("images", this.pageOfListImages, request);
96
+ /**
97
+ * Get an image. Retrieve information about a given container image, specified by its `image_id` and region. Full details about the image, such as `name`, `namespace_id`, `status`, `visibility`, and `size` are returned in the response.
98
+ *
99
+ * @param request - The request {@link GetImageRequest}
100
+ * @returns A Promise of Image
101
+ */
102
+ getImage = (request) => this.client.fetch({
103
+ method: "GET",
104
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
105
+ }, unmarshalImage);
106
+ /**
107
+ * Waits for {@link Image} to be in a final state.
108
+ *
109
+ * @param request - The request {@link GetImageRequest}
110
+ * @param options - The waiting options
111
+ * @returns A Promise of Image
112
+ */
113
+ waitForImage = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!IMAGE_TRANSIENT_STATUSES.includes(res.status))), this.getImage, request, options);
114
+ /**
115
+ * Update an image. Update the parameters of a given image, specified by its `image_id` and `region`. You can update the `visibility` parameter.
116
+ *
117
+ * @param request - The request {@link UpdateImageRequest}
118
+ * @returns A Promise of Image
119
+ */
120
+ updateImage = (request) => this.client.fetch({
121
+ body: JSON.stringify(marshalUpdateImageRequest(request, this.client.settings)),
122
+ headers: jsonContentHeaders,
123
+ method: "PATCH",
124
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
125
+ }, unmarshalImage);
126
+ /**
127
+ * Delete an image. Delete a given image. You must specify, in the endpoint, the `region` and `image_id` parameters of the image you want to delete.
128
+ *
129
+ * @param request - The request {@link DeleteImageRequest}
130
+ * @returns A Promise of Image
131
+ */
132
+ deleteImage = (request) => this.client.fetch({
133
+ method: "DELETE",
134
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
135
+ }, unmarshalImage);
136
+ pageOfListTags = (request) => this.client.fetch({
137
+ method: "GET",
138
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}/tags`,
139
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
140
+ }, unmarshalListTagsResponse);
141
+ /**
142
+ * List tags. List all tags for a given image, specified by region. By default, the tags listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `name`.
143
+ *
144
+ * @param request - The request {@link ListTagsRequest}
145
+ * @returns A Promise of ListTagsResponse
146
+ */
147
+ listTags = (request) => enrichForPagination("tags", this.pageOfListTags, request);
148
+ /**
149
+ * Get a tag. Retrieve information about a given image tag, specified by its `tag_id` and region. Full details about the tag, such as `name`, `image_id`, `status`, and `digest` are returned in the response.
150
+ *
151
+ * @param request - The request {@link GetTagRequest}
152
+ * @returns A Promise of Tag
153
+ */
154
+ getTag = (request) => this.client.fetch({
155
+ method: "GET",
156
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`
157
+ }, unmarshalTag);
158
+ /**
159
+ * Waits for {@link Tag} to be in a final state.
160
+ *
161
+ * @param request - The request {@link GetTagRequest}
162
+ * @param options - The waiting options
163
+ * @returns A Promise of Tag
164
+ */
165
+ waitForTag = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TAG_TRANSIENT_STATUSES.includes(res.status))), this.getTag, request, options);
166
+ /**
167
+ * Delete a tag. Delete a given image tag. You must specify, in the endpoint, the `region` and `tag_id` parameters of the tag you want to delete.
168
+ *
169
+ * @param request - The request {@link DeleteTagRequest}
170
+ * @returns A Promise of Tag
171
+ */
172
+ deleteTag = (request) => this.client.fetch({
173
+ method: "DELETE",
174
+ path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`,
175
+ urlParams: urlParams(["force", request.force])
176
+ }, unmarshalTag);
267
177
  };
178
+ export { API$1 as API };
@@ -1,8 +1,7 @@
1
+ /** Lists transient statutes of the enum {@link ImageStatus}. */
1
2
  const IMAGE_TRANSIENT_STATUSES = ["deleting"];
3
+ /** Lists transient statutes of the enum {@link NamespaceStatus}. */
2
4
  const NAMESPACE_TRANSIENT_STATUSES = ["deleting"];
5
+ /** Lists transient statutes of the enum {@link TagStatus}. */
3
6
  const TAG_TRANSIENT_STATUSES = ["deleting"];
4
- export {
5
- IMAGE_TRANSIENT_STATUSES,
6
- NAMESPACE_TRANSIENT_STATUSES,
7
- TAG_TRANSIENT_STATUSES
8
- };
7
+ export { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES };
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { CreateNamespaceRequest, DeleteImageRequest, DeleteNamespaceRequest, DeleteTagRequest, GetImageRequest, GetNamespaceRequest, GetTagRequest, Image, ImageStatus, ImageVisibility, ListImagesRequest, ListImagesRequestOrderBy, ListImagesResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTagsRequest, ListTagsRequestOrderBy, ListTagsResponse, Namespace, NamespaceStatus, Tag, TagStatus, UpdateImageRequest, UpdateNamespaceRequest, } from './types.gen.js';
@@ -1,18 +1,20 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateNamespaceRequest, marshalUpdateImageRequest, marshalUpdateNamespaceRequest, unmarshalImage, unmarshalListImagesResponse, unmarshalListNamespacesResponse, unmarshalListTagsResponse, unmarshalNamespace, unmarshalTag } from "./marshalling.gen.js";
4
- export {
5
- API,
6
- IMAGE_TRANSIENT_STATUSES,
7
- NAMESPACE_TRANSIENT_STATUSES,
8
- TAG_TRANSIENT_STATUSES,
9
- marshalCreateNamespaceRequest,
10
- marshalUpdateImageRequest,
11
- marshalUpdateNamespaceRequest,
12
- unmarshalImage,
13
- unmarshalListImagesResponse,
14
- unmarshalListNamespacesResponse,
15
- unmarshalListTagsResponse,
16
- unmarshalNamespace,
17
- unmarshalTag
18
- };
4
+ import { API } from "./api.gen.js";
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ API: () => API,
7
+ IMAGE_TRANSIENT_STATUSES: () => IMAGE_TRANSIENT_STATUSES,
8
+ NAMESPACE_TRANSIENT_STATUSES: () => NAMESPACE_TRANSIENT_STATUSES,
9
+ TAG_TRANSIENT_STATUSES: () => TAG_TRANSIENT_STATUSES,
10
+ marshalCreateNamespaceRequest: () => marshalCreateNamespaceRequest,
11
+ marshalUpdateImageRequest: () => marshalUpdateImageRequest,
12
+ marshalUpdateNamespaceRequest: () => marshalUpdateNamespaceRequest,
13
+ unmarshalImage: () => unmarshalImage,
14
+ unmarshalListImagesResponse: () => unmarshalListImagesResponse,
15
+ unmarshalListNamespacesResponse: () => unmarshalListNamespacesResponse,
16
+ unmarshalListTagsResponse: () => unmarshalListTagsResponse,
17
+ unmarshalNamespace: () => unmarshalNamespace,
18
+ unmarshalTag: () => unmarshalTag
19
+ });
20
+ export { index_gen_exports };
@@ -1,128 +1,89 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
3
  const unmarshalImage = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'Image' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- createdAt: unmarshalDate(data.created_at),
11
- id: data.id,
12
- name: data.name,
13
- namespaceId: data.namespace_id,
14
- size: data.size,
15
- status: data.status,
16
- statusMessage: data.status_message,
17
- tags: data.tags,
18
- updatedAt: unmarshalDate(data.updated_at),
19
- visibility: data.visibility
20
- };
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
5
+ return {
6
+ createdAt: unmarshalDate(data.created_at),
7
+ id: data.id,
8
+ name: data.name,
9
+ namespaceId: data.namespace_id,
10
+ size: data.size,
11
+ status: data.status,
12
+ statusMessage: data.status_message,
13
+ tags: data.tags,
14
+ updatedAt: unmarshalDate(data.updated_at),
15
+ visibility: data.visibility
16
+ };
21
17
  };
22
18
  const unmarshalNamespace = (data) => {
23
- if (!isJSONObject(data)) {
24
- throw new TypeError(
25
- `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`
26
- );
27
- }
28
- return {
29
- createdAt: unmarshalDate(data.created_at),
30
- description: data.description,
31
- endpoint: data.endpoint,
32
- id: data.id,
33
- imageCount: data.image_count,
34
- isPublic: data.is_public,
35
- name: data.name,
36
- organizationId: data.organization_id,
37
- projectId: data.project_id,
38
- region: data.region,
39
- size: data.size,
40
- status: data.status,
41
- statusMessage: data.status_message,
42
- updatedAt: unmarshalDate(data.updated_at)
43
- };
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
20
+ return {
21
+ createdAt: unmarshalDate(data.created_at),
22
+ description: data.description,
23
+ endpoint: data.endpoint,
24
+ id: data.id,
25
+ imageCount: data.image_count,
26
+ isPublic: data.is_public,
27
+ name: data.name,
28
+ organizationId: data.organization_id,
29
+ projectId: data.project_id,
30
+ region: data.region,
31
+ size: data.size,
32
+ status: data.status,
33
+ statusMessage: data.status_message,
34
+ updatedAt: unmarshalDate(data.updated_at)
35
+ };
44
36
  };
45
37
  const unmarshalTag = (data) => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(
48
- `Unmarshalling the type 'Tag' failed as data isn't a dictionary.`
49
- );
50
- }
51
- return {
52
- createdAt: unmarshalDate(data.created_at),
53
- digest: data.digest,
54
- id: data.id,
55
- imageId: data.image_id,
56
- name: data.name,
57
- status: data.status,
58
- updatedAt: unmarshalDate(data.updated_at)
59
- };
38
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Tag' failed as data isn't a dictionary.`);
39
+ return {
40
+ createdAt: unmarshalDate(data.created_at),
41
+ digest: data.digest,
42
+ id: data.id,
43
+ imageId: data.image_id,
44
+ name: data.name,
45
+ status: data.status,
46
+ updatedAt: unmarshalDate(data.updated_at)
47
+ };
60
48
  };
61
49
  const unmarshalListImagesResponse = (data) => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- images: unmarshalArrayOfObject(data.images, unmarshalImage),
69
- totalCount: data.total_count
70
- };
50
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
51
+ return {
52
+ images: unmarshalArrayOfObject(data.images, unmarshalImage),
53
+ totalCount: data.total_count
54
+ };
71
55
  };
72
56
  const unmarshalListNamespacesResponse = (data) => {
73
- if (!isJSONObject(data)) {
74
- throw new TypeError(
75
- `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`
76
- );
77
- }
78
- return {
79
- namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
80
- totalCount: data.total_count
81
- };
57
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
58
+ return {
59
+ namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
60
+ totalCount: data.total_count
61
+ };
82
62
  };
83
63
  const unmarshalListTagsResponse = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
86
- `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`
87
- );
88
- }
89
- return {
90
- tags: unmarshalArrayOfObject(data.tags, unmarshalTag),
91
- totalCount: data.total_count
92
- };
64
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);
65
+ return {
66
+ tags: unmarshalArrayOfObject(data.tags, unmarshalTag),
67
+ totalCount: data.total_count
68
+ };
93
69
  };
94
70
  const marshalCreateNamespaceRequest = (request, defaults) => ({
95
- description: request.description,
96
- is_public: request.isPublic,
97
- name: request.name || randomName("ns"),
98
- ...resolveOneOf([
99
- {
100
- default: defaults.defaultProjectId,
101
- param: "project_id",
102
- value: request.projectId
103
- },
104
- {
105
- default: defaults.defaultOrganizationId,
106
- param: "organization_id",
107
- value: request.organizationId
108
- }
109
- ])
110
- });
111
- const marshalUpdateImageRequest = (request, defaults) => ({
112
- visibility: request.visibility
71
+ description: request.description,
72
+ is_public: request.isPublic,
73
+ name: request.name || randomName("ns"),
74
+ ...resolveOneOf([{
75
+ default: defaults.defaultProjectId,
76
+ param: "project_id",
77
+ value: request.projectId
78
+ }, {
79
+ default: defaults.defaultOrganizationId,
80
+ param: "organization_id",
81
+ value: request.organizationId
82
+ }])
113
83
  });
84
+ const marshalUpdateImageRequest = (request, defaults) => ({ visibility: request.visibility });
114
85
  const marshalUpdateNamespaceRequest = (request, defaults) => ({
115
- description: request.description,
116
- is_public: request.isPublic
86
+ description: request.description,
87
+ is_public: request.isPublic
117
88
  });
118
- export {
119
- marshalCreateNamespaceRequest,
120
- marshalUpdateImageRequest,
121
- marshalUpdateNamespaceRequest,
122
- unmarshalImage,
123
- unmarshalListImagesResponse,
124
- unmarshalListNamespacesResponse,
125
- unmarshalListTagsResponse,
126
- unmarshalNamespace,
127
- unmarshalTag
128
- };
89
+ export { marshalCreateNamespaceRequest, marshalUpdateImageRequest, marshalUpdateNamespaceRequest, unmarshalImage, unmarshalListImagesResponse, unmarshalListNamespacesResponse, unmarshalListTagsResponse, unmarshalNamespace, unmarshalTag };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-registry",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK registry",
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.0"
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",