@scaleway/sdk-key-manager 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 CHANGED
@@ -83,6 +83,7 @@ const api = new KeyManager.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 "./v1alpha1/index.gen.js";
2
- export {
3
- index_gen as KeyManagerv1alpha1
4
- };
1
+ import { index_gen_exports } from "./v1alpha1/index.gen.js";
2
+ export { index_gen_exports as KeyManagerv1alpha1 };
@@ -1,340 +1,253 @@
1
- import { API as API$1, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalCreateKeyRequest, unmarshalKey, unmarshalPublicKey, marshalUpdateKeyRequest, unmarshalListKeysResponse, marshalGenerateDataKeyRequest, unmarshalDataKey, marshalEncryptRequest, unmarshalEncryptResponse, marshalDecryptRequest, unmarshalDecryptResponse, marshalSignRequest, unmarshalSignResponse, marshalVerifyRequest, unmarshalVerifyResponse, marshalImportKeyMaterialRequest, unmarshalListAlgorithmsResponse } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class API extends API$1 {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- regions: [
13
- "fr-par",
14
- "nl-ams",
15
- "pl-waw"
16
- ]
17
- });
18
- /**
19
- * Create a key. Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
20
- *
21
- * @param request - The request {@link CreateKeyRequest}
22
- * @returns A Promise of Key
23
- */
24
- createKey = (request) => this.client.fetch(
25
- {
26
- body: JSON.stringify(
27
- marshalCreateKeyRequest(request, this.client.settings)
28
- ),
29
- headers: jsonContentHeaders,
30
- method: "POST",
31
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`
32
- },
33
- unmarshalKey
34
- );
35
- /**
36
- * Get key metadata. Retrieve metadata for a specified key using the `region` and `key_id` parameters.
37
- *
38
- * @param request - The request {@link GetKeyRequest}
39
- * @returns A Promise of Key
40
- */
41
- getKey = (request) => this.client.fetch(
42
- {
43
- method: "GET",
44
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
45
- },
46
- unmarshalKey
47
- );
48
- /**
49
- * Get the public key in PEM format.. Retrieves the public portion of an asymmetric cryptographic key in PEM format.
50
- *
51
- * @param request - The request {@link GetPublicKeyRequest}
52
- * @returns A Promise of PublicKey
53
- */
54
- getPublicKey = (request) => this.client.fetch(
55
- {
56
- method: "GET",
57
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/public-key`
58
- },
59
- unmarshalPublicKey
60
- );
61
- /**
62
- * Update a key. Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters.
63
- *
64
- * @param request - The request {@link UpdateKeyRequest}
65
- * @returns A Promise of Key
66
- */
67
- updateKey = (request) => this.client.fetch(
68
- {
69
- body: JSON.stringify(
70
- marshalUpdateKeyRequest(request, this.client.settings)
71
- ),
72
- headers: jsonContentHeaders,
73
- method: "PATCH",
74
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
75
- },
76
- unmarshalKey
77
- );
78
- /**
79
- * Delete a key. Permanently delete a key specified by the `region` and `key_id` parameters. This action is irreversible. Any data encrypted with this key, including data encryption keys, will no longer be decipherable.
80
- *
81
- * @param request - The request {@link DeleteKeyRequest}
82
- */
83
- deleteKey = (request) => this.client.fetch(
84
- {
85
- method: "DELETE",
86
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
87
- }
88
- );
89
- /**
90
- * Rotate a key. Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation.
91
- *
92
- * @param request - The request {@link RotateKeyRequest}
93
- * @returns A Promise of Key
94
- */
95
- rotateKey = (request) => this.client.fetch(
96
- {
97
- body: "{}",
98
- headers: jsonContentHeaders,
99
- method: "POST",
100
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/rotate`
101
- },
102
- unmarshalKey
103
- );
104
- /**
105
- * Apply key protection. Apply protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted.
106
- *
107
- * @param request - The request {@link ProtectKeyRequest}
108
- * @returns A Promise of Key
109
- */
110
- protectKey = (request) => this.client.fetch(
111
- {
112
- body: "{}",
113
- headers: jsonContentHeaders,
114
- method: "POST",
115
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/protect`
116
- },
117
- unmarshalKey
118
- );
119
- /**
120
- * Remove key protection. Remove key protection from a given key specified by the `key_id` parameter. Removing key protection means that your key can be deleted anytime.
121
- *
122
- * @param request - The request {@link UnprotectKeyRequest}
123
- * @returns A Promise of Key
124
- */
125
- unprotectKey = (request) => this.client.fetch(
126
- {
127
- body: "{}",
128
- headers: jsonContentHeaders,
129
- method: "POST",
130
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/unprotect`
131
- },
132
- unmarshalKey
133
- );
134
- /**
135
- * Enable key. Enable a given key to be used for cryptographic operations. Enabling a key allows you to make a disabled key usable again. You must specify the `region` and `key_id` parameters.
136
- *
137
- * @param request - The request {@link EnableKeyRequest}
138
- * @returns A Promise of Key
139
- */
140
- enableKey = (request) => this.client.fetch(
141
- {
142
- body: "{}",
143
- headers: jsonContentHeaders,
144
- method: "POST",
145
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/enable`
146
- },
147
- unmarshalKey
148
- );
149
- /**
150
- * Disable key. Disable a given key, preventing it to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters.
151
- *
152
- * @param request - The request {@link DisableKeyRequest}
153
- * @returns A Promise of Key
154
- */
155
- disableKey = (request) => this.client.fetch(
156
- {
157
- body: "{}",
158
- headers: jsonContentHeaders,
159
- method: "POST",
160
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/disable`
161
- },
162
- unmarshalKey
163
- );
164
- pageOfListKeys = (request) => this.client.fetch(
165
- {
166
- method: "GET",
167
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`,
168
- urlParams: urlParams(
169
- ["name", request.name],
170
- ["order_by", request.orderBy],
171
- ["organization_id", request.organizationId],
172
- ["page", request.page],
173
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
174
- ["project_id", request.projectId],
175
- ["scheduled_for_deletion", request.scheduledForDeletion],
176
- ["tags", request.tags],
177
- ["usage", request.usage]
178
- )
179
- },
180
- unmarshalListKeysResponse
181
- );
182
- /**
183
- * List keys. Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
184
- *
185
- * @param request - The request {@link ListKeysRequest}
186
- * @returns A Promise of ListKeysResponse
187
- */
188
- listKeys = (request) => enrichForPagination("keys", this.pageOfListKeys, request);
189
- /**
190
- * Create a data encryption key. Create a new data encryption key for cryptographic operations outside of Key Manager. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager.
191
-
192
- The data encryption key is returned in plaintext and ciphertext but it should only be stored in its encrypted form (ciphertext). Key Manager does not store your data encryption key. To retrieve your key's plaintext, use the `Decrypt` method with your key's ID and ciphertext.
193
- *
194
- * @param request - The request {@link GenerateDataKeyRequest}
195
- * @returns A Promise of DataKey
196
- */
197
- generateDataKey = (request) => this.client.fetch(
198
- {
199
- body: JSON.stringify(
200
- marshalGenerateDataKeyRequest(request, this.client.settings)
201
- ),
202
- headers: jsonContentHeaders,
203
- method: "POST",
204
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/generate-data-key`
205
- },
206
- unmarshalDataKey
207
- );
208
- /**
209
- * Encrypt a payload. Encrypt a payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be encrypted is 64 KB of plaintext.
210
- *
211
- * @param request - The request {@link EncryptRequest}
212
- * @returns A Promise of EncryptResponse
213
- */
214
- encrypt = (request) => this.client.fetch(
215
- {
216
- body: JSON.stringify(
217
- marshalEncryptRequest(request, this.client.settings)
218
- ),
219
- headers: jsonContentHeaders,
220
- method: "POST",
221
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/encrypt`
222
- },
223
- unmarshalEncryptResponse
224
- );
225
- /**
226
- * Decrypt an encrypted payload. Decrypt an encrypted payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is equivalent to the encrypted output of 64 KB of data (around 131 KB).
227
- *
228
- * @param request - The request {@link DecryptRequest}
229
- * @returns A Promise of DecryptResponse
230
- */
231
- decrypt = (request) => this.client.fetch(
232
- {
233
- body: JSON.stringify(
234
- marshalDecryptRequest(request, this.client.settings)
235
- ),
236
- headers: jsonContentHeaders,
237
- method: "POST",
238
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/decrypt`
239
- },
240
- unmarshalDecryptResponse
241
- );
242
- /**
243
- * Sign a message digest. Use a given key to sign a message digest. The key must have its usage set to `asymmetric_signing`. The digest must be created using the same digest algorithm that is defined in the key's algorithm configuration.
244
- *
245
- * @param request - The request {@link SignRequest}
246
- * @returns A Promise of SignResponse
247
- */
248
- sign = (request) => this.client.fetch(
249
- {
250
- body: JSON.stringify(
251
- marshalSignRequest(request, this.client.settings)
252
- ),
253
- headers: jsonContentHeaders,
254
- method: "POST",
255
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
256
- },
257
- unmarshalSignResponse
258
- );
259
- /**
260
- * Verify a message signature. Use a given key to verify a message signature against a message digest. The key must have its usage set to `asymmetric_signing`. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration.
261
- *
262
- * @param request - The request {@link VerifyRequest}
263
- * @returns A Promise of VerifyResponse
264
- */
265
- verify = (request) => this.client.fetch(
266
- {
267
- body: JSON.stringify(
268
- marshalVerifyRequest(request, this.client.settings)
269
- ),
270
- headers: jsonContentHeaders,
271
- method: "POST",
272
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/verify`
273
- },
274
- unmarshalVerifyResponse
275
- );
276
- /**
277
- * Import key material. Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`.
278
- *
279
- * @param request - The request {@link ImportKeyMaterialRequest}
280
- * @returns A Promise of Key
281
- */
282
- importKeyMaterial = (request) => this.client.fetch(
283
- {
284
- body: JSON.stringify(
285
- marshalImportKeyMaterialRequest(request, this.client.settings)
286
- ),
287
- headers: jsonContentHeaders,
288
- method: "POST",
289
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/import-key-material`
290
- },
291
- unmarshalKey
292
- );
293
- /**
294
- * Delete key material. Delete previously imported key material. This renders the associated cryptographic key unusable for any operation. The key's origin must be `external`.
295
- *
296
- * @param request - The request {@link DeleteKeyMaterialRequest}
297
- */
298
- deleteKeyMaterial = (request) => this.client.fetch(
299
- {
300
- body: "{}",
301
- headers: jsonContentHeaders,
302
- method: "POST",
303
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
304
- }
305
- );
306
- /**
307
- * Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
308
- *
309
- * @param request - The request {@link RestoreKeyRequest}
310
- * @returns A Promise of Key
311
- */
312
- restoreKey = (request) => this.client.fetch(
313
- {
314
- body: "{}",
315
- headers: jsonContentHeaders,
316
- method: "POST",
317
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/restore`
318
- },
319
- unmarshalKey
320
- );
321
- /**
322
- * List all available algorithms. Lists all cryptographic algorithms supported by the Key Manager service.
323
- *
324
- * @param request - The request {@link ListAlgorithmsRequest}
325
- * @returns A Promise of ListAlgorithmsResponse
326
- */
327
- listAlgorithms = (request = {}) => this.client.fetch(
328
- {
329
- method: "GET",
330
- path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
331
- urlParams: urlParams(
332
- ["usages", request.usages]
333
- )
334
- },
335
- unmarshalListAlgorithmsResponse
336
- );
337
- }
338
- export {
339
- API
1
+ import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * Key Manager API.
6
+
7
+ This API allows you to create, manage and use cryptographic keys in a centralized and secure service.
8
+ */
9
+ var API$1 = class extends API {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static LOCALITY = toApiLocality({ regions: [
15
+ "fr-par",
16
+ "nl-ams",
17
+ "pl-waw"
18
+ ] });
19
+ /**
20
+ * Create a key. Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
21
+ *
22
+ * @param request - The request {@link CreateKeyRequest}
23
+ * @returns A Promise of Key
24
+ */
25
+ createKey = (request) => this.client.fetch({
26
+ body: JSON.stringify(marshalCreateKeyRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`
30
+ }, unmarshalKey);
31
+ /**
32
+ * Get key metadata. Retrieve metadata for a specified key using the `region` and `key_id` parameters.
33
+ *
34
+ * @param request - The request {@link GetKeyRequest}
35
+ * @returns A Promise of Key
36
+ */
37
+ getKey = (request) => this.client.fetch({
38
+ method: "GET",
39
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
40
+ }, unmarshalKey);
41
+ /**
42
+ * Get the public key in PEM format.. Retrieves the public portion of an asymmetric cryptographic key in PEM format.
43
+ *
44
+ * @param request - The request {@link GetPublicKeyRequest}
45
+ * @returns A Promise of PublicKey
46
+ */
47
+ getPublicKey = (request) => this.client.fetch({
48
+ method: "GET",
49
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/public-key`
50
+ }, unmarshalPublicKey);
51
+ /**
52
+ * Update a key. Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters.
53
+ *
54
+ * @param request - The request {@link UpdateKeyRequest}
55
+ * @returns A Promise of Key
56
+ */
57
+ updateKey = (request) => this.client.fetch({
58
+ body: JSON.stringify(marshalUpdateKeyRequest(request, this.client.settings)),
59
+ headers: jsonContentHeaders,
60
+ method: "PATCH",
61
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
62
+ }, unmarshalKey);
63
+ /**
64
+ * Delete a key. Permanently delete a key specified by the `region` and `key_id` parameters. This action is irreversible. Any data encrypted with this key, including data encryption keys, will no longer be decipherable.
65
+ *
66
+ * @param request - The request {@link DeleteKeyRequest}
67
+ */
68
+ deleteKey = (request) => this.client.fetch({
69
+ method: "DELETE",
70
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
71
+ });
72
+ /**
73
+ * Rotate a key. Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation.
74
+ *
75
+ * @param request - The request {@link RotateKeyRequest}
76
+ * @returns A Promise of Key
77
+ */
78
+ rotateKey = (request) => this.client.fetch({
79
+ body: "{}",
80
+ headers: jsonContentHeaders,
81
+ method: "POST",
82
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/rotate`
83
+ }, unmarshalKey);
84
+ /**
85
+ * Apply key protection. Apply protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted.
86
+ *
87
+ * @param request - The request {@link ProtectKeyRequest}
88
+ * @returns A Promise of Key
89
+ */
90
+ protectKey = (request) => this.client.fetch({
91
+ body: "{}",
92
+ headers: jsonContentHeaders,
93
+ method: "POST",
94
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/protect`
95
+ }, unmarshalKey);
96
+ /**
97
+ * Remove key protection. Remove key protection from a given key specified by the `key_id` parameter. Removing key protection means that your key can be deleted anytime.
98
+ *
99
+ * @param request - The request {@link UnprotectKeyRequest}
100
+ * @returns A Promise of Key
101
+ */
102
+ unprotectKey = (request) => this.client.fetch({
103
+ body: "{}",
104
+ headers: jsonContentHeaders,
105
+ method: "POST",
106
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/unprotect`
107
+ }, unmarshalKey);
108
+ /**
109
+ * Enable key. Enable a given key to be used for cryptographic operations. Enabling a key allows you to make a disabled key usable again. You must specify the `region` and `key_id` parameters.
110
+ *
111
+ * @param request - The request {@link EnableKeyRequest}
112
+ * @returns A Promise of Key
113
+ */
114
+ enableKey = (request) => this.client.fetch({
115
+ body: "{}",
116
+ headers: jsonContentHeaders,
117
+ method: "POST",
118
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/enable`
119
+ }, unmarshalKey);
120
+ /**
121
+ * Disable key. Disable a given key, preventing it to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters.
122
+ *
123
+ * @param request - The request {@link DisableKeyRequest}
124
+ * @returns A Promise of Key
125
+ */
126
+ disableKey = (request) => this.client.fetch({
127
+ body: "{}",
128
+ headers: jsonContentHeaders,
129
+ method: "POST",
130
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/disable`
131
+ }, unmarshalKey);
132
+ pageOfListKeys = (request) => this.client.fetch({
133
+ method: "GET",
134
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`,
135
+ 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], ["scheduled_for_deletion", request.scheduledForDeletion], ["tags", request.tags], ["usage", request.usage])
136
+ }, unmarshalListKeysResponse);
137
+ /**
138
+ * List keys. Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
139
+ *
140
+ * @param request - The request {@link ListKeysRequest}
141
+ * @returns A Promise of ListKeysResponse
142
+ */
143
+ listKeys = (request) => enrichForPagination("keys", this.pageOfListKeys, request);
144
+ /**
145
+ * Create a data encryption key. Create a new data encryption key for cryptographic operations outside of Key Manager. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager.
146
+
147
+ The data encryption key is returned in plaintext and ciphertext but it should only be stored in its encrypted form (ciphertext). Key Manager does not store your data encryption key. To retrieve your key's plaintext, use the `Decrypt` method with your key's ID and ciphertext.
148
+ *
149
+ * @param request - The request {@link GenerateDataKeyRequest}
150
+ * @returns A Promise of DataKey
151
+ */
152
+ generateDataKey = (request) => this.client.fetch({
153
+ body: JSON.stringify(marshalGenerateDataKeyRequest(request, this.client.settings)),
154
+ headers: jsonContentHeaders,
155
+ method: "POST",
156
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/generate-data-key`
157
+ }, unmarshalDataKey);
158
+ /**
159
+ * Encrypt a payload. Encrypt a payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be encrypted is 64 KB of plaintext.
160
+ *
161
+ * @param request - The request {@link EncryptRequest}
162
+ * @returns A Promise of EncryptResponse
163
+ */
164
+ encrypt = (request) => this.client.fetch({
165
+ body: JSON.stringify(marshalEncryptRequest(request, this.client.settings)),
166
+ headers: jsonContentHeaders,
167
+ method: "POST",
168
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/encrypt`
169
+ }, unmarshalEncryptResponse);
170
+ /**
171
+ * Decrypt an encrypted payload. Decrypt an encrypted payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is equivalent to the encrypted output of 64 KB of data (around 131 KB).
172
+ *
173
+ * @param request - The request {@link DecryptRequest}
174
+ * @returns A Promise of DecryptResponse
175
+ */
176
+ decrypt = (request) => this.client.fetch({
177
+ body: JSON.stringify(marshalDecryptRequest(request, this.client.settings)),
178
+ headers: jsonContentHeaders,
179
+ method: "POST",
180
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/decrypt`
181
+ }, unmarshalDecryptResponse);
182
+ /**
183
+ * Sign a message digest. Use a given key to sign a message digest. The key must have its usage set to `asymmetric_signing`. The digest must be created using the same digest algorithm that is defined in the key's algorithm configuration.
184
+ *
185
+ * @param request - The request {@link SignRequest}
186
+ * @returns A Promise of SignResponse
187
+ */
188
+ sign = (request) => this.client.fetch({
189
+ body: JSON.stringify(marshalSignRequest(request, this.client.settings)),
190
+ headers: jsonContentHeaders,
191
+ method: "POST",
192
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
193
+ }, unmarshalSignResponse);
194
+ /**
195
+ * Verify a message signature. Use a given key to verify a message signature against a message digest. The key must have its usage set to `asymmetric_signing`. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration.
196
+ *
197
+ * @param request - The request {@link VerifyRequest}
198
+ * @returns A Promise of VerifyResponse
199
+ */
200
+ verify = (request) => this.client.fetch({
201
+ body: JSON.stringify(marshalVerifyRequest(request, this.client.settings)),
202
+ headers: jsonContentHeaders,
203
+ method: "POST",
204
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/verify`
205
+ }, unmarshalVerifyResponse);
206
+ /**
207
+ * Import key material. Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`.
208
+ *
209
+ * @param request - The request {@link ImportKeyMaterialRequest}
210
+ * @returns A Promise of Key
211
+ */
212
+ importKeyMaterial = (request) => this.client.fetch({
213
+ body: JSON.stringify(marshalImportKeyMaterialRequest(request, this.client.settings)),
214
+ headers: jsonContentHeaders,
215
+ method: "POST",
216
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/import-key-material`
217
+ }, unmarshalKey);
218
+ /**
219
+ * Delete key material. Delete previously imported key material. This renders the associated cryptographic key unusable for any operation. The key's origin must be `external`.
220
+ *
221
+ * @param request - The request {@link DeleteKeyMaterialRequest}
222
+ */
223
+ deleteKeyMaterial = (request) => this.client.fetch({
224
+ body: "{}",
225
+ headers: jsonContentHeaders,
226
+ method: "POST",
227
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
228
+ });
229
+ /**
230
+ * Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
231
+ *
232
+ * @param request - The request {@link RestoreKeyRequest}
233
+ * @returns A Promise of Key
234
+ */
235
+ restoreKey = (request) => this.client.fetch({
236
+ body: "{}",
237
+ headers: jsonContentHeaders,
238
+ method: "POST",
239
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/restore`
240
+ }, unmarshalKey);
241
+ /**
242
+ * List all available algorithms. Lists all cryptographic algorithms supported by the Key Manager service.
243
+ *
244
+ * @param request - The request {@link ListAlgorithmsRequest}
245
+ * @returns A Promise of ListAlgorithmsResponse
246
+ */
247
+ listAlgorithms = (request = {}) => this.client.fetch({
248
+ method: "GET",
249
+ path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
250
+ urlParams: urlParams(["usages", request.usages])
251
+ }, unmarshalListAlgorithmsResponse);
340
252
  };
