@scaleway/sdk 3.0.0-alpha.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.gen.d.ts +362 -0
- package/dist/index.gen.js +323 -0
- package/package.json +71 -25
- package/README.md +0 -46
- package/dist/api/account/index.js +0 -4
- package/dist/api/account/v2/api.gen.js +0 -147
- package/dist/api/account/v2/index.gen.js +0 -4
- package/dist/api/account/v2/marshalling.gen.js +0 -39
- package/dist/api/account/v3/api.gen.js +0 -129
- package/dist/api/account/v3/index.gen.js +0 -6
- package/dist/api/account/v3/marshalling.gen.js +0 -39
- package/dist/api/account/v3/validation-rules.gen.js +0 -39
- package/dist/api/applesilicon/index.js +0 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
- package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
- package/dist/api/baremetal/index.js +0 -2
- package/dist/api/baremetal/v1/api.gen.js +0 -523
- package/dist/api/baremetal/v1/api.utils.js +0 -27
- package/dist/api/baremetal/v1/content.gen.js +0 -13
- package/dist/api/baremetal/v1/index.js +0 -5
- package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
- package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
- package/dist/api/billing/index.js +0 -2
- package/dist/api/billing/v2alpha1/api.gen.js +0 -80
- package/dist/api/billing/v2alpha1/index.gen.js +0 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
- package/dist/api/block/index.js +0 -2
- package/dist/api/block/v1alpha1/api.gen.js +0 -245
- package/dist/api/block/v1alpha1/content.gen.js +0 -13
- package/dist/api/block/v1alpha1/index.gen.js +0 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
- package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
- package/dist/api/cockpit/index.js +0 -2
- package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
- package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
- package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
- package/dist/api/container/index.js +0 -2
- package/dist/api/container/v1beta1/api.gen.js +0 -549
- package/dist/api/container/v1beta1/content.gen.js +0 -22
- package/dist/api/container/v1beta1/index.gen.js +0 -5
- package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
- package/dist/api/document_db/index.js +0 -2
- package/dist/api/document_db/v1beta1/api.gen.js +0 -830
- package/dist/api/document_db/v1beta1/content.gen.js +0 -19
- package/dist/api/document_db/v1beta1/index.gen.js +0 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
- package/dist/api/domain/index.js +0 -2
- package/dist/api/domain/v2beta1/api.gen.js +0 -875
- package/dist/api/domain/v2beta1/content.gen.js +0 -28
- package/dist/api/domain/v2beta1/index.gen.js +0 -7
- package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
- package/dist/api/flexibleip/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
- package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
- package/dist/api/function/index.js +0 -2
- package/dist/api/function/v1beta1/api.gen.js +0 -560
- package/dist/api/function/v1beta1/content.gen.js +0 -22
- package/dist/api/function/v1beta1/index.gen.js +0 -5
- package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
- package/dist/api/iam/index.js +0 -2
- package/dist/api/iam/v1alpha1/api.gen.js +0 -799
- package/dist/api/iam/v1alpha1/index.gen.js +0 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
- package/dist/api/instance/index.js +0 -2
- package/dist/api/instance/v1/api.gen.js +0 -1003
- package/dist/api/instance/v1/api.utils.js +0 -369
- package/dist/api/instance/v1/content.gen.js +0 -31
- package/dist/api/instance/v1/index.js +0 -2
- package/dist/api/instance/v1/marshalling.gen.js +0 -1206
- package/dist/api/instance/v1/marshalling.utils.js +0 -63
- package/dist/api/iot/index.js +0 -2
- package/dist/api/iot/v1/api.gen.js +0 -581
- package/dist/api/iot/v1/content.gen.js +0 -7
- package/dist/api/iot/v1/index.gen.js +0 -5
- package/dist/api/iot/v1/marshalling.gen.js +0 -388
- package/dist/api/ipfs/index.js +0 -2
- package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
- package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
- package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/k8s/index.js +0 -2
- package/dist/api/k8s/v1/api.gen.js +0 -454
- package/dist/api/k8s/v1/api.utils.js +0 -13
- package/dist/api/k8s/v1/content.gen.js +0 -13
- package/dist/api/k8s/v1/index.js +0 -4
- package/dist/api/k8s/v1/marshalling.gen.js +0 -333
- package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
- package/dist/api/lb/index.js +0 -2
- package/dist/api/lb/v1/api.gen.js +0 -1669
- package/dist/api/lb/v1/api.utils.js +0 -81
- package/dist/api/lb/v1/content.gen.js +0 -16
- package/dist/api/lb/v1/index.js +0 -2
- package/dist/api/lb/v1/marshalling.gen.js +0 -923
- package/dist/api/marketplace/index.js +0 -4
- package/dist/api/marketplace/v1/api.gen.js +0 -60
- package/dist/api/marketplace/v1/index.gen.js +0 -4
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
- package/dist/api/marketplace/v2/api.gen.js +0 -162
- package/dist/api/marketplace/v2/index.gen.js +0 -4
- package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
- package/dist/api/mnq/index.js +0 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
- package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
- package/dist/api/rdb/index.js +0 -2
- package/dist/api/rdb/v1/api.gen.js +0 -972
- package/dist/api/rdb/v1/content.gen.js +0 -22
- package/dist/api/rdb/v1/index.gen.js +0 -7
- package/dist/api/rdb/v1/marshalling.gen.js +0 -636
- package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
- package/dist/api/redis/index.js +0 -2
- package/dist/api/redis/v1/api.gen.js +0 -389
- package/dist/api/redis/v1/content.gen.js +0 -7
- package/dist/api/redis/v1/index.gen.js +0 -5
- package/dist/api/redis/v1/marshalling.gen.js +0 -259
- package/dist/api/registry/index.js +0 -2
- package/dist/api/registry/v1/api.gen.js +0 -252
- package/dist/api/registry/v1/content.gen.js +0 -13
- package/dist/api/registry/v1/index.gen.js +0 -5
- package/dist/api/registry/v1/marshalling.gen.js +0 -106
- package/dist/api/secret/index.js +0 -2
- package/dist/api/secret/v1alpha1/api.gen.js +0 -415
- package/dist/api/secret/v1alpha1/index.gen.js +0 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
- package/dist/api/tem/index.js +0 -2
- package/dist/api/tem/v1alpha1/api.gen.js +0 -229
- package/dist/api/tem/v1alpha1/content.gen.js +0 -10
- package/dist/api/tem/v1alpha1/index.gen.js +0 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
- package/dist/api/test/index.js +0 -2
- package/dist/api/test/v1/api.gen.js +0 -152
- package/dist/api/test/v1/content.gen.js +0 -7
- package/dist/api/test/v1/index.gen.js +0 -5
- package/dist/api/test/v1/marshalling.gen.js +0 -79
- package/dist/api/vpc/index.js +0 -4
- package/dist/api/vpc/v1/api.gen.js +0 -110
- package/dist/api/vpc/v1/index.gen.js +0 -4
- package/dist/api/vpc/v1/marshalling.gen.js +0 -44
- package/dist/api/vpc/v2/api.gen.js +0 -276
- package/dist/api/vpc/v2/index.gen.js +0 -4
- package/dist/api/vpc/v2/marshalling.gen.js +0 -135
- package/dist/api/vpcgw/index.js +0 -2
- package/dist/api/vpcgw/v1/api.gen.js +0 -669
- package/dist/api/vpcgw/v1/content.gen.js +0 -10
- package/dist/api/vpcgw/v1/index.gen.js +0 -5
- package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
- package/dist/api/webhosting/index.js +0 -2
- package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
- package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
- package/dist/helpers/is-browser.js +0 -5
- package/dist/helpers/is-response.js +0 -10
- package/dist/helpers/json.js +0 -11
- package/dist/helpers/marshalling.js +0 -130
- package/dist/index.cjs +0 -24364
- package/dist/index.d.ts +0 -27584
- package/dist/index.js +0 -69
- package/dist/internal/async/interval-retrier.js +0 -105
- package/dist/internal/async/sleep.js +0 -13
- package/dist/internal/interceptors/composer.js +0 -46
- package/dist/internal/interceptors/helpers.js +0 -32
- package/dist/internal/logger/console-logger.js +0 -38
- package/dist/internal/logger/index.js +0 -41
- package/dist/internal/logger/level-resolver.js +0 -13
- package/dist/internal/validations/string-validation.js +0 -38
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/dist/scw/api.js +0 -12
- package/dist/scw/auth.js +0 -68
- package/dist/scw/client-ini-factory.js +0 -174
- package/dist/scw/client-ini-profile.js +0 -54
- package/dist/scw/client-settings.js +0 -78
- package/dist/scw/client.js +0 -98
- package/dist/scw/constants.js +0 -4
- package/dist/scw/custom-marshalling.js +0 -131
- package/dist/scw/errors/error-parser.js +0 -107
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
- package/dist/scw/errors/scw-error.js +0 -66
- package/dist/scw/errors/standard/already-exists-error.js +0 -26
- package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
- package/dist/scw/errors/standard/index.js +0 -13
- package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
- package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
- package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
- package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
- package/dist/scw/errors/standard/resource-expired-error.js +0 -26
- package/dist/scw/errors/standard/resource-locked-error.js +0 -25
- package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
- package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
- package/dist/scw/errors/standard/transient-state-error.js +0 -26
- package/dist/scw/errors/types.js +0 -23
- package/dist/scw/fetch/build-fetcher.js +0 -72
- package/dist/scw/fetch/http-dumper.js +0 -54
- package/dist/scw/fetch/http-interceptors.js +0 -99
- package/dist/scw/fetch/resource-paginator.js +0 -84
- package/dist/scw/fetch/response-parser.js +0 -72
- package/node_modules/@scaleway/random-name/.npmignore +0 -4
- package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
- package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
- package/node_modules/@scaleway/random-name/README.md +0 -26
- package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
- package/node_modules/@scaleway/random-name/dist/index.js +0 -13
- package/node_modules/@scaleway/random-name/package.json +0 -23
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API as API$1 } from '../../../scw/api.js';
|
|
3
|
-
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
|
-
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
|
-
import { NAMESPACE_TRANSIENT_STATUSES, IMAGE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListImagesResponse, unmarshalImage, marshalUpdateImageRequest, unmarshalListTagsResponse, unmarshalTag } from './marshalling.gen.js';
|
|
7
|
-
|
|
8
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
9
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
10
|
-
const jsonContentHeaders = {
|
|
11
|
-
'Content-Type': 'application/json; charset=utf-8'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Container Registry API. */
|
|
15
|
-
class API extends API$1 {
|
|
16
|
-
/** Lists the available regions of the API. */
|
|
17
|
-
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
18
|
-
pageOfListNamespaces = (() => {
|
|
19
|
-
var _this = this;
|
|
20
|
-
return function (request) {
|
|
21
|
-
if (request === void 0) {
|
|
22
|
-
request = {};
|
|
23
|
-
}
|
|
24
|
-
return _this.client.fetch({
|
|
25
|
-
method: 'GET',
|
|
26
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
|
|
27
|
-
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])
|
|
28
|
-
}, unmarshalListNamespacesResponse);
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* List namespaces. List all namespaces in a specified region. By default, the
|
|
34
|
-
* namespaces listed are ordered by creation date in ascending order. This can
|
|
35
|
-
* be modified via the order_by field. You can also define additional
|
|
36
|
-
* parameters for your query, such as the `instance_id` and `project_id`
|
|
37
|
-
* parameters.
|
|
38
|
-
*
|
|
39
|
-
* @param request - The request {@link ListNamespacesRequest}
|
|
40
|
-
* @returns A Promise of ListNamespacesResponse
|
|
41
|
-
*/
|
|
42
|
-
listNamespaces = (() => {
|
|
43
|
-
var _this2 = this;
|
|
44
|
-
return function (request) {
|
|
45
|
-
if (request === void 0) {
|
|
46
|
-
request = {};
|
|
47
|
-
}
|
|
48
|
-
return enrichForPagination('namespaces', _this2.pageOfListNamespaces, request);
|
|
49
|
-
};
|
|
50
|
-
})();
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Get a namespace. Retrieve information about a given namespace, specified by
|
|
54
|
-
* its `namespace_id` and region. Full details about the namespace, such as
|
|
55
|
-
* `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and
|
|
56
|
-
* `image_count` are returned in the response.
|
|
57
|
-
*
|
|
58
|
-
* @param request - The request {@link GetNamespaceRequest}
|
|
59
|
-
* @returns A Promise of Namespace
|
|
60
|
-
*/
|
|
61
|
-
getNamespace = request => this.client.fetch({
|
|
62
|
-
method: 'GET',
|
|
63
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
|
|
64
|
-
}, unmarshalNamespace);
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Waits for {@link Namespace} to be in a final state.
|
|
68
|
-
*
|
|
69
|
-
* @param request - The request {@link GetNamespaceRequest}
|
|
70
|
-
* @param options - The waiting options
|
|
71
|
-
* @returns A Promise of Namespace
|
|
72
|
-
*/
|
|
73
|
-
waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Create a namespace. Create a new Container Registry namespace. You must
|
|
77
|
-
* specify the namespace name and region in which you want it to be created.
|
|
78
|
-
* Optionally, you can specify the `project_id` and `is_public` in the request
|
|
79
|
-
* payload.
|
|
80
|
-
*
|
|
81
|
-
* @param request - The request {@link CreateNamespaceRequest}
|
|
82
|
-
* @returns A Promise of Namespace
|
|
83
|
-
*/
|
|
84
|
-
createNamespace = request => this.client.fetch({
|
|
85
|
-
body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
|
|
86
|
-
headers: jsonContentHeaders,
|
|
87
|
-
method: 'POST',
|
|
88
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`
|
|
89
|
-
}, unmarshalNamespace);
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Update a namespace. Update the parameters of a given namespace, specified
|
|
93
|
-
* by its `namespace_id` and `region`. You can update the `description` and
|
|
94
|
-
* `is_public` parameters.
|
|
95
|
-
*
|
|
96
|
-
* @param request - The request {@link UpdateNamespaceRequest}
|
|
97
|
-
* @returns A Promise of Namespace
|
|
98
|
-
*/
|
|
99
|
-
updateNamespace = request => this.client.fetch({
|
|
100
|
-
body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
|
|
101
|
-
headers: jsonContentHeaders,
|
|
102
|
-
method: 'PATCH',
|
|
103
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
|
|
104
|
-
}, unmarshalNamespace);
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Delete a namespace. Delete a given namespace. You must specify, in the
|
|
108
|
-
* endpoint, the `region` and `namespace_id` parameters of the namespace you
|
|
109
|
-
* want to delete.
|
|
110
|
-
*
|
|
111
|
-
* @param request - The request {@link DeleteNamespaceRequest}
|
|
112
|
-
* @returns A Promise of Namespace
|
|
113
|
-
*/
|
|
114
|
-
deleteNamespace = request => this.client.fetch({
|
|
115
|
-
method: 'DELETE',
|
|
116
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
|
|
117
|
-
}, unmarshalNamespace);
|
|
118
|
-
pageOfListImages = (() => {
|
|
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: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/images`,
|
|
127
|
-
urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
128
|
-
}, unmarshalListImagesResponse);
|
|
129
|
-
};
|
|
130
|
-
})();
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* List images. List all images in a specified region. By default, the images
|
|
134
|
-
* listed are ordered by creation date in ascending order. This can be
|
|
135
|
-
* modified via the order_by field. You can also define additional parameters
|
|
136
|
-
* for your query, such as the `namespace_id` and `project_id` parameters.
|
|
137
|
-
*
|
|
138
|
-
* @param request - The request {@link ListImagesRequest}
|
|
139
|
-
* @returns A Promise of ListImagesResponse
|
|
140
|
-
*/
|
|
141
|
-
listImages = (() => {
|
|
142
|
-
var _this4 = this;
|
|
143
|
-
return function (request) {
|
|
144
|
-
if (request === void 0) {
|
|
145
|
-
request = {};
|
|
146
|
-
}
|
|
147
|
-
return enrichForPagination('images', _this4.pageOfListImages, request);
|
|
148
|
-
};
|
|
149
|
-
})();
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Get an image. Retrieve information about a given container image, specified
|
|
153
|
-
* by its `image_id` and region. Full details about the image, such as `name`,
|
|
154
|
-
* `namespace_id`, `status`, `visibility`, and `size` are returned in the
|
|
155
|
-
* response.
|
|
156
|
-
*
|
|
157
|
-
* @param request - The request {@link GetImageRequest}
|
|
158
|
-
* @returns A Promise of Image
|
|
159
|
-
*/
|
|
160
|
-
getImage = request => this.client.fetch({
|
|
161
|
-
method: 'GET',
|
|
162
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`
|
|
163
|
-
}, unmarshalImage);
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Waits for {@link Image} to be in a final state.
|
|
167
|
-
*
|
|
168
|
-
* @param request - The request {@link GetImageRequest}
|
|
169
|
-
* @param options - The waiting options
|
|
170
|
-
* @returns A Promise of Image
|
|
171
|
-
*/
|
|
172
|
-
waitForImage = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!IMAGE_TRANSIENT_STATUSES.includes(res.status))), this.getImage, request, options);
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Update an image. Update the parameters of a given image, specified by its
|
|
176
|
-
* `image_id` and `region`. You can update the `visibility` parameter.
|
|
177
|
-
*
|
|
178
|
-
* @param request - The request {@link UpdateImageRequest}
|
|
179
|
-
* @returns A Promise of Image
|
|
180
|
-
*/
|
|
181
|
-
updateImage = request => this.client.fetch({
|
|
182
|
-
body: JSON.stringify(marshalUpdateImageRequest(request, this.client.settings)),
|
|
183
|
-
headers: jsonContentHeaders,
|
|
184
|
-
method: 'PATCH',
|
|
185
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`
|
|
186
|
-
}, unmarshalImage);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Delete an image. Delete a given image. You must specify, in the endpoint,
|
|
190
|
-
* the `region` and `image_id` parameters of the image you want to delete.
|
|
191
|
-
*
|
|
192
|
-
* @param request - The request {@link DeleteImageRequest}
|
|
193
|
-
* @returns A Promise of Image
|
|
194
|
-
*/
|
|
195
|
-
deleteImage = request => this.client.fetch({
|
|
196
|
-
method: 'DELETE',
|
|
197
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`
|
|
198
|
-
}, unmarshalImage);
|
|
199
|
-
pageOfListTags = request => this.client.fetch({
|
|
200
|
-
method: 'GET',
|
|
201
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}/tags`,
|
|
202
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
203
|
-
}, unmarshalListTagsResponse);
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* List tags. List all tags for a given image, specified by region. By
|
|
207
|
-
* default, the tags listed are ordered by creation date in ascending order.
|
|
208
|
-
* This can be modified via the order_by field. You can also define additional
|
|
209
|
-
* parameters for your query, such as the `name`.
|
|
210
|
-
*
|
|
211
|
-
* @param request - The request {@link ListTagsRequest}
|
|
212
|
-
* @returns A Promise of ListTagsResponse
|
|
213
|
-
*/
|
|
214
|
-
listTags = request => enrichForPagination('tags', this.pageOfListTags, request);
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Get a tag. Retrieve information about a given image tag, specified by its
|
|
218
|
-
* `tag_id` and region. Full details about the tag, such as `name`,
|
|
219
|
-
* `image_id`, `status`, and `digest` are returned in the response.
|
|
220
|
-
*
|
|
221
|
-
* @param request - The request {@link GetTagRequest}
|
|
222
|
-
* @returns A Promise of Tag
|
|
223
|
-
*/
|
|
224
|
-
getTag = request => this.client.fetch({
|
|
225
|
-
method: 'GET',
|
|
226
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`
|
|
227
|
-
}, unmarshalTag);
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Waits for {@link Tag} to be in a final state.
|
|
231
|
-
*
|
|
232
|
-
* @param request - The request {@link GetTagRequest}
|
|
233
|
-
* @param options - The waiting options
|
|
234
|
-
* @returns A Promise of Tag
|
|
235
|
-
*/
|
|
236
|
-
waitForTag = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TAG_TRANSIENT_STATUSES.includes(res.status))), this.getTag, request, options);
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Delete a tag. Delete a given image tag. You must specify, in the endpoint,
|
|
240
|
-
* 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
|
-
method: 'DELETE',
|
|
247
|
-
path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`,
|
|
248
|
-
urlParams: urlParams(['force', request.force])
|
|
249
|
-
}, unmarshalTag);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export { API };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
-
|
|
4
|
-
/** Lists transient statutes of the enum {@link ImageStatus}. */
|
|
5
|
-
const IMAGE_TRANSIENT_STATUSES = ['deleting'];
|
|
6
|
-
|
|
7
|
-
/** Lists transient statutes of the enum {@link NamespaceStatus}. */
|
|
8
|
-
const NAMESPACE_TRANSIENT_STATUSES = ['deleting'];
|
|
9
|
-
|
|
10
|
-
/** Lists transient statutes of the enum {@link TagStatus}. */
|
|
11
|
-
const TAG_TRANSIENT_STATUSES = ['deleting'];
|
|
12
|
-
|
|
13
|
-
export { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
2
|
-
export { IMAGE_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TAG_TRANSIENT_STATUSES } from './content.gen.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.
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
-
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
-
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
4
|
-
|
|
5
|
-
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
-
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
-
const unmarshalImage = data => {
|
|
8
|
-
if (!isJSONObject(data)) {
|
|
9
|
-
throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
createdAt: unmarshalDate(data.created_at),
|
|
13
|
-
id: data.id,
|
|
14
|
-
name: data.name,
|
|
15
|
-
namespaceId: data.namespace_id,
|
|
16
|
-
size: data.size,
|
|
17
|
-
status: data.status,
|
|
18
|
-
statusMessage: data.status_message ? data.status_message : undefined,
|
|
19
|
-
tags: data.tags,
|
|
20
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
21
|
-
visibility: data.visibility
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
const unmarshalNamespace = data => {
|
|
25
|
-
if (!isJSONObject(data)) {
|
|
26
|
-
throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
|
|
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
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const unmarshalTag = data => {
|
|
46
|
-
if (!isJSONObject(data)) {
|
|
47
|
-
throw new TypeError(`Unmarshalling the type 'Tag' failed as data isn't a dictionary.`);
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
createdAt: unmarshalDate(data.created_at),
|
|
51
|
-
digest: data.digest,
|
|
52
|
-
id: data.id,
|
|
53
|
-
imageId: data.image_id,
|
|
54
|
-
name: data.name,
|
|
55
|
-
status: data.status,
|
|
56
|
-
updatedAt: unmarshalDate(data.updated_at)
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
const unmarshalListImagesResponse = data => {
|
|
60
|
-
if (!isJSONObject(data)) {
|
|
61
|
-
throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
images: unmarshalArrayOfObject(data.images, unmarshalImage),
|
|
65
|
-
totalCount: data.total_count
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const unmarshalListNamespacesResponse = data => {
|
|
69
|
-
if (!isJSONObject(data)) {
|
|
70
|
-
throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
|
|
74
|
-
totalCount: data.total_count
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
const unmarshalListTagsResponse = data => {
|
|
78
|
-
if (!isJSONObject(data)) {
|
|
79
|
-
throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
tags: unmarshalArrayOfObject(data.tags, unmarshalTag),
|
|
83
|
-
totalCount: data.total_count
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
87
|
-
description: request.description,
|
|
88
|
-
is_public: request.isPublic,
|
|
89
|
-
name: request.name || randomName('ns'),
|
|
90
|
-
...resolveOneOf([{
|
|
91
|
-
param: 'organization_id',
|
|
92
|
-
value: request.organizationId
|
|
93
|
-
}, {
|
|
94
|
-
param: 'project_id',
|
|
95
|
-
value: request.projectId
|
|
96
|
-
}])
|
|
97
|
-
});
|
|
98
|
-
const marshalUpdateImageRequest = (request, defaults) => ({
|
|
99
|
-
visibility: request.visibility
|
|
100
|
-
});
|
|
101
|
-
const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
102
|
-
description: request.description,
|
|
103
|
-
is_public: request.isPublic
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
export { marshalCreateNamespaceRequest, marshalUpdateImageRequest, marshalUpdateNamespaceRequest, unmarshalImage, unmarshalListImagesResponse, unmarshalListNamespacesResponse, unmarshalListTagsResponse, unmarshalNamespace, unmarshalTag };
|
package/dist/api/secret/index.js
DELETED