@scaleway/sdk-registry 2.2.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1/api.gen.js +177 -257
- package/dist/v1/content.gen.js +7 -14
- package/dist/v1/index.gen.js +18 -16
- package/dist/v1/marshalling.gen.js +72 -111
- package/package.json +4 -4
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
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,258 +1,178 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
unmarshalImage
|
|
179
|
-
);
|
|
180
|
-
/**
|
|
181
|
-
* 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.
|
|
182
|
-
*
|
|
183
|
-
* @param request - The request {@link DeleteImageRequest}
|
|
184
|
-
* @returns A Promise of Image
|
|
185
|
-
*/
|
|
186
|
-
deleteImage = (request) => this.client.fetch(
|
|
187
|
-
{
|
|
188
|
-
method: "DELETE",
|
|
189
|
-
path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}`
|
|
190
|
-
},
|
|
191
|
-
unmarshalImage
|
|
192
|
-
);
|
|
193
|
-
pageOfListTags = (request) => this.client.fetch(
|
|
194
|
-
{
|
|
195
|
-
method: "GET",
|
|
196
|
-
path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam("imageId", request.imageId)}/tags`,
|
|
197
|
-
urlParams: urlParams(
|
|
198
|
-
["name", request.name],
|
|
199
|
-
["order_by", request.orderBy],
|
|
200
|
-
["page", request.page],
|
|
201
|
-
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
202
|
-
)
|
|
203
|
-
},
|
|
204
|
-
unmarshalListTagsResponse
|
|
205
|
-
);
|
|
206
|
-
/**
|
|
207
|
-
* 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`.
|
|
208
|
-
*
|
|
209
|
-
* @param request - The request {@link ListTagsRequest}
|
|
210
|
-
* @returns A Promise of ListTagsResponse
|
|
211
|
-
*/
|
|
212
|
-
listTags = (request) => enrichForPagination("tags", this.pageOfListTags, request);
|
|
213
|
-
/**
|
|
214
|
-
* 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.
|
|
215
|
-
*
|
|
216
|
-
* @param request - The request {@link GetTagRequest}
|
|
217
|
-
* @returns A Promise of Tag
|
|
218
|
-
*/
|
|
219
|
-
getTag = (request) => this.client.fetch(
|
|
220
|
-
{
|
|
221
|
-
method: "GET",
|
|
222
|
-
path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`
|
|
223
|
-
},
|
|
224
|
-
unmarshalTag
|
|
225
|
-
);
|
|
226
|
-
/**
|
|
227
|
-
* Waits for {@link Tag} to be in a final state.
|
|
228
|
-
*
|
|
229
|
-
* @param request - The request {@link GetTagRequest}
|
|
230
|
-
* @param options - The waiting options
|
|
231
|
-
* @returns A Promise of Tag
|
|
232
|
-
*/
|
|
233
|
-
waitForTag = (request, options) => waitForResource(
|
|
234
|
-
options?.stop ?? ((res) => Promise.resolve(!TAG_TRANSIENT_STATUSES.includes(res.status))),
|
|
235
|
-
this.getTag,
|
|
236
|
-
request,
|
|
237
|
-
options
|
|
238
|
-
);
|
|
239
|
-
/**
|
|
240
|
-
* 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.
|
|
241
|
-
*
|
|
242
|
-
* @param request - The request {@link DeleteTagRequest}
|
|
243
|
-
* @returns A Promise of Tag
|
|
244
|
-
*/
|
|
245
|
-
deleteTag = (request) => this.client.fetch(
|
|
246
|
-
{
|
|
247
|
-
method: "DELETE",
|
|
248
|
-
path: `/registry/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam("tagId", request.tagId)}`,
|
|
249
|
-
urlParams: urlParams(
|
|
250
|
-
["force", request.force]
|
|
251
|
-
)
|
|
252
|
-
},
|
|
253
|
-
unmarshalTag
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
export {
|
|
257
|
-
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);
|
|
258
177
|
};
|
|
178
|
+
export { API$1 as API };
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const NAMESPACE_TRANSIENT_STATUSES = [
|
|
5
|
-
|
|
6
|
-
];
|
|
7
|
-
|
|
8
|
-
"deleting"
|
|
9
|
-
];
|
|
10
|
-
export {
|
|
11
|
-
IMAGE_TRANSIENT_STATUSES,
|
|
12
|
-
NAMESPACE_TRANSIENT_STATUSES,
|
|
13
|
-
TAG_TRANSIENT_STATUSES
|
|
14
|
-
};
|
|
1
|
+
/** Lists transient statutes of the enum {@link ImageStatus}. */
|
|
2
|
+
const IMAGE_TRANSIENT_STATUSES = ["deleting"];
|
|
3
|
+
/** Lists transient statutes of the enum {@link NamespaceStatus}. */
|
|
4
|
+
const NAMESPACE_TRANSIENT_STATUSES = ["deleting"];
|
|
5
|
+
/** Lists transient statutes of the enum {@link TagStatus}. */
|
|
6
|
+
const TAG_TRANSIENT_STATUSES = ["deleting"];
|
|
7
|
+
export { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES };
|
package/dist/v1/index.gen.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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.
|
|
3
|
+
"version": "2.3.1",
|
|
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.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.1
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.1
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|