253
+ export { API$1 as API };
@@ -1,22 +1,24 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
3
- export {
4
- API,
5
- marshalCreateKeyRequest,
6
- marshalDecryptRequest,
7
- marshalEncryptRequest,
8
- marshalGenerateDataKeyRequest,
9
- marshalImportKeyMaterialRequest,
10
- marshalSignRequest,
11
- marshalUpdateKeyRequest,
12
- marshalVerifyRequest,
13
- unmarshalDataKey,
14
- unmarshalDecryptResponse,
15
- unmarshalEncryptResponse,
16
- unmarshalKey,
17
- unmarshalListAlgorithmsResponse,
18
- unmarshalListKeysResponse,
19
- unmarshalPublicKey,
20
- unmarshalSignResponse,
21
- unmarshalVerifyResponse
22
- };
3
+ import { API } from "./api.gen.js";
4
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
5
+ API: () => API,
6
+ marshalCreateKeyRequest: () => marshalCreateKeyRequest,
7
+ marshalDecryptRequest: () => marshalDecryptRequest,
8
+ marshalEncryptRequest: () => marshalEncryptRequest,
9
+ marshalGenerateDataKeyRequest: () => marshalGenerateDataKeyRequest,
10
+ marshalImportKeyMaterialRequest: () => marshalImportKeyMaterialRequest,
11
+ marshalSignRequest: () => marshalSignRequest,
12
+ marshalUpdateKeyRequest: () => marshalUpdateKeyRequest,
13
+ marshalVerifyRequest: () => marshalVerifyRequest,
14
+ unmarshalDataKey: () => unmarshalDataKey,
15
+ unmarshalDecryptResponse: () => unmarshalDecryptResponse,
16
+ unmarshalEncryptResponse: () => unmarshalEncryptResponse,
17
+ unmarshalKey: () => unmarshalKey,
18
+ unmarshalListAlgorithmsResponse: () => unmarshalListAlgorithmsResponse,
19
+ unmarshalListKeysResponse: () => unmarshalListKeysResponse,
20
+ unmarshalPublicKey: () => unmarshalPublicKey,
21
+ unmarshalSignResponse: () => unmarshalSignResponse,
22
+ unmarshalVerifyResponse: () => unmarshalVerifyResponse
23
+ });
24
+ export { index_gen_exports };
@@ -1,230 +1,156 @@
1
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalKeyRotationPolicy = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- nextRotationAt: unmarshalDate(data.next_rotation_at),
10
- rotationPeriod: data.rotation_period
11
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalKeyRotationPolicy = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary.`);
4
+ return {
5
+ nextRotationAt: unmarshalDate(data.next_rotation_at),
6
+ rotationPeriod: data.rotation_period
7
+ };
12
8
  };
13
- const unmarshalKeyUsage = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
16
- `Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary.`
17
- );
18
- }
19
- return {
20
- asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : void 0,
21
- asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : void 0,
22
- symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0
23
- };
9
+ var unmarshalKeyUsage = (data) => {
10
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary.`);
11
+ return {
12
+ asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : void 0,
13
+ asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : void 0,
14
+ symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0
15
+ };
24
16
  };
