@scaleway/sdk 2.29.0 → 2.30.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/dist/api/baremetal/v1/marshalling.gen.cjs +1 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +1 -0
- package/dist/api/baremetal/v1/types.gen.d.ts +5 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/key_manager/index.cjs +4 -0
- package/dist/api/key_manager/index.d.ts +1 -0
- package/dist/api/key_manager/index.js +4 -0
- package/dist/api/key_manager/v1alpha1/api.gen.cjs +257 -0
- package/dist/api/key_manager/v1alpha1/api.gen.d.ts +142 -0
- package/dist/api/key_manager/v1alpha1/api.gen.js +257 -0
- package/dist/api/key_manager/v1alpha1/index.gen.cjs +4 -0
- package/dist/api/key_manager/v1alpha1/index.gen.d.ts +2 -0
- package/dist/api/key_manager/v1alpha1/index.gen.js +4 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.cjs +143 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.d.ts +12 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.js +143 -0
- package/dist/api/key_manager/v1alpha1/types.gen.d.ts +268 -0
- package/dist/api/llm_inference/v1beta1/api.gen.cjs +1 -1
- package/dist/api/llm_inference/v1beta1/api.gen.d.ts +3 -3
- package/dist/api/llm_inference/v1beta1/api.gen.js +1 -1
- package/dist/api/llm_inference/v1beta1/types.gen.d.ts +4 -4
- package/dist/index.cjs +30 -28
- package/dist/index.js +30 -28
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -143,6 +143,7 @@ const unmarshalOffer = (data) => {
|
|
|
143
143
|
fee: data.fee ? customMarshalling.unmarshalMoney(data.fee) : void 0,
|
|
144
144
|
id: data.id,
|
|
145
145
|
incompatibleOsIds: data.incompatible_os_ids,
|
|
146
|
+
maxBandwidth: data.max_bandwidth,
|
|
146
147
|
memories: marshalling.unmarshalArrayOfObject(data.memories, unmarshalMemory),
|
|
147
148
|
name: data.name,
|
|
148
149
|
operationPath: data.operation_path,
|
|
@@ -141,6 +141,7 @@ const unmarshalOffer = (data) => {
|
|
|
141
141
|
fee: data.fee ? unmarshalMoney(data.fee) : void 0,
|
|
142
142
|
id: data.id,
|
|
143
143
|
incompatibleOsIds: data.incompatible_os_ids,
|
|
144
|
+
maxBandwidth: data.max_bandwidth,
|
|
144
145
|
memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),
|
|
145
146
|
name: data.name,
|
|
146
147
|
operationPath: data.operation_path,
|
|
@@ -183,6 +183,11 @@ export interface Offer {
|
|
|
183
183
|
stock: OfferStock;
|
|
184
184
|
/** Public bandwidth available (in bits/s) with the offer. */
|
|
185
185
|
bandwidth: number;
|
|
186
|
+
/**
|
|
187
|
+
* Maximum public bandwidth available (in bits/s) depending on available
|
|
188
|
+
* options.
|
|
189
|
+
*/
|
|
190
|
+
maxBandwidth: number;
|
|
186
191
|
/** Commercial range of the offer. */
|
|
187
192
|
commercialRange: string;
|
|
188
193
|
/**
|
package/dist/api/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * as IPAM from './ipam';
|
|
|
17
17
|
export * as IPFS from './ipfs';
|
|
18
18
|
export * as Jobs from './jobs';
|
|
19
19
|
export * as K8S from './k8s';
|
|
20
|
+
export * as KeyManager from './key_manager';
|
|
20
21
|
export * as LB from './lb';
|
|
21
22
|
export * as LLMInference from './llm_inference';
|
|
22
23
|
export * as Marketplace from './marketplace';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as v1alpha1 from './v1alpha1/index.gen';
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api = require("../../../scw/api.cjs");
|
|
4
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
6
|
+
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
7
|
+
const jsonContentHeaders = {
|
|
8
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
9
|
+
};
|
|
10
|
+
class API extends api.API {
|
|
11
|
+
/** Lists the available regions of the API. */
|
|
12
|
+
static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
|
|
13
|
+
/**
|
|
14
|
+
* Create a key. Create a key in a given region specified by the `region`
|
|
15
|
+
* parameter. Keys only support symmetric encryption. You can use keys to
|
|
16
|
+
* encrypt or decrypt arbitrary payloads, or to generate data encryption keys
|
|
17
|
+
* that can be used without being stored in Key Manager.
|
|
18
|
+
*
|
|
19
|
+
* @param request - The request {@link CreateKeyRequest}
|
|
20
|
+
* @returns A Promise of Key
|
|
21
|
+
*/
|
|
22
|
+
createKey = (request) => this.client.fetch(
|
|
23
|
+
{
|
|
24
|
+
body: JSON.stringify(
|
|
25
|
+
marshalling_gen.marshalCreateKeyRequest(request, this.client.settings)
|
|
26
|
+
),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`
|
|
30
|
+
},
|
|
31
|
+
marshalling_gen.unmarshalKey
|
|
32
|
+
);
|
|
33
|
+
/**
|
|
34
|
+
* Get key metadata. Retrieve the metadata of a key specified by the `region`
|
|
35
|
+
* and `key_id` parameters.
|
|
36
|
+
*
|
|
37
|
+
* @param request - The request {@link GetKeyRequest}
|
|
38
|
+
* @returns A Promise of Key
|
|
39
|
+
*/
|
|
40
|
+
getKey = (request) => this.client.fetch(
|
|
41
|
+
{
|
|
42
|
+
method: "GET",
|
|
43
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}`
|
|
44
|
+
},
|
|
45
|
+
marshalling_gen.unmarshalKey
|
|
46
|
+
);
|
|
47
|
+
/**
|
|
48
|
+
* Update a key. Update a key's metadata (name, description and tags),
|
|
49
|
+
* specified by the `key_id` and `region` parameters.
|
|
50
|
+
*
|
|
51
|
+
* @param request - The request {@link UpdateKeyRequest}
|
|
52
|
+
* @returns A Promise of Key
|
|
53
|
+
*/
|
|
54
|
+
updateKey = (request) => this.client.fetch(
|
|
55
|
+
{
|
|
56
|
+
body: JSON.stringify(
|
|
57
|
+
marshalling_gen.marshalUpdateKeyRequest(request, this.client.settings)
|
|
58
|
+
),
|
|
59
|
+
headers: jsonContentHeaders,
|
|
60
|
+
method: "PATCH",
|
|
61
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}`
|
|
62
|
+
},
|
|
63
|
+
marshalling_gen.unmarshalKey
|
|
64
|
+
);
|
|
65
|
+
/**
|
|
66
|
+
* Delete a key. Delete an existing key specified by the `region` and `key_id`
|
|
67
|
+
* parameters. Deleting a key is permanent and cannot be undone. All data
|
|
68
|
+
* encrypted using this key, including data encryption keys, will become
|
|
69
|
+
* unusable.
|
|
70
|
+
*
|
|
71
|
+
* @param request - The request {@link DeleteKeyRequest}
|
|
72
|
+
*/
|
|
73
|
+
deleteKey = (request) => this.client.fetch({
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}`
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Rotate a key. Generate a new version of an existing key with randomly
|
|
79
|
+
* generated key material. Rotated keys can still be used to decrypt
|
|
80
|
+
* previously encrypted data. The key's new material will be used for
|
|
81
|
+
* subsequent encryption operations and data key generation.
|
|
82
|
+
*
|
|
83
|
+
* @param request - The request {@link RotateKeyRequest}
|
|
84
|
+
* @returns A Promise of Key
|
|
85
|
+
*/
|
|
86
|
+
rotateKey = (request) => this.client.fetch(
|
|
87
|
+
{
|
|
88
|
+
body: "{}",
|
|
89
|
+
headers: jsonContentHeaders,
|
|
90
|
+
method: "POST",
|
|
91
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/rotate`
|
|
92
|
+
},
|
|
93
|
+
marshalling_gen.unmarshalKey
|
|
94
|
+
);
|
|
95
|
+
/**
|
|
96
|
+
* Apply key protection. Apply key protection to a given key specified by the
|
|
97
|
+
* `key_id` parameter. Applying key protection means that your key can be used
|
|
98
|
+
* and modified, but it cannot be deleted.
|
|
99
|
+
*
|
|
100
|
+
* @param request - The request {@link ProtectKeyRequest}
|
|
101
|
+
* @returns A Promise of Key
|
|
102
|
+
*/
|
|
103
|
+
protectKey = (request) => this.client.fetch(
|
|
104
|
+
{
|
|
105
|
+
body: "{}",
|
|
106
|
+
headers: jsonContentHeaders,
|
|
107
|
+
method: "POST",
|
|
108
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/protect`
|
|
109
|
+
},
|
|
110
|
+
marshalling_gen.unmarshalKey
|
|
111
|
+
);
|
|
112
|
+
/**
|
|
113
|
+
* Remove key protection. Remove key protection from a given key specified by
|
|
114
|
+
* the `key_id` parameter. Removing key protection means that your key can be
|
|
115
|
+
* deleted anytime.
|
|
116
|
+
*
|
|
117
|
+
* @param request - The request {@link UnprotectKeyRequest}
|
|
118
|
+
* @returns A Promise of Key
|
|
119
|
+
*/
|
|
120
|
+
unprotectKey = (request) => this.client.fetch(
|
|
121
|
+
{
|
|
122
|
+
body: "{}",
|
|
123
|
+
headers: jsonContentHeaders,
|
|
124
|
+
method: "POST",
|
|
125
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/unprotect`
|
|
126
|
+
},
|
|
127
|
+
marshalling_gen.unmarshalKey
|
|
128
|
+
);
|
|
129
|
+
/**
|
|
130
|
+
* Enable key. Enable a given key to be used for cryptographic operations.
|
|
131
|
+
* Enabling a key allows you to make a disabled key usable again. You must
|
|
132
|
+
* specify the `region` and `key_id` parameters.
|
|
133
|
+
*
|
|
134
|
+
* @param request - The request {@link EnableKeyRequest}
|
|
135
|
+
* @returns A Promise of Key
|
|
136
|
+
*/
|
|
137
|
+
enableKey = (request) => this.client.fetch(
|
|
138
|
+
{
|
|
139
|
+
body: "{}",
|
|
140
|
+
headers: jsonContentHeaders,
|
|
141
|
+
method: "POST",
|
|
142
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/enable`
|
|
143
|
+
},
|
|
144
|
+
marshalling_gen.unmarshalKey
|
|
145
|
+
);
|
|
146
|
+
/**
|
|
147
|
+
* Disable key. Disable a given key to be used for cryptographic operations.
|
|
148
|
+
* Disabling a key renders it unusable. You must specify the `region` and
|
|
149
|
+
* `key_id` parameters.
|
|
150
|
+
*
|
|
151
|
+
* @param request - The request {@link DisableKeyRequest}
|
|
152
|
+
* @returns A Promise of Key
|
|
153
|
+
*/
|
|
154
|
+
disableKey = (request) => this.client.fetch(
|
|
155
|
+
{
|
|
156
|
+
body: "{}",
|
|
157
|
+
headers: jsonContentHeaders,
|
|
158
|
+
method: "POST",
|
|
159
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/disable`
|
|
160
|
+
},
|
|
161
|
+
marshalling_gen.unmarshalKey
|
|
162
|
+
);
|
|
163
|
+
pageOfListKeys = (request = {}) => this.client.fetch(
|
|
164
|
+
{
|
|
165
|
+
method: "GET",
|
|
166
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`,
|
|
167
|
+
urlParams: marshalling.urlParams(
|
|
168
|
+
["name", request.name],
|
|
169
|
+
["order_by", request.orderBy],
|
|
170
|
+
["organization_id", request.organizationId],
|
|
171
|
+
["page", request.page],
|
|
172
|
+
[
|
|
173
|
+
"page_size",
|
|
174
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
175
|
+
],
|
|
176
|
+
["project_id", request.projectId],
|
|
177
|
+
["tags", request.tags]
|
|
178
|
+
)
|
|
179
|
+
},
|
|
180
|
+
marshalling_gen.unmarshalListKeysResponse
|
|
181
|
+
);
|
|
182
|
+
/**
|
|
183
|
+
* List keys. Retrieve the list of keys created within all Projects of an
|
|
184
|
+
* Organization or in a given Project. You must specify the `region`, and
|
|
185
|
+
* either the `organization_id` or the `project_id`.
|
|
186
|
+
*
|
|
187
|
+
* @param request - The request {@link ListKeysRequest}
|
|
188
|
+
* @returns A Promise of ListKeysResponse
|
|
189
|
+
*/
|
|
190
|
+
listKeys = (request = {}) => resourcePaginator.enrichForPagination("keys", this.pageOfListKeys, request);
|
|
191
|
+
/**
|
|
192
|
+
* Generate a data encryption key. Generate a new data encryption key to use
|
|
193
|
+
* for cryptographic operations outside of Key Manager. Note that Key Manager
|
|
194
|
+
* does not store your data encryption key. The data encryption key is
|
|
195
|
+
* encrypted and must be decrypted using the key you have created in Key
|
|
196
|
+
* Manager. The data encryption key's plaintext is returned in the response
|
|
197
|
+
* object, for immediate usage.
|
|
198
|
+
*
|
|
199
|
+
* Always store the data encryption key's ciphertext, rather than its
|
|
200
|
+
* plaintext, which must not be stored. To retrieve your key's plaintext, call
|
|
201
|
+
* the Decrypt endpoint with your key's ID and ciphertext.
|
|
202
|
+
*
|
|
203
|
+
* @param request - The request {@link GenerateDataKeyRequest}
|
|
204
|
+
* @returns A Promise of DataKey
|
|
205
|
+
*/
|
|
206
|
+
generateDataKey = (request) => this.client.fetch(
|
|
207
|
+
{
|
|
208
|
+
body: JSON.stringify(
|
|
209
|
+
marshalling_gen.marshalGenerateDataKeyRequest(request, this.client.settings)
|
|
210
|
+
),
|
|
211
|
+
headers: jsonContentHeaders,
|
|
212
|
+
method: "POST",
|
|
213
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/generate-data-key`
|
|
214
|
+
},
|
|
215
|
+
marshalling_gen.unmarshalDataKey
|
|
216
|
+
);
|
|
217
|
+
/**
|
|
218
|
+
* Encrypt data. Encrypt data using an existing key, specified by the `key_id`
|
|
219
|
+
* parameter. Only keys with a usage set to **symmetric_encryption** are
|
|
220
|
+
* supported by this method. The maximum payload size that can be encrypted is
|
|
221
|
+
* 64KB of plaintext.
|
|
222
|
+
*
|
|
223
|
+
* @param request - The request {@link EncryptRequest}
|
|
224
|
+
* @returns A Promise of EncryptResponse
|
|
225
|
+
*/
|
|
226
|
+
encrypt = (request) => this.client.fetch(
|
|
227
|
+
{
|
|
228
|
+
body: JSON.stringify(
|
|
229
|
+
marshalling_gen.marshalEncryptRequest(request, this.client.settings)
|
|
230
|
+
),
|
|
231
|
+
headers: jsonContentHeaders,
|
|
232
|
+
method: "POST",
|
|
233
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/encrypt`
|
|
234
|
+
},
|
|
235
|
+
marshalling_gen.unmarshalEncryptResponse
|
|
236
|
+
);
|
|
237
|
+
/**
|
|
238
|
+
* Decrypt data. Decrypt data using an existing key, specified by the `key_id`
|
|
239
|
+
* parameter. The maximum payload size that can be decrypted is the result of
|
|
240
|
+
* the encryption of 64KB of data (around 131KB).
|
|
241
|
+
*
|
|
242
|
+
* @param request - The request {@link DecryptRequest}
|
|
243
|
+
* @returns A Promise of DecryptResponse
|
|
244
|
+
*/
|
|
245
|
+
decrypt = (request) => this.client.fetch(
|
|
246
|
+
{
|
|
247
|
+
body: JSON.stringify(
|
|
248
|
+
marshalling_gen.marshalDecryptRequest(request, this.client.settings)
|
|
249
|
+
),
|
|
250
|
+
headers: jsonContentHeaders,
|
|
251
|
+
method: "POST",
|
|
252
|
+
path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/decrypt`
|
|
253
|
+
},
|
|
254
|
+
marshalling_gen.unmarshalDecryptResponse
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
exports.API = API;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { API as ParentAPI } from '../../../bridge';
|
|
2
|
+
import type { Region } from '../../../bridge';
|
|
3
|
+
import type { CreateKeyRequest, DataKey, DecryptRequest, DecryptResponse, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, Key, ListKeysRequest, ListKeysResponse, ProtectKeyRequest, RotateKeyRequest, UnprotectKeyRequest, UpdateKeyRequest } from './types.gen';
|
|
4
|
+
/**
|
|
5
|
+
* Key Manager API.
|
|
6
|
+
*
|
|
7
|
+
* This API allows you to create, manage and use cryptographic keys in a
|
|
8
|
+
* centralized and secure service.
|
|
9
|
+
*/
|
|
10
|
+
export declare class API extends ParentAPI {
|
|
11
|
+
/** Lists the available regions of the API. */
|
|
12
|
+
static readonly LOCALITIES: Region[];
|
|
13
|
+
/**
|
|
14
|
+
* Create a key. Create a key in a given region specified by the `region`
|
|
15
|
+
* parameter. Keys only support symmetric encryption. You can use keys to
|
|
16
|
+
* encrypt or decrypt arbitrary payloads, or to generate data encryption keys
|
|
17
|
+
* that can be used without being stored in Key Manager.
|
|
18
|
+
*
|
|
19
|
+
* @param request - The request {@link CreateKeyRequest}
|
|
20
|
+
* @returns A Promise of Key
|
|
21
|
+
*/
|
|
22
|
+
createKey: (request: Readonly<CreateKeyRequest>) => Promise<Key>;
|
|
23
|
+
/**
|
|
24
|
+
* Get key metadata. Retrieve the metadata of a key specified by the `region`
|
|
25
|
+
* and `key_id` parameters.
|
|
26
|
+
*
|
|
27
|
+
* @param request - The request {@link GetKeyRequest}
|
|
28
|
+
* @returns A Promise of Key
|
|
29
|
+
*/
|
|
30
|
+
getKey: (request: Readonly<GetKeyRequest>) => Promise<Key>;
|
|
31
|
+
/**
|
|
32
|
+
* Update a key. Update a key's metadata (name, description and tags),
|
|
33
|
+
* specified by the `key_id` and `region` parameters.
|
|
34
|
+
*
|
|
35
|
+
* @param request - The request {@link UpdateKeyRequest}
|
|
36
|
+
* @returns A Promise of Key
|
|
37
|
+
*/
|
|
38
|
+
updateKey: (request: Readonly<UpdateKeyRequest>) => Promise<Key>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete a key. Delete an existing key specified by the `region` and `key_id`
|
|
41
|
+
* parameters. Deleting a key is permanent and cannot be undone. All data
|
|
42
|
+
* encrypted using this key, including data encryption keys, will become
|
|
43
|
+
* unusable.
|
|
44
|
+
*
|
|
45
|
+
* @param request - The request {@link DeleteKeyRequest}
|
|
46
|
+
*/
|
|
47
|
+
deleteKey: (request: Readonly<DeleteKeyRequest>) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Rotate a key. Generate a new version of an existing key with randomly
|
|
50
|
+
* generated key material. Rotated keys can still be used to decrypt
|
|
51
|
+
* previously encrypted data. The key's new material will be used for
|
|
52
|
+
* subsequent encryption operations and data key generation.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link RotateKeyRequest}
|
|
55
|
+
* @returns A Promise of Key
|
|
56
|
+
*/
|
|
57
|
+
rotateKey: (request: Readonly<RotateKeyRequest>) => Promise<Key>;
|
|
58
|
+
/**
|
|
59
|
+
* Apply key protection. Apply key protection to a given key specified by the
|
|
60
|
+
* `key_id` parameter. Applying key protection means that your key can be used
|
|
61
|
+
* and modified, but it cannot be deleted.
|
|
62
|
+
*
|
|
63
|
+
* @param request - The request {@link ProtectKeyRequest}
|
|
64
|
+
* @returns A Promise of Key
|
|
65
|
+
*/
|
|
66
|
+
protectKey: (request: Readonly<ProtectKeyRequest>) => Promise<Key>;
|
|
67
|
+
/**
|
|
68
|
+
* Remove key protection. Remove key protection from a given key specified by
|
|
69
|
+
* the `key_id` parameter. Removing key protection means that your key can be
|
|
70
|
+
* deleted anytime.
|
|
71
|
+
*
|
|
72
|
+
* @param request - The request {@link UnprotectKeyRequest}
|
|
73
|
+
* @returns A Promise of Key
|
|
74
|
+
*/
|
|
75
|
+
unprotectKey: (request: Readonly<UnprotectKeyRequest>) => Promise<Key>;
|
|
76
|
+
/**
|
|
77
|
+
* Enable key. Enable a given key to be used for cryptographic operations.
|
|
78
|
+
* Enabling a key allows you to make a disabled key usable again. You must
|
|
79
|
+
* specify the `region` and `key_id` parameters.
|
|
80
|
+
*
|
|
81
|
+
* @param request - The request {@link EnableKeyRequest}
|
|
82
|
+
* @returns A Promise of Key
|
|
83
|
+
*/
|
|
84
|
+
enableKey: (request: Readonly<EnableKeyRequest>) => Promise<Key>;
|
|
85
|
+
/**
|
|
86
|
+
* Disable key. Disable a given key to be used for cryptographic operations.
|
|
87
|
+
* Disabling a key renders it unusable. You must specify the `region` and
|
|
88
|
+
* `key_id` parameters.
|
|
89
|
+
*
|
|
90
|
+
* @param request - The request {@link DisableKeyRequest}
|
|
91
|
+
* @returns A Promise of Key
|
|
92
|
+
*/
|
|
93
|
+
disableKey: (request: Readonly<DisableKeyRequest>) => Promise<Key>;
|
|
94
|
+
protected pageOfListKeys: (request?: Readonly<ListKeysRequest>) => Promise<ListKeysResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* List keys. Retrieve the list of keys created within all Projects of an
|
|
97
|
+
* Organization or in a given Project. You must specify the `region`, and
|
|
98
|
+
* either the `organization_id` or the `project_id`.
|
|
99
|
+
*
|
|
100
|
+
* @param request - The request {@link ListKeysRequest}
|
|
101
|
+
* @returns A Promise of ListKeysResponse
|
|
102
|
+
*/
|
|
103
|
+
listKeys: (request?: Readonly<ListKeysRequest>) => Promise<ListKeysResponse> & {
|
|
104
|
+
all: () => Promise<Key[]>;
|
|
105
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Key[], void, void>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Generate a data encryption key. Generate a new data encryption key to use
|
|
109
|
+
* for cryptographic operations outside of Key Manager. Note that Key Manager
|
|
110
|
+
* does not store your data encryption key. The data encryption key is
|
|
111
|
+
* encrypted and must be decrypted using the key you have created in Key
|
|
112
|
+
* Manager. The data encryption key's plaintext is returned in the response
|
|
113
|
+
* object, for immediate usage.
|
|
114
|
+
*
|
|
115
|
+
* Always store the data encryption key's ciphertext, rather than its
|
|
116
|
+
* plaintext, which must not be stored. To retrieve your key's plaintext, call
|
|
117
|
+
* the Decrypt endpoint with your key's ID and ciphertext.
|
|
118
|
+
*
|
|
119
|
+
* @param request - The request {@link GenerateDataKeyRequest}
|
|
120
|
+
* @returns A Promise of DataKey
|
|
121
|
+
*/
|
|
122
|
+
generateDataKey: (request: Readonly<GenerateDataKeyRequest>) => Promise<DataKey>;
|
|
123
|
+
/**
|
|
124
|
+
* Encrypt data. Encrypt data using an existing key, specified by the `key_id`
|
|
125
|
+
* parameter. Only keys with a usage set to **symmetric_encryption** are
|
|
126
|
+
* supported by this method. The maximum payload size that can be encrypted is
|
|
127
|
+
* 64KB of plaintext.
|
|
128
|
+
*
|
|
129
|
+
* @param request - The request {@link EncryptRequest}
|
|
130
|
+
* @returns A Promise of EncryptResponse
|
|
131
|
+
*/
|
|
132
|
+
encrypt: (request: Readonly<EncryptRequest>) => Promise<EncryptResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Decrypt data. Decrypt data using an existing key, specified by the `key_id`
|
|
135
|
+
* parameter. The maximum payload size that can be decrypted is the result of
|
|
136
|
+
* the encryption of 64KB of data (around 131KB).
|
|
137
|
+
*
|
|
138
|
+
* @param request - The request {@link DecryptRequest}
|
|
139
|
+
* @returns A Promise of DecryptResponse
|
|
140
|
+
*/
|
|
141
|
+
decrypt: (request: Readonly<DecryptRequest>) => Promise<DecryptResponse>;
|
|
142
|
+
}
|