25
17
  const unmarshalKey = (data) => {
26
- if (!isJSONObject(data)) {
27
- throw new TypeError(
28
- `Unmarshalling the type 'Key' failed as data isn't a dictionary.`
29
- );
30
- }
31
- return {
32
- createdAt: unmarshalDate(data.created_at),
33
- deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
34
- description: data.description,
35
- id: data.id,
36
- locked: data.locked,
37
- name: data.name,
38
- origin: data.origin,
39
- projectId: data.project_id,
40
- protected: data.protected,
41
- region: data.region,
42
- rotatedAt: unmarshalDate(data.rotated_at),
43
- rotationCount: data.rotation_count,
44
- rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : void 0,
45
- state: data.state,
46
- tags: data.tags,
47
- updatedAt: unmarshalDate(data.updated_at),
48
- usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0
49
- };
18
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Key' failed as data isn't a dictionary.`);
19
+ return {
20
+ createdAt: unmarshalDate(data.created_at),
21
+ deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
22
+ description: data.description,
23
+ id: data.id,
24
+ locked: data.locked,
25
+ name: data.name,
26
+ origin: data.origin,
27
+ projectId: data.project_id,
28
+ protected: data.protected,
29
+ region: data.region,
30
+ rotatedAt: unmarshalDate(data.rotated_at),
31
+ rotationCount: data.rotation_count,
32
+ rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : void 0,
33
+ state: data.state,
34
+ tags: data.tags,
35
+ updatedAt: unmarshalDate(data.updated_at),
36
+ usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0
37
+ };
50
38
  };
51
39
  const unmarshalDataKey = (data) => {
52
- if (!isJSONObject(data)) {
53
- throw new TypeError(
54
- `Unmarshalling the type 'DataKey' failed as data isn't a dictionary.`
55
- );
56
- }
57
- return {
58
- algorithm: data.algorithm,
59
- ciphertext: data.ciphertext,
60
- createdAt: unmarshalDate(data.created_at),
61
- keyId: data.key_id,
62
- plaintext: data.plaintext
63
- };
40
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DataKey' failed as data isn't a dictionary.`);
41
+ return {
42
+ algorithm: data.algorithm,
43
+ ciphertext: data.ciphertext,
44
+ createdAt: unmarshalDate(data.created_at),
45
+ keyId: data.key_id,
46
+ plaintext: data.plaintext
47
+ };
64
48
  };
65
49
  const unmarshalDecryptResponse = (data) => {
66
- if (!isJSONObject(data)) {
67
- throw new TypeError(
68
- `Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary.`
69
- );
70
- }
71
- return {
72
- ciphertext: data.ciphertext,
73
- keyId: data.key_id,
74
- plaintext: data.plaintext
75
- };
50
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary.`);
51
+ return {
52
+ ciphertext: data.ciphertext,
53
+ keyId: data.key_id,
54
+ plaintext: data.plaintext
55
+ };
76
56
  };
77
57
  const unmarshalEncryptResponse = (data) => {
78
- if (!isJSONObject(data)) {
79
- throw new TypeError(
80
- `Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary.`
81
- );
82
- }
83
- return {
84
- ciphertext: data.ciphertext,
85
- keyId: data.key_id
86
- };
58
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary.`);
59
+ return {
60
+ ciphertext: data.ciphertext,
61
+ keyId: data.key_id
62
+ };
87
63
  };
88
- const unmarshalListAlgorithmsResponseAlgorithm = (data) => {
89
- if (!isJSONObject(data)) {
90
- throw new TypeError(
91
- `Unmarshalling the type 'ListAlgorithmsResponseAlgorithm' failed as data isn't a dictionary.`
92
- );
93
- }
94
- return {
95
- name: data.name,
96
- recommended: data.recommended,
97
- usage: data.usage
98
- };
64
+ var unmarshalListAlgorithmsResponseAlgorithm = (data) => {
65
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlgorithmsResponseAlgorithm' failed as data isn't a dictionary.`);
66
+ return {
67
+ name: data.name,
68
+ recommended: data.recommended,
69
+ usage: data.usage
70
+ };
99
71
  };
100
72
  const unmarshalListAlgorithmsResponse = (data) => {
101
- if (!isJSONObject(data)) {
102
- throw new TypeError(
103
- `Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary.`
104
- );
105
- }
106
- return {
107
- algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm)
108
- };
73
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary.`);
74
+ return { algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm) };
109
75
  };
110
76
  const unmarshalListKeysResponse = (data) => {
111
- if (!isJSONObject(data)) {
112
- throw new TypeError(
113
- `Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.`
114
- );
115
- }
116
- return {
117
- keys: unmarshalArrayOfObject(data.keys, unmarshalKey),
118
- totalCount: data.total_count
119
- };
77
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.`);
78
+ return {
79
+ keys: unmarshalArrayOfObject(data.keys, unmarshalKey),
80
+ totalCount: data.total_count
81
+ };
120
82
  };
121
83
  const unmarshalPublicKey = (data) => {
122
- if (!isJSONObject(data)) {
123
- throw new TypeError(
124
- `Unmarshalling the type 'PublicKey' failed as data isn't a dictionary.`
125
- );
126
- }
127
- return {
128
- pem: data.pem
129
- };
84
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PublicKey' failed as data isn't a dictionary.`);
85
+ return { pem: data.pem };
130
86
  };
131
87
  const unmarshalSignResponse = (data) => {
132
- if (!isJSONObject(data)) {
133
- throw new TypeError(
134
- `Unmarshalling the type 'SignResponse' failed as data isn't a dictionary.`
135
- );
136
- }
137
- return {
138
- keyId: data.key_id,
139
- signature: data.signature
140
- };
88
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SignResponse' failed as data isn't a dictionary.`);
89
+ return {
90
+ keyId: data.key_id,
91
+ signature: data.signature
92
+ };
141
93
  };
142
94
  const unmarshalVerifyResponse = (data) => {
143
- if (!isJSONObject(data)) {
144
- throw new TypeError(
145
- `Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary.`
146
- );
147
- }
148
- return {
149
- keyId: data.key_id,
150
- valid: data.valid
151
- };
95
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary.`);
96
+ return {
97
+ keyId: data.key_id,
98
+ valid: data.valid
99
+ };
152
100
  };
153
- const marshalKeyRotationPolicy = (request, defaults) => ({
154
- next_rotation_at: request.nextRotationAt,
155
- rotation_period: request.rotationPeriod
156
- });
157
- const marshalKeyUsage = (request, defaults) => ({
158
- ...resolveOneOf([
159
- {
160
- param: "symmetric_encryption",
161
- value: request.symmetricEncryption
162
- },
163
- {
164
- param: "asymmetric_encryption",
165
- value: request.asymmetricEncryption
166
- },
167
- {
168
- param: "asymmetric_signing",
169
- value: request.asymmetricSigning
170
- }
171
- ])
101
+ var marshalKeyRotationPolicy = (request, defaults) => ({
102
+ next_rotation_at: request.nextRotationAt,
103
+ rotation_period: request.rotationPeriod
172
104
  });
105
+ var marshalKeyUsage = (request, defaults) => ({ ...resolveOneOf([
106
+ {
107
+ param: "symmetric_encryption",
108
+ value: request.symmetricEncryption
109
+ },
110
+ {
111
+ param: "asymmetric_encryption",
112
+ value: request.asymmetricEncryption
113
+ },
114
+ {
115
+ param: "asymmetric_signing",
116
+ value: request.asymmetricSigning
117
+ }
118
+ ]) });
173
119
  const marshalCreateKeyRequest = (request, defaults) => ({
174
- description: request.description,
175
- name: request.name,
176
- origin: request.origin,
177
- project_id: request.projectId ?? defaults.defaultProjectId,
178
- rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0,
179
- tags: request.tags,
180
- unprotected: request.unprotected,
181
- usage: request.usage !== void 0 ? marshalKeyUsage(request.usage) : void 0
120
+ description: request.description,
121
+ name: request.name,
122
+ origin: request.origin,
123
+ project_id: request.projectId ?? defaults.defaultProjectId,
124
+ rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) : void 0,
125
+ tags: request.tags,
126
+ unprotected: request.unprotected,
127
+ usage: request.usage !== void 0 ? marshalKeyUsage(request.usage, defaults) : void 0
182
128
  });
183
129
  const marshalDecryptRequest = (request, defaults) => ({
184
- associated_data: request.associatedData,
185
- ciphertext: request.ciphertext
130
+ associated_data: request.associatedData,
131
+ ciphertext: request.ciphertext
186
132
  });
187
133
  const marshalEncryptRequest = (request, defaults) => ({
188
- associated_data: request.associatedData,
189
- plaintext: request.plaintext
134
+ associated_data: request.associatedData,
135
+ plaintext: request.plaintext
190
136
  });
191
137
  const marshalGenerateDataKeyRequest = (request, defaults) => ({
192
- algorithm: request.algorithm,
193
- without_plaintext: request.withoutPlaintext
138
+ algorithm: request.algorithm,
139
+ without_plaintext: request.withoutPlaintext
194
140
  });
195
141
  const marshalImportKeyMaterialRequest = (request, defaults) => ({
196
- key_material: request.keyMaterial,
197
- salt: request.salt
198
- });
199
- const marshalSignRequest = (request, defaults) => ({
200
- digest: request.digest
142
+ key_material: request.keyMaterial,
143
+ salt: request.salt
201
144
  });
145
+ const marshalSignRequest = (request, defaults) => ({ digest: request.digest });
202
146
  const marshalUpdateKeyRequest = (request, defaults) => ({
203
- description: request.description,
204
- name: request.name,
205
- rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0,
206
- tags: request.tags
147
+ description: request.description,
148
+ name: request.name,
149
+ rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) : void 0,
150
+ tags: request.tags
207
151
  });
208
152
  const marshalVerifyRequest = (request, defaults) => ({
209
- digest: request.digest,
210
- signature: request.signature
153
+ digest: request.digest,
154
+ signature: request.signature
211
155
  });
212
- export {
213
- marshalCreateKeyRequest,
214
- marshalDecryptRequest,
215
- marshalEncryptRequest,
216
- marshalGenerateDataKeyRequest,
217
- marshalImportKeyMaterialRequest,
218
- marshalSignRequest,
219
- marshalUpdateKeyRequest,
220
- marshalVerifyRequest,
221
- unmarshalDataKey,
222
- unmarshalDecryptResponse,
223
- unmarshalEncryptResponse,
224
- unmarshalKey,
225
- unmarshalListAlgorithmsResponse,
226
- unmarshalListKeysResponse,
227
- unmarshalPublicKey,
228
- unmarshalSignResponse,
229
- unmarshalVerifyResponse
230
- };
156
+ export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-key-manager",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "Scaleway SDK key-manager",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.1"
30
+ "@scaleway/sdk-std": "2.2.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.1"